exprotList.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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="imgPath+'/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. computed: {
  72. imgPath() {
  73. return this.$store.state.imgpath
  74. }
  75. },
  76. methods: {
  77. getlist(item){
  78. this.show=!this.show
  79. this.nowlist=item.users
  80. console.log(this.nowlist)
  81. },
  82. close(){
  83. this.show=!this.show
  84. console.log(this.show)
  85. },
  86. open(){},
  87. pullDownRefresh() {
  88. // 下拉刷新
  89. this.triggered = true; //下拉了状态为true
  90. setTimeout(() => {
  91. this.triggered = false;
  92. uni.stopPullDownRefresh()
  93. this.pageNum = 1;
  94. this.getexaminelist('refresh') //触底 不穿执行else
  95. // 请求接口里面需要判断是不是最后一页 是最后一页 status赋值为‘loadmore’没有更多了
  96. // 请求接口
  97. }, 1000)
  98. },
  99. reachBottom() {
  100. // status这个是加载状态
  101. console.log(111);
  102. if (this.status === 'loadmore') {
  103. this.status = 'loading'
  104. uni.showNavigationBarLoading()
  105. setTimeout(() => {
  106. this.pageNum++
  107. this.getexaminelist() //触底 不穿执行else
  108. uni.hideNavigationBarLoading()
  109. }, 1000);
  110. }
  111. },
  112. sectionChange(index){
  113. this.listgood=[]
  114. this.actnav=index
  115. this.getexaminelist()
  116. },
  117. getexaminelist(type){
  118. this.listgood=[]
  119. const data={
  120. pageNum: this.pageNum,
  121. pageSize: this.pageSize,
  122. status:this.actnav
  123. }
  124. getchangeslist(data).then(res=>{
  125. if(res.code==200){
  126. // refresh 下拉
  127. if (type == 'refresh') {
  128. this.listgood = res.data.list
  129. } else {
  130. // 加载更多 当前页和下一页合并
  131. this.listgood = [...this.listgood, ...res.data.list]
  132. }
  133. if (res.data.isLastPage) {
  134. this.status = 'nomore'
  135. } else {
  136. this.status = 'loadmore'
  137. }
  138. }else{
  139. uni.showToast({
  140. icon: 'none',
  141. title: res.msg
  142. })
  143. }
  144. })
  145. }
  146. }
  147. }
  148. </script>
  149. <style lang="scss" scoped>
  150. // page{
  151. // background-color: #fff;
  152. // }
  153. .listcss{
  154. background-color: #fff;
  155. margin: 20rpx;
  156. padding: 20rpx;
  157. border-radius: 10rpx;
  158. }
  159. .poplist{
  160. width: 500rpx;
  161. height: 600rpx;
  162. border-radius: 20rpx;
  163. padding: 20rpx;
  164. }
  165. </style>