exprotList.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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="mtb16" >
  41. <view class="justify-start align-center">
  42. <u-avatar :src="item.avatar" size="25"></u-avatar>
  43. <view class="fs28 ml16">昵称:</view>
  44. <view class="fs28 ">{{item.userName}}</view>
  45. </view>
  46. <view class="justify-start align-center fs24 mt8 base-color-6 ">
  47. <view>所属项目:</view>
  48. <view >{{item.projectName}}</view>
  49. </view>
  50. </view>
  51. </view>
  52. </u-popup>
  53. </view>
  54. </template>
  55. <script>
  56. import {
  57. getchangeslist
  58. } from "@/api/manageCompany.js"
  59. export default {
  60. data() {
  61. return {
  62. list: ['待审核', '通过审核', '审核未通过'],
  63. actnav:0,
  64. triggered: false,
  65. status: 'loadmore',
  66. isEnabled: true,
  67. pageNum: 1,
  68. pageSize: 10,
  69. listgood:[],
  70. show:false,
  71. nowlist:[]
  72. }
  73. },
  74. onShow() {
  75. this.getexaminelist()
  76. },
  77. computed: {
  78. imgPath() {
  79. return this.$store.state.imgpath
  80. }
  81. },
  82. methods: {
  83. getlist(item){
  84. this.show=!this.show
  85. this.nowlist=item.users
  86. console.log(this.nowlist)
  87. },
  88. close(){
  89. this.show=!this.show
  90. console.log(this.show)
  91. },
  92. open(){},
  93. pullDownRefresh() {
  94. // 下拉刷新
  95. this.triggered = true; //下拉了状态为true
  96. setTimeout(() => {
  97. this.triggered = false;
  98. uni.stopPullDownRefresh()
  99. this.pageNum = 1;
  100. this.getexaminelist('refresh') //触底 不穿执行else
  101. // 请求接口里面需要判断是不是最后一页 是最后一页 status赋值为‘loadmore’没有更多了
  102. // 请求接口
  103. }, 1000)
  104. },
  105. reachBottom() {
  106. // status这个是加载状态
  107. console.log(111);
  108. if (this.status === 'loadmore') {
  109. this.status = 'loading'
  110. uni.showNavigationBarLoading()
  111. setTimeout(() => {
  112. this.pageNum++
  113. this.getexaminelist() //触底 不穿执行else
  114. uni.hideNavigationBarLoading()
  115. }, 1000);
  116. }
  117. },
  118. sectionChange(index){
  119. this.listgood=[]
  120. this.actnav=index
  121. this.getexaminelist()
  122. },
  123. getexaminelist(type){
  124. this.listgood=[]
  125. const data={
  126. pageNum: this.pageNum,
  127. pageSize: this.pageSize,
  128. status:this.actnav
  129. }
  130. getchangeslist(data).then(res=>{
  131. if(res.code==200){
  132. // refresh 下拉
  133. if (type == 'refresh') {
  134. this.listgood = res.data.list
  135. } else {
  136. // 加载更多 当前页和下一页合并
  137. this.listgood = [...this.listgood, ...res.data.list]
  138. }
  139. if (res.data.isLastPage) {
  140. this.status = 'nomore'
  141. } else {
  142. this.status = 'loadmore'
  143. }
  144. }else{
  145. uni.showToast({
  146. icon: 'none',
  147. title: res.msg
  148. })
  149. }
  150. })
  151. }
  152. }
  153. }
  154. </script>
  155. <style lang="scss" scoped>
  156. // page{
  157. // background-color: #fff;
  158. // }
  159. .listcss{
  160. background-color: #fff;
  161. margin: 20rpx;
  162. padding: 20rpx;
  163. border-radius: 10rpx;
  164. }
  165. .poplist{
  166. width: 500rpx;
  167. height: 600rpx;
  168. border-radius: 20rpx;
  169. padding: 20rpx;
  170. }
  171. </style>