exprotList.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <template>
  2. <view class="column flex-1 hb">
  3. <view class="p20 bgf">
  4. <u-subsection :list="list" :current="actnav" @change="sectionChange" bgColor='#def1ff' inactiveColor="#666"></u-subsection>
  5. </view>
  6. <view class="column scrolly">
  7. <scroll-view scroll-y="true" class="hb" :refresher-enabled="isEnabled" :refresher-triggered="triggered"
  8. refresher-background="rgba(0,0,0,0)" @refresherrefresh="pullDownRefresh"
  9. @refresherrestore="triggered = false" :upper-threshold="100" :lower-threshold="100"
  10. @refresherabort="triggered = false" @scrolltolower="reachBottom">
  11. <view v-for="(item,index) in listgood" :key="index" class="listcss" @click="getlist(item)">
  12. <view class="justify-between align-center">
  13. <view class="w180 justify-between fs28 align-center ">
  14. <u-avatar :src="item.fromAvatar" size="25"></u-avatar>
  15. <text class="ml10 single-ellipsis">{{item.fromName}}</text>
  16. </view>
  17. <view class="column align-center">
  18. <text class="fs24 base-color-9">更换为</text>
  19. <image src="https://fbylive.obs.cn-southwest-2.myhuaweicloud.com:443/app/images/jiantou.png" class="w60 h40"></image>
  20. </view>
  21. <view class="w180 justify-between fs28 align-center ">
  22. <u-avatar :src="item.toAvatar" size="25"></u-avatar>
  23. <text class="ml10 single-ellipsis">{{item.toName}}</text>
  24. </view>
  25. </view>
  26. <view class="justify-between">
  27. <view class="fs24 base-color-9">{{item.applyTime}}</view>
  28. <view class="fs24 base-color-9 " style="color: orange;" v-if="actnav==0">待审核</view>
  29. <view class="fs24 base-color-9 base-color" v-if="actnav==1">审核通过</view>
  30. <view class="fs24 base-color-9 base-color-red" v-if="actnav==2">审核未通过</view>
  31. </view>
  32. </view>
  33. </scroll-view>
  34. <u-loadmore :status="status" />
  35. </view>
  36. <u-popup :show="show" @close="close" @open="open" :closeOnClickOverlay="true"
  37. mode="center" round='10'>
  38. <view class="poplist scrolly">
  39. <view class="center mb20">更换会员</view>
  40. <view v-for="(item,index) in nowlist" :key="index" class="justify-start align-center">
  41. <u-avatar :src="item.avatar" size="25"></u-avatar>
  42. <view class="fs28 ml16 base-color-6">昵称:</view>
  43. <view class="fs28 base-color-6">{{item.userName}}</view>
  44. </view>
  45. </view>
  46. </u-popup>
  47. </view>
  48. </template>
  49. <script>
  50. import {
  51. getchangeslist
  52. } from "@/api/courseManage.js"
  53. export default {
  54. data() {
  55. return {
  56. list: ['待审核', '通过审核', '审核未通过'],
  57. actnav:0,
  58. triggered: false,
  59. status: 'loadmore',
  60. isEnabled: true,
  61. pageNum: 1,
  62. pageSize: 10,
  63. listgood:[],
  64. show:false,
  65. nowlist:[]
  66. }
  67. },
  68. onShow() {
  69. this.getexaminelist()
  70. },
  71. methods: {
  72. getlist(item){
  73. this.show=!this.show
  74. this.nowlist=item.users
  75. console.log(this.nowlist)
  76. },
  77. close(){
  78. this.show=!this.show
  79. console.log(this.show)
  80. },
  81. open(){},
  82. pullDownRefresh() {
  83. // 下拉刷新
  84. this.triggered = true; //下拉了状态为true
  85. setTimeout(() => {
  86. this.triggered = false;
  87. uni.stopPullDownRefresh()
  88. this.pageNum = 1;
  89. this.getexaminelist('refresh') //触底 不穿执行else
  90. // 请求接口里面需要判断是不是最后一页 是最后一页 status赋值为‘loadmore’没有更多了
  91. // 请求接口
  92. }, 1000)
  93. },
  94. reachBottom() {
  95. // status这个是加载状态
  96. console.log(111);
  97. if (this.status === 'loadmore') {
  98. this.status = 'loading'
  99. uni.showNavigationBarLoading()
  100. setTimeout(() => {
  101. this.pageNum++
  102. this.getexaminelist() //触底 不穿执行else
  103. uni.hideNavigationBarLoading()
  104. }, 1000);
  105. }
  106. },
  107. sectionChange(index){
  108. this.listgood=[]
  109. this.actnav=index
  110. this.getexaminelist()
  111. },
  112. getexaminelist(type){
  113. this.listgood=[]
  114. const data={
  115. pageNum: this.pageNum,
  116. pageSize: this.pageSize,
  117. status:this.actnav
  118. }
  119. getchangeslist(data).then(res=>{
  120. if(res.code==200){
  121. // refresh 下拉
  122. if (type == 'refresh') {
  123. this.listgood = res.data.list
  124. } else {
  125. // 加载更多 当前页和下一页合并
  126. this.listgood = [...this.listgood, ...res.data.list]
  127. }
  128. if (res.data.isLastPage) {
  129. this.status = 'nomore'
  130. } else {
  131. this.status = 'loadmore'
  132. }
  133. }else{
  134. uni.showToast({
  135. icon: 'none',
  136. title: res.msg
  137. })
  138. }
  139. })
  140. }
  141. }
  142. }
  143. </script>
  144. <style lang="scss" scoped>
  145. // page{
  146. // background-color: #fff;
  147. // }
  148. .listcss{
  149. background-color: #fff;
  150. margin: 20rpx;
  151. padding: 20rpx;
  152. border-radius: 10rpx;
  153. }
  154. .poplist{
  155. width: 500rpx;
  156. height: 600rpx;
  157. border-radius: 20rpx;
  158. padding: 20rpx;
  159. }
  160. </style>