list.vue 14 KB

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