assets.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. <template>
  2. <view class="container">
  3. <view class="status_bar"></view>
  4. <view class="title">资产</view>
  5. <view>
  6. <view class="list-box">
  7. <view class="bg"><image src="../../static/img/assets-bg.png" mode=""></image></view>
  8. <view class="info-box">
  9. <view class="flex" v-show="show == true">
  10. <view class="info">
  11. <view class="list-title">总资产合计(USDT)</view>
  12. <view class="list-name clamp">{{ like_usdt * 1 }}</view>
  13. <view class="ustd">≈ {{ like_rmb * 1 }}RMB</view>
  14. </view>
  15. <image class="image" src="../../static/img/eyes.png" @click="showPick(false)"></image>
  16. </view>
  17. <view class="flex" v-show="show == false">
  18. <view class="info">
  19. <view class="list-title">总资产合计(USDT)</view>
  20. <view class="list-name clamp">****</view>
  21. <view class="ustd">≈ ****RMB</view>
  22. </view>
  23. <image class="image" src="../../static/img/img43.png" @click="showPick(true)"></image>
  24. </view>
  25. </view>
  26. <view class="list-tpl flex">
  27. <view class="tpl" @click="navTo('/pages/assets/transfer')">
  28. <image class="zhuanz" src="../../static/img/zhuan.png"></image>
  29. <view class="tpl-name">转账</view>
  30. </view>
  31. <view class="tpl" @click="navTo('/pages/assets/recharge')">
  32. <!-- @click="recharge" -->
  33. <image src="../../static/img/chong.png"></image>
  34. <view class="tpl-name">充币</view>
  35. </view>
  36. <view class="tpl" @click="navTo('/pages/assets/withdraw')">
  37. <image src="../../static/img/ti.png"></image>
  38. <view class="tpl-name">提币</view>
  39. </view>
  40. </view>
  41. <!-- <view class="list-tips flex_item">
  42. <image src="../../static/img/img07.png"></image>
  43. <view>资产正在保护中</view>
  44. </view> -->
  45. </view>
  46. <view class="list-cell" v-for="(ls, index) in list" :key="index" @click="toDateils(ls, index)">
  47. <view class="cell flex">
  48. <view class="cell-title flex">
  49. <image :src="ls.LOGO" mode="scaleToFill" class="logo"></image>
  50. <view class="name">{{ ls.name }}</view>
  51. </view>
  52. <image src="../../static/img/img16.png"></image>
  53. </view>
  54. <view class="flex cell-list">
  55. <view class="cell-tpl tips">
  56. <view class="name">可用</view>
  57. <view class="tpl">{{ ls.money.money * 1 }}</view>
  58. </view>
  59. <view class="cell-tpl tips">
  60. <view class="name">冻结中</view>
  61. <view class="tpl">{{ ls.lock_money * 1 }}</view>
  62. </view>
  63. <view class="cell-tpl tip-box">
  64. <view class="name">折合(USDT)</view>
  65. <view class="tpl clamp">{{ ls.usdt * 1 }}</view>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. </template>
  72. <script>
  73. import { wallet } from '@/api/finance.js';
  74. import easyselect from '@/components/easy-select/easy-select.vue';
  75. export default {
  76. components: {
  77. easyselect
  78. },
  79. data() {
  80. return {
  81. num: '',
  82. money: '',
  83. type: '',
  84. moneyTypeList: [],
  85. list: [],
  86. show: true,
  87. like_rmb: '',
  88. like_usdt: '',
  89. wallet: ''
  90. };
  91. },
  92. onLoad(option) {
  93. this.loadData();
  94. },
  95. onShow() {
  96. this.loadData();
  97. let show = uni.getStorageSync('showPick');
  98. if (show == false) {
  99. this.show = false;
  100. }
  101. if (show == true) {
  102. this.show = true;
  103. }
  104. },
  105. //下拉刷新
  106. onPullDownRefresh() {
  107. this.loadData();
  108. setTimeout(function() {
  109. uni.stopPullDownRefresh();
  110. }, 1000);
  111. },
  112. methods: {
  113. // 请求载入数据
  114. loadData() {
  115. let obj = this;
  116. uni.showLoading({
  117. title: '加载中'
  118. });
  119. obj.loading = true;
  120. wallet({}).then(({ data }) => {
  121. console.log(data);
  122. obj.like_rmb = data.all_rmb;
  123. obj.like_usdt = data.all_usdt;
  124. const arr = Object.keys(data.back);
  125. console.log(arr);
  126. let ar = [];
  127. arr.forEach(e => {
  128. ar.push(data.back[e]);
  129. });
  130. obj.list = ar;
  131. uni.hideLoading();
  132. });
  133. },
  134. showPick(item) {
  135. this.show = item;
  136. uni.setStorage({
  137. key: 'showPick',
  138. data: item,
  139. success: function() {}
  140. });
  141. },
  142. selectOne(options) {
  143. this.money = options.name;
  144. this.type = options.code;
  145. },
  146. useOutClickSide() {
  147. this.$refs.easySelect.hideOptions && this.$refs.easySelect.hideOptions();
  148. },
  149. close() {
  150. this.$refs.popup.close();
  151. },
  152. navTo(url) {
  153. uni.navigateTo({
  154. url
  155. });
  156. },
  157. toDateils(ls) {
  158. console.log(ls, '55');
  159. let wayaddress = {};
  160. uni.navigateTo({
  161. url: '/pages/assets/details?name=' + ls.name
  162. });
  163. }
  164. }
  165. };
  166. </script>
  167. <style lang="scss">
  168. page {
  169. min-height: 100%;
  170. background-color: #ffffff;
  171. .container {
  172. width: 100%;
  173. padding: 25rpx 40rpx;
  174. }
  175. }
  176. .status_bar {
  177. height: var(--status-bar-height);
  178. width: 100%;
  179. }
  180. .title {
  181. font-size: 46rpx;
  182. font-family: PingFang SC;
  183. font-weight: bold;
  184. color: $font-color-dark;
  185. margin-bottom: 30rpx;
  186. }
  187. .list-tips {
  188. position: absolute;
  189. right: 0;
  190. top: 25rpx;
  191. font-size: 24rpx;
  192. background-color: #f4ca1c;
  193. padding: 14rpx 27rpx;
  194. border-bottom-left-radius: 50rpx;
  195. border-top-left-radius: 50rpx;
  196. color: #5771df;
  197. image {
  198. width: 30rpx;
  199. height: 31rpx;
  200. margin-right: 12rpx;
  201. }
  202. }
  203. .list-box {
  204. .bg {
  205. position: absolute;
  206. right: 0;
  207. left: 0;
  208. top: 0;
  209. width: 100%;
  210. height: 100%;
  211. image {
  212. height: 100%;
  213. width: 100%;
  214. }
  215. }
  216. position: relative;
  217. color: #ffffff;
  218. border-radius: 20rpx;
  219. margin-bottom: 60rpx;
  220. .info-box {
  221. z-index: 10;
  222. position: relative;
  223. padding: 31rpx 43rpx;
  224. .image {
  225. width: 44rpx !important;
  226. height: 30rpx !important;
  227. }
  228. .info {
  229. width: 80%;
  230. .list-title {
  231. position: relative;
  232. z-index: 10;
  233. font-size: 30rpx;
  234. font-weight: 500;
  235. color: #ffffff;
  236. }
  237. .list-name {
  238. width: 100%;
  239. font-size: 64rpx;
  240. font-weight: bold;
  241. padding: 25rpx 0rpx;
  242. }
  243. .ustd {
  244. font-size: 30rpx;
  245. font-weight: normal;
  246. }
  247. }
  248. }
  249. .list-tpl {
  250. z-index: 10;
  251. position: relative;
  252. padding: 30rpx 100rpx;
  253. .tpl {
  254. text-align: center;
  255. image {
  256. width: 45rpx;
  257. height: 42rpx;
  258. }
  259. .zhuanz {
  260. width: 45rpx;
  261. height: 42rpx;
  262. }
  263. .tpl-name {
  264. font-size: 27rpx;
  265. font-weight: bold;
  266. padding-left: 10rpx;
  267. color: #ffffff;
  268. }
  269. }
  270. }
  271. }
  272. .list-cell {
  273. padding-bottom: 58rpx;
  274. .cell {
  275. padding-bottom: 31rpx;
  276. image {
  277. width: 12rpx;
  278. height: 24rpx;
  279. }
  280. .cell-title {
  281. font-size: 34rpx;
  282. font-weight: 500;
  283. color: #5771df;
  284. .logo {
  285. border-radius: 99rpx;
  286. width: 50rpx;
  287. height: 50rpx;
  288. }
  289. .name {
  290. margin-left: 20rpx;
  291. color: $font-color-dark;
  292. font-weight: bold;
  293. }
  294. }
  295. }
  296. .cell-list {
  297. width: 100%;
  298. justify-content: space-between;
  299. .cell-tpl {
  300. text-align: left;
  301. .name {
  302. font-size: 24rpx;
  303. font-weight: 500;
  304. color: #999999;
  305. padding-bottom: 15rpx;
  306. }
  307. }
  308. .tip-box {
  309. text-align: right;
  310. // width: 40%;
  311. }
  312. .tip-tpl {
  313. text-align: center;
  314. // width: 30%;
  315. }
  316. .tips {
  317. // width: 30%;
  318. }
  319. }
  320. }
  321. //弹窗
  322. .popup {
  323. background-color: #ffffff;
  324. border-radius: 25rpx;
  325. font-size: 30rpx;
  326. .cancel {
  327. text-align: center;
  328. width: 100%;
  329. line-height: 60rpx;
  330. .tip {
  331. background-color: #5771df;
  332. color: #ffffff;
  333. width: 70rpx;
  334. height: 70rpx;
  335. border-top-right-radius: 25rpx;
  336. }
  337. }
  338. .list-boxs {
  339. padding: 0rpx 80rpx;
  340. .password {
  341. padding: 50rpx 0rpx;
  342. width: 100%;
  343. input {
  344. width: 70%;
  345. height: 80rpx;
  346. border: 2rpx solid #999999;
  347. padding-left: 25rpx;
  348. box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.27);
  349. border-radius: 11rpx;
  350. }
  351. }
  352. .confirm-btn {
  353. padding-bottom: 120rpx;
  354. padding-top: 30rpx;
  355. text {
  356. background-color: #5771df;
  357. color: #ffffff;
  358. width: 70%;
  359. text-align: center;
  360. padding: 25rpx 90rpx;
  361. border-radius: 15rpx;
  362. }
  363. }
  364. }
  365. }
  366. .loading {
  367. width: 100%;
  368. height: 100%;
  369. }
  370. </style>