list.vue 13 KB

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