allClub-list.vue 8.7 KB

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