list.vue 13 KB

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