myrg.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <view class="content">
  3. <view class="flex navbar">
  4. <view class="" v-for="(item, index) in navList" :class="{ action: current == index }" @click="changetab(index)">{{ $t('rg.' + item.name) }}</view>
  5. </view>
  6. <swiper class="swiper" :style="{ height: height }" :current="current" disable-touch>
  7. <swiper-item v-for="navitem in navList">
  8. <scroll-view scroll-y="true" class="scroll" :style="{ height: height }">
  9. <view v-for="(item, ind) in navitem.list" class="usdtList padding-t-30 padding-b-30">
  10. <view class="top flex">
  11. <view class="top-left">{{ $t('rg.xm') }}:{{ item.name }}</view>
  12. <view class="top-right">{{ item.status == 1 ? $t('rg.djz') : $t('rg.yjd') }}</view>
  13. </view>
  14. <view class="main-bottom flex">
  15. <view class="main-bottom-item first">
  16. <view class="main-bottom-item-font">{{ $t('rg.rgsl') }}({{ item.coinname.toLocaleUpperCase() }})</view>
  17. <view class="main-bottom-item-num">{{ item.num }}</view>
  18. </view>
  19. <view class="main-bottom-item">
  20. <view class="main-bottom-item-font">{{ $t('rg.zfje') }}({{ item.buycoin.toLocaleUpperCase() }})</view>
  21. <view class="main-bottom-item-num">{{ item.num }}</view>
  22. </view>
  23. <view class="main-bottom-item">
  24. <view class="main-bottom-item-font">{{ item.status == 1 ? $t('rg.jdrq') : $t('rg.sfrq') }}</view>
  25. <view class="main-bottom-item-num">{{ item.endday }}</view>
  26. </view>
  27. </view>
  28. </view>
  29. </scroll-view>
  30. </swiper-item>
  31. </swiper>
  32. </view>
  33. </template>
  34. <script>
  35. import { issuelog } from '@/api/wallet.js';
  36. export default {
  37. data() {
  38. return {
  39. height: '',
  40. current: 0,
  41. navList: [
  42. {
  43. status: 1,
  44. name: 'qbrg',
  45. page: 1,
  46. limit: 10,
  47. loadingType: 'more',
  48. loded: false,
  49. list: []
  50. },
  51. {
  52. status: 2,
  53. name: 'djz',
  54. page: 1,
  55. limit: 10,
  56. loadingType: 'more',
  57. loded: false,
  58. list: []
  59. },
  60. {
  61. status: 3,
  62. name: 'yjd',
  63. page: 1,
  64. limit: 10,
  65. loadingType: 'more',
  66. loded: false,
  67. list: []
  68. }
  69. ]
  70. };
  71. },
  72. onLoad() {
  73. this.loadData();
  74. uni.setNavigationBarTitle({ title: this.$t('rg.wdrg') });
  75. },
  76. onShow() {},
  77. onReachBottom() {},
  78. onReady(res) {
  79. var obj = this;
  80. uni.getSystemInfo({
  81. success: resu => {
  82. const query = uni.createSelectorQuery();
  83. query.select('.swiper').boundingClientRect();
  84. query.exec(function(res) {
  85. obj.height = resu.windowHeight - res[0].top + 'px';
  86. });
  87. },
  88. fail: res => {}
  89. });
  90. },
  91. methods: {
  92. changetab(index) {
  93. this.current = index;
  94. this.loadData('tab');
  95. },
  96. loadData(tab) {
  97. let obj = this;
  98. let index = obj.current;
  99. let item = obj.navList[index];
  100. if (tab == 'tab' && item.loaded) {
  101. return;
  102. }
  103. if (item.loadingType == 'loading') {
  104. return;
  105. }
  106. issuelog({
  107. type: item.status,
  108. page: item.page,
  109. limit: item.limit
  110. })
  111. .then(({ data }) => {
  112. item.list = item.list.concat(data);
  113. this.$set(item, 'loaded', true);
  114. })
  115. .catch(e => {
  116. console.log(e);
  117. });
  118. }
  119. }
  120. };
  121. </script>
  122. <style lang="scss">
  123. .swiper {
  124. background-color: #fff;
  125. }
  126. .scroll {
  127. padding: 0 20rpx;
  128. }
  129. .navbar {
  130. justify-content: flex-start;
  131. font-size: 40rpx;
  132. padding: 30rpx;
  133. view {
  134. padding-left: 40rpx;
  135. height: 100rpx;
  136. line-height: 100rpx;
  137. }
  138. }
  139. .usdtList {
  140. color: #707a8a;
  141. border-bottom: 1px solid $border-color-light;
  142. .top {
  143. padding-top: 20rpx;
  144. .top-left {
  145. font-size: 32rpx;
  146. font-weight: 500;
  147. color: #000;
  148. }
  149. .top-right {
  150. padding: 5rpx 10rpx;
  151. font-size: 28rpx;
  152. color: red;
  153. }
  154. }
  155. .main-bottom {
  156. padding: 28rpx 0;
  157. .main-bottom-item {
  158. display: flex;
  159. flex-direction: column;
  160. align-items: center;
  161. .main-bottom-item-font {
  162. font-size: 28rpx;
  163. color: #707a8a;
  164. }
  165. .main-bottom-item-num {
  166. margin-top: 10rpx;
  167. font-size: 28rpx;
  168. color: #707a8a;
  169. }
  170. }
  171. }
  172. }
  173. .action {
  174. font-weight: bold;
  175. font-size: 44rpx;
  176. }
  177. </style>