list.vue 14 KB

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