list.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  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(response =>{
  159. this.$util.msg(response.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(response =>{
  182. this.$util.msg(response.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.navigateTo(`/market/pages/order/order-history?clubID=${item.clubID}`)
  215. },
  216. onShowClose () {//输入框失去焦点时触发
  217. if(this.searchInputVal != ''){
  218. this.isShowClose = true
  219. }else{
  220. this.isShowClose = false
  221. }
  222. },
  223. delInputText(){//清除输入框内容
  224. this.searchInputVal = ''
  225. this.isShowClose = false
  226. }
  227. },
  228. onReachBottom() {
  229. if(this.hasNextPage){
  230. this.loadding = true
  231. this.pullUpOn = true
  232. this.getOnReachBottomData()
  233. }
  234. },
  235. onShow() {
  236. this.$api.getStorage().then(response =>{
  237. this.serviceProviderId = response.serviceProviderID
  238. this.pageNum = 1;
  239. this.initclubList();
  240. })
  241. }
  242. }
  243. </script>
  244. <style lang='scss'>
  245. page {
  246. height: auto;
  247. }
  248. page,.container{
  249. /* padding-bottom: 120upx; */
  250. background: #F7F7F7;
  251. border-top: 1px solid #EBEBEB;
  252. }
  253. .container{
  254. position: relative;
  255. }
  256. .club-search{
  257. height: 64rpx;
  258. width: 702rpx;
  259. padding: 24rpx;
  260. background: #FFFFFF;
  261. display: flex;
  262. align-items: center;
  263. position: fixed;
  264. top: 0;
  265. left: 0;
  266. z-index: 999;
  267. .search-from{
  268. width: 582rpx;
  269. height: 64rpx;
  270. background: #F7F7F7;
  271. border-radius: 14rpx;
  272. float: left;
  273. position: relative;
  274. .input{
  275. width: 500rpx;
  276. height: 64rpx;
  277. float: left;
  278. line-height: 64rpx;
  279. color: $text-color;
  280. font-size: $font-size-24;
  281. }
  282. .icon-iconfonticonfontsousuo1{
  283. width: 64rpx;
  284. height: 64rpx;
  285. line-height: 64rpx;
  286. text-align: center;
  287. display: block;
  288. font-size: $font-size-38;
  289. float: left;
  290. color: #999999;
  291. }
  292. .icon-shanchu1{
  293. font-size: $font-size-32;
  294. color: #999999;
  295. position: absolute;
  296. width: 64rpx;
  297. height: 64rpx;
  298. line-height: 64rpx;
  299. text-align: center;
  300. top: 0;
  301. right: 0;
  302. z-index: 10;
  303. }
  304. }
  305. .search-btn{
  306. width: 120rpx;
  307. line-height: 64rpx;
  308. text-align: center;
  309. font-size: $font-size-28;
  310. color: $color-system;
  311. float: left;
  312. background: #FFFFFF;
  313. }
  314. }
  315. .club-main{
  316. padding-top: 122rpx;
  317. .list{
  318. display: flex;
  319. align-items: center;
  320. width: 702rpx;
  321. height: 92rpx;
  322. padding: 24rpx;
  323. background: #FFFFFF;
  324. position: relative;
  325. border-bottom: 1px solid #EBEBEB;
  326. .list-left{
  327. display: flex;
  328. flex: 8;
  329. .list-head{
  330. width: 92rpx;
  331. height: 92rpx;
  332. border-radius: 14rpx;
  333. image{
  334. width: 92rpx;
  335. height: 92rpx;
  336. border-radius: 14rpx;
  337. }
  338. }
  339. .list-tel{
  340. margin-left: 18rpx;
  341. .txt{
  342. display: flex;
  343. flex: 1;
  344. font-size: $font-size-28;
  345. color: $text-color;
  346. line-height: 46rpx;
  347. &.sm{
  348. font-size: $font-size-24;
  349. color: #666666;
  350. .txt-le{
  351. margin-right: 26rpx;
  352. }
  353. }
  354. }
  355. }
  356. }
  357. .list-opea{
  358. display: flex;
  359. flex: 2;
  360. color: #166CE1;
  361. flex-direction: column;
  362. .opea-type-cell{
  363. font-size: 24rpx;
  364. .iconfont{
  365. font-size: 34rpx;
  366. margin-right: 5rpx;
  367. }
  368. }
  369. .opea-type-dell{
  370. line-height: 46rpx;
  371. font-size: 24rpx;
  372. &.or{
  373. color: #E19B16;
  374. }
  375. .iconfont{
  376. font-size: 34rpx;
  377. margin-right: 5rpx;
  378. }
  379. }
  380. }
  381. }
  382. }
  383. .tabBar{
  384. width:100%;
  385. height: 98rpx;
  386. background: #fff;
  387. border-top:1px solid #E5E5E5;
  388. position: fixed;
  389. bottom:0px;
  390. left:0px;
  391. right:0px;
  392. display: flex;
  393. align-items: center;
  394. justify-content: center;
  395. .tabBar_list{
  396. width:86%;
  397. display: flex;
  398. justify-content: space-between;
  399. .tabBar_item{
  400. width:120rpx;
  401. display: flex;
  402. justify-content: center;
  403. align-items: center;
  404. flex-direction: column;
  405. font-size: 20rpx;
  406. color: #999999;
  407. &.current{
  408. color: #166CE1;
  409. .iconfont{
  410. color:#166CE1;
  411. }
  412. }
  413. &.current1{
  414. color: #FF0000;
  415. .iconfont{
  416. color:#FF0000;
  417. }
  418. }
  419. &.current2{
  420. color: #16E15C;
  421. .iconfont{
  422. color:#16E15C;
  423. }
  424. }
  425. .iconfont{
  426. width:48rpx;
  427. height: 48rpx;
  428. display: block;
  429. margin-bottom:2rpx;
  430. text-align: center;
  431. font-size: 46rpx;
  432. color: #999999;
  433. }
  434. }
  435. }
  436. }
  437. .nav_active{
  438. color: $color-system;
  439. }
  440. </style>