index.vue 8.9 KB

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