assets.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  1. <template>
  2. <view class="container">
  3. <view>
  4. <view class="list-box">
  5. <view class="bg">
  6. <image src="../../static/img/assets-bg.png" mode=""></image>
  7. </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">{{ ls.name }}</view>
  49. <image src="../../static/img/img16.png"></image>
  50. </view>
  51. <view class="flex cell-list">
  52. <view class="cell-tpl tips">
  53. <view class="name">可用</view>
  54. <view class="tpl">{{ ls.money.money * 1 }}</view>
  55. </view>
  56. <view class="cell-tpl tip-tpl">
  57. <view class="name">冻结</view>
  58. <view class="tpl">{{ ls.lock_moeny }}</view>
  59. </view>
  60. <view class="cell-tpl tip-box">
  61. <view class="name">折合(USDT)</view>
  62. <view class="tpl clamp">{{ ls.usdt * 1 }}</view>
  63. </view>
  64. </view>
  65. </view>
  66. <!-- <uni-popup ref="popup" type="center">
  67. <view class="popup">
  68. <view class="cancel flex" @click="close">
  69. <view></view>
  70. <view class="tip">x</view>
  71. </view>
  72. <view class="list-boxs">
  73. <view class="popup-text">购买数量:</view>
  74. <view class="password"><input type="number" v-model="num" placeholder="请输入算力数量"></view>
  75. <view class="popup-text">币种选择:</view>
  76. <view class="content" @click="useOutClickSide">
  77. <easy-select ref="easySelect" :options='moneyTypeList' :value="money" @selectOne="selectOne"></easy-select>
  78. </view>
  79. <view class="confirm-btn" @click="pay"><text>确认充币</text></view>
  80. </view>
  81. </view>
  82. </uni-popup> -->
  83. </view>
  84. </view>
  85. </template>
  86. <script>
  87. import { recharge, wallet,moneyType } from '@/api/finance.js';
  88. import easyselect from '@/components/easy-select/easy-select.vue';
  89. export default {
  90. components: {
  91. easyselect
  92. },
  93. data() {
  94. return {
  95. num: '',
  96. money: '',
  97. type: '',
  98. moneyTypeList: [],
  99. list: '',
  100. show: true,
  101. like_rmb: '',
  102. like_usdt: '',
  103. wallet: '',
  104. };
  105. },
  106. onLoad(option) {
  107. this.moneyType();
  108. this.loadData();
  109. },
  110. onShow() {
  111. this.moneyType();
  112. this.loadData();
  113. let show = uni.getStorageSync('showPick');
  114. if (show == false) {
  115. this.show = false;
  116. }
  117. if (show == true) {
  118. this.show = true;
  119. }
  120. },
  121. //下拉刷新
  122. onPullDownRefresh() {
  123. this.loadData();
  124. this.moneyType();
  125. setTimeout(function() {
  126. uni.stopPullDownRefresh();
  127. }, 1000);
  128. },
  129. methods: {
  130. // 所有币种
  131. async moneyType() {
  132. let obj = this;
  133. moneyType({}).then(({ data }) => {
  134. obj.moneyTypeList = data;
  135. });
  136. },
  137. // 请求载入数据
  138. loadData() {
  139. let obj = this;
  140. uni.showLoading({
  141. title:'加载中'
  142. })
  143. obj.loading = true;
  144. wallet({}).then(({ data }) => {
  145. console.log(data);
  146. obj.like_rmb = data.like_rmb;
  147. obj.like_usdt = data.like_usdt;
  148. obj.list = data.back;
  149. uni.hideLoading();
  150. });
  151. },
  152. showPick(item) {
  153. this.show = item;
  154. uni.setStorage({
  155. key: 'showPick',
  156. data: item,
  157. success: function() {}
  158. });
  159. },
  160. recharge() {
  161. this.$refs.popup.open();
  162. },
  163. selectOne(options) {
  164. this.money = options.name;
  165. this.type = options.code;
  166. },
  167. useOutClickSide() {
  168. this.$refs.easySelect.hideOptions && this.$refs.easySelect.hideOptions();
  169. },
  170. // pay(){
  171. // let obj = this;
  172. // recharge({
  173. // num:obj.num,
  174. // money_type:obj.type
  175. // },obj.buyId).then(({ data }) => {
  176. // console.log(data)
  177. // obj.$api.msg(data.msg);
  178. // obj.$refs.popup.close();
  179. // obj.num='';
  180. // obj.type = '';
  181. // uni.navigateTo({
  182. // url:'/pages/finance/recharge?LOGO='+data._address_qr+'&order_id='+data.order_id+'&ddress='+data.__money_address+'&id='+data.id
  183. // })
  184. // }).catch(e => {
  185. // obj.$refs.popup.close();
  186. // });
  187. // },
  188. close() {
  189. this.$refs.popup.close();
  190. },
  191. navTo(url) {
  192. uni.navigateTo({
  193. url
  194. });
  195. },
  196. toDateils(ls, index) {
  197. console.log(ls, 88);
  198. let way = ls.way.split(',');
  199. console.log(way[0], 'money-----------', ls.money);
  200. let path = 'address_' + way[0];
  201. console.log(path);
  202. console.log(path === 'address_TRC20');
  203. let address = ls.money[path];
  204. let wayaddress = {};
  205. way.forEach(item => {
  206. let path = 'address_' + item;
  207. wayaddress[item] = ls.money[path];
  208. });
  209. let waypath = JSON.stringify(wayaddress);
  210. uni.navigateTo({
  211. url:
  212. '/pages/finance/details?code=' +
  213. ls.code +
  214. '&name=' +
  215. ls.name +
  216. '&logo=' +
  217. ls.LOGO +
  218. '&price=' +
  219. ls.money.money +
  220. '&_address_qr=' +
  221. ls._address_qr +
  222. '&__money_address=' +
  223. ls.__money_address +
  224. '&mark=' +
  225. ls.mark +
  226. '&ids=' +
  227. ls.money.id +
  228. '&keysAddr=' +
  229. ls.money.address +
  230. '&charge=' +
  231. ls.charge +
  232. '&address=' +
  233. address +
  234. '&way=' +
  235. ls.way +
  236. '&waypath=' +
  237. waypath+
  238. '&less=' +
  239. ls.less
  240. });
  241. }
  242. }
  243. };
  244. </script>
  245. <style lang="scss">
  246. page {
  247. min-height: 100%;
  248. background-color: #ffffff;
  249. .container {
  250. width: 100%;
  251. padding: 25rpx 40rpx;
  252. }
  253. }
  254. .list-tips {
  255. position: absolute;
  256. right: 0;
  257. top: 25rpx;
  258. font-size: 24rpx;
  259. background-color: #f4ca1c;
  260. padding: 14rpx 27rpx;
  261. border-bottom-left-radius: 50rpx;
  262. border-top-left-radius: 50rpx;
  263. color: #5771df;
  264. image {
  265. width: 30rpx;
  266. height: 31rpx;
  267. margin-right: 12rpx;
  268. }
  269. }
  270. .list-box {
  271. .bg {
  272. position: absolute;
  273. right: 0;
  274. left: 0;
  275. top: 0;
  276. width: 100%;
  277. height: 100%;
  278. image {
  279. height: 100%;
  280. width: 100%;
  281. }
  282. }
  283. position: relative;
  284. color: #ffffff;
  285. border-radius: 20rpx;
  286. margin-bottom: 60rpx;
  287. .info-box {
  288. z-index: 10;
  289. position: relative;
  290. padding: 31rpx 43rpx;
  291. .image {
  292. width: 44rpx !important;
  293. height: 30rpx !important;
  294. }
  295. .info {
  296. width: 80%;
  297. .list-title {
  298. position: relative;
  299. z-index: 10;
  300. font-size: 30rpx;
  301. font-weight: 500;
  302. color: #ffffff;
  303. }
  304. .list-name {
  305. width: 100%;
  306. font-size: 64rpx;
  307. font-weight: bold;
  308. padding: 25rpx 0rpx;
  309. }
  310. .ustd {
  311. font-size: 30rpx;
  312. font-weight: normal;
  313. }
  314. }
  315. }
  316. .list-tpl {
  317. z-index: 10;
  318. position: relative;
  319. padding: 30rpx 100rpx;
  320. .tpl {
  321. text-align: center;
  322. image {
  323. width: 45rpx;
  324. height: 42rpx;
  325. }
  326. .zhuanz {
  327. width: 45rpx;
  328. height: 42rpx;
  329. }
  330. .tpl-name {
  331. font-size: 27rpx;
  332. font-weight: bold;
  333. padding-left: 10rpx;
  334. color: #FFFFFF;
  335. }
  336. }
  337. }
  338. }
  339. .list-cell {
  340. padding-bottom: 58rpx;
  341. .cell {
  342. padding-bottom: 31rpx;
  343. image {
  344. width: 12rpx;
  345. height: 24rpx;
  346. }
  347. .cell-title {
  348. font-size: 34rpx;
  349. font-weight: 500;
  350. color: #5771df;
  351. }
  352. }
  353. .cell-list {
  354. width: 100%;
  355. .cell-tpl {
  356. text-align: left;
  357. .name {
  358. font-size: 24rpx;
  359. font-weight: 500;
  360. color: #999999;
  361. padding-bottom: 15rpx;
  362. }
  363. }
  364. .tip-box {
  365. text-align: right;
  366. width: 40%;
  367. }
  368. .tip-tpl {
  369. text-align: center;
  370. width: 30%;
  371. }
  372. .tips {
  373. width: 30%;
  374. }
  375. }
  376. }
  377. //弹窗
  378. .popup {
  379. background-color: #ffffff;
  380. border-radius: 25rpx;
  381. font-size: 30rpx;
  382. .cancel {
  383. text-align: center;
  384. width: 100%;
  385. line-height: 60rpx;
  386. .tip {
  387. background-color: #5771df;
  388. color: #ffffff;
  389. width: 70rpx;
  390. height: 70rpx;
  391. border-top-right-radius: 25rpx;
  392. }
  393. }
  394. .list-boxs {
  395. padding: 0rpx 80rpx;
  396. .password {
  397. padding: 50rpx 0rpx;
  398. width: 100%;
  399. input {
  400. width: 70%;
  401. height: 80rpx;
  402. border: 2rpx solid #999999;
  403. padding-left: 25rpx;
  404. box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.27);
  405. border-radius: 11rpx;
  406. }
  407. }
  408. .confirm-btn {
  409. padding-bottom: 120rpx;
  410. padding-top: 30rpx;
  411. text {
  412. background-color: #5771df;
  413. color: #ffffff;
  414. width: 70%;
  415. text-align: center;
  416. padding: 25rpx 90rpx;
  417. border-radius: 15rpx;
  418. }
  419. }
  420. }
  421. }
  422. .loading {
  423. width: 100%;
  424. height: 100%;
  425. }
  426. </style>