user.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. <template>
  2. <view class="container">
  3. <navBar :show-title="true" :title="$t('user.我的资产')" url="/pages/index/index"></navBar>
  4. <view class="centerBox">
  5. <view class="myMoney flex-center position-relative">
  6. <view class="myMoneyBox">
  7. <view class="moneyTitle">
  8. <text>{{$t('user.我的资产')}}</text>
  9. <image class="myIcon margin-l-10" src="../../static/img/userIcon4.png" mode="scaleToFill">
  10. </image>
  11. </view>
  12. <view class="money margin-t-30">
  13. <text class="font-size-sm">≈</text>{{(userInfo.usdt*1).toFixed(5)}}U
  14. </view>
  15. </view>
  16. </view>
  17. <view class="flex cardBottom" @click="navto('./withdrawal')">
  18. <view class="cardLeft flex">
  19. <image class="leftTip" src="../../static/img/userIcon5.png" mode="scaleToFill"></image>
  20. <view class="moneyUp">
  21. USDT{{$t('user.提现')}}
  22. </view>
  23. <view class="moneyOut">
  24. ({{$t('user.手续费')}}{{num}}%)
  25. </view>
  26. </view>
  27. <view class="cardRight flex">
  28. <text class="margin-r-10">{{$t('user.去提现')}}</text>
  29. <image class="rightTip" src="../../static/img/mininext.png" mode="widthFix"></image>
  30. </view>
  31. </view>
  32. <view class="title">
  33. {{$t('user.我的资产')}}
  34. </view>
  35. <view class="list">
  36. <view class="item flex " @click="navto('./money?type=USDT')" >
  37. <view class="left flex-start">
  38. <image class="typeIcon" src="../../static/img/userIcon1.png" mode="scaleToFill"></image>
  39. <text>
  40. USDT
  41. </text>
  42. </view>
  43. <view class="right flex">
  44. <view class="moneyBox margin-r-20">
  45. <view class="num">
  46. {{(userInfo.USDT*1).toFixed(5)}}
  47. </view>
  48. <!-- <view class="tip">
  49. ≈{{money}}RMB
  50. </view> -->
  51. </view>
  52. <image class="itemTip" src="../../static/img/mininext.png" mode="widthFix"></image>
  53. </view>
  54. </view>
  55. <view class="item flex" @click="navto('./money?type=BCMM')">
  56. <view class="left flex-start">
  57. <image class="typeIcon" src="../../static/img/userIcon2.png" mode="scaleToFill"></image>
  58. <text>
  59. BCMM
  60. </text>
  61. </view>
  62. <view class="right flex">
  63. <view class="moneyBox margin-r-20">
  64. <view class="num">
  65. {{(userInfo.BCMM*1).toFixed(5)}}
  66. </view>
  67. <!-- <view class="tip">
  68. ≈{{money}}RMB
  69. </view> -->
  70. </view>
  71. <image class="itemTip" src="../../static/img/mininext.png" mode="widthFix"></image>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. </template>
  78. <script>
  79. import {
  80. mapState,
  81. mapMutations
  82. } from "vuex";
  83. import {
  84. loadIndexs
  85. } from '@/api/index.js';
  86. import {
  87. getUserInfo
  88. } from '@/api/user.js';
  89. import navBar from "@/components/nav/nav.vue"
  90. export default {
  91. data() {
  92. return {
  93. money: 0.00,
  94. num:0
  95. }
  96. },
  97. components: {
  98. navBar
  99. },
  100. computed: {
  101. ...mapState("user", ['userInfo']),
  102. },
  103. onLoad(option) {
  104. this.getUserInfo();
  105. },
  106. methods: {
  107. ...mapMutations('user', ['setUserInfo']),
  108. navto(url) {
  109. uni.navigateTo({
  110. url,
  111. });
  112. },
  113. // 获取更新用户信息
  114. getUserInfo() {
  115. getUserInfo().then((res) => {
  116. this.setUserInfo(res.data);
  117. }).catch((res) => {
  118. console.log(res);
  119. })
  120. loadIndexs().then((res) => {
  121. this.num = +res.data.commission;
  122. }).catch((res) => {
  123. console.log(res);
  124. })
  125. },
  126. },
  127. }
  128. </script>
  129. <style lang="scss">
  130. .centerBox {
  131. padding: 30rpx;
  132. color: #FFF;
  133. .title {
  134. padding: 50rpx 0;
  135. font-weight: 500;
  136. font-size: 36rpx;
  137. }
  138. .myMoney {
  139. background: url("../../static/img/userIcon3.png");
  140. height: 199rpx;
  141. background-size: 100% 100%;
  142. padding: 30rpx;
  143. font-weight: bold;
  144. .myMoneyBox {
  145. width: 100%;
  146. .moneyTitle {
  147. font-size: 29rpx;
  148. }
  149. .myIcon {
  150. width: 36rpx;
  151. height: 22rpx;
  152. }
  153. .money {
  154. font-size: 33rpx;
  155. }
  156. }
  157. }
  158. .item {
  159. margin-bottom: 50rpx;
  160. .left {
  161. .typeIcon {
  162. width: 80rpx;
  163. height: 80rpx;
  164. margin-right: 20rpx;
  165. }
  166. }
  167. .right {
  168. flex-shrink: 0;
  169. flex-grow: 1;
  170. justify-content: flex-end;
  171. font-weight: 500;
  172. text-align: right;
  173. .moneyBox {
  174. .num {
  175. font-size: 32rpx;
  176. }
  177. .tip {
  178. font-size: 26rpx;
  179. color: #999999;
  180. }
  181. }
  182. .itemTip {
  183. width: 18rpx;
  184. }
  185. }
  186. }
  187. }
  188. .cardBottom{
  189. background: #292D40;
  190. border-bottom-left-radius: 22rpx;
  191. border-bottom-right-radius: 22rpx;
  192. padding:44rpx 30rpx 34rpx 30rpx;
  193. margin-top: -20rpx;
  194. .leftTip{
  195. width: 31rpx;
  196. height: 32rpx;
  197. }
  198. .moneyUp{
  199. padding-left: 10rpx;
  200. font-weight: 500;
  201. font-size: 31rpx;
  202. }
  203. .moneyOut{
  204. font-weight: 500;
  205. font-size: 24rpx;
  206. color: rgba(255,255,255,.7);
  207. }
  208. .rightTip{
  209. width: 11rpx;
  210. }
  211. .cardRight{
  212. font-size: 24rpx;
  213. color: rgba(255,255,255,.7);
  214. }
  215. }
  216. .container {
  217. width: 100%;
  218. line-height: 1;
  219. background-color: rgb(12, 8, 21);
  220. min-height: 100vh;
  221. }
  222. </style>