wallet.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  1. <template>
  2. <view>
  3. <!-- 公共组件-每个页面必须引入 -->
  4. <public-module></public-module>
  5. <!-- 银行卡信息Start -->
  6. <view class="wallet-head">
  7. <view class="bank-det d-flex flex-column">
  8. <view class="d-flex">
  9. <image class="bank-icon flex-shrink" src="/static/image/wallet/bankcard.png" mode="widthFix"></image>
  10. <view class="bank-name d-flex flex-1">
  11. <p>{{bankname}}</p>
  12. <p style="font-size: 24upx;line-height: 40upx;" >储蓄卡</p>
  13. </view>
  14. <view class="changebank" @tap="changeBank" >改绑</view>
  15. </view>
  16. <view class="bank-num d-flex">
  17. <!-- <span>*****</span>
  18. <span>*****</span>
  19. <span>*****</span>
  20. 0179 -->
  21. <span class="d-flex a-center j-center">{{accountno}}</span>
  22. </view>
  23. </view>
  24. </view>
  25. <!-- 银行卡信息End -->
  26. <!-- 钱包金额Start -->
  27. <view class="wallet-money d-flex">
  28. <view class="d-flex flex-1 flex-column" @tap="toBillDetails(1)">
  29. <view class="d-flex a-center j-center">预收账户</view>
  30. <view class="d-flex a-center j-center">¥{{advanceMoney}}</view>
  31. </view>
  32. <view class="d-flex flex-1 flex-column" @tap="toBillDetails(2)">
  33. <view class="d-flex a-center j-center">可提现现金</view>
  34. <view class="d-flex a-center j-center">¥{{withdrawal}}</view>
  35. </view>
  36. <view class="d-flex flex-1 flex-column" @tap="toBillDetails(3)">
  37. <view class="d-flex a-center j-center">推广费</view>
  38. <view class="d-flex a-center j-center">¥{{extendMoney}}</view>
  39. </view>
  40. </view>
  41. <!-- 钱包金额End -->
  42. <!-- 钱包数据Start -->
  43. <view class="wallet-data">
  44. <view class="bg1">
  45. <view>{{monthCost}}</view>
  46. <hr>
  47. <view>本月累计推广费(元)</view>
  48. </view>
  49. <view class="bg2">
  50. <view>{{yearCost}}</view>
  51. <hr>
  52. <view>今年累计推广费(元)</view>
  53. </view>
  54. <view class="bg3">
  55. <view>{{monthPremium}}</view>
  56. <hr>
  57. <view>本月推广订单保费(元)</view>
  58. </view>
  59. <view class="bg4">
  60. <view>{{yearPremium}}</view>
  61. <hr>
  62. <view>今年推广订单保费(元)</view>
  63. </view>
  64. <view class="bg5">
  65. <view>{{monthExNumber}}</view>
  66. <hr>
  67. <view>本月累计推广人数</view>
  68. </view>
  69. <view class="bg6">
  70. <view>{{historyNumber}}</view>
  71. <hr>
  72. <view>历史累计推广人数</view>
  73. </view>
  74. </view>
  75. <!-- 钱包数据End -->
  76. <view style="height: 100upx;"></view>
  77. <view class="wallet-btn d-flex">
  78. <view @tap="toSpread" class="d-flex a-center j-center flex-1">推广</view>
  79. <view @tap="toWithdraw" class="d-flex a-center j-center flex-1">提现</view>
  80. </view>
  81. </view>
  82. </template>
  83. <script>
  84. import {mapState} from "vuex"
  85. export default {
  86. data() {
  87. return {
  88. bankname:'',
  89. accountno:'',
  90. advanceMoney:'0',// 预收账户金额
  91. withdrawal:'0',//可提现金额
  92. extendMoney:'0',//推广费
  93. monthCost:'0',
  94. yearCost:'0',
  95. monthPremium:'0',
  96. yearPremium:'0',
  97. monthExNumber:'0',
  98. historyNumber:'0'
  99. }
  100. },
  101. computed:{
  102. ...mapState(['userInfo'])
  103. },
  104. async onShow(){
  105. await this.getAdvanceMoney();//预收金额
  106. await this.getPayAccount();//可提现余额
  107. await this.getExtendMoney();//推广费
  108. await this.getQuerywallet();//查询推广
  109. },
  110. // onLoad() {
  111. // this.bankname=this.userInfo.esmUserInternal.bankname;
  112. // this.accountno = this.formatBankNo({"value":this.userInfo.esmUserInternal.accountno});
  113. // },
  114. onShow(){
  115. this.bankname=this.userInfo.esmUserInternal.bankname;
  116. this.accountno = this.formatBankNo({"value":this.userInfo.esmUserInternal.accountno});
  117. },
  118. methods: {
  119. // 预收账户金额查询
  120. async getAdvanceMoney() {
  121. let res = await this.$http.get('/insPayApply/advanceAccount?userid=' + this.userInfo.sysUser.id, {},{load:false});
  122. this.advanceMoney = res.data;
  123. },
  124. // 可提现余额查询
  125. async getPayAccount() {
  126. let res = await this.$http.get('/insPayApply/payAccount?userid=' + this.userInfo.sysUser.id, {},{load:false});
  127. this.withdrawal = res.data.accountBalance;
  128. },
  129. //推广费
  130. async getExtendMoney() {
  131. let res = await this.$http.get('/insPayApply/extendAccount?userid=' + this.userInfo.sysUser.id, {},{load:false});
  132. this.extendMoney = res.data.accountBalance;
  133. },
  134. //推广费
  135. async getQuerywallet() {
  136. let res = await this.$http.get('/insPayApply/querywallet?userid=' + this.userInfo.sysUser.id, {},{load:false});
  137. this.monthCost = res.data.monthCost;//本月累计推广费
  138. this.yearCost=res.data.yearCost;//今年累计推广费
  139. this.monthPremium = res.data.monthPremium;//本月推广订单保费
  140. this.yearPremium = res.data.yearPremium;//今年推广订单保费
  141. this.monthExNumber = res.data.monthExNumber;//本月累计推广人数
  142. this.historyNumber = res.data.historyNumber;//历史累计推广人数
  143. },
  144. // 去账单明细
  145. toBillDetails(type){
  146. this.navigate({url:"/pages/wallet/billDetails"+type},"navigateTo",true)
  147. },
  148. // 绑定银行卡界面
  149. changeBank(){
  150. this.navigate({url:"/pages/wallet/bindBank"},"navigateTo",true);
  151. },
  152. // 推广界面
  153. toSpread(){
  154. this.navigate({url:"/pages/tools/poster/poster"},"navigateTo",true);
  155. },
  156. //提现界面
  157. toWithdraw(){
  158. this.navigate({url:"/pages/wallet/withdraw"},"navigateTo",true);
  159. },
  160. //格式化银行卡号
  161. formatBankNo (BankNo){
  162. if (BankNo.value == "") return;
  163. var account = new String (BankNo.value);
  164. account = account.substring(0,22); /*帐号的总数, 包括空格在内 */
  165. if (account.match (".[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{7}") == null){
  166. /* 对照格式 */
  167. if (account.match (".[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{7}|" + ".[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{7}|" +
  168. ".[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{7}|" + ".[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{7}") == null){
  169. var accountNumeric = "";
  170. var accountChar ="";
  171. var i;
  172. for (i=0;i<account.length;i++){
  173. accountChar = account.substr (i,1);
  174. if (!isNaN (accountChar) && (accountChar != " ")) accountNumeric = accountNumeric + accountChar;
  175. }
  176. account = "";
  177. for (i=0;i<accountNumeric.length;i++){ /* 可将以下空格改为-,效果也不错 */
  178. if (i == 4) account = account + " "; /* 帐号第四位数后加空格 */
  179. if (i == 8) account = account + " "; /* 帐号第八位数后加空格 */
  180. if (i == 12) account = account + " ";/* 帐号第十二位后数后加空格 */
  181. if (i == 16) account = account + " ";/* 帐号第十二位后数后加空格 */
  182. account = account + accountNumeric.substr (i,1)
  183. }
  184. }
  185. }
  186. else
  187. {
  188. account = " " + account.substring (1,5) + " " + account.substring (6,10) + " " + account.substring (14,18) + "-" + account.substring(18,25);
  189. }
  190. if (account != BankNo.value) BankNo.value = account;
  191. return account;
  192. }
  193. }
  194. }
  195. </script>
  196. <style lang="scss" scoped>
  197. @import '@/style/mixin.scss';
  198. /* 银行卡信息Start */
  199. .wallet-head{
  200. position: relative;
  201. width: 100%;
  202. height: 264upx;
  203. background:url('/static/image/wallet/imgbg.jpg') no-repeat 50%;
  204. background-size: 100% 100%;
  205. }
  206. .wallet-head .bank-det{
  207. position: absolute;
  208. color: #FFFFFF;
  209. left: 5%;
  210. top: 32upx;
  211. width: 90%;
  212. height: 232upx;
  213. }
  214. .wallet-head .bank-det .bank-icon{
  215. margin-left: 5.5%;
  216. margin-top: 48upx;
  217. height: 70upx;
  218. width: 70upx;
  219. vertical-align: top;
  220. }
  221. .wallet-head .bank-det .bank-name{
  222. display: inline-block;
  223. vertical-align: top;
  224. padding: 46upx 0 0 20upx;
  225. font-size: 36upx;
  226. line-height: 45upx;
  227. }
  228. .wallet-head .bank-det .changebank{
  229. float: right;
  230. display: inline-block;
  231. vertical-align: top;
  232. width: 110upx;
  233. padding-top: 0;
  234. margin-top: 48upx;
  235. margin-right: 6%;
  236. height: 50upx;
  237. line-height: 50upx;
  238. border: 1px solid #fff;
  239. border-radius: 30upx;
  240. text-align: center;
  241. font-size: 30upx;
  242. }
  243. .wallet-head .bank-det .bank-num{
  244. /* width: 86%; */
  245. width: 100%;
  246. display: inline-block;
  247. vertical-align: top;
  248. padding-top: 20upx;
  249. font-size: 36upx;
  250. text-align: right;
  251. line-height:40upx;
  252. }
  253. .wallet-head .bank-det .bank-num span{
  254. vertical-align: middle;
  255. /* margin-right: 10%; */
  256. opacity: .5;
  257. font-size: 42upx;
  258. line-height:50upx;
  259. }
  260. /* 银行卡信息End */
  261. /* 钱包金额Start */
  262. .wallet-money{
  263. width: 100%;
  264. height: 130upx;
  265. background: #343740;
  266. color: #fff;
  267. }
  268. .wallet-money>view>view:nth-of-type(1){
  269. font-size: 24upx;
  270. opacity: 0.4;
  271. margin-top: 27upx;
  272. line-height: 30upx;
  273. }
  274. .wallet-money>view>view:nth-of-type(2){
  275. font-size: 28upx;
  276. margin-top: 10upx;
  277. line-height: 40upx;
  278. }
  279. /* 钱包金额End */
  280. /* 钱包数据Start */
  281. .wallet-data {
  282. width: 100%;
  283. height: auto;
  284. padding: 2upx 0 100upx;
  285. background: #fefefe;
  286. }
  287. .wallet-data>view{
  288. display: inline-block;
  289. vertical-align: top;
  290. width: 330upx;
  291. height: 160upx;
  292. padding-left: 50upx;
  293. box-sizing: border-box;
  294. margin: 30upx 0 0 30upx;
  295. border-radius: 5upx;
  296. box-shadow: 3upx 8upx 30upx #efeff4, -3upx 8upx 30upx #efeff4;
  297. background: #fff;
  298. }
  299. .wallet-data .bg1{
  300. background: url('/static/image/wallet/bg1.png') no-repeat 50%;
  301. background-size: 100% 100%;
  302. }
  303. .wallet-data .bg2{
  304. background: url('/static/image/wallet/bg2.png') no-repeat 50%;
  305. background-size: 100% 100%;
  306. }
  307. .wallet-data .bg3{
  308. background: url('/static/image/wallet/bg3.png') no-repeat 50%;
  309. background-size: 100% 100%;
  310. }
  311. .wallet-data .bg4{
  312. background: url('/static/image/wallet/bg4.png') no-repeat 50%;
  313. background-size: 100% 100%;
  314. }
  315. .wallet-data .bg5{
  316. background: url('/static/image/wallet/bg5.png') no-repeat 50%;
  317. background-size: 100% 100%;
  318. }
  319. .wallet-data .bg6{
  320. background: url('/static/image/wallet/bg6.png') no-repeat 50%;
  321. background-size: 100% 100%;
  322. }
  323. .wallet-data>view>view:nth-of-type(1){
  324. padding-top: 20upx;
  325. line-height: 60upx;
  326. font-size: 32upx;
  327. color: #333;
  328. }
  329. .wallet-data>view hr{
  330. width: 35upx;
  331. }
  332. .wallet-data>view>view:nth-last-of-type(1) {
  333. font-size: 20upx;
  334. color: #999;
  335. line-height: 54upx;
  336. }
  337. /* 钱包数据End */
  338. .wallet-btn{
  339. width: 100%;
  340. position: fixed;
  341. bottom: 0;
  342. height: 100upx;
  343. line-height: 100upx;
  344. }
  345. .wallet-btn>view{
  346. font-size: 36upx;
  347. flex-shrink: 1;
  348. height: 100%;
  349. font-weight: bold;
  350. box-sizing: border-box;
  351. width: 100%;
  352. }
  353. .wallet-btn>view:nth-of-type(1){
  354. color: $themeColor;
  355. background: #fff;
  356. border-top: 1px solid #d4d4d4;
  357. }
  358. .wallet-btn>view:nth-of-type(2){
  359. color: #fff;
  360. background: $themeColor;
  361. border-top: 1px solid $themeColor;
  362. }
  363. </style>