assets.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <div class="assets">
  3. <div class="head">
  4. <!-- <img @click="back" src="@/assets/images/back.png" class="arrow_img" /> -->
  5. <span>我的资产</span>
  6. </div>
  7. <div class="">
  8. <div class="total_box">
  9. <span class="total">{{ Math.floor(assets * 100) / 100 || 0 }}</span>
  10. <span class="text">用户总资产</span>
  11. </div>
  12. <div class="balance_box">
  13. <div class="balance_li" @click="navigation('usdtWithdraw', '')">
  14. <img src="@/assets/images/wallet/icon1.png" alt="" class="icon" />
  15. <span>USDT提现</span>
  16. </div>
  17. <!-- <div class="balance_li" @click="navigation('etcManage', '')">
  18. <img src="@/assets/images/wallet/icon2.png" alt="" class="icon" />
  19. <span>ETC管理</span>
  20. </div> -->
  21. <div class="balance_li" @click="navigation('smhManage', '')">
  22. <img src="@/assets/images/wallet/icon2.png" alt="" class="icon" />
  23. <span>SMH管理</span>
  24. </div>
  25. <div class="balance_li" @click="navigation('arManage', '')">
  26. <img src="@/assets/images/wallet/icon2.png" alt="" class="icon" />
  27. <span>AR管理</span>
  28. </div>
  29. </div>
  30. <!-- <div class="balance_box">
  31. <div class="balance_li" @click="navigation('etcWithdraw', '')">
  32. <img src="@/assets/images/wallet/icon1.png" alt="" class="icon" />
  33. <span>ETC提现</span>
  34. </div>
  35. <div class="balance_li" @click="navigation('transfer', '')">
  36. <img src="@/assets/images/wallet/icon2.png" alt="" class="icon" />
  37. <span>SMH管理</span>
  38. </div>
  39. </div> -->
  40. <div class="bare" v-if="total > 1">
  41. <span>暂无数据</span>
  42. </div>
  43. <div v-else>
  44. <div class="list">
  45. <div
  46. v-for="(item, index) in coinList"
  47. :key="index"
  48. :style="{ 'border-top': index != 0 ? ' 1px solid rgba(232, 240, 247, 1)' : '' }"
  49. class="li"
  50. @click="navigation('assetDetails', { coin_type: item.coin_key, coin_name: item.coin_name })"
  51. >
  52. <div class="li_left">
  53. <img :src="require('@/assets/images/wallet/' + item.coin_key + '.png')" class="li_img" />
  54. <span>{{ item.coin_name }}</span>
  55. </div>
  56. <span class="num">{{ Math.floor(item.amount * 100) / 100 || 0 }}</span>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. <BottomNavigation></BottomNavigation>
  62. </div>
  63. </template>
  64. <script>
  65. import BottomNavigation from '@/components/BottomNavigation.vue';
  66. import { homeApi } from '@/api/index';
  67. import { dateFormat } from '@/utils/formatTool.js';
  68. export default {
  69. components: {
  70. BottomNavigation,
  71. },
  72. data() {
  73. return {
  74. page: 0,
  75. loading: false,
  76. finished: false,
  77. total: 1,
  78. assets: 0,
  79. coinList: [
  80. // {
  81. // coin_name: 'USDT',
  82. // amount: '0',
  83. // },
  84. // {
  85. // coin_name: '算力',
  86. // amount: '0',
  87. // },
  88. // {
  89. // coin_name: '能量值',
  90. // amount: '0',
  91. // },
  92. ],
  93. showPopover: false,
  94. typeText: '全部',
  95. actionType: -1, //-1:全部 0:未知 1:租赁 2:直推奖励 3:团队的算力奖励 4:团队的平级算力奖励
  96. };
  97. },
  98. mounted() {
  99. this.actionGet();
  100. },
  101. methods: {
  102. //返回上一页
  103. back() {
  104. this.$router.back();
  105. },
  106. navigation(name, query) {
  107. console.log(query);
  108. if (query.coin_type == 'server') {
  109. this.$router.push({ name: 'orders' });
  110. } else {
  111. this.$router.push({ name, query });
  112. }
  113. },
  114. dateFormatFn(date) {
  115. return dateFormat(new Date(date * 1000), 'yyyy-MM-dd hh:mm:ss');
  116. },
  117. actionGet() {
  118. homeApi.assets().then(res => {
  119. if (res.code == 200) {
  120. this.assets = res.data.assets;
  121. this.coinList = res.data.coin_list;
  122. }
  123. });
  124. },
  125. },
  126. };
  127. </script>
  128. <style lang="less" scoped>
  129. .head {
  130. position: fixed;
  131. top: 0;
  132. left: 0;
  133. width: 100%;
  134. display: flex;
  135. align-items: center;
  136. justify-content: center;
  137. color: rgba(#000, 0.8);
  138. letter-spacing: 1.5px;
  139. font-weight: 550;
  140. background: #fff;
  141. padding: 14px 0;
  142. .arrow_img {
  143. position: absolute;
  144. left: 20px;
  145. width: 10px;
  146. height: 16px;
  147. // transform: translate(0, -50%);
  148. }
  149. }
  150. .assets {
  151. min-height: 100vh;
  152. padding: 66px 16px 100px;
  153. .total_box {
  154. display: flex;
  155. flex-direction: column;
  156. justify-content: center;
  157. font-size: 14px;
  158. color: #fff;
  159. height: 150px;
  160. text-align: center;
  161. border-radius: 16px;
  162. // padding: 20px;
  163. background: url('~@/assets/images/wallet/bg.png') no-repeat center;
  164. background-size: 120% 120%;
  165. .total {
  166. font-size: 24px;
  167. font-weight: 600;
  168. margin-bottom: 10px;
  169. }
  170. .text {
  171. color: rgba(#fff, 0.8);
  172. }
  173. }
  174. .balance_box {
  175. display: flex;
  176. align-items: center;
  177. justify-content: space-between;
  178. padding-top: 16px;
  179. .balance_li {
  180. color: #000;
  181. display: flex;
  182. align-items: center;
  183. flex-direction: column;
  184. width: 32%;
  185. font-size: 14px;
  186. border-radius: 16px;
  187. padding: 16px 0;
  188. box-shadow: 4px 4px 15px 0px rgba(180, 212, 212, 0.59);
  189. background-color: rgba(255, 255, 255, 0.3);
  190. .icon {
  191. width: 30px;
  192. height: 30px;
  193. margin-bottom: 10px;
  194. }
  195. }
  196. }
  197. .bare {
  198. text-align: center;
  199. font-size: 14px;
  200. padding: 60px 14px;
  201. color: #888;
  202. }
  203. .list {
  204. border-radius: 16px;
  205. padding: 0 16px;
  206. margin-top: 16px;
  207. box-shadow: 4px 4px 15px 0px rgba(180, 212, 212, 0.59);
  208. background-color: rgba(255, 255, 255, 0.3);
  209. .li {
  210. display: flex;
  211. align-items: center;
  212. justify-content: space-between;
  213. font-size: 14px;
  214. color: rgba(51, 51, 51, 1);
  215. padding: 14px 0;
  216. .li_left {
  217. display: flex;
  218. align-items: center;
  219. .li_img {
  220. display: block;
  221. width: 32px;
  222. height: 32px;
  223. margin-right: 6px;
  224. border-radius: 50%;
  225. }
  226. }
  227. .num {
  228. font-size: 16px;
  229. font-weight: 550;
  230. }
  231. }
  232. }
  233. }
  234. </style>