myrg.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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)">{{ 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">項目:{{ item.name }}</view>
  12. <view class="top-right">{{ item.status == 1 ? '凍結中' : '已解凍' }}</view>
  13. </view>
  14. <view class="main-bottom flex">
  15. <view class="main-bottom-item first">
  16. <view class="main-bottom-item-font">認購數量({{ 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">支付金額({{ 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 ? '解凍日期' : '釋放日期' }}</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: '全部認購',
  45. page: 1,
  46. limit: 10,
  47. loadingType: 'more',
  48. loded: false,
  49. list: []
  50. },
  51. {
  52. status: 2,
  53. name: '凍結中',
  54. page: 1,
  55. limit: 10,
  56. loadingType: 'more',
  57. loded: false,
  58. list: []
  59. },
  60. {
  61. status: 3,
  62. name: '已解凍',
  63. page: 1,
  64. limit: 10,
  65. loadingType: 'more',
  66. loded: false,
  67. list: []
  68. }
  69. ]
  70. };
  71. },
  72. onLoad() {
  73. this.loadData();
  74. },
  75. onShow() {},
  76. onReachBottom() {},
  77. onReady(res) {
  78. var obj = this;
  79. uni.getSystemInfo({
  80. success: resu => {
  81. const query = uni.createSelectorQuery();
  82. query.select('.swiper').boundingClientRect();
  83. query.exec(function(res) {
  84. obj.height = resu.windowHeight - res[0].top + 'px';
  85. });
  86. },
  87. fail: res => {}
  88. });
  89. },
  90. methods: {
  91. changetab(index) {
  92. this.current = index;
  93. this.loadData('tab');
  94. },
  95. loadData(tab) {
  96. let obj = this;
  97. let index = obj.current;
  98. let item = obj.navList[index];
  99. if (tab == 'tab' && item.loaded) {
  100. return;
  101. }
  102. if (item.loadingType == 'loading') {
  103. return;
  104. }
  105. issuelog({
  106. type: item.status,
  107. page: item.page,
  108. limit: item.limit
  109. })
  110. .then(({ data }) => {
  111. item.list = item.list.concat(data);
  112. this.$set(item, 'loaded', true);
  113. })
  114. .catch(e => {
  115. console.log(e);
  116. });
  117. }
  118. }
  119. };
  120. </script>
  121. <style lang="scss">
  122. .swiper {
  123. background-color: #fff;
  124. }
  125. .scroll {
  126. padding: 0 20rpx;
  127. }
  128. .navbar {
  129. justify-content: flex-start;
  130. font-size: 40rpx;
  131. padding: 30rpx;
  132. view {
  133. padding-left: 40rpx;
  134. height: 100rpx;
  135. line-height: 100rpx;
  136. }
  137. }
  138. .usdtList {
  139. color: #707a8a;
  140. border-bottom: 1px solid $border-color-light;
  141. .top {
  142. padding-top: 20rpx;
  143. .top-left {
  144. font-size: 32rpx;
  145. font-weight: 500;
  146. color: #000;
  147. }
  148. .top-right {
  149. padding: 5rpx 10rpx;
  150. font-size: 28rpx;
  151. color: red;
  152. }
  153. }
  154. .main-bottom {
  155. padding: 28rpx 0;
  156. .main-bottom-item {
  157. display: flex;
  158. flex-direction: column;
  159. align-items: center;
  160. .main-bottom-item-font {
  161. font-size: 28rpx;
  162. color: #707a8a;
  163. }
  164. .main-bottom-item-num {
  165. margin-top: 10rpx;
  166. font-size: 28rpx;
  167. color: #707a8a;
  168. }
  169. }
  170. }
  171. }
  172. .action {
  173. font-weight: bold;
  174. font-size: 44rpx;
  175. }
  176. </style>