list.vue 11 KB

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