list.vue 14 KB

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