index.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  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)">
  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. };
  99. },
  100. onLoad(option){
  101. this.moneyType();
  102. this.loadData();
  103. },
  104. onShow() {
  105. let show = uni.getStorageSync('showPick');
  106. if(show == false){
  107. this.show = false;
  108. }
  109. if(show == true){
  110. this.show = true;
  111. }
  112. },
  113. //下拉刷新
  114. onPullDownRefresh() {
  115. this.loadData();
  116. this.moneyType();
  117. setTimeout(function () {
  118. uni.stopPullDownRefresh();
  119. }, 1000);
  120. },
  121. methods: {
  122. // 所有币种
  123. async moneyType(){
  124. let obj = this;
  125. moneyType({}).then(({ data }) => {
  126. obj.moneyTypeList = data;
  127. });
  128. },
  129. // 请求载入数据
  130. loadData() {
  131. let obj = this;
  132. wallet({}).then(({ data }) => {
  133. obj.like_rmb = data.like_rmb;
  134. obj.like_usdt = data.like_usdt;
  135. obj.list = data.back;
  136. });
  137. },
  138. showPick(item){
  139. this.show = item;
  140. uni.setStorage({
  141. key: 'showPick',
  142. data: item,
  143. success: function () {
  144. }
  145. });
  146. },
  147. recharge(){
  148. this.$refs.popup.open();
  149. },
  150. selectOne(options) {
  151. this.money = options.name;
  152. this.type = options.code;
  153. },
  154. useOutClickSide() {
  155. this.$refs.easySelect.hideOptions && this.$refs.easySelect.hideOptions()
  156. },
  157. // pay(){
  158. // let obj = this;
  159. // recharge({
  160. // num:obj.num,
  161. // money_type:obj.type
  162. // },obj.buyId).then(({ data }) => {
  163. // console.log(data)
  164. // obj.$api.msg(data.msg);
  165. // obj.$refs.popup.close();
  166. // obj.num='';
  167. // obj.type = '';
  168. // uni.navigateTo({
  169. // url:'/pages/finance/recharge?LOGO='+data._address_qr+'&order_id='+data.order_id+'&ddress='+data.__money_address+'&id='+data.id
  170. // })
  171. // }).catch(e => {
  172. // obj.$refs.popup.close();
  173. // });
  174. // },
  175. close() {
  176. this.$refs.popup.close();
  177. },
  178. navTo(url) {
  179. uni.navigateTo({
  180. url
  181. });
  182. },
  183. toDateils(ls){
  184. console.log(ls,88)
  185. uni.navigateTo({
  186. 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
  187. })
  188. },
  189. }
  190. };
  191. </script>
  192. <style lang="scss">
  193. page {
  194. min-height: 100%;
  195. background-color: #ffffff;
  196. .container {
  197. width: 100%;
  198. padding: 25rpx 40rpx;
  199. }
  200. }
  201. .list-tips{
  202. position: absolute;
  203. right: 0;
  204. top: 25rpx;
  205. font-size: 24rpx;
  206. background-color: #F4CA1C;
  207. padding: 14rpx 27rpx;
  208. border-bottom-left-radius: 50rpx;
  209. border-top-left-radius: 50rpx;
  210. color: #5771DF;
  211. image{
  212. width: 30rpx;
  213. height: 31rpx;
  214. margin-right: 12rpx;
  215. }
  216. }
  217. .list-box{
  218. background: linear-gradient(234.593deg, #0ADFFF 0%,#0171FD 100%);
  219. position: relative;
  220. color: #FFFFFF;
  221. border-radius: 20rpx;
  222. margin-bottom: 60rpx;
  223. .info-box{
  224. padding: 31rpx 43rpx;
  225. .image{
  226. width: 44rpx !important;
  227. height: 30rpx !important;
  228. }
  229. .info{
  230. width: 80%;
  231. .list-title{
  232. font-size: 30rpx;
  233. font-weight: 500;
  234. color: #FFFFFF;
  235. }
  236. .list-name{
  237. width:100%;
  238. font-size: 64rpx;
  239. font-weight: bold;
  240. padding: 25rpx 0rpx;
  241. }
  242. .ustd{
  243. font-size: 30rpx;
  244. font-weight: normal;
  245. }
  246. }
  247. }
  248. .list-tpl{
  249. padding: 30rpx 100rpx;
  250. background-color: #064285;
  251. .tpl{
  252. text-align: center;
  253. image{
  254. width: 45rpx;
  255. height: 42rpx;
  256. }
  257. .zhuanz{
  258. width: 45rpx;
  259. height: 42rpx;
  260. }
  261. .tpl-name{
  262. font-size: 27rpx;
  263. font-weight: bold;
  264. padding-left: 10rpx;
  265. }
  266. }
  267. }
  268. }
  269. .list-cell{
  270. padding-bottom: 58rpx;
  271. .cell{
  272. padding-bottom: 31rpx;
  273. image{
  274. width: 12rpx;
  275. height: 24rpx;
  276. }
  277. .cell-title{
  278. font-size: 34rpx;
  279. font-weight: 500;
  280. color: #5771DF;
  281. }
  282. }
  283. .cell-list{
  284. width: 100%;
  285. .cell-tpl{
  286. text-align: left;
  287. .name{
  288. font-size: 24rpx;
  289. font-weight: 500;
  290. color: #999999;
  291. padding-bottom: 15rpx;
  292. }
  293. }
  294. .tip-box{
  295. text-align: right;
  296. width: 40%;
  297. }
  298. .tip-tpl{
  299. text-align: center;
  300. width: 30%;
  301. }
  302. .tips{
  303. width: 30%;
  304. }
  305. }
  306. }
  307. //弹窗
  308. .popup{
  309. background-color: #FFFFFF;
  310. border-radius: 25rpx;
  311. font-size: 30rpx;
  312. .cancel{
  313. text-align: center;
  314. width: 100%;
  315. line-height: 60rpx;
  316. .tip{
  317. background-color: #5771DF;
  318. color: #FFFFFF;
  319. width:70rpx;
  320. height: 70rpx;
  321. border-top-right-radius:25rpx ;
  322. }
  323. }
  324. .list-boxs{
  325. padding: 0rpx 80rpx;
  326. .password{
  327. padding: 50rpx 0rpx;
  328. width: 100%;
  329. input{
  330. width: 70%;
  331. height: 80rpx;
  332. border: 2rpx solid #999999;
  333. padding-left: 25rpx;
  334. box-shadow:0px 3px 5px 0px rgba(0, 0, 0, 0.27);
  335. border-radius:11rpx;
  336. }
  337. }
  338. .confirm-btn{
  339. padding-bottom: 120rpx;
  340. padding-top: 30rpx;
  341. text{
  342. background-color: #5771DF;
  343. color: #FFFFFF;
  344. width: 70%;
  345. text-align: center;
  346. padding:25rpx 90rpx;
  347. border-radius: 15rpx;
  348. }
  349. }
  350. }
  351. }
  352. </style>