list.vue 12 KB

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