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