assets.vue 7.3 KB

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