list.vue 11 KB

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