user.vue 7.1 KB

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