list.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519
  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. }
  279. .container{
  280. position: relative;
  281. }
  282. .club-search{
  283. height: auto;
  284. width: 100%;
  285. padding: 24rpx 0 0 0;
  286. background: #FFFFFF;
  287. display: flex;
  288. flex-direction: column;
  289. position: fixed;
  290. top: 0;
  291. left: 0;
  292. z-index: 999;
  293. .search-top{
  294. flex: 1;
  295. display: flex;
  296. align-items: center;
  297. padding: 24rpx;
  298. .search-from{
  299. width: 582rpx;
  300. height: 64rpx;
  301. background: #F7F7F7;
  302. border-radius: 14rpx;
  303. float: left;
  304. position: relative;
  305. .input{
  306. width: 500rpx;
  307. height: 64rpx;
  308. float: left;
  309. line-height: 64rpx;
  310. color: $text-color;
  311. font-size: $font-size-24;
  312. }
  313. .icon-iconfonticonfontsousuo1{
  314. width: 64rpx;
  315. height: 64rpx;
  316. line-height: 64rpx;
  317. text-align: center;
  318. display: block;
  319. font-size: $font-size-38;
  320. float: left;
  321. color: #999999;
  322. }
  323. .icon-shanchu1{
  324. font-size: $font-size-32;
  325. color: #999999;
  326. position: absolute;
  327. width: 64rpx;
  328. height: 64rpx;
  329. line-height: 64rpx;
  330. text-align: center;
  331. top: 0;
  332. right: 0;
  333. z-index: 10;
  334. }
  335. }
  336. .search-btn{
  337. width: 120rpx;
  338. line-height: 64rpx;
  339. text-align: center;
  340. font-size: $font-size-28;
  341. color: $color-system;
  342. float: left;
  343. background: #FFFFFF;
  344. }
  345. }
  346. .search-tab{
  347. height: 80rpx;
  348. display: flex;
  349. flex: 1;
  350. background: #FFFFFF;
  351. border-bottom: 1px solid #EFEFEF;
  352. .tab-item{
  353. flex: 1;
  354. line-height: 80rpx;
  355. text-align: center;
  356. color: $text-color;
  357. font-size: $font-size-28;
  358. position: relative;
  359. .item-text{
  360. padding: 10rpx 0;
  361. border-bottom:2px solid #FFFFFF;
  362. }
  363. &:nth-child(1)::before{
  364. content: '';
  365. width: 2px;
  366. height: 50rpx;
  367. position: absolute;
  368. right: 0;
  369. top: 15rpx;
  370. background: #EBEBEB;
  371. }
  372. &.current{
  373. color: $color-system;
  374. .item-text{
  375. border-color:$color-system;;
  376. }
  377. }
  378. }
  379. }
  380. }
  381. .club-main{
  382. padding-top: 224rpx;
  383. .list{
  384. display: flex;
  385. align-items: center;
  386. width: 702rpx;
  387. height: 92rpx;
  388. padding: 24rpx;
  389. background: #FFFFFF;
  390. position: relative;
  391. border-bottom: 1px solid #EBEBEB;
  392. .list-left{
  393. display: flex;
  394. flex: 8;
  395. .list-head{
  396. width: 92rpx;
  397. height: 92rpx;
  398. border-radius: 14rpx;
  399. image{
  400. width: 92rpx;
  401. height: 92rpx;
  402. border-radius: 14rpx;
  403. }
  404. }
  405. .list-tel{
  406. margin-left: 18rpx;
  407. .txt{
  408. display: flex;
  409. flex: 1;
  410. font-size: $font-size-28;
  411. color: $text-color;
  412. line-height: 46rpx;
  413. &.sm{
  414. font-size: $font-size-24;
  415. color: #666666;
  416. .txt-le{
  417. margin-right: 26rpx;
  418. }
  419. }
  420. }
  421. }
  422. }
  423. .list-opea{
  424. display: flex;
  425. flex: 2;
  426. color: #166CE1;
  427. flex-direction: column;
  428. .opea-type-cell{
  429. font-size: 24rpx;
  430. .iconfont{
  431. font-size: 34rpx;
  432. margin-right: 5rpx;
  433. }
  434. }
  435. .opea-type-dell{
  436. line-height: 46rpx;
  437. font-size: 24rpx;
  438. position: relative;
  439. .opea-badge{
  440. position: absolute;
  441. left: -45rpx;
  442. top: -10rpx;
  443. &.right{
  444. left: -20rpx;
  445. }
  446. }
  447. &.or{
  448. color: #E19B16;
  449. }
  450. .iconfont{
  451. font-size: 34rpx;
  452. margin-right: 5rpx;
  453. }
  454. }
  455. }
  456. }
  457. }
  458. .tabBar{
  459. width:100%;
  460. height: 98rpx;
  461. background: #fff;
  462. border-top:1px solid #E5E5E5;
  463. position: fixed;
  464. bottom:0px;
  465. left:0px;
  466. right:0px;
  467. display: flex;
  468. align-items: center;
  469. justify-content: center;
  470. .tabBar_list{
  471. width:86%;
  472. display: flex;
  473. justify-content: space-between;
  474. .tabBar_item{
  475. width:120rpx;
  476. display: flex;
  477. justify-content: center;
  478. align-items: center;
  479. flex-direction: column;
  480. font-size: 20rpx;
  481. color: #999999;
  482. &.current{
  483. color: #166CE1;
  484. .iconfont{
  485. color:#166CE1;
  486. }
  487. }
  488. &.current1{
  489. color: #16E15C;
  490. .iconfont{
  491. color:#16E15C;
  492. }
  493. }
  494. &.current2{
  495. color: #FF0000;
  496. .iconfont{
  497. color:#FF0000;
  498. }
  499. }
  500. .iconfont{
  501. width:48rpx;
  502. height: 48rpx;
  503. display: block;
  504. margin-bottom:2rpx;
  505. text-align: center;
  506. font-size: 46rpx;
  507. color: #999999;
  508. }
  509. }
  510. }
  511. }
  512. .nav_active{
  513. color: $color-system;
  514. }
  515. </style>