index.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <view>
  3. <card @updateShowMoneyStatus="(e) => showMoney = e">
  4. <template #cardnum>
  5. {{ legalAccount.usdt_totle || '--'}}
  6. </template>
  7. <template #cardnums>
  8. {{ legalAccount.totle || '--'}}
  9. </template>
  10. <template #cardmuen>
  11. <block v-for="(item , index ) in cardMuen">
  12. <view class="card-muen-item_1" @click.stop="cardBtns(item)">
  13. <image class="item-icon" :src="item.icon" mode="aspectFit"></image>
  14. <text class="item-name">{{item.name}}</text>
  15. </view>
  16. </block>
  17. </template>
  18. </card>
  19. <view class="legal-tender-box">
  20. <uni-table class="table-box" emptyText="暂无更多数据">
  21. <!-- 表头行 -->
  22. <uni-tr>
  23. <uni-th align="left" style="flex: 1;">币种</uni-th>
  24. <uni-th align="left" style="flex: 1;">账户权益</uni-th>
  25. <uni-th align="left" style="flex: 1;">冻结</uni-th>
  26. <uni-th align="right" style="flex: 1;">可用</uni-th>
  27. </uni-tr>
  28. <!-- 表格数据行 -->
  29. <template v-if="legalAccount.balance">
  30. <uni-tr v-for="(item , index) in legalAccount.balance" v-if="item.legal_balance > 0" :key="`legalAccount_${index}`">
  31. <uni-td style="flex: 1;">{{ item.currency_name }}</uni-td>
  32. <uni-td style="flex: 1;">{{ showMoney ? getNums(item.lock_legal_balance , item.legal_balance) : '*****' }}</uni-td>
  33. <uni-td style="flex: 1;">{{ showMoney ? item.lock_legal_balance : '*****' }}</uni-td>
  34. <uni-td style="text-align: right; flex: 1;">{{ showMoney ? item.legal_balance : '*****' }}</uni-td>
  35. </uni-tr>
  36. </template>
  37. </uni-table>
  38. </view>
  39. <capital-switch ref="capitalSwitchRef" />
  40. </view>
  41. </template>
  42. <script>
  43. import card from "../card.vue"
  44. import capitalSwitch from "./capital-switch.vue"
  45. import {
  46. checkBill
  47. } from "../card.js"
  48. import {
  49. mapGetters
  50. } from 'vuex'
  51. export default {
  52. name: 'legalTenderModules',
  53. components: {
  54. card,
  55. capitalSwitch
  56. },
  57. computed: {
  58. ...mapGetters([
  59. 'legalAccount',
  60. ])
  61. },
  62. data() {
  63. return {
  64. showMoney: true,
  65. cardMuen: [{
  66. icon: require('@/static/images/zichan/icon_01.png'),
  67. name: '资金划转'
  68. }, {
  69. icon: require('@/static/images/zichan/icon_02.png'),
  70. name: '用户账单',
  71. path: '/pages/property/bill?type=2'
  72. }],
  73. };
  74. },
  75. methods:{
  76. cardBtns(item) {
  77. const path = item?.path
  78. if (!path) {
  79. // 资金转换
  80. this.$nextTick(() => {
  81. this.$refs.capitalSwitchRef.open()
  82. })
  83. } else {
  84. // '用户账单',
  85. checkBill(path)
  86. }
  87. },
  88. getNums(a = 0, b = 0){
  89. return this.$decimalNum.add(a , b)
  90. }
  91. }
  92. }
  93. </script>
  94. <style lang="scss" scoped>
  95. @import "~./../table.scss";
  96. .legal-tender-box {
  97. padding: 0 $pages-padding ;
  98. width: 100%;
  99. }
  100. </style>