index.vue 8.9 KB

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