card.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <view class="box">
  3. <view class="card-box">
  4. <view class="card-title">
  5. <text class="title">资产估值(USDT)</text>
  6. <text v-show="showMoney" @click.stop="showMoney = !showMoney"
  7. class="title-icon iconfont">&#xe663;</text>
  8. <text v-show="!showMoney" @click.stop="showMoney = !showMoney"
  9. class="title-icon iconfont">&#xe664;</text>
  10. <!-- <image class="icon" src="../../../static/logo.png" mode="aspectFit"></image> -->
  11. </view>
  12. <view class="card-num" v-show="showMoney">
  13. <slot name="cardnum"></slot>
  14. </view>
  15. <view class="card-num" v-show="!showMoney">
  16. *****
  17. </view>
  18. <view class="card-nums" v-show="showMoney">
  19. <text class="nums-icon iconfont">&#xe623;</text>
  20. <text class="nums-icon iconfont">&#xe615;</text>
  21. <text>
  22. <slot name="cardnums"></slot>
  23. </text>
  24. </view>
  25. <view class="card-nums" v-show="!showMoney">
  26. <text>*****</text>
  27. </view>
  28. <view class="card-muen">
  29. <slot name="cardmuen"></slot>
  30. <!-- <block v-for="(item , index ) in cardMuen[cardIndex]">
  31. <template v-if="[0,2,3].includes(cardIndex)">
  32. <view class="card-muen-item_1" @click.stop="cardBtns(item)">
  33. <image class="item-icon" :src="item.icon" mode="aspectFit"></image>
  34. <text class="item-name">{{item.name}}</text>
  35. </view>
  36. </template>
  37. <template v-else-if="[1].includes(cardIndex)">
  38. <view class="card-muen-item_2" @click.stop="cardBtns(item)">
  39. <image class="item-icon" :src="item.icon" mode="aspectFit"></image>
  40. <text class="item-name">{{item.name}}</text>
  41. </view>
  42. </template>
  43. </block> -->
  44. </view>
  45. </view>
  46. <!-- GiftMoney / 赠金账户 -->
  47. <!-- <GiftMoney ref="GiftMoneyRef" /> -->
  48. </view>
  49. </template>
  50. <script>
  51. export default {
  52. name: 'cardModules',
  53. props: {
  54. userInfo: {
  55. type: [String, Object],
  56. default: null
  57. },
  58. cardIndex: {
  59. type: Number,
  60. default: 0
  61. }
  62. },
  63. components: {
  64. // capitalSwitch,
  65. // GiftMoney,
  66. },
  67. watch:{
  68. showMoney:{
  69. handler(newStatus){
  70. this.$emit('updateShowMoneyStatus' , newStatus)
  71. },
  72. immediate:true
  73. }
  74. },
  75. data() {
  76. return {
  77. showMoney:true,
  78. cardMuen: [
  79. ]
  80. };
  81. },
  82. methods: {
  83. cardBtns(item) {
  84. const btn = item?.btn
  85. if (btn) {
  86. switch (btn) {
  87. case 'capitalSwitch':
  88. // 资金转换
  89. this.$nextTick(() => {
  90. this.$refs.capitalSwitchRef.open()
  91. })
  92. break;
  93. case 'BibiSwitch':
  94. // 币币账户 - 资金转换
  95. this.$nextTick(() => {
  96. this.$refs.BibiSwitchRef.open()
  97. })
  98. break;
  99. case 'GiftMoney':
  100. // 资金转换
  101. this.$nextTick(() => {
  102. this.$refs.GiftMoneyRef.open()
  103. })
  104. break;
  105. }
  106. return false
  107. }
  108. const path = item?.path
  109. if (path) {
  110. uni.navigateTo({
  111. url: path
  112. });
  113. }
  114. },
  115. // 资金转换
  116. openCapitalSwitch() {
  117. }
  118. }
  119. }
  120. </script>
  121. <style lang="scss" scoped>
  122. @import "~./card.scss"
  123. </style>