assets.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  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>
  10. <br />
  11. 贡献值
  12. </view>
  13. <view class="l"></view>
  14. <view class="value">
  15. <text>788</text>
  16. <br />
  17. 诚信值
  18. </view>
  19. </view> -->
  20. <view class="main">
  21. <view class="btn" @click="nav('/pages/money/wallet')">
  22. <image src="../../static/icon/assent1.png"></image>
  23. <text>{{ userInfo.brokerage_price * 1 }}</text>
  24. 佣金
  25. </view>
  26. <view class="btn" @click="nav('/pages/money/award')">
  27. <image src="../../static/icon/assent2.png"></image>
  28. <text>{{ candy || 0 }}</text>
  29. 糖果
  30. </view>
  31. <view class="btn" @click="nav('/pages/money/integralShopping')">
  32. <image src="../../static/icon/assent3.png"></image>
  33. <text>{{ userInfo.now_money * 1 }}</text>
  34. 货款
  35. </view>
  36. <view class="btn" @click="nav('/pages/money/mallPoints')">
  37. <image src="../../static/icon/assent4.png"></image>
  38. <text>{{ scjf || 0 }}</text>
  39. 商城积分
  40. </view>
  41. <view class="btn" @click="nav('/pages/money/integralP')">
  42. <image src="../../static/icon/assent5.png"></image>
  43. <text>{{ jf || 0 }}</text>
  44. 拼团积分
  45. </view>
  46. <view class="btn" @click="nav('/pages/money/frozen')">
  47. <image src="../../static/icon/assent6.png"></image>
  48. <text>{{ ptdjjf || 0 }}</text>
  49. 拼团冻结积分
  50. </view>
  51. <view class="btn" @click="nav('/pages/money/publicWelfare')">
  52. <image src="../../static/icon/assent7.png"></image>
  53. <text>{{ gyjf || 0 }}</text>
  54. 公益积分
  55. </view>
  56. <view class="btn" @click="nav('/pages/money/publicPing')">
  57. <image src="../../static/icon/assent8.png"></image>
  58. <text>{{ ptb || 0 }}</text>
  59. 拼团币
  60. </view>
  61. <view class="btn" @click="nav('/pages/money/publicW')">
  62. <image src="../../static/icon/assent9.png"></image>
  63. <text>{{ wjb || 0 }}</text>
  64. 文件币
  65. </view>
  66. </view>
  67. </view>
  68. </template>
  69. <script>
  70. import { wallet } from '@/api/finance.js';
  71. import { mapState, mapMutations } from 'vuex';
  72. export default {
  73. data() {
  74. return {
  75. candy: '',
  76. jf: '',
  77. ptdjjf: '',
  78. scjf: '',
  79. gyjf: '',
  80. ptb:'',
  81. wjb:''
  82. };
  83. },
  84. onLoad() {
  85. this.getWallet();
  86. },
  87. methods: {
  88. getWallet() {
  89. uni.showLoading({
  90. title: '加载中'
  91. });
  92. wallet({}).then(({ data }) => {
  93. console.log(data);
  94. const obj = this;
  95. const arr = Object.keys(data.back);
  96. console.log(arr);
  97. let ar = [];
  98. arr.forEach(e => {
  99. console.log(e, '11111');
  100. if (e == 'LALA') {
  101. obj.candy = (data.back[e].money.money * 1).toFixed(0);
  102. }
  103. if (e == 'USDC') {
  104. obj.jf = data.back[e].money.money * 1;
  105. }
  106. if (e == 'USDL') {
  107. obj.ptdjjf = data.back[e].money.money * 1;
  108. }
  109. if (e == 'SCJF') {
  110. obj.scjf = data.back[e].money.money * 1;
  111. }
  112. if (e == 'GYJF') {
  113. obj.gyjf = data.back[e].money.money * 1;
  114. }
  115. if (e == 'USDT') {
  116. obj.ptb = data.back[e].money.money * 1;
  117. }
  118. if (e == 'FIL') {
  119. obj.wjb = data.back[e].money.money * 1;
  120. }
  121. });
  122. uni.hideLoading();
  123. });
  124. },
  125. nav(url) {
  126. uni.navigateTo({
  127. url: url,
  128. fail() {
  129. uni.switchTab({
  130. url: url
  131. });
  132. }
  133. });
  134. }
  135. },
  136. computed: {
  137. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  138. }
  139. };
  140. </script>
  141. <style lang="scss" scoped>
  142. .assets {
  143. .header {
  144. height: 400rpx;
  145. background: linear-gradient(180deg, #32c6ff 0%, #2e58ff 100%);
  146. color: #fff;
  147. font-size: 35rpx;
  148. text-align: center;
  149. font-family: PingFang-SC-Medium;
  150. padding-top: 100rpx;
  151. .img {
  152. margin-bottom:10rpx;
  153. image {
  154. border-radius: 50%;
  155. width: 150rpx;
  156. height: 150rpx;
  157. border: solid 6rpx #fff;
  158. }
  159. }
  160. }
  161. .numerical {
  162. box-shadow: 0 5rpx 10rpx 1rpx #e6e6e6;
  163. margin: 30rpx;
  164. color: #666666;
  165. display: flex;
  166. text-align: center;
  167. background-color: #fff;
  168. padding: 30rpx;
  169. border-radius: 20rpx;
  170. position: relative;
  171. top: -120rpx;
  172. .l {
  173. background-color: #f8f8f8;
  174. width: 5rpx;
  175. height: 70rpx;
  176. margin: auto 0;
  177. }
  178. .value {
  179. flex: 1;
  180. }
  181. text {
  182. font-size: 40rpx;
  183. color: #333333;
  184. }
  185. }
  186. .main {
  187. position: relative;
  188. display: flex;
  189. flex-wrap: wrap;
  190. text-align: center;
  191. margin: 20rpx;
  192. .btn {
  193. padding: 40rpx;
  194. box-shadow: 0 5rpx 10rpx 1rpx #e6e6e6;
  195. border-radius: 20rpx;
  196. width: calc(50% - 20rpx);
  197. height: 240rpx;
  198. background-color: #fff;
  199. margin: 10rpx;
  200. display: grid;
  201. align-content: space-around;
  202. color: #666666;
  203. font-family: PingFang-SC-Medium;
  204. image {
  205. margin: 10rpx auto;
  206. width: 80rpx;
  207. height: 80rpx;
  208. }
  209. text {
  210. color: #333333;
  211. font-size: 35rpx;
  212. }
  213. }
  214. }
  215. }
  216. </style>