assets.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <view class="assets">
  3. <view class="header">
  4. <view class="img"><image :src="userInfo.avatar" mode=""></image></view>
  5. {{ userInfo.nickname }}
  6. </view>
  7. <view class="numerical">
  8. <view class="value">
  9. <text>8555</text><br>
  10. 贡献值
  11. </view>
  12. <view class="l"></view>
  13. <view class="value">
  14. <text>788</text><br>
  15. 诚信值
  16. </view>
  17. </view>
  18. <view class="main">
  19. <view class="btn" @click="nav('/pages/money/wallet')">
  20. <image src="../../static/icon/index1.png"></image>
  21. <text>{{userInfo.brokerage_price * 1}}</text>
  22. 佣金
  23. </view>
  24. <view class="btn" @click="nav('/pages/money/award')">
  25. <image src="../../static/icon/index2.png"></image>
  26. <text>{{ candy||0 }}</text>
  27. 糖果
  28. </view>
  29. <view class="btn" @click="nav('/pages/money/integralShopping')">
  30. <image src="../../static/icon/index3.png"></image>
  31. <text>{{ userInfo.now_money*1 }}</text>
  32. 货款
  33. </view>
  34. <view class="btn" @click="nav('/pages/money/mallPoints')">
  35. <image src="../../static/icon/index4.png"></image>
  36. <text>2000</text>
  37. 商城积分
  38. </view>
  39. <view class="btn" @click="nav('/pages/money/integralP')">
  40. <image src="../../static/icon/index5.png"></image>
  41. <text>{{ jf||0 }}</text>
  42. 拼团积分
  43. </view>
  44. <view class="btn" @click="nav('/pages/money/frozen')">
  45. <image src="../../static/icon/index6.png"></image>
  46. <text>2000</text>
  47. 拼团冻结积分
  48. </view>
  49. <view class="btn" @click="nav('/pages/money/publicWelfare')">
  50. <image src="../../static/icon/index7.png"></image>
  51. <text>2000</text>
  52. 公益积分
  53. </view>
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. import { wallet } from '@/api/finance.js';
  59. export default {
  60. mounted() {
  61. console.log(this.userInfo)
  62. },
  63. data() {
  64. return {
  65. candy: '',
  66. jf: ''
  67. }
  68. },
  69. mounted() {
  70. this.getWallet()
  71. },
  72. methods: {
  73. getWallet() {
  74. wallet({}).then(({ data }) => {
  75. console.log(data)
  76. const obj = this
  77. const arr = Object.keys(data.back);
  78. console.log(arr);
  79. let ar = [];
  80. arr.forEach(e => {
  81. console.log(e,'11111')
  82. if(e == 'LALA'){
  83. obj.candy = (data.back[e].money.money*1).toFixed(0)
  84. }
  85. if(e == 'USDC'){
  86. obj.jf = (data.back[e].money.money*1)
  87. }
  88. ar.push(data.back[e]);
  89. });
  90. });
  91. },
  92. nav(url) {
  93. uni.navigateTo({
  94. url: url,
  95. fail() {
  96. uni.switchTab({
  97. url: url
  98. });
  99. }
  100. });
  101. },
  102. },
  103. computed: {
  104. userInfo() {
  105. return this.$store.state.user.userInfo
  106. }
  107. }
  108. }
  109. </script>
  110. <style lang="scss" scoped>
  111. .assets {
  112. .header {
  113. height: 480rpx;
  114. background: linear-gradient(180deg, #32C6FF 0%, #2E58FF 100%);
  115. color: #fff;
  116. font-size: 35rpx;
  117. text-align: center;
  118. font-family: PingFang-SC-Medium;
  119. padding-top: 140rpx;
  120. .img {
  121. margin-bottom: 10rpx;
  122. image {
  123. border-radius: 50%;
  124. width: 150rpx;
  125. height: 150rpx;
  126. border: solid 6rpx #fff;
  127. }
  128. }
  129. }
  130. .numerical {
  131. box-shadow: 0 5rpx 10rpx 1rpx #e6e6e6;
  132. margin: 30rpx;
  133. color: #666666;
  134. display: flex;
  135. text-align: center;
  136. background-color: #fff;
  137. padding: 30rpx;
  138. border-radius: 20rpx;
  139. position: relative;
  140. top: -120rpx;
  141. .l {
  142. background-color: #F8F8F8;
  143. width: 5rpx;
  144. height: 70rpx;
  145. margin: auto 0;
  146. }
  147. .value {
  148. flex: 1;
  149. }
  150. text {
  151. font-size: 40rpx;
  152. color: #333333;
  153. }
  154. }
  155. .main {
  156. position: relative;
  157. top: -140rpx;
  158. display: flex;
  159. flex-wrap: wrap;
  160. text-align: center;
  161. margin: 20rpx;
  162. .btn {
  163. padding: 40rpx;
  164. box-shadow: 0 5rpx 10rpx 1rpx #e6e6e6;
  165. border-radius: 20rpx;
  166. width: calc(50% - 20rpx);
  167. height: 240rpx;
  168. background-color: #fff;
  169. margin: 10rpx;
  170. display: grid;
  171. align-content: space-around;
  172. color: #666666;
  173. font-family: PingFang-SC-Medium;
  174. image {
  175. margin: 10rpx auto;
  176. width: 80rpx;
  177. height: 80rpx;
  178. }
  179. text {
  180. color: #333333;
  181. font-size: 35rpx;
  182. }
  183. }
  184. }
  185. }
  186. </style>