assets.vue 7.2 KB

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