index.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <template>
  2. <app-layout class="c-wrapper dir-top-wrap">
  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. <block v-if="arr.data.length || !arr.initData">
  25. <view class="cell-box" v-for="(item,itemIndex) in arr.data" :key="itemIndex">
  26. <view class="stamp" v-if="item.status == 1">
  27. <u-image
  28. width="150"
  29. height="150"
  30. mode="aspectFit"
  31. src="@/static/images/agree.png"
  32. ></u-image>
  33. </view>
  34. <view class="header main-between">
  35. <text class="nickname">微信昵称:{{vuex_user_data.nickname}}</text>
  36. <text>{{item.status==1?'已通过':(item.status==2?'已驳回':'带审核')}}</text>
  37. </view>
  38. <view class="section main-between cross-cente">
  39. <view class="info main-left cross-center">
  40. <text>提现金额</text>
  41. <view class="price">¥{{item.price}}</view>
  42. </view>
  43. <view class="name cross-center">
  44. {{item.name}}({{item.account}})
  45. </view>
  46. </view>
  47. <view class="footer">
  48. <text>申请时间:{{item.created_at}}</text>
  49. </view>
  50. </view>
  51. <u-loadmore :status="arr.status" font-size="20" margin-top="40"></u-loadmore>
  52. </block>
  53. <block v-else>
  54. <view class="dir-top-wrap main-center cross-center no-order">
  55. <text class="tips">暂无数据</text>
  56. </view>
  57. </block>
  58. </view>
  59. </scroll-view>
  60. </swiper-item>
  61. </swiper>
  62. </app-layout>
  63. </template>
  64. <script>
  65. import appLayout from '@/components/app-layout'
  66. export default {
  67. components:{
  68. appLayout
  69. },
  70. data() {
  71. return {
  72. currentTab: 0,
  73. tabs: [
  74. {name: '全部', value: -1},
  75. {name: '待审核', value: 0},
  76. {name: '已通过', value: 1},
  77. {name: '已驳回', value: 2},
  78. ],
  79. currentSwiper: 0,
  80. dataList: [],
  81. isReload: false,
  82. }
  83. },
  84. onLoad(options){
  85. this.getTabsData();
  86. if(options.status){
  87. const index = options.status - 2;
  88. this.currentTab = index;
  89. this.currentSwiper = index;
  90. this.getList(index, 1);
  91. }
  92. },
  93. onPullDownRefresh(){
  94. this.isReload = true;
  95. this.getList(this.currentSwiper,1);
  96. },
  97. methods: {
  98. getTabsData(){
  99. let _this = this;
  100. _this.tabs.forEach((obj, index) => {
  101. _this.dataList.push({
  102. data: [],
  103. status: 'loadmore',
  104. currentPage: 1,
  105. totalPage: 0,
  106. initData: false,
  107. });
  108. });
  109. _this.getList(0, 1);
  110. },
  111. getList(index, page){
  112. let params = {
  113. status: this.tabs[index].value,
  114. page: page
  115. };
  116. let activeData = this.dataList[index];
  117. this.$u.api.withdrawLists(params).then(data => {
  118. uni.stopPullDownRefresh()
  119. activeData.initData = true;
  120. activeData.data = this.isReload ? data.data : activeData.data.concat(data.data);
  121. activeData.currentPage = data.current_page;
  122. activeData.totalPage = data.last_page;
  123. if(activeData.currentPage >= activeData.totalPage){
  124. activeData.status = 'nomore';
  125. }else{
  126. activeData.status = 'loadmore';
  127. }
  128. this.isReload = false;
  129. console.log('-->data',activeData)
  130. })
  131. },
  132. // tabs 切换
  133. changeTabs(index){
  134. this.currentSwiper = index;
  135. console.log('-->data',this.dataList[index].initData)
  136. if(!this.dataList[index].initData){
  137. this.getList(index, 1);
  138. }
  139. },
  140. // 滚动到底部
  141. scrollBottom(){
  142. let index = this.currentTab;
  143. let activeData = this.dataList[index];
  144. if(activeData.currentPage < activeData.totalPage){
  145. activeData.status = 'loading';
  146. this.getList(index,activeData.currentPage + 1);
  147. }else{
  148. activeData.status = 'nomore';
  149. }
  150. },
  151. // 左右切换 设置滑块位置
  152. swiperTransition({ detail: { dx } }){
  153. this.$refs.tabs.setDx(dx);
  154. },
  155. // 切换完成
  156. swiperAnimationFinish({ detail: { current } }){
  157. this.$refs.tabs.setFinishCurrent(current);
  158. this.currentSwiper = current;
  159. this.currentTab = current;
  160. if(!this.dataList[current].initData){
  161. this.getList(current, 1);
  162. }
  163. if(this.dataList[current].data.length === 0 && this.dataList[current].status !== 'nomore'){
  164. this.dataList[current].status = 'loading';
  165. this.getList(current,this.dataList[current].currentPage);
  166. }
  167. },
  168. },
  169. computed:{
  170. },
  171. }
  172. </script>
  173. <style lang="scss">
  174. .c-wrapper{
  175. height: 100vh;
  176. }
  177. .swiper-box {
  178. height: calc(100vh - 90rpx);
  179. .swiper-item {
  180. height: 100%;
  181. }
  182. .scroll-item{
  183. height: 100%;
  184. width: 100%;
  185. }
  186. }
  187. .page-box{
  188. flex: 1;
  189. padding: 20rpx 30rpx;
  190. .no-order{
  191. height: 70vh;
  192. .tips{
  193. margin-top: 13upx;
  194. font-size: 26upx;
  195. color: #999999;
  196. }
  197. }
  198. .cell-box{
  199. position: relative;
  200. background: #fff;
  201. border-radius: 16rpx;
  202. padding: 36rpx 32rpx;
  203. margin-bottom: 32rpx;
  204. .stamp{
  205. position: absolute;
  206. right: 0;
  207. z-index: 9;
  208. }
  209. .header{
  210. .nickname{
  211. color: #666666;
  212. font-size: 30rpx;
  213. }
  214. }
  215. .section{
  216. color: #666666;
  217. margin: 36rpx 0;
  218. font-size: 30rpx;
  219. .info {
  220. .price{
  221. color: $main-color;
  222. font-weight: bold;
  223. font-size: 56rpx;
  224. margin-left: 10rpx;
  225. &:first-letter{
  226. font-size: .5em;
  227. }
  228. }
  229. }
  230. }
  231. .footer{
  232. text{
  233. color: #999999;
  234. }
  235. }
  236. }
  237. }
  238. </style>