index.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <view class="">
  3. <card @updateShowMoneyStatus="(e) => showMoney = e">
  4. <template #cardnum>
  5. {{ contractAccount.usdt_totle || '--'}}
  6. </template>
  7. <template #cardnums>
  8. {{ contractAccount.CNY || '--'}}
  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="contractAccount.balance">
  30. <uni-tr v-for="item in contractAccount.balance">
  31. <uni-td style="flex: 1;">{{ item.currency_name }}</uni-td>
  32. <uni-td style="flex: 1;">{{ showMoney ? getNums(item.lock_lever_balance , item.usdt_price) : '*****' }}</uni-td>
  33. <uni-td style="flex: 1;">{{ showMoney ? item.lock_lever_balance : '*****' }}</uni-td>
  34. <uni-td style="text-align: right; flex: 1;">{{ showMoney ? item.usdt_price : '*****' }}</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 {
  44. mapGetters
  45. } from 'vuex'
  46. import capitalSwitch from "./capital-switch.vue"
  47. import card from "../card.vue"
  48. import {
  49. checkBill
  50. } from "../card.js"
  51. export default {
  52. name: 'contractModules',
  53. components: {
  54. card,
  55. capitalSwitch
  56. },
  57. data() {
  58. return {
  59. showMoney:false,
  60. cardMuen: [{
  61. icon: require('@/static/logo.png'),
  62. name: '资金划转',
  63. btn: "capitalSwitch"
  64. }, {
  65. icon: require('@/static/logo.png'),
  66. name: '用户账单',
  67. path: '/pages/property/bill?type=0'
  68. }],
  69. };
  70. },
  71. computed: {
  72. ...mapGetters([
  73. 'contractAccount',
  74. ])
  75. },
  76. methods: {
  77. cardBtns(item) {
  78. const btn = item?.btn
  79. const path = item?.path
  80. if (btn) {
  81. // 资金转换
  82. this.$nextTick(() => {
  83. this.$refs.capitalSwitchRef.open()
  84. })
  85. } else if(path){
  86. // '用户账单',
  87. checkBill(path)
  88. }
  89. },
  90. //
  91. getNums(a,b){
  92. return this.$decimalNum.add(a,b)
  93. }
  94. }
  95. }
  96. </script>
  97. <style lang="scss" scoped>
  98. @import "~./../table.scss";
  99. .legal-tender-box {
  100. // padding: 0 $pages-padding ;
  101. width: 100%;
  102. }
  103. .table-box {
  104. padding: 0 $pages-padding ;
  105. }
  106. </style>