wallet.vue 11 KB

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