index.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <template>
  2. <view class="">
  3. <card @updateShowMoneyStatus="(e) => showMoney = e">
  4. <template #cardnum>
  5. {{ bibiAccount.usdt_totle || '--'}}
  6. </template>
  7. <template #cardnums>
  8. {{ bibiAccount.totle || '--'}}
  9. </template>
  10. <template #cardmuen>
  11. <block v-for="(item , index ) in cardMuen">
  12. <view class="card-muen-item_2" @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. <view class="lable-title">保证金</view>
  21. <view class="capital-item">
  22. <view class="capital-status" @click.stop="hideNoNums = !hideNoNums">
  23. <view :class="['status-box' , !hideNoNums ? '' : 'show-status-box' ]">
  24. <text v-show="hideNoNums" class="iconfont">&#xe6c5;</text>
  25. <!-- <image v-show="hideNoNums" class="capital-icon" src="@/static/images/notarize.png"
  26. mode="aspectFit"></image> -->
  27. </view>
  28. <text>隐藏为0的资产 </text>
  29. </view>
  30. <view class="capital-nums">
  31. 钱包:{{ bibiAccount.usdt_totle || '--'}} USDT
  32. </view>
  33. </view>
  34. <uni-table class="table-box" emptyText="暂无更多数据">
  35. <!-- 表头行 -->
  36. <uni-tr>
  37. <uni-th align="left" style="flex: 1;">币种</uni-th>
  38. <uni-th align="left" style="flex: 1;">账户权益</uni-th>
  39. <uni-th align="right" style="flex: 1;">可用</uni-th>
  40. </uni-tr>
  41. <!-- 表格数据行 -->
  42. <template v-if="bibiAccount.balance">
  43. <uni-tr v-for="(item , index) in bibiAccount.balance" v-if="hideNoName(hideNoNums , index)">
  44. <uni-td style="flex: 1;">{{ item.currency_name }}</uni-td>
  45. <uni-td style="flex: 1;">{{ showMoney ? item.usdt_price : '*****' }}</uni-td>
  46. <uni-td style="text-align: right; flex: 1;">{{ showMoney ? item.usdt_price : '*****' }}</uni-td>
  47. </uni-tr>
  48. </template>
  49. </uni-table>
  50. <capitalSwitch ref="capitalSwitchRef"/>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. import card from "../card.vue"
  56. import capitalSwitch from "./capital-switch.vue"
  57. import {
  58. checkBill
  59. } from "../card.js"
  60. import {
  61. mapGetters
  62. } from 'vuex'
  63. export default {
  64. name: 'BibiModules',
  65. components: {
  66. card,
  67. capitalSwitch
  68. },
  69. computed: {
  70. ...mapGetters([
  71. 'contractAccount',
  72. 'bibiAccount'
  73. ])
  74. },
  75. data() {
  76. return {
  77. showMoney: true,
  78. hideNoNums: false,
  79. cardMuen: [{
  80. icon: require('@/static/logo.png'),
  81. name: '充币',
  82. path:'/pages/content/select-currency?type=recharge'
  83. }, {
  84. icon: require('@/static/logo.png'),
  85. name: '提币',
  86. path:'/pages/content/select-currency?type=withdraw'
  87. }, {
  88. icon: require('@/static/logo.png'),
  89. name: '闪兑',
  90. path:'/pages/exchange/index'
  91. }, {
  92. icon: require('@/static/logo.png'),
  93. name: '划转',
  94. btn: "BibiSwitch"
  95. }, {
  96. icon: require('@/static/logo.png'),
  97. name: '记录',
  98. path: '/pages/property/bill?type=1'
  99. }],
  100. };
  101. },
  102. methods: {
  103. hideNoName(type, index) {
  104. // console.log('hideNoName = ', type, index)
  105. if (type) {
  106. return index % 2
  107. }
  108. return true
  109. },
  110. cardBtns(item) {
  111. const path = item?.path
  112. if (!path) {
  113. // 资金转换
  114. this.$nextTick(() => {
  115. this.$refs.capitalSwitchRef.open()
  116. })
  117. } else if (path) {
  118. // '用户账单',
  119. checkBill(path)
  120. }
  121. }
  122. }
  123. }
  124. </script>
  125. <style lang="scss" scoped>
  126. @import "~./../table.scss";
  127. .legal-tender-box {
  128. // padding: 0 $pages-padding ;
  129. width: 100%;
  130. .lable-title {
  131. border-bottom: none;
  132. }
  133. .capital-item {
  134. width: 100%;
  135. padding: 14rpx $pages-padding 25rpx;
  136. display: flex;
  137. justify-content: space-between;
  138. font-size: 24rpx;
  139. font-family: PingFang SC, PingFang SC-Regular;
  140. font-weight: 400;
  141. color: #808080;
  142. line-height: 33rpx;
  143. border-bottom: 1px solid #e6e6e6;
  144. .capital-status {
  145. flex-shrink: 0;
  146. display: flex;
  147. align-items: center;
  148. padding-right: 20rpx;
  149. .status-box {
  150. width: 28rpx;
  151. height: 28rpx;
  152. background: #e7e7e7;
  153. border-radius: 2rpx;
  154. margin-right: 12rpx;
  155. display: flex;
  156. justify-content: center;
  157. align-items: center;
  158. .iconfont {
  159. font-size: 24rpx;
  160. color: #fff;
  161. }
  162. .capital-icon {
  163. width: 24rpx;
  164. height: 24rpx;
  165. }
  166. }
  167. .show-status-box {
  168. background-color: $Theme-Color;
  169. }
  170. }
  171. .capital-status,
  172. .capital-nums {
  173. // width: 1px;
  174. // flex: 1;
  175. // flex-shrink: 0;
  176. white-space: pre-wrap;
  177. }
  178. // <view class="capital-status">
  179. // <view class="status-box">
  180. // <image v-show="notarizeAgreement" class="capital-icon" src="@/static/images/notarize.png"
  181. // mode="aspectFit"></image>
  182. // </view>
  183. // <text>隐藏为0的资产</text>
  184. // </view>
  185. }
  186. }
  187. .table-box {
  188. padding: 0 $pages-padding ;
  189. }
  190. </style>