list.vue 15 KB

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