allClub-list.vue 8.7 KB

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