card.vue 5.6 KB

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