list.vue 11 KB

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