allClub-list.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  1. <template>
  2. <view class="container club clearfix">
  3. <view class="club-search clearfix">
  4. <view class="search-from name">
  5. <text class="iconfont icon-iconfonticonfontsousuo1"></text>
  6. <input class="input"
  7. type="text"
  8. confirm-type="search"
  9. v-model="searchInputVal"
  10. @input="onShowClose"
  11. @confirm="initclubList()"
  12. placeholder="请输入机构关键词"
  13. maxlength="16"/>
  14. <text class="iconfont icon-shanchu1" v-if="isShowClose" @click="delInputText()"></text>
  15. </view>
  16. <view class="search-btn">
  17. <button class="search-btn" type="default" @click.stop="searchClubList">搜索</button>
  18. </view>
  19. </view>
  20. <view class="club-main">
  21. <view v-if="isEmpty" class="empty-container">
  22. <image class="club-empty-image" src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AY2ZjAABpmnBICH4247.png" mode="aspectFit"></image>
  23. <view class="txt">暂无机构数据</view>
  24. </view>
  25. <view v-else class="club-list">
  26. <scroll-view scroll-y="true" >
  27. <view class="list" v-for="(item, index) in clubList" :key="index">
  28. <view class="list-left">
  29. <view class="list-head"><image :src="item.headpic ? item.headpic : '../../../static/temp/icon-club@3x.png'" mode=""></image></view>
  30. <view class="list-tel">
  31. <text class="txt">{{item.name}}</text>
  32. <text class="txt sm">
  33. <text class="txt-le">{{item.linkMan1 ? item.linkMan1 : ''}}</text>
  34. {{item.contractMobile1 ? item.contractMobile1 : item.contractMobile1}}
  35. </text>
  36. </view>
  37. </view>
  38. <view class="list-opea">
  39. <view class="opea-type-cell" @click.stop="goOperator(item)">
  40. <text class="text">邀请运营人员</text>
  41. </view>
  42. </view>
  43. </view>
  44. <!--加载loadding-->
  45. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  46. <tui-nomore :visible="!pullUpOn" bgcolor="#F7F7F7" :text='nomoreText'></tui-nomore>
  47. <!--加载loadding-->
  48. </scroll-view>
  49. </view>
  50. </view>
  51. </view>
  52. </template>
  53. <script>
  54. import authorize from '@/common/config/authorize.js'
  55. import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
  56. import tuiNomore from "@/components/tui-components/nomore/nomore"
  57. import { getFindAllClubList } from "@/api/seller.js"
  58. export default {
  59. components:{
  60. tuiLoadmore,
  61. tuiNomore,
  62. },
  63. data() {
  64. return {
  65. serviceProviderId:'',
  66. isShowClose:false,
  67. searchInputVal:'',
  68. isEmpty:false,
  69. nomoreText: '上拉显示更多',
  70. pageNum:1,
  71. pageSize:10,
  72. hasNextPage:false,
  73. loadding: false,
  74. pullUpOn: true,
  75. pullFlag: true,
  76. allowDataStatus:true,
  77. wrapperHeight:'100%',
  78. scrollHeight:'',
  79. deleteAddressId:'',
  80. currPage:'',//当前页面
  81. prevPage:'',//上一个页面
  82. tabCurrentIndex:0,
  83. listStatus:1,
  84. clubList:[],
  85. isIphoneX:this.$store.state.isIphoneX,
  86. show_index:0,//控制显示那个组件
  87. }
  88. },
  89. onLoad(){
  90. this.setScrollHeight();
  91. },
  92. methods: {
  93. setScrollHeight() {
  94. // 窗口高度 - 底部距离
  95. setTimeout(()=> {
  96. const query = wx.createSelectorQuery().in(this);
  97. query.selectAll('.add-btn').boundingClientRect();
  98. query.exec(res => {
  99. if(res[0][0]){
  100. let winHeight = this.$api.getWindowHeight(),
  101. eleTop = res[0][0].top - 1;
  102. this.scrollHeight = eleTop;
  103. }
  104. })
  105. }, 500)
  106. },
  107. searchClubList(){
  108. this.pageNum=1
  109. this.initclubList()
  110. },
  111. initclubList(){
  112. let params = { searchWord:this.searchInputVal,pageNum:1,pageSize:this.pageSize }
  113. getFindAllClubList(params).then(response =>{
  114. let responseData = response.data
  115. if(responseData.results&&responseData.results.length > 0){
  116. this.isEmpty = false
  117. this.hasNextPage = response.data.hasNextPage
  118. this.clubList =responseData.results
  119. this.pullFlag = false;
  120. setTimeout(()=>{this.pullFlag = true;},500)
  121. if(this.hasNextPage){
  122. this.pullUpOn = false
  123. this.nomoreText = '上拉显示更多'
  124. }else{
  125. this.pullUpOn = true
  126. this.loadding = false
  127. this.nomoreText = '已至底部'
  128. }
  129. }else{
  130. this.isEmpty = true
  131. }
  132. }).catch(response =>{
  133. this.$util.msg(response.msg,2000)
  134. })
  135. },
  136. getOnReachBottomData(){
  137. this.pageNum+=1
  138. let params = {searchWord:this.searchInputVal,pageNum:this.pageNum,pageSize:this.pageSize }
  139. getFindAllClubList(params).then(response =>{
  140. let responseData = response.data
  141. if(responseData.results&&responseData.results.length > 0){
  142. this.hasNextPage = response.data.hasNextPage
  143. this.clubList = this.clubList.concat(responseData.results)
  144. this.pullFlag = false;// 防上拉暴滑
  145. setTimeout(()=>{this.pullFlag = true;},500)
  146. if(this.hasNextPage){
  147. this.pullUpOn = false
  148. this.nomoreText = '上拉显示更多'
  149. }else{
  150. this.pullUpOn = false
  151. this.loadding = false
  152. this.nomoreText = '已至底部'
  153. }
  154. }
  155. }).catch(response =>{
  156. this.$util.msg(response.msg,2000)
  157. })
  158. },
  159. goOperator(item){
  160. this.$api.setStorage('orderUserInfo',item)
  161. this.$api.navigateTo('/market/pages/club/addoperator')
  162. },
  163. onShowClose () {//输入框失去焦点时触发
  164. if(this.searchInputVal != ''){
  165. this.isShowClose = true
  166. }else{
  167. this.isShowClose = false
  168. this.pageNum=1
  169. this.initclubList()
  170. }
  171. },
  172. delInputText(){//清除输入框内容
  173. this.searchInputVal = ''
  174. this.isShowClose = false
  175. this.pageNum=1
  176. this.initclubList()
  177. }
  178. },
  179. onReachBottom() {
  180. if(this.hasNextPage){
  181. this.loadding = true
  182. this.pullUpOn = true
  183. this.getOnReachBottomData()
  184. }
  185. },
  186. onShow() {
  187. this.$api.getStorage().then(response =>{
  188. this.serviceProviderId = response.serviceProviderID
  189. this.pageNum = 1;
  190. this.initclubList();
  191. })
  192. }
  193. }
  194. </script>
  195. <style lang='scss'>
  196. page {
  197. height: auto;
  198. }
  199. page,.container{
  200. /* padding-bottom: 120upx; */
  201. background: #F7F7F7;
  202. border-top: 1px solid #EBEBEB;
  203. }
  204. .container{
  205. position: relative;
  206. }
  207. .club-search{
  208. height: 64rpx;
  209. width: 702rpx;
  210. padding: 24rpx;
  211. background: #FFFFFF;
  212. display: flex;
  213. align-items: center;
  214. position: fixed;
  215. top: 0;
  216. left: 0;
  217. z-index: 999;
  218. .search-from{
  219. width: 582rpx;
  220. height: 64rpx;
  221. background: #F7F7F7;
  222. border-radius: 14rpx;
  223. float: left;
  224. position: relative;
  225. .input{
  226. width: 500rpx;
  227. height: 64rpx;
  228. float: left;
  229. line-height: 64rpx;
  230. color: $text-color;
  231. font-size: $font-size-24;
  232. }
  233. .icon-iconfonticonfontsousuo1{
  234. width: 64rpx;
  235. height: 64rpx;
  236. line-height: 64rpx;
  237. text-align: center;
  238. display: block;
  239. font-size: $font-size-38;
  240. float: left;
  241. color: #999999;
  242. }
  243. .icon-shanchu1{
  244. font-size: $font-size-32;
  245. color: #999999;
  246. position: absolute;
  247. width: 64rpx;
  248. height: 64rpx;
  249. line-height: 64rpx;
  250. text-align: center;
  251. top: 0;
  252. right: 0;
  253. z-index: 10;
  254. }
  255. }
  256. .search-btn{
  257. width: 120rpx;
  258. line-height: 64rpx;
  259. text-align: center;
  260. font-size: $font-size-28;
  261. color: $color-system;
  262. float: left;
  263. background: #FFFFFF;
  264. }
  265. }
  266. .club-main{
  267. padding-top: 122rpx;
  268. .list{
  269. display: flex;
  270. align-items: center;
  271. width: 702rpx;
  272. height: 92rpx;
  273. padding: 24rpx;
  274. background: #FFFFFF;
  275. position: relative;
  276. border-bottom: 1px solid #EBEBEB;
  277. .list-left{
  278. display: flex;
  279. flex: 8;
  280. .list-head{
  281. width: 92rpx;
  282. height: 92rpx;
  283. border-radius: 14rpx;
  284. image{
  285. width: 92rpx;
  286. height: 92rpx;
  287. border-radius: 14rpx;
  288. }
  289. }
  290. .list-tel{
  291. margin-left: 18rpx;
  292. .txt{
  293. display: flex;
  294. flex: 1;
  295. font-size: $font-size-28;
  296. color: $text-color;
  297. line-height: 46rpx;
  298. &.sm{
  299. font-size: $font-size-24;
  300. color: #666666;
  301. .txt-le{
  302. margin-right: 26rpx;
  303. }
  304. }
  305. }
  306. }
  307. }
  308. .list-opea{
  309. display: flex;
  310. flex: 2;
  311. color: #166CE1;
  312. flex-direction: column;
  313. .opea-type-cell{
  314. font-size: 24rpx;
  315. .text{
  316. width: 156rpx;
  317. height: 60rpx;
  318. padding: 0 20rpx;
  319. line-height: 60rpx;
  320. border-radius: 10rpx;
  321. font-size: $font-size-24;
  322. color: #FFFFFF;
  323. text-align: center;
  324. background: $btn-confirm;
  325. display: block;
  326. }
  327. }
  328. }
  329. }
  330. }
  331. </style>