index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <app-layout class="c-wrapper">
  3. <!--tab-->
  4. <view class="u-tabs-box">
  5. <u-tabs-swiper ref="tabs"
  6. :active-color="$u.color['mainBgColor']"
  7. inactive-color="#666666"
  8. bar-height="4"
  9. height="90"
  10. :list="tabs"
  11. :current="currentTab"
  12. @change="changeTabs"
  13. :is-scroll="false" swiperWidth="750"
  14. ></u-tabs-swiper>
  15. </view>
  16. <!--内容-->
  17. <swiper class="swiper-box" :current="currentSwiper" @transition="swiperTransition" @animationfinish="swiperAnimationFinish">
  18. <swiper-item class="swiper-item" v-for="(arr,index) in dataList" :key="index">
  19. <scroll-view scroll-y
  20. class="scroll-item"
  21. lower-threshold="80"
  22. @scrolltolower="scrollBottom">
  23. <view class="page-box">
  24. <view class="cell-box">
  25. <view class="stamp">
  26. <u-image
  27. width="150"
  28. height="150"
  29. mode="aspectFit"
  30. src="@/static/images/agree.png"
  31. ></u-image>
  32. </view>
  33. <view class="header main-between">
  34. <text class="nickname">微信昵称:Z是一颗星</text>
  35. <text>待审核</text>
  36. </view>
  37. <view class="section main-between cross-cente">
  38. <view class="info main-left cross-center">
  39. <text>提现金额</text>
  40. <view class="price">¥76</view>
  41. </view>
  42. <view class="name cross-center">
  43. 张三(2390573452730)
  44. </view>
  45. </view>
  46. <view class="footer">
  47. <text>申请时间:2021/07/21 15:45</text>
  48. </view>
  49. </view>
  50. </view>
  51. </scroll-view>
  52. </swiper-item>
  53. </swiper>
  54. </app-layout>
  55. </template>
  56. <script>
  57. import appLayout from '@/components/app-layout'
  58. export default {
  59. components:{
  60. appLayout
  61. },
  62. data() {
  63. return {
  64. currentTab: 0,
  65. tabs: [
  66. {name: '全部', value: -1},
  67. {name: '待审核', value: 1},
  68. {name: '已通过', value: 2},
  69. {name: '已驳回', value: 3},
  70. ],
  71. currentSwiper: 0,
  72. dataList: [],
  73. isReload: false,
  74. }
  75. },
  76. onLoad(options){
  77. this.getTabsData();
  78. if(options.status){
  79. const index = options.status - 2;
  80. this.currentTab = index;
  81. this.currentSwiper = index;
  82. this.getList(index, 1);
  83. }
  84. },
  85. onPullDownRefresh(){
  86. this.isReload = true;
  87. this.getList(this.currentSwiper,1);
  88. },
  89. methods: {
  90. getTabsData(){
  91. let _this = this;
  92. _this.tabs.forEach((obj, index) => {
  93. _this.dataList.push({
  94. data: [],
  95. status: 'loadmore',
  96. currentPage: 1,
  97. totalPage: 0,
  98. initData: false,
  99. });
  100. });
  101. _this.getList(0, 1);
  102. },
  103. getList(index, page){
  104. },
  105. // tabs 切换
  106. changeTabs(index){
  107. this.currentSwiper = index;
  108. if(!this.dataList[index].initData){
  109. this.getList(index, 1);
  110. }
  111. },
  112. // 滚动到底部
  113. scrollBottom(){
  114. let index = this.currentTab;
  115. let activeData = this.dataList[index];
  116. if(activeData.currentPage < activeData.totalPage){
  117. activeData.status = 'loading';
  118. //this.getList(index,activeData.currentPage + 1);
  119. }else{
  120. activeData.status = 'nomore';
  121. }
  122. },
  123. // 左右切换 设置滑块位置
  124. swiperTransition({ detail: { dx } }){
  125. this.$refs.tabs.setDx(dx);
  126. },
  127. // 切换完成
  128. swiperAnimationFinish({ detail: { current } }){
  129. this.$refs.tabs.setFinishCurrent(current);
  130. this.currentSwiper = current;
  131. this.currentTab = current;
  132. if(!this.dataList[current].initData){
  133. this.getList(current, 1);
  134. }
  135. if(this.dataList[current].data.length === 0 && this.dataList[current].status !== 'nomore'){
  136. this.dataList[current].status = 'loading';
  137. //this.getList(current,this.dataList[current].currentPage);
  138. }
  139. },
  140. },
  141. computed:{
  142. },
  143. }
  144. </script>
  145. <style lang="scss">
  146. .swiper-box {
  147. flex: 1;
  148. .swiper-item {
  149. height: 100%;
  150. }
  151. .scroll-item{
  152. height: 100%;
  153. width: 100%;
  154. }
  155. }
  156. .page-box{
  157. flex: 1;
  158. padding: 20rpx 30rpx;
  159. .cell-box{
  160. position: relative;
  161. background: #fff;
  162. border-radius: 16rpx;
  163. padding: 36rpx 32rpx;
  164. .stamp{
  165. position: absolute;
  166. right: 0;
  167. z-index: 9;
  168. }
  169. .header{
  170. .nickname{
  171. color: #666666;
  172. font-size: 30rpx;
  173. }
  174. }
  175. .section{
  176. color: #666666;
  177. margin: 36rpx 0;
  178. font-size: 30rpx;
  179. .info {
  180. .price{
  181. color: $main-color;
  182. font-weight: bold;
  183. font-size: 56rpx;
  184. margin-left: 10rpx;
  185. &:first-letter{
  186. font-size: .5em;
  187. }
  188. }
  189. }
  190. }
  191. .footer{
  192. text{
  193. color: #999999;
  194. }
  195. }
  196. }
  197. }
  198. </style>