card.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. <template>
  2. <view class="box">
  3. <view class="card-box">
  4. <view class="card-title">
  5. <text class="title">资产估值(USDT)</text>
  6. <image class="icon" src="../../../static/logo.png" mode="aspectFit"></image>
  7. </view>
  8. <view class="card-num">
  9. 29858.7458
  10. </view>
  11. <view class="card-nums">
  12. =¥ 205129.58
  13. </view>
  14. <view class="card-muen">
  15. <block v-for="(item , index ) in cardMuen[cardIndex]">
  16. <template v-if="[0,2,3].includes(cardIndex)">
  17. <view class="card-muen-item_1" @click.stop="cardBtns(item)">
  18. <image class="item-icon" :src="item.icon" mode="aspectFit"></image>
  19. <text class="item-name">{{item.name}}</text>
  20. </view>
  21. </template>
  22. <template v-else-if="[1].includes(cardIndex)">
  23. <view class="card-muen-item_2" @click.stop="cardBtns(item)">
  24. <image class="item-icon" :src="item.icon" mode="aspectFit"></image>
  25. <text class="item-name">{{item.name}}</text>
  26. </view>
  27. </template>
  28. </block>
  29. </view>
  30. </view>
  31. <capital-switch ref="capitalSwitchRef" />
  32. <!-- 币币账户 / 资金转换 -->
  33. <BibiSwitch ref="BibiSwitchRef" />
  34. <!-- GiftMoney / 赠金账户 -->
  35. <GiftMoney ref="GiftMoneyRef" />
  36. </view>
  37. </template>
  38. <script>
  39. import capitalSwitch from "./capital-switch.vue"
  40. import GiftMoney from "./GiftMoney/capital-switch.vue"
  41. import BibiSwitch from "./Bibi/capital-switch.vue"
  42. export default {
  43. name: 'cardModules',
  44. props: {
  45. cardIndex: {
  46. type: Number,
  47. default: 0
  48. }
  49. },
  50. components: {
  51. capitalSwitch,
  52. GiftMoney,
  53. BibiSwitch
  54. },
  55. data() {
  56. return {
  57. cardMuen: [
  58. [{
  59. icon: require('../../../static/logo.png'),
  60. name: '资金划转',
  61. btn: "capitalSwitch"
  62. }, {
  63. icon: require('../../../static/logo.png'),
  64. name: '用户账单',
  65. path: '/pages/property/bill?type=0'
  66. }],
  67. [{
  68. icon: require('../../../static/logo.png'),
  69. name: '充币'
  70. }, {
  71. icon: require('../../../static/logo.png'),
  72. name: '提币'
  73. }, {
  74. icon: require('../../../static/logo.png'),
  75. name: '闪兑'
  76. }, {
  77. icon: require('../../../static/logo.png'),
  78. name: '划转',
  79. btn: "BibiSwitch"
  80. }, {
  81. icon: require('../../../static/logo.png'),
  82. name: '记录',
  83. path: '/pages/property/bill?type=1'
  84. }],
  85. [{
  86. icon: require('../../../static/logo.png'),
  87. name: '资金划转'
  88. }, {
  89. icon: require('../../../static/logo.png'),
  90. name: '用户账单',
  91. path: '/pages/property/bill?type=2'
  92. }],
  93. [{
  94. icon: require('../../../static/logo.png'),
  95. name: '资金划转',
  96. btn: "GiftMoney"
  97. }, {
  98. icon: require('../../../static/logo.png'),
  99. name: '用户账单',
  100. path: '/pages/property/bill?type=3'
  101. }]
  102. ]
  103. };
  104. },
  105. methods: {
  106. cardBtns(item) {
  107. const btn = item?.btn
  108. console.log('cardBtns ', btn)
  109. if (btn) {
  110. switch (btn) {
  111. case 'capitalSwitch':
  112. // 资金转换
  113. this.$nextTick(() => {
  114. this.$refs.capitalSwitchRef.open()
  115. })
  116. break;
  117. case 'BibiSwitch':
  118. // 币币账户 - 资金转换
  119. this.$nextTick(() => {
  120. this.$refs.BibiSwitchRef.open()
  121. })
  122. break;
  123. case 'GiftMoney':
  124. // 资金转换
  125. this.$nextTick(() => {
  126. this.$refs.GiftMoneyRef.open()
  127. })
  128. break;
  129. }
  130. return false
  131. }
  132. const path = item?.path
  133. if (path) {
  134. uni.navigateTo({
  135. url: path
  136. });
  137. }
  138. },
  139. // 资金转换
  140. openCapitalSwitch() {
  141. }
  142. }
  143. }
  144. </script>
  145. <style lang="scss" scoped>
  146. .box {
  147. padding: 0 $pages-padding;
  148. }
  149. .card-box {
  150. width: 100%;
  151. min-height: 327rpx;
  152. padding: 34rpx 30rpx;
  153. background: linear-gradient(89deg, #05c373 1%, #8eeabb 99%);
  154. border-radius: 18rpx;
  155. .card-title {
  156. width: 100%;
  157. display: flex;
  158. align-items: center;
  159. .title {
  160. font-size: 24rpx;
  161. font-family: PingFang SC, PingFang SC-Regular;
  162. font-weight: 400;
  163. color: #ffffff;
  164. line-height: 33rpx;
  165. }
  166. .icon {
  167. width: 28rpx;
  168. height: 18rpx;
  169. margin-left: 10rpx;
  170. }
  171. }
  172. .card-num {
  173. padding: 19rpx 0 11rpx;
  174. font-size: 40rpx;
  175. font-family: PingFang SC, PingFang SC-Regular;
  176. font-weight: 400;
  177. color: #ffffff;
  178. line-height: 56rpx;
  179. }
  180. .card-nums {
  181. font-size: 20rpx;
  182. font-family: PingFang SC, PingFang SC-Regular;
  183. font-weight: 400;
  184. color: #ffffff;
  185. line-height: 28rpx;
  186. }
  187. .card-muen {
  188. padding-top: 48rpx;
  189. display: flex;
  190. align-items: center;
  191. flex-wrap: wrap;
  192. .card-muen-item_1 {
  193. width: calc((100% - 22rpx) / 2);
  194. min-height: 64rpx;
  195. flex-shrink: 0;
  196. background: #05bd73;
  197. border: 1rpx solid rgba(255, 255, 255, 0.81);
  198. border-radius: 6rpx;
  199. display: flex;
  200. align-items: center;
  201. justify-content: center;
  202. &:nth-child(even) {
  203. margin-left: 22rpx;
  204. }
  205. &:nth-child(n + 3) {
  206. margin-top: 22rpx;
  207. }
  208. .item-icon {
  209. width: 38rpx;
  210. height: 38rpx;
  211. border-radius: 6rpx;
  212. }
  213. .item-name {
  214. padding-left: 32rpx;
  215. font-size: 30rpx;
  216. font-family: PingFang SC, PingFang SC-Regular;
  217. font-weight: 400;
  218. color: #ffffff;
  219. }
  220. }
  221. .card-muen-item_2 {
  222. flex-shrink: 0;
  223. width: 20%;
  224. display: flex;
  225. flex-direction: column;
  226. justify-content: center;
  227. align-items: center;
  228. .item-icon {
  229. width: 32rpx;
  230. height: 32rpx;
  231. border-radius: 6rpx;
  232. }
  233. .item-name {
  234. padding-top: 2.5px;
  235. font-size: 22rpx;
  236. font-family: PingFang SC, PingFang SC-Regular;
  237. font-weight: 400;
  238. color: #ffffff;
  239. line-height: 30rpx;
  240. }
  241. }
  242. }
  243. }
  244. </style>