list.vue 11 KB

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