wallet.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  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. async changeBank() {
  132. let res = await this.$http.post('/userBank/getUserBankList', {
  133. auditStatus: "",
  134. });
  135. if (res.data.length) {
  136. this.navigate({
  137. url: "/pages/wallet/bankCard"
  138. }, "navigateTo", true);
  139. } else {
  140. this.navigate({
  141. url: '/pages/wallet/bindBank',
  142. complete: () => {
  143. setTimeout(() => {
  144. uni.showToast({
  145. title: '请先绑定银行卡',
  146. duration: 3000,
  147. icon: "none"
  148. });
  149. }, 500);
  150. }
  151. }, "navigateTo", true)
  152. }
  153. },
  154. // 推广界面
  155. toSpread() {
  156. this.navigate({
  157. url: "/pages/tools/poster/poster"
  158. }, "navigateTo", true);
  159. },
  160. //提现界面
  161. toWithdraw() {
  162. this.navigate({
  163. url: "/pages/wallet/withdraw"
  164. }, "navigateTo", true);
  165. },
  166. //格式化银行卡号
  167. formatBankNo(BankNo) {
  168. if (BankNo.value == "") return;
  169. var account = new String(BankNo.value);
  170. account = account.substring(0, 22); /*帐号的总数, 包括空格在内 */
  171. if (account.match(".[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{7}") == null) {
  172. /* 对照格式 */
  173. 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}|" +
  174. ".[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) {
  175. var accountNumeric = "";
  176. var accountChar = "";
  177. var i;
  178. for (i = 0; i < account.length; i++) {
  179. accountChar = account.substr(i, 1);
  180. if (!isNaN(accountChar) && (accountChar != " ")) accountNumeric = accountNumeric + accountChar;
  181. }
  182. account = "";
  183. for (i = 0; i < accountNumeric.length; i++) {
  184. /* 可将以下空格改为-,效果也不错 */
  185. if (i == 4) account = account + " "; /* 帐号第四位数后加空格 */
  186. if (i == 8) account = account + " "; /* 帐号第八位数后加空格 */
  187. if (i == 12) account = account + " "; /* 帐号第十二位后数后加空格 */
  188. if (i == 16) account = account + " "; /* 帐号第十二位后数后加空格 */
  189. account = account + accountNumeric.substr(i, 1)
  190. }
  191. }
  192. } else {
  193. account = " " + account.substring(1, 5) + " " + account.substring(6, 10) + " " + account.substring(14,
  194. 18) + "-" + account.substring(18, 25);
  195. }
  196. if (account != BankNo.value) BankNo.value = account;
  197. return account;
  198. }
  199. }
  200. }
  201. </script>
  202. <style lang="scss" scoped>
  203. @import '@/style/mixin.scss';
  204. /* 银行卡信息Start */
  205. .wallet-head {
  206. width: 100%;
  207. height: 165px;
  208. // background-color: #0052FF;
  209. background-image: url("/static/image/my/1.png");
  210. background-size: 100% 100%;
  211. padding: 22px 34px;
  212. position: relative;
  213. image {
  214. width: 31px;
  215. height: 31px;
  216. }
  217. .amount {
  218. >view {
  219. font-size: 12px;
  220. color: #333333;
  221. }
  222. .sum {
  223. font-size: 20rpx;
  224. font-weight: bold;
  225. font-family: DIN, DIN;
  226. }
  227. }
  228. }
  229. .walletData {
  230. width: 100%;
  231. height: auto;
  232. padding: 0 16px;
  233. .fee-sector,
  234. .copyTrade-sector,
  235. .promotion-sector {
  236. position: relative;
  237. width: 32%;
  238. height: 56px;
  239. background: #FFFFFF;
  240. box-shadow: 0px 4px 10px 0px #DAE3F4;
  241. border-radius: 4px;
  242. margin-bottom: 12px;
  243. padding-left: 12px;
  244. display: flex;
  245. flex-direction: column;
  246. justify-content: center;
  247. text:first-child {
  248. font-size: 12px;
  249. color: rgba(51, 51, 51, 0.8);
  250. }
  251. text:last-child {
  252. font-family: DIN, DIN;
  253. font-size: 20rpx;
  254. font-weight: bold;
  255. color: #333333;
  256. }
  257. }
  258. }
  259. .fee-sector::before {
  260. content: "";
  261. display: block;
  262. position: absolute;
  263. top: 0;
  264. left: 0;
  265. width: 6%;
  266. height: 100%;
  267. background-color: #0052FF;
  268. border-radius: 4px 0 0 4px;
  269. /* 按需设置颜色 */
  270. }
  271. .copyTrade-sector::before {
  272. content: "";
  273. display: block;
  274. position: absolute;
  275. top: 0;
  276. left: 0;
  277. width: 6%;
  278. height: 100%;
  279. background-color: #FF5600;
  280. border-radius: 4px 0 0 4px;
  281. }
  282. .promotion-sector::before {
  283. content: "";
  284. display: block;
  285. position: absolute;
  286. top: 0;
  287. left: 0;
  288. width: 6%;
  289. height: 100%;
  290. background-color: #229805;
  291. border-radius: 4px 0 0 4px;
  292. }
  293. </style>