allClub-list.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  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">{{checkData(item.linkMan1) ? desensitizationName(item.linkMan1) : ''}}</text>
  34. {{item.contractMobile1 ? hidePhone(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. hidePhone(val){
  179. let phone = this.$reg.hidePhone(val)
  180. return phone
  181. },
  182. checkData (value){
  183. let data;
  184. if(value == null || value ==""){
  185. data = ''
  186. }else{
  187. data = value
  188. }
  189. return data
  190. },
  191. desensitizationName(val){
  192. let name = this.$reg.desensitizationName(val)
  193. return name
  194. }
  195. },
  196. onReachBottom() {
  197. if(this.hasNextPage){
  198. this.loadding = true
  199. this.pullUpOn = true
  200. this.getOnReachBottomData()
  201. }
  202. },
  203. onShow() {
  204. this.$api.getStorage().then(response =>{
  205. this.serviceProviderId = response.serviceProviderID
  206. this.pageNum = 1;
  207. this.initclubList();
  208. })
  209. }
  210. }
  211. </script>
  212. <style lang='scss'>
  213. page {
  214. height: auto;
  215. }
  216. page,.container{
  217. /* padding-bottom: 120upx; */
  218. background: #F7F7F7;
  219. border-top: 1px solid #EBEBEB;
  220. }
  221. .container{
  222. position: relative;
  223. }
  224. .club-search{
  225. height: 64rpx;
  226. width: 702rpx;
  227. padding: 24rpx;
  228. background: #FFFFFF;
  229. display: flex;
  230. align-items: center;
  231. position: fixed;
  232. top: 0;
  233. left: 0;
  234. z-index: 999;
  235. .search-from{
  236. width: 582rpx;
  237. height: 64rpx;
  238. background: #F7F7F7;
  239. border-radius: 14rpx;
  240. float: left;
  241. position: relative;
  242. .input{
  243. width: 500rpx;
  244. height: 64rpx;
  245. float: left;
  246. line-height: 64rpx;
  247. color: $text-color;
  248. font-size: $font-size-24;
  249. }
  250. .icon-iconfonticonfontsousuo1{
  251. width: 64rpx;
  252. height: 64rpx;
  253. line-height: 64rpx;
  254. text-align: center;
  255. display: block;
  256. font-size: $font-size-38;
  257. float: left;
  258. color: #999999;
  259. }
  260. .icon-shanchu1{
  261. font-size: $font-size-32;
  262. color: #999999;
  263. position: absolute;
  264. width: 64rpx;
  265. height: 64rpx;
  266. line-height: 64rpx;
  267. text-align: center;
  268. top: 0;
  269. right: 0;
  270. z-index: 10;
  271. }
  272. }
  273. .search-btn{
  274. width: 120rpx;
  275. line-height: 64rpx;
  276. text-align: center;
  277. font-size: $font-size-28;
  278. color: $color-system;
  279. float: left;
  280. background: #FFFFFF;
  281. }
  282. }
  283. .club-main{
  284. padding-top: 122rpx;
  285. .list{
  286. display: flex;
  287. align-items: center;
  288. width: 702rpx;
  289. height: 92rpx;
  290. padding: 24rpx;
  291. background: #FFFFFF;
  292. position: relative;
  293. border-bottom: 1px solid #EBEBEB;
  294. .list-left{
  295. display: flex;
  296. flex: 8;
  297. .list-head{
  298. width: 92rpx;
  299. height: 92rpx;
  300. border-radius: 14rpx;
  301. image{
  302. width: 92rpx;
  303. height: 92rpx;
  304. border-radius: 14rpx;
  305. }
  306. }
  307. .list-tel{
  308. margin: 0 15rpx;
  309. .txt{
  310. display: flex;
  311. flex: 1;
  312. font-size: $font-size-28;
  313. color: $text-color;
  314. line-height: 46rpx;
  315. &.sm{
  316. font-size: $font-size-24;
  317. color: #666666;
  318. .txt-le{
  319. margin-right: 26rpx;
  320. }
  321. }
  322. }
  323. }
  324. }
  325. .list-opea{
  326. display: flex;
  327. flex: 2;
  328. color: #166CE1;
  329. flex-direction: column;
  330. .opea-type-cell{
  331. font-size: 24rpx;
  332. .text{
  333. width: 156rpx;
  334. height: 60rpx;
  335. padding: 0 20rpx;
  336. line-height: 60rpx;
  337. border-radius: 10rpx;
  338. font-size: $font-size-24;
  339. color: #FFFFFF;
  340. text-align: center;
  341. background: $btn-confirm;
  342. display: block;
  343. }
  344. }
  345. }
  346. }
  347. }
  348. </style>