list.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  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. 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. shareBindClub(item){//分享登录
  257. this.shareClubUseId = item.userID
  258. this.isShareModal = true
  259. },
  260. onShowClose () {//输入框失去焦点时触发
  261. if(this.searchInputVal != ''){
  262. this.isShowClose = true
  263. }else{
  264. this.isShowClose = false
  265. }
  266. },
  267. delInputText(){//清除输入框内容
  268. this.searchInputVal = ''
  269. this.isShowClose = false
  270. },
  271. showBadge(n){
  272. let num ='';
  273. if(n>100){num = 99}else{num = n;}
  274. return num;
  275. },
  276. },
  277. onReachBottom() {
  278. if(this.hasNextPage){
  279. this.loadding = true
  280. this.pullUpOn = true
  281. this.getOnReachBottomData()
  282. }
  283. },
  284. onShow() {
  285. this.$api.getStorage().then(response =>{
  286. this.serviceProviderId = response.serviceProviderId
  287. this.pageNum = 1;
  288. this.initclubList();
  289. })
  290. },
  291. onShareAppMessage(res){//分享转发
  292. this.isShareModal = false
  293. if (res.from === 'button') {
  294. // 来自页面内转发按钮
  295. let path = `pages/login/binding?userId=${this.shareClubUseId}`
  296. console.log(path)
  297. return {
  298. title: '您已注册采美365网,请点击登录',
  299. path: path,
  300. imageUrl:'https://static.caimei365.com/app/img/icon/icon-addShare@3x.png'
  301. }
  302. }
  303. },
  304. }
  305. </script>
  306. <style lang='scss'>
  307. page {
  308. height: auto;
  309. }
  310. page,.container{
  311. /* padding-bottom: 120upx; */
  312. background: #F7F7F7;
  313. }
  314. .container{
  315. position: relative;
  316. }
  317. .club-search{
  318. height: auto;
  319. width: 100%;
  320. padding: 24rpx 0 0 0;
  321. background: #FFFFFF;
  322. display: flex;
  323. flex-direction: column;
  324. position: fixed;
  325. top: 0;
  326. left: 0;
  327. z-index: 999;
  328. .search-top{
  329. flex: 1;
  330. display: flex;
  331. align-items: center;
  332. padding: 24rpx;
  333. .search-from{
  334. width: 582rpx;
  335. height: 64rpx;
  336. background: #F7F7F7;
  337. border-radius: 32rpx;
  338. float: left;
  339. position: relative;
  340. .input{
  341. width: 500rpx;
  342. height: 64rpx;
  343. float: left;
  344. line-height: 64rpx;
  345. color: $text-color;
  346. font-size: $font-size-24;
  347. }
  348. .icon-iconfonticonfontsousuo1{
  349. width: 64rpx;
  350. height: 64rpx;
  351. line-height: 64rpx;
  352. text-align: center;
  353. display: block;
  354. font-size: $font-size-38;
  355. float: left;
  356. color: #999999;
  357. }
  358. .icon-shanchu1{
  359. font-size: $font-size-32;
  360. color: #999999;
  361. position: absolute;
  362. width: 64rpx;
  363. height: 64rpx;
  364. line-height: 64rpx;
  365. text-align: center;
  366. top: 0;
  367. right: 0;
  368. z-index: 10;
  369. }
  370. }
  371. .search-btn{
  372. width: 120rpx;
  373. line-height: 64rpx;
  374. text-align: center;
  375. font-size: $font-size-28;
  376. color: $color-system;
  377. float: left;
  378. background: #FFFFFF;
  379. }
  380. }
  381. .search-tab{
  382. height: 80rpx;
  383. display: flex;
  384. flex: 1;
  385. background: #FFFFFF;
  386. border-bottom: 1px solid #EFEFEF;
  387. .tab-item{
  388. flex: 1;
  389. line-height: 80rpx;
  390. text-align: center;
  391. color: $text-color;
  392. font-size: $font-size-28;
  393. position: relative;
  394. .item-text{
  395. padding: 10rpx 0;
  396. border-bottom:2px solid #FFFFFF;
  397. }
  398. &:nth-child(1)::before{
  399. content: '';
  400. width: 2px;
  401. height: 50rpx;
  402. position: absolute;
  403. right: 0;
  404. top: 15rpx;
  405. background: #EBEBEB;
  406. }
  407. &.current{
  408. color: $color-system;
  409. .item-text{
  410. border-color:$color-system;;
  411. }
  412. }
  413. }
  414. }
  415. }
  416. .club-main{
  417. padding-top: 224rpx;
  418. .list{
  419. width: 100%;
  420. height: 228rpx;
  421. padding: 24rpx;
  422. box-sizing: border-box;
  423. background: #FFFFFF;
  424. position: relative;
  425. border-bottom: 1px solid #EBEBEB;
  426. .list-logo{
  427. width: 180rpx;
  428. height: 180rpx;
  429. float: left;
  430. image{
  431. width: 180rpx;
  432. height: 180rpx;
  433. border-radius: 8rpx;
  434. }
  435. }
  436. .list-content{
  437. width: 498rpx;
  438. height: 180rpx;
  439. float: right;
  440. .list-name{
  441. width: 100%;
  442. height: 50rpx;
  443. float: left;
  444. line-height: 50rpx;
  445. text-align: left;
  446. font-size: $font-size-26;
  447. color: #333333;
  448. }
  449. .list-ntel{
  450. width: 100%;
  451. height: 50rpx;
  452. float: left;
  453. line-height: 50rpx;
  454. text-align: left;
  455. font-size: $font-size-26;
  456. color: #666666;
  457. .list-link{
  458. display: inline-block;
  459. float: left;
  460. margin-right: 40rpx;
  461. }
  462. .list-texl{
  463. display: inline-block;
  464. float: left;
  465. }
  466. }
  467. .list-opera{
  468. width: 100%;
  469. height: 60rpx;
  470. display: flex;
  471. color: #166CE1;
  472. flex-direction: row;
  473. align-items: center;
  474. float: left;
  475. margin-top: 20rpx;
  476. .btn{
  477. width: 160rpx;
  478. height: 60rpx;
  479. line-height: 60rpx;
  480. border-radius: 30rpx;
  481. font-size: $font-size-24;
  482. color: $text-color;
  483. text-align: center;
  484. margin:0 20rpx 0 0;
  485. position: relative;
  486. .opea-badge{
  487. position: absolute;
  488. right: -10rpx;
  489. top: -20rpx;
  490. }
  491. &.org{
  492. border: 1px solid #2769d5;
  493. color: #2769d5;
  494. }
  495. &.gre{
  496. border: 1px solid #e15616;
  497. color: #e15616;
  498. }
  499. &.yel{
  500. border: 1px solid #4ad04c;
  501. color: #4ad04c;
  502. }
  503. }
  504. }
  505. }
  506. }
  507. }
  508. .tabBar{
  509. width:100%;
  510. height: 98rpx;
  511. background: #fff;
  512. border-top:1px solid #E5E5E5;
  513. position: fixed;
  514. bottom:0px;
  515. left:0px;
  516. right:0px;
  517. display: flex;
  518. align-items: center;
  519. justify-content: center;
  520. .tabBar_list{
  521. width:86%;
  522. display: flex;
  523. justify-content: space-between;
  524. .tabBar_item{
  525. width:120rpx;
  526. display: flex;
  527. justify-content: center;
  528. align-items: center;
  529. flex-direction: column;
  530. font-size: 20rpx;
  531. color: #999999;
  532. &.current{
  533. color: #166CE1;
  534. .iconfont{
  535. color:#166CE1;
  536. }
  537. }
  538. &.current1{
  539. color: #16E15C;
  540. .iconfont{
  541. color:#16E15C;
  542. }
  543. }
  544. &.current2{
  545. color: #FF0000;
  546. .iconfont{
  547. color:#FF0000;
  548. }
  549. }
  550. .iconfont{
  551. width:48rpx;
  552. height: 48rpx;
  553. display: block;
  554. margin-bottom:2rpx;
  555. text-align: center;
  556. font-size: 46rpx;
  557. color: #999999;
  558. }
  559. }
  560. }
  561. }
  562. .nav_active{
  563. color: $color-system;
  564. }
  565. </style>