club-list.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <template>
  2. <view class="container club clearfix">
  3. </view>
  4. </template>
  5. <script>
  6. import authorize from '@/common/config/authorize.js'
  7. import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
  8. import tuiNomore from "@/components/tui-components/nomore/nomore"
  9. import { queryclubList, deleteclub , updateCode } from "@/api/operator.js"
  10. export default {
  11. components:{
  12. tuiLoadmore,
  13. tuiNomore,
  14. },
  15. data() {
  16. return {
  17. clubID:'',
  18. clubName:'',
  19. clubImage:'',
  20. linkman:'',
  21. clubMobile:'',
  22. isEmpty:false,
  23. nomoreText: '上拉显示更多',
  24. userID:'',
  25. pageNum:1,
  26. pageSize:10,
  27. hasNextPage:false,
  28. loadding: false,
  29. pullUpOn: true,
  30. pullFlag: true,
  31. allowDataStatus:true,
  32. wrapperHeight:'100%',
  33. scrollHeight:'',
  34. deleteAddressId:'',
  35. currPage:'',//当前页面
  36. prevPage:'',//上一个页面
  37. clubList:[],
  38. isIphoneX:this.$store.state.isIphoneX,
  39. }
  40. },
  41. onLoad(){
  42. this.setScrollHeight();
  43. },
  44. methods: {
  45. setScrollHeight() {
  46. // 窗口高度 - 底部距离
  47. setTimeout(()=> {
  48. const query = wx.createSelectorQuery().in(this);
  49. query.selectAll('.add-btn').boundingClientRect();
  50. query.exec(res => {
  51. if(res[0][0]){
  52. let winHeight = this.$api.getWindowHeight(),
  53. eleTop = res[0][0].top - 1;
  54. this.scrollHeight = eleTop;
  55. }
  56. })
  57. }, 500)
  58. },
  59. searchOpertor(){
  60. this.pageNum=1
  61. this.initclubList()
  62. },
  63. initclubList(){
  64. let params = {clubID:this.clubID,pageNum:1,pageSize:this.pageSize,linkName:this.linkman,mobile:this.clubMobile}
  65. queryclubList(params).then(response =>{
  66. let responseData = response.data
  67. if(responseData.results&&responseData.results.length > 0){
  68. this.isEmpty = false
  69. this.hasNextPage = response.data.hasNextPage
  70. this.clubList =responseData.results
  71. this.pullFlag = false;
  72. setTimeout(()=>{this.pullFlag = true;},500)
  73. if(this.hasNextPage){
  74. this.pullUpOn = false
  75. this.nomoreText = '上拉显示更多'
  76. }else{
  77. this.pullUpOn = true
  78. this.loadding = false
  79. this.nomoreText = '已至底部'
  80. }
  81. }else{
  82. this.isEmpty = true
  83. }
  84. }).catch(response =>{
  85. this.$util.msg(response.msg,2000)
  86. })
  87. },
  88. getOnReachBottomData(){
  89. this.pageNum+=1
  90. let params = {pageNum:this.pageNum,pageSize:this.pageSize,linkName:this.linkman,mobile:this.clubMobile}
  91. queryclubList(params).then(response =>{
  92. let responseData = response.data
  93. if(responseData.results&&responseData.results.length > 0){
  94. this.hasNextPage = response.data.hasNextPage
  95. this.clubList = this.clubList.concat(responseData.results)
  96. this.pullFlag = false;// 防上拉暴滑
  97. setTimeout(()=>{this.pullFlag = true;},500)
  98. if(this.hasNextPage){
  99. this.pullUpOn = false
  100. this.nomoreText = '上拉显示更多'
  101. }else{
  102. this.pullUpOn = false
  103. this.loadding = false
  104. this.nomoreText = '已至底部'
  105. }
  106. }
  107. }).catch(response =>{
  108. this.$util.msg(response.msg,2000)
  109. })
  110. },
  111. rexpStautsColor(status) {
  112. let textColor = ''
  113. switch (status) {
  114. case '1':
  115. textColor = '#55BB00'
  116. break
  117. case '2':
  118. textColor = '#0056BB'
  119. break
  120. case '3':
  121. textColor = '#BB0000'
  122. break
  123. }
  124. return textColor
  125. },
  126. iconStautsColor(status) {
  127. let textColor = ''
  128. if(status == '2'){
  129. textColor = '#09BB07'
  130. }else{
  131. textColor = '#DDDDDD'
  132. }
  133. return textColor
  134. },
  135. },
  136. onReachBottom() {
  137. if(this.hasNextPage){
  138. this.loadding = true
  139. this.pullUpOn = true
  140. this.getOnReachBottomData()
  141. }
  142. },
  143. onShow() {
  144. this.$api.getCommonStorage('clubInfo').then(response =>{
  145. })
  146. }
  147. }
  148. </script>
  149. <style lang='scss'>
  150. page {
  151. height: auto;
  152. }
  153. page,.container{
  154. /* padding-bottom: 120upx; */
  155. background: #F7F7F7;
  156. border-top: 1px solid #EBEBEB;
  157. }
  158. </style>