index.vue 8.1 KB

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