list.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. <template>
  2. <view class="container club clearfix" :style="{paddingBottom:isIphoneX?'140rpx':'98rpx'}">
  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 : ''}}</text>
  35. </view>
  36. </view>
  37. <view class="list-opea" v-if="tabCurrentIndex===2">
  38. <view class="opea-type-dell" @click.stop="checkData(item)">
  39. <text class="iconfont icon-xieboke"></text>
  40. <text>修改资料</text>
  41. </view>
  42. <view class="opea-type-dell or" @click.stop="orderHistory(item)">
  43. <text class="iconfont icon-dingdanxuanzhong"></text>
  44. <text>历史订单</text>
  45. </view>
  46. </view>
  47. <view class="list-opea" v-else>
  48. <view class="opea-type-cell" @click.stop="checkData(item)">
  49. <text class="iconfont icon-xieboke"></text>
  50. <text>修改资料</text>
  51. </view>
  52. </view>
  53. </view>
  54. <!--加载loadding-->
  55. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  56. <tui-nomore :visible="!pullUpOn" bgcolor="#F7F7F7" :text='nomoreText'></tui-nomore>
  57. <!--加载loadding-->
  58. </scroll-view>
  59. </view>
  60. </view>
  61. <view class="tabBar" :style="{height:isIphoneX?'140rpx':'98rpx'}">
  62. <view class="tabBar_list" :style="{paddingBottom:isIphoneX?'40rpx':''}">
  63. <view class="tabBar_item" :class="{ 'current' : tabCurrentIndex === 0}" @click="tabClick(0)" >
  64. <text class="iconfont icon-lishidingdan"></text>
  65. <view class="tabBar_name">待审核</view>
  66. </view>
  67. <view class="tabBar_item" :class="{ 'current1' : tabCurrentIndex === 1}" @click="tabClick(1)" >
  68. <text class="iconfont icon-shenhebutongguo"></text>
  69. <view class="tabBar_name">审核未通过</view>
  70. </view>
  71. <view class="tabBar_item" :class="{ 'current2' : tabCurrentIndex === 2}" @click="tabClick(2)" >
  72. <text class="iconfont icon-shenhetongguo"></text>
  73. <view class="tabBar_name">已上线</view>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </template>
  79. <script>
  80. import authorize from '@/common/config/authorize.js'
  81. import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
  82. import tuiNomore from "@/components/tui-components/nomore/nomore"
  83. import { getSellerClubList } from "@/api/seller.js"
  84. export default {
  85. components:{
  86. tuiLoadmore,
  87. tuiNomore,
  88. },
  89. data() {
  90. return {
  91. serviceProviderId:'',
  92. isShowClose:false,
  93. searchInputVal:'',
  94. isEmpty:false,
  95. nomoreText: '上拉显示更多',
  96. pageNum:1,
  97. pageSize:10,
  98. hasNextPage:false,
  99. loadding: false,
  100. pullUpOn: true,
  101. pullFlag: true,
  102. allowDataStatus:true,
  103. wrapperHeight:'100%',
  104. scrollHeight:'',
  105. deleteAddressId:'',
  106. currPage:'',//当前页面
  107. prevPage:'',//上一个页面
  108. tabCurrentIndex:0,
  109. listStatus:1,
  110. clubList:[],
  111. isIphoneX:this.$store.state.isIphoneX,
  112. show_index:0,//控制显示那个组件
  113. }
  114. },
  115. onLoad(){
  116. this.setScrollHeight();
  117. },
  118. methods: {
  119. setScrollHeight() {
  120. // 窗口高度 - 底部距离
  121. setTimeout(()=> {
  122. const query = wx.createSelectorQuery().in(this);
  123. query.selectAll('.add-btn').boundingClientRect();
  124. query.exec(res => {
  125. if(res[0][0]){
  126. let winHeight = this.$api.getWindowHeight(),
  127. eleTop = res[0][0].top - 1;
  128. this.scrollHeight = eleTop;
  129. }
  130. })
  131. }, 500)
  132. },
  133. searchClubList(){
  134. this.pageNum=1
  135. this.initclubList()
  136. },
  137. initclubList(){
  138. let params = {name:this.searchInputVal,pageNum:1,pageSize:this.pageSize,spId:this.serviceProviderId,status:this.listStatus}
  139. getSellerClubList(params).then(response =>{
  140. let responseData = response.data
  141. if(responseData.results&&responseData.results.length > 0){
  142. this.isEmpty = false
  143. this.hasNextPage = response.data.hasNextPage
  144. this.clubList =responseData.results
  145. this.pullFlag = false;
  146. setTimeout(()=>{this.pullFlag = true;},500)
  147. if(this.hasNextPage){
  148. this.pullUpOn = false
  149. this.nomoreText = '上拉显示更多'
  150. }else{
  151. this.pullUpOn = true
  152. this.loadding = false
  153. this.nomoreText = '已至底部'
  154. }
  155. }else{
  156. this.isEmpty = true
  157. }
  158. }).catch(error =>{
  159. this.$util.msg(error.msg,2000)
  160. })
  161. },
  162. getOnReachBottomData(){
  163. this.pageNum+=1
  164. let params = {name:this.searchInputVal,pageNum:this.pageNum,pageSize:this.pageSize,spId:this.serviceProviderId,status:this.listStatus}
  165. getSellerClubList(params).then(response =>{
  166. let responseData = response.data
  167. if(responseData.results&&responseData.results.length > 0){
  168. this.hasNextPage = response.data.hasNextPage
  169. this.clubList = this.clubList.concat(responseData.results)
  170. this.pullFlag = false;// 防上拉暴滑
  171. setTimeout(()=>{this.pullFlag = true;},500)
  172. if(this.hasNextPage){
  173. this.pullUpOn = false
  174. this.nomoreText = '上拉显示更多'
  175. }else{
  176. this.pullUpOn = false
  177. this.loadding = false
  178. this.nomoreText = '已至底部'
  179. }
  180. }
  181. }).catch(error =>{
  182. this.$util.msg(error.msg,2000)
  183. })
  184. },
  185. tabClick(index) {//tab切换
  186. this.tabCurrentIndex = index;
  187. switch(index){
  188. case 0:
  189. this.listStatus = 1
  190. break;
  191. case 1:
  192. this.listStatus = 92
  193. break;
  194. case 2:
  195. this.listStatus = 90
  196. break;
  197. }
  198. this.initclubList()
  199. },
  200. checkData(item){
  201. switch(this.tabCurrentIndex){
  202. case 0:
  203. this.$api.navigateTo(`/market/pages/login/information?userID=${item.userID}&status=${item.status}`)
  204. break;
  205. case 1:
  206. this.$api.navigateTo(`/market/pages/login/apply?userID=${item.userID}&status=${item.status}`)
  207. break;
  208. case 2:
  209. this.$api.navigateTo(`/market/pages/login/information?userID=${item.userID}&status=${item.status}`)
  210. break;
  211. }
  212. },
  213. orderHistory(item){
  214. this.$api.setStorage('orderUserInfo',item)
  215. this.$api.navigateTo(`/market/pages/order/order-history?clubID=${item.clubID}`)
  216. },
  217. onShowClose () {//输入框失去焦点时触发
  218. if(this.searchInputVal != ''){
  219. this.isShowClose = true
  220. }else{
  221. this.isShowClose = false
  222. }
  223. },
  224. delInputText(){//清除输入框内容
  225. this.searchInputVal = ''
  226. this.isShowClose = false
  227. }
  228. },
  229. onReachBottom() {
  230. if(this.hasNextPage){
  231. this.loadding = true
  232. this.pullUpOn = true
  233. this.getOnReachBottomData()
  234. }
  235. },
  236. onShow() {
  237. this.$api.getStorage().then(response =>{
  238. this.serviceProviderId = response.serviceProviderID
  239. this.pageNum = 1;
  240. this.initclubList();
  241. })
  242. }
  243. }
  244. </script>
  245. <style lang='scss'>
  246. page {
  247. height: auto;
  248. }
  249. page,.container{
  250. /* padding-bottom: 120upx; */
  251. background: #F7F7F7;
  252. border-top: 1px solid #EBEBEB;
  253. }
  254. .container{
  255. position: relative;
  256. }
  257. .club-search{
  258. height: 64rpx;
  259. width: 702rpx;
  260. padding: 24rpx;
  261. background: #FFFFFF;
  262. display: flex;
  263. align-items: center;
  264. position: fixed;
  265. top: 0;
  266. left: 0;
  267. z-index: 999;
  268. .search-from{
  269. width: 582rpx;
  270. height: 64rpx;
  271. background: #F7F7F7;
  272. border-radius: 14rpx;
  273. float: left;
  274. position: relative;
  275. .input{
  276. width: 500rpx;
  277. height: 64rpx;
  278. float: left;
  279. line-height: 64rpx;
  280. color: $text-color;
  281. font-size: $font-size-24;
  282. }
  283. .icon-iconfonticonfontsousuo1{
  284. width: 64rpx;
  285. height: 64rpx;
  286. line-height: 64rpx;
  287. text-align: center;
  288. display: block;
  289. font-size: $font-size-38;
  290. float: left;
  291. color: #999999;
  292. }
  293. .icon-shanchu1{
  294. font-size: $font-size-32;
  295. color: #999999;
  296. position: absolute;
  297. width: 64rpx;
  298. height: 64rpx;
  299. line-height: 64rpx;
  300. text-align: center;
  301. top: 0;
  302. right: 0;
  303. z-index: 10;
  304. }
  305. }
  306. .search-btn{
  307. width: 120rpx;
  308. line-height: 64rpx;
  309. text-align: center;
  310. font-size: $font-size-28;
  311. color: $color-system;
  312. float: left;
  313. background: #FFFFFF;
  314. }
  315. }
  316. .club-main{
  317. padding-top: 122rpx;
  318. .list{
  319. display: flex;
  320. align-items: center;
  321. width: 702rpx;
  322. height: 92rpx;
  323. padding: 24rpx;
  324. background: #FFFFFF;
  325. position: relative;
  326. border-bottom: 1px solid #EBEBEB;
  327. .list-left{
  328. display: flex;
  329. flex: 8;
  330. .list-head{
  331. width: 92rpx;
  332. height: 92rpx;
  333. border-radius: 14rpx;
  334. image{
  335. width: 92rpx;
  336. height: 92rpx;
  337. border-radius: 14rpx;
  338. }
  339. }
  340. .list-tel{
  341. margin-left: 18rpx;
  342. .txt{
  343. display: flex;
  344. flex: 1;
  345. font-size: $font-size-28;
  346. color: $text-color;
  347. line-height: 46rpx;
  348. &.sm{
  349. font-size: $font-size-24;
  350. color: #666666;
  351. .txt-le{
  352. margin-right: 26rpx;
  353. }
  354. }
  355. }
  356. }
  357. }
  358. .list-opea{
  359. display: flex;
  360. flex: 2;
  361. color: #166CE1;
  362. flex-direction: column;
  363. .opea-type-cell{
  364. font-size: 24rpx;
  365. .iconfont{
  366. font-size: 34rpx;
  367. margin-right: 5rpx;
  368. }
  369. }
  370. .opea-type-dell{
  371. line-height: 46rpx;
  372. font-size: 24rpx;
  373. &.or{
  374. color: #E19B16;
  375. }
  376. .iconfont{
  377. font-size: 34rpx;
  378. margin-right: 5rpx;
  379. }
  380. }
  381. }
  382. }
  383. }
  384. .tabBar{
  385. width:100%;
  386. height: 98rpx;
  387. background: #fff;
  388. border-top:1px solid #E5E5E5;
  389. position: fixed;
  390. bottom:0px;
  391. left:0px;
  392. right:0px;
  393. display: flex;
  394. align-items: center;
  395. justify-content: center;
  396. .tabBar_list{
  397. width:86%;
  398. display: flex;
  399. justify-content: space-between;
  400. .tabBar_item{
  401. width:120rpx;
  402. display: flex;
  403. justify-content: center;
  404. align-items: center;
  405. flex-direction: column;
  406. font-size: 20rpx;
  407. color: #999999;
  408. &.current{
  409. color: #166CE1;
  410. .iconfont{
  411. color:#166CE1;
  412. }
  413. }
  414. &.current1{
  415. color: #FF0000;
  416. .iconfont{
  417. color:#FF0000;
  418. }
  419. }
  420. &.current2{
  421. color: #16E15C;
  422. .iconfont{
  423. color:#16E15C;
  424. }
  425. }
  426. .iconfont{
  427. width:48rpx;
  428. height: 48rpx;
  429. display: block;
  430. margin-bottom:2rpx;
  431. text-align: center;
  432. font-size: 46rpx;
  433. color: #999999;
  434. }
  435. }
  436. }
  437. }
  438. .nav_active{
  439. color: $color-system;
  440. }
  441. </style>