wallet.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. <template>
  2. <view>
  3. <!-- 公共组件-每个页面必须引入 -->
  4. <public-module></public-module>
  5. <!-- 银行卡信息Start -->
  6. <view class="wallet-head dis f-c j-end">
  7. <view class="dis a-start" style="position: absolute;top:13%;left: 9.5%;">
  8. <image src="/static/image/my/avatar1.png" mode=""></image>
  9. <!-- <text style="font-size: 14px;">admin</text> -->
  10. </view>
  11. <view class="dis a-c j-s mt-2">
  12. <text style="font-size: 15px;color: #333333;font-weight: bold;">我的资产</text>
  13. <u-tag @click="changeBank" text="卡包" mode="dark"
  14. style="background: linear-gradient( 270deg, #0052FF 0%, #6899FF 100%);" />
  15. </view>
  16. <view class="dis a-c j-s mt-2 amount">
  17. <view class="dis f-c a-c" @click="toBillDetails(1)">
  18. <text>手续金额</text>
  19. <text v-if="MoneyData.handlingFee" class="sum" style="color: #0052FF;">¥ <text
  20. style="font-size: 14px;">{{MoneyData.handlingFee.toFixed(2)}}</text> </text>
  21. <text v-else class="sum" style="color: #0052FF;">¥ <text style="font-size: 14px;">0.00</text>
  22. </text>
  23. </view>
  24. <view class="dis f-c a-c" @click="toBillDetails(2)">
  25. <text>跟单金额</text>
  26. <text v-if="MoneyData.documentary" class="sum" style="color: #FF5600;">¥ <text
  27. style="font-size: 14px;">{{MoneyData.documentary.toFixed(2)}}</text> </text>
  28. <text v-else class="sum" style="color: #FF5600;">¥ <text style="font-size: 14px;">0.00</text>
  29. </text>
  30. </view>
  31. <view class="dis f-c a-c" @click="toBillDetails(3)">
  32. <text>推广金额</text>
  33. <text v-if="MoneyData.promotion" class="sum" style="color: #229805;">¥ <text
  34. style="font-size: 14px;">{{MoneyData.promotion.toFixed(2)}}</text> </text>
  35. <text v-else class="sum" style="color: #229805;">¥ <text style="font-size: 14px;">0.00</text>
  36. </text>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="walletData dis a-c j-s f-wrap">
  41. <view class="fee-sector ">
  42. <text>手续金额预收</text>
  43. <text v-if="MoneyData.willHalding">¥ <text style="font-size: 13px;">{{MoneyData.willHalding}}</text>
  44. </text>
  45. <text v-else>¥ <text style="font-size: 13px;">0.00</text> </text>
  46. </view>
  47. <view class="copyTrade-sector ">
  48. <text>跟单金额预收</text>
  49. <text v-if="MoneyData.willDocumentary">¥<text
  50. style="font-size: 13px;">{{MoneyData.willDocumentary}}</text></text>
  51. <text v-else>¥<text style="font-size: 13px;">0.00</text></text>
  52. </view>
  53. <view class="promotion-sector ">
  54. <text>推广金额预收</text>
  55. <text v-if="MoneyData.willPromotion">¥<text
  56. style="font-size: 13px;">{{MoneyData.willPromotion}}</text></text>
  57. <text v-else>¥<text style="font-size: 13px;">0.00</text></text>
  58. </view>
  59. <view class="fee-sector ">
  60. <text>手续金额提现中</text>
  61. <text v-if="MoneyData.withdrawalHalding">¥<text
  62. style="font-size: 13px;">{{MoneyData.withdrawalHalding}}</text></text>
  63. <text v-else>¥<text style="font-size: 13px;">0.00</text></text>
  64. </view>
  65. <view class="copyTrade-sector ">
  66. <text>跟单金额提现中</text>
  67. <text v-if="MoneyData.withdrawalDocumentary">¥<text
  68. style="font-size: 13px;">{{MoneyData.withdrawalDocumentary}}</text></text>
  69. <text v-else>¥<text style="font-size: 13px;">0.00</text></text>
  70. </view>
  71. <view class="promotion-sector ">
  72. <text>推广金额提现中</text>
  73. <text v-if="MoneyData.withdrawalPromotion">¥<text
  74. style="font-size: 13px;">{{MoneyData.withdrawalPromotion}}</text></text>
  75. <text v-else>¥<text style="font-size: 13px;">0.00</text></text>
  76. </view>
  77. <view class="fee-sector">
  78. <text>手续金额已提现</text>
  79. <text v-if="MoneyData.approvedHalding">¥<text
  80. style="font-size: 13px;">{{MoneyData.approvedHalding}}</text></text>
  81. <text v-else>¥<text style="font-size: 13px;">0.00</text></text>
  82. </view>
  83. <view class="copyTrade-sector">
  84. <text>跟单金额已提现</text>
  85. <text v-if="MoneyData.approvedDocumentary">¥<text
  86. style="font-size: 13px;">{{MoneyData.approvedDocumentary}}</text></text>
  87. <text v-else>¥<text style="font-size: 13px;">0.00</text></text>
  88. </view>
  89. <view class="promotion-sector">
  90. <text>推广金额已提现</text>
  91. <text v-if="MoneyData.approvedPromotion">¥<text
  92. style="font-size: 13px;">{{MoneyData.approvedPromotion}}</text></text>
  93. <text v-else>¥<text style="font-size: 13px;">0.00</text></text>
  94. </view>
  95. </view>
  96. </view>
  97. </template>
  98. <script>
  99. import {
  100. mapState
  101. } from "vuex"
  102. export default {
  103. data() {
  104. return {
  105. MoneyData: {},
  106. }
  107. },
  108. computed: {
  109. ...mapState(['userInfo'])
  110. },
  111. async onShow() {
  112. await this.getAdvanceMoney(); //金额
  113. },
  114. async onLoad() {
  115. await this.getAdvanceMoney(); //手续费金额
  116. },
  117. onShow() {},
  118. methods: {
  119. // 预收账户金额查询
  120. async getAdvanceMoney() {
  121. let res = await this.$http.get('/sysUserAccount/getSysAllAmount');
  122. this.MoneyData = res.data;
  123. },
  124. // 去账单明细
  125. toBillDetails(type) {
  126. this.navigate({
  127. url: "/pages/wallet/billDetails" + type
  128. }, "navigateTo", true)
  129. },
  130. // 绑定银行卡界面
  131. changeBank() {
  132. this.navigate({
  133. url: "/pages/wallet/bankCard"
  134. }, "navigateTo", true);
  135. },
  136. // 推广界面
  137. toSpread() {
  138. this.navigate({
  139. url: "/pages/tools/poster/poster"
  140. }, "navigateTo", true);
  141. },
  142. //提现界面
  143. toWithdraw() {
  144. this.navigate({
  145. url: "/pages/wallet/withdraw"
  146. }, "navigateTo", true);
  147. },
  148. //格式化银行卡号
  149. formatBankNo(BankNo) {
  150. if (BankNo.value == "") return;
  151. var account = new String(BankNo.value);
  152. account = account.substring(0, 22); /*帐号的总数, 包括空格在内 */
  153. if (account.match(".[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{7}") == null) {
  154. /* 对照格式 */
  155. 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}|" +
  156. ".[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) {
  157. var accountNumeric = "";
  158. var accountChar = "";
  159. var i;
  160. for (i = 0; i < account.length; i++) {
  161. accountChar = account.substr(i, 1);
  162. if (!isNaN(accountChar) && (accountChar != " ")) accountNumeric = accountNumeric + accountChar;
  163. }
  164. account = "";
  165. for (i = 0; i < accountNumeric.length; i++) {
  166. /* 可将以下空格改为-,效果也不错 */
  167. if (i == 4) account = account + " "; /* 帐号第四位数后加空格 */
  168. if (i == 8) account = account + " "; /* 帐号第八位数后加空格 */
  169. if (i == 12) account = account + " "; /* 帐号第十二位后数后加空格 */
  170. if (i == 16) account = account + " "; /* 帐号第十二位后数后加空格 */
  171. account = account + accountNumeric.substr(i, 1)
  172. }
  173. }
  174. } else {
  175. account = " " + account.substring(1, 5) + " " + account.substring(6, 10) + " " + account.substring(14,
  176. 18) + "-" + account.substring(18, 25);
  177. }
  178. if (account != BankNo.value) BankNo.value = account;
  179. return account;
  180. }
  181. }
  182. }
  183. </script>
  184. <style lang="scss" scoped>
  185. @import '@/style/mixin.scss';
  186. /* 银行卡信息Start */
  187. .wallet-head {
  188. width: 100%;
  189. height: 165px;
  190. // background-color: #0052FF;
  191. background-image: url("/static/image/my/1.png");
  192. background-size: 100% 100%;
  193. padding: 22px 34px;
  194. position: relative;
  195. image {
  196. width: 31px;
  197. height: 31px;
  198. }
  199. .amount {
  200. >view {
  201. font-size: 12px;
  202. color: #333333;
  203. }
  204. .sum {
  205. font-size: 20rpx;
  206. font-weight: bold;
  207. font-family: DIN, DIN;
  208. }
  209. }
  210. }
  211. .walletData {
  212. width: 100%;
  213. height: auto;
  214. padding: 0 16px;
  215. .fee-sector,
  216. .copyTrade-sector,
  217. .promotion-sector {
  218. position: relative;
  219. width: 32%;
  220. height: 56px;
  221. background: #FFFFFF;
  222. box-shadow: 0px 4px 10px 0px #DAE3F4;
  223. border-radius: 4px;
  224. margin-bottom: 12px;
  225. padding-left: 12px;
  226. display: flex;
  227. flex-direction: column;
  228. justify-content: center;
  229. text:first-child {
  230. font-size: 12px;
  231. color: rgba(51, 51, 51, 0.8);
  232. }
  233. text:last-child {
  234. font-family: DIN, DIN;
  235. font-size: 20rpx;
  236. font-weight: bold;
  237. color: #333333;
  238. }
  239. }
  240. }
  241. .fee-sector::before {
  242. content: "";
  243. display: block;
  244. position: absolute;
  245. top: 0;
  246. left: 0;
  247. width: 6%;
  248. height: 100%;
  249. background-color: #0052FF;
  250. border-radius: 4px 0 0 4px;
  251. /* 按需设置颜色 */
  252. }
  253. .copyTrade-sector::before {
  254. content: "";
  255. display: block;
  256. position: absolute;
  257. top: 0;
  258. left: 0;
  259. width: 6%;
  260. height: 100%;
  261. background-color: #FF5600;
  262. border-radius: 4px 0 0 4px;
  263. }
  264. .promotion-sector::before {
  265. content: "";
  266. display: block;
  267. position: absolute;
  268. top: 0;
  269. left: 0;
  270. width: 6%;
  271. height: 100%;
  272. background-color: #229805;
  273. border-radius: 4px 0 0 4px;
  274. }
  275. </style>