list.vue 15 KB

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