user.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. <template>
  2. <view class="content">
  3. <view class="allmoneybox">
  4. <view class="allmbox_1">
  5. <image v-if="show" @click="look(false)" src="../../static/icon/user-eyes.png" mode=""></image>
  6. <image v-if="!show" @click="look(true)" src="../../static/icon/user-eyesb.png" mode=""></image>
  7. </view>
  8. <view class="allmbox_2 flex">
  9. <view class="allmbox_2_font">賬戶總資產折合(USDT)</view>
  10. <view class="allmbox_2_icon" @click="open()"><image src="../../static/icon/user-th.png" mode=""></image></view>
  11. </view>
  12. <view class="allmbox_3">{{ show ? money : '****.****' }}</view>
  13. <view class="allmbox_btn">
  14. <view class="allmbox_btn_1">
  15. <view class="allmbox_cbtn btn_active" @click="navTo('/pages/transaction/cblist')">充幣</view>
  16. <view class="allmbox_tbtn" @click="navTo('/pages/transaction/tblist')">提幣</view>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="findbox">
  21. <view class="findbox_1">
  22. <view class="findbox_2"><view class="findbox_3">資產列表</view></view>
  23. </view>
  24. <scroll-view :scroll-y="true" class="swiper-box" :style="{ height: maxheight }">
  25. <view class="listbox" v-for="(item, index) in list">
  26. <view class="listbox_title flex">
  27. <view class="listbox_title_l">{{ item.name.toLocaleUpperCase() }}</view>
  28. <view class="listbox_title_r"><image src="../../static/icon/user-back.png" mode=""></image></view>
  29. </view>
  30. <view class="main flex">
  31. <view class="main-item">
  32. <view class="main-item-font">可用</view>
  33. <view class="main-item-num">{{ item.data.num || '0.0000' }}</view>
  34. </view>
  35. <view class="main-item">
  36. <view class="main-item-font">冻结</view>
  37. <view class="main-item-num">{{ item.data.numd || '0.0000' }}</view>
  38. </view>
  39. <view class="main-item">
  40. <view class="main-item-font">折合(USDT)</view>
  41. <view class="main-item-num">{{ item.data.zhe || '0.0000' }}</view>
  42. </view>
  43. </view>
  44. </view>
  45. </scroll-view>
  46. </view>
  47. <uni-popup ref="popup" type="center">
  48. <view class="popup-box">
  49. <view class="img"><image src="../../static/img/user-index.png" mode=""></image></view>
  50. <view class="popup-font">由於資金統計存在延時,賬戶餘額不一定是並非最新余額,如需準確餘額請到相關賬戶頁面進行查詢</view>
  51. <view class="btn" @click="cancel()">確定</view>
  52. </view>
  53. </uni-popup>
  54. </view>
  55. </template>
  56. <script>
  57. import { usercoin, getallzhehe } from '@/api/wallet.js';
  58. export default {
  59. onReady(res) {
  60. var _this = this;
  61. uni.getSystemInfo({
  62. success: resu => {
  63. const query = uni.createSelectorQuery();
  64. query.select('.swiper-box').boundingClientRect();
  65. query.exec(function(res) {
  66. _this.maxheight = resu.windowHeight - res[0].top + 'px';
  67. console.log('打印页面的剩余高度', _this.maxheight);
  68. });
  69. },
  70. fail: res => {
  71. console.log('打印页面的剩余高度', res);
  72. }
  73. });
  74. },
  75. data() {
  76. return {
  77. maxheight: '',
  78. show: false,
  79. list: '',
  80. money: ''
  81. };
  82. },
  83. onLoad() {},
  84. onShow() {
  85. this.loadData();
  86. },
  87. methods: {
  88. look(type) {
  89. this.show = type;
  90. },
  91. loadData() {
  92. usercoin({}).then(({ data }) => {
  93. this.list = data;
  94. });
  95. getallzhehe({}).then(e => {
  96. this.money = e.allzhehe;
  97. console.log(e, '123456');
  98. });
  99. },
  100. cancel() {
  101. this.$refs.popup.close();
  102. },
  103. open() {
  104. this.$refs.popup.open();
  105. },
  106. navTo(url) {
  107. uni.navigateTo({
  108. url
  109. });
  110. }
  111. }
  112. };
  113. </script>
  114. <style lang="scss">
  115. page,
  116. .content {
  117. height: auto;
  118. min-height: 100%;
  119. }
  120. ::-webkit-input-placeholder {
  121. color: #b5b5b5;
  122. font-size: 12px;
  123. }
  124. ::-moz-placeholder {
  125. color: #b5b5b5;
  126. font-size: 12px;
  127. }
  128. input:focus {
  129. background: #fff;
  130. outline: 1px solid #fff;
  131. }
  132. a:hover,
  133. a:link,
  134. a:visited,
  135. a:active {
  136. color: #707a8a;
  137. text-decoration: none;
  138. }
  139. .no_header {
  140. position: fixed;
  141. z-index: 9999;
  142. padding: 0px 10px;
  143. top: 0px;
  144. height: 45px;
  145. // box-shadow: 0 2px 10px 0 rgb(0 0 0 / 10%);
  146. }
  147. .txtl {
  148. line-height: 50px;
  149. width: 20%;
  150. text-align: center;
  151. border-bottom: 3px solid #fcd535;
  152. }
  153. .titlebox {
  154. width: 100%;
  155. height: 120px;
  156. background: #fff;
  157. margin-top: 55px;
  158. border-top-left-radius: 20px;
  159. border-top-right-radius: 20px;
  160. }
  161. .allmoneybox {
  162. width: 100%;
  163. height: 300rpx;
  164. background: #f5f5f5;
  165. // box-shadow: 0 2px 10px 0 rgb(0 0 0 / 10%);
  166. // position: fixed;
  167. // top: 44px;
  168. }
  169. .allmbox_1 {
  170. width: 100%;
  171. display: flex;
  172. justify-content: flex-end;
  173. padding: 22px 15px 10rpx;
  174. image {
  175. width: 36rpx;
  176. height: 30rpx;
  177. }
  178. }
  179. .allmbox_2 {
  180. justify-content: flex-start;
  181. width: 100%;
  182. text-align: left;
  183. padding: 0px 15px;
  184. .allmbox_2_font {
  185. font-size: 25rpx;
  186. font-family: PingFang SC;
  187. font-weight: 500;
  188. color: #070707;
  189. margin-right: 10rpx;
  190. }
  191. .allmbox_2_icon {
  192. width: 34rpx;
  193. height: 34rpx;
  194. image {
  195. width: 100%;
  196. height: 100%;
  197. }
  198. }
  199. }
  200. .allmbox_3 {
  201. line-height: 1;
  202. width: 100%;
  203. margin-top: 24rpx;
  204. text-align: left;
  205. padding: 0px 15px;
  206. font-size: 40rpx;
  207. font-family: PingFang SC;
  208. font-weight: 500;
  209. color: #070707;
  210. }
  211. .allmbox_btn {
  212. width: 100%;
  213. height: 35px;
  214. line-height: 35px;
  215. padding: 0px 10px;
  216. }
  217. .allmbox_btn_1 {
  218. width: 60%;
  219. height: 35px;
  220. float: right;
  221. }
  222. .allmbox_cbtn {
  223. width: 45%;
  224. height: 35px;
  225. line-height: 35px;
  226. text-align: center;
  227. float: left;
  228. border: 1px solid #fcd535;
  229. border-radius: 5px;
  230. }
  231. .allmbox_tbtn {
  232. width: 45%;
  233. height: 35px;
  234. line-height: 35px;
  235. text-align: center;
  236. float: right;
  237. border: 1px solid #e6e6e6;
  238. border-radius: 5px;
  239. background: #e6e6e6;
  240. }
  241. .btn_active {
  242. background: linear-gradient(to left, #eeb80d, #ffe35b);
  243. }
  244. .findbox {
  245. background: #fff;
  246. }
  247. .findbox_1 {
  248. width: 100%;
  249. height: 40px;
  250. line-height: 40px;
  251. padding: 0px 15px;
  252. border-bottom: 1px solid #f5f5f5;
  253. }
  254. .findbox_2 {
  255. width: 60%;
  256. height: 40px;
  257. line-height: 40px;
  258. float: left;
  259. }
  260. .findbox_3 {
  261. height: 40px;
  262. background: #ffffff;
  263. border-bottom: 2px solid #fcd535;
  264. float: left;
  265. text-align: center;
  266. }
  267. .listbox {
  268. padding: 33rpx 20rpx 24rpx;
  269. width: 100%;
  270. background: #fff;
  271. border-bottom: 1px solid #f5f5f5;
  272. }
  273. .listbox_title {
  274. margin-top: 30rpx;
  275. width: 100%;
  276. }
  277. .listbox_title_l {
  278. width: 50%;
  279. font-size: 27rpx;
  280. font-family: PingFang SC;
  281. font-weight: bold;
  282. color: #767682;
  283. text-align: left;
  284. }
  285. .listbox_title_r {
  286. image {
  287. width: 28rpx;
  288. height: 28rpx;
  289. }
  290. }
  291. .main {
  292. margin-top: 30rpx;
  293. .main-item {
  294. width: 33%;
  295. line-height: 1;
  296. .main-item-font {
  297. font-size: 25rpx;
  298. font-family: PingFang SC;
  299. font-weight: 500;
  300. color: #cdcdcd;
  301. }
  302. .main-item-num {
  303. margin-top: 14rpx;
  304. font-size: 23rpx;
  305. font-family: PingFang SC;
  306. font-weight: 500;
  307. color: #000000;
  308. }
  309. }
  310. }
  311. .popup-box {
  312. background: #fff;
  313. border-radius: 30rpx;
  314. width: 580rpx;
  315. padding: 20rpx;
  316. .img {
  317. padding: 10rpx 0 0 0;
  318. display: flex;
  319. justify-content: center;
  320. image {
  321. width: 72rpx;
  322. height: 72rpx;
  323. }
  324. }
  325. .popup-font {
  326. font-size: 28rpx;
  327. color: #000;
  328. padding: 10rpx 20rpx;
  329. }
  330. .btn {
  331. width: 100%;
  332. height: 80rpx;
  333. line-height: 80rpx;
  334. background: linear-gradient(to left, #eeb80d, #ffe35b);
  335. border-radius: 10rpx;
  336. text-align: center;
  337. margin-top: 20rpx;
  338. }
  339. }
  340. </style>