list.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610
  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
  8. class="input"
  9. type="text"
  10. confirm-type="search"
  11. v-model="searchInputVal"
  12. @input="onShowClose"
  13. @confirm="initclubList()"
  14. placeholder="机构名称/联系人"
  15. maxlength="16"
  16. />
  17. <text class="iconfont icon-shanchu1" v-if="isShowClose" @click="delInputText()"></text>
  18. </view>
  19. <view class="search-btn">
  20. <button class="search-btn" type="default" @click.stop="searchClubList">搜索</button>
  21. </view>
  22. </view>
  23. <view class="search-tab">
  24. <view
  25. class="tab-item"
  26. v-for="(item, index) in listTab"
  27. :key="index"
  28. :class="{ current: tabCurrentNum === index }"
  29. @click="tabCurrentClick(index)"
  30. >
  31. <text class="item-text">{{ item.name }}<text class="line"></text></text>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="club-main">
  36. <view v-if="isEmpty" class="empty-container">
  37. <image
  38. class="club-empty-image"
  39. src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AY2ZjAABpmnBICH4247.png"
  40. mode="aspectFit"
  41. ></image>
  42. <view class="txt">暂无机构数据</view>
  43. </view>
  44. <view v-else class="club-list">
  45. <scroll-view scroll-y="true">
  46. <view class="list" v-for="(club, index) in clubList" :key="index">
  47. <view class="list-logo">
  48. <image
  49. :src="
  50. club.headpic
  51. ? club.headpic
  52. : 'https://static.caimei365.com/app/img/icon/icon-club@3x.png'
  53. "
  54. mode=""
  55. ></image>
  56. </view>
  57. <view class="list-content">
  58. <view class="list-name">
  59. {{ club.userIdentity === 2 ? club.name : club.linkMan }}
  60. <text class="tags" v-if="tabCurrentNum == 0">VIP</text>
  61. <text class="tags sv" v-if="tabCurrentNum == 1">SVIP</text>
  62. </view>
  63. <view class="list-ntel">
  64. <text class="list-link">{{ club.linkMan ? club.linkMan : '' }}</text>
  65. <text class="list-texl">{{ club.contractMobile ? club.contractMobile : '' }}</text>
  66. </view>
  67. <view class="list-opera">
  68. <button class="btn org" @click.stop="checkData(club)">修改资料</button>
  69. <view class="btn gre" @click.stop="orderHistory(club)">
  70. 历史订单
  71. <text
  72. v-if="club.orderNum > 0"
  73. class="opea-badge uni-badge uni-badge-error uni-small uni-badge--small icon-num"
  74. >
  75. {{ showBadge(club.orderNum) }}
  76. </text>
  77. </view>
  78. <view class="btn doc" @click.stop="clubRemaks(club)"> 资料备注 </view>
  79. </view>
  80. </view>
  81. </view>
  82. <!--加载loadding-->
  83. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  84. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#ffffff'" :text="nomoreText"></tui-nomore>
  85. </scroll-view>
  86. </view>
  87. </view>
  88. <view class="tabBar" :style="{ height: isIphoneX ? '140rpx' : '98rpx' }" v-if="tabCurrentNum === 0">
  89. <view class="tabBar_list" :style="{ paddingBottom: isIphoneX ? '40rpx' : '' }">
  90. <view class="tabBar_item" :class="{ current: tabCurrentIndex === 0 }" @click="tabClick(0)">
  91. <text class="iconfont icon-shenhetongguo"></text> <view class="tabBar_name">待升级</view>
  92. </view>
  93. <view class="tabBar_item" :class="{ current1: tabCurrentIndex === 1 }" @click="tabClick(1)">
  94. <text class="iconfont icon-lishidingdan"></text> <view class="tabBar_name">升级中</view>
  95. </view>
  96. <view class="tabBar_item" :class="{ current2: tabCurrentIndex === 2 }" @click="tabClick(2)">
  97. <text class="iconfont icon-shenhebutongguo"></text> <view class="tabBar_name">升级失败</view>
  98. </view>
  99. </view>
  100. </view>
  101. <!-- 分享弹窗 -->
  102. <shareModel v-if="isShareModal" :orderID="shareClubUseId" @shareConfirm="onShareAppMessage"></shareModel>
  103. </view>
  104. </template>
  105. <script>
  106. import authorize from '@/common/config/authorize.js'
  107. import tuiLoadmore from '@/components/tui-components/loadmore/loadmore'
  108. import tuiNomore from '@/components/tui-components/nomore/nomore'
  109. import shareModel from '@/components/cm-module/modelAlert/shareModel.vue' //分享弹窗
  110. export default {
  111. components: {
  112. tuiLoadmore,
  113. tuiNomore,
  114. shareModel
  115. },
  116. data() {
  117. return {
  118. listTab: [{ name: '个人机构' }, { name: '资质机构' }],
  119. serviceProviderId: '',
  120. shareClubUseId: 0,
  121. shareIdentity: 0,
  122. isShowClose: false,
  123. searchInputVal: '',
  124. isEmpty: false,
  125. isShareModal: 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(() => {
  187. this.pullFlag = true
  188. }, 500)
  189. if (this.hasNextPage) {
  190. this.pullUpOn = false
  191. this.nomoreText = '上拉显示更多'
  192. } else {
  193. this.pullUpOn = true
  194. this.loadding = false
  195. this.nomoreText = '已至底部'
  196. }
  197. } else {
  198. this.isEmpty = true
  199. }
  200. })
  201. .catch(error => {
  202. this.$util.msg(error.msg, 2000)
  203. })
  204. },
  205. getOnReachBottomData() {
  206. this.pageNum += 1
  207. this.SellerService.GetSellerClubList({
  208. userIdentity: this.userIdentity,
  209. name: this.searchInputVal,
  210. pageNum: this.pageNum,
  211. pageSize: this.pageSize,
  212. spId: this.serviceProviderId,
  213. status: this.listStatus
  214. })
  215. .then(response => {
  216. let responseData = response.data
  217. if (responseData.results && responseData.results.length > 0) {
  218. this.hasNextPage = response.data.hasNextPage
  219. this.clubList = this.clubList.concat(responseData.results)
  220. this.pullFlag = false // 防上拉暴滑
  221. setTimeout(() => {
  222. this.pullFlag = true
  223. }, 500)
  224. if (this.hasNextPage) {
  225. this.pullUpOn = false
  226. this.nomoreText = '上拉显示更多'
  227. } else {
  228. this.pullUpOn = false
  229. this.loadding = false
  230. this.nomoreText = '已至底部'
  231. }
  232. }
  233. })
  234. .catch(error => {
  235. this.$util.msg(error.msg, 2000)
  236. })
  237. },
  238. tabClick(index) {
  239. //tab切换
  240. this.tabCurrentIndex = index
  241. switch (index) {
  242. case 0:
  243. this.listStatus = 90
  244. break
  245. case 1:
  246. this.listStatus = 1
  247. break
  248. case 2:
  249. this.listStatus = 92
  250. break
  251. }
  252. this.initclubList()
  253. },
  254. tabCurrentClick(index) {
  255. //商品详情&&供应商信息tab切换
  256. this.tabCurrentNum = index
  257. switch (index) {
  258. case 0:
  259. this.tabCurrentIndex = 0
  260. this.userIdentity = 4
  261. this.listStatus = 90
  262. this.initclubList()
  263. break
  264. case 1:
  265. this.userIdentity = 2
  266. this.listStatus = 90
  267. this.initclubList()
  268. break
  269. }
  270. },
  271. checkData(club) {
  272. //修改机构资料
  273. switch (this.tabCurrentNum) {
  274. case 0:
  275. this.$api.navigateTo(`/pages/seller/login/apply?userID=${club.userID}`)
  276. break
  277. case 1:
  278. this.$api.navigateTo(`/pages/seller/login/information?userID=${club.userID}`)
  279. break
  280. }
  281. },
  282. orderHistory(club) {
  283. //跳转机构历史订单
  284. this.$api.setStorage('orderUserInfo', club)
  285. this.$api.navigateTo(`/pages/seller/order/order-historylist?clubId=${club.clubID}&listType=0`)
  286. },
  287. clubRemaks(club){
  288. //跳转机构资料备注
  289. this.$api.setStorage('orderUserInfo', club)
  290. this.$api.navigateTo(`/pages/seller/remarks/list?clubId=${club.clubID}`)
  291. },
  292. onShowClose() {
  293. //输入框失去焦点时触发
  294. if (this.searchInputVal != '') {
  295. this.isShowClose = true
  296. } else {
  297. this.isShowClose = false
  298. }
  299. },
  300. delInputText() {
  301. //清除输入框内容
  302. this.searchInputVal = ''
  303. this.isShowClose = false
  304. },
  305. showBadge(n) {
  306. let num = ''
  307. if (n > 100) {
  308. num = 99
  309. } else {
  310. num = n
  311. }
  312. return num
  313. }
  314. },
  315. onReachBottom() {
  316. if (this.hasNextPage) {
  317. this.loadding = true
  318. this.pullUpOn = true
  319. this.getOnReachBottomData()
  320. }
  321. },
  322. onShow() {
  323. this.$api.getStorage().then(response => {
  324. this.serviceProviderId = response.serviceProviderId
  325. this.pageNum = 1
  326. this.initclubList()
  327. })
  328. }
  329. }
  330. </script>
  331. <style lang="scss">
  332. page {
  333. height: auto;
  334. }
  335. page,
  336. .container {
  337. /* padding-bottom: 120upx; */
  338. background: #f7f7f7;
  339. }
  340. .container {
  341. position: relative;
  342. }
  343. .club-search {
  344. height: auto;
  345. width: 100%;
  346. padding: 24rpx 0 0 0;
  347. background: #ffffff;
  348. display: flex;
  349. flex-direction: column;
  350. position: fixed;
  351. top: 0;
  352. left: 0;
  353. z-index: 999;
  354. .search-top {
  355. flex: 1;
  356. display: flex;
  357. align-items: center;
  358. padding: 24rpx;
  359. .search-from {
  360. width: 582rpx;
  361. height: 64rpx;
  362. background: #f7f7f7;
  363. border-radius: 32rpx;
  364. float: left;
  365. position: relative;
  366. .input {
  367. width: 500rpx;
  368. height: 64rpx;
  369. float: left;
  370. line-height: 64rpx;
  371. color: $text-color;
  372. font-size: $font-size-24;
  373. }
  374. .icon-iconfonticonfontsousuo1 {
  375. width: 64rpx;
  376. height: 64rpx;
  377. line-height: 64rpx;
  378. text-align: center;
  379. display: block;
  380. font-size: $font-size-38;
  381. float: left;
  382. color: #999999;
  383. }
  384. .icon-shanchu1 {
  385. font-size: $font-size-32;
  386. color: #999999;
  387. position: absolute;
  388. width: 64rpx;
  389. height: 64rpx;
  390. line-height: 64rpx;
  391. text-align: center;
  392. top: 0;
  393. right: 0;
  394. z-index: 10;
  395. }
  396. }
  397. .search-btn {
  398. width: 120rpx;
  399. line-height: 64rpx;
  400. text-align: center;
  401. font-size: $font-size-28;
  402. color: $color-system;
  403. float: left;
  404. background: #ffffff;
  405. }
  406. }
  407. .search-tab {
  408. height: 80rpx;
  409. display: flex;
  410. flex: 1;
  411. background: #ffffff;
  412. border-bottom: 1px solid #efefef;
  413. .tab-item {
  414. flex: 1;
  415. line-height: 80rpx;
  416. text-align: center;
  417. color: $text-color;
  418. font-size: $font-size-28;
  419. position: relative;
  420. .item-text {
  421. padding: 10rpx 0;
  422. border-bottom: 2px solid #ffffff;
  423. }
  424. &:nth-child(1)::before {
  425. content: '';
  426. width: 2px;
  427. height: 50rpx;
  428. position: absolute;
  429. right: 0;
  430. top: 15rpx;
  431. background: #ebebeb;
  432. }
  433. &.current {
  434. color: $color-system;
  435. .item-text {
  436. border-color: $color-system;
  437. }
  438. }
  439. }
  440. }
  441. }
  442. .club-main {
  443. padding-top: 224rpx;
  444. .list {
  445. width: 100%;
  446. height: 228rpx;
  447. padding: 24rpx;
  448. box-sizing: border-box;
  449. background: #ffffff;
  450. position: relative;
  451. border-bottom: 1px solid #ebebeb;
  452. .list-logo {
  453. width: 180rpx;
  454. height: 180rpx;
  455. float: left;
  456. image {
  457. width: 180rpx;
  458. height: 180rpx;
  459. border-radius: 8rpx;
  460. }
  461. }
  462. .list-content {
  463. width: 498rpx;
  464. height: 180rpx;
  465. float: right;
  466. .list-name {
  467. width: 100%;
  468. height: 50rpx;
  469. float: left;
  470. line-height: 50rpx;
  471. text-align: left;
  472. font-size: $font-size-26;
  473. color: #333333;
  474. .tags {
  475. display: inline-block;
  476. width: 60rpx;
  477. height: 32rpx;
  478. border-radius: 8rpx;
  479. background: #f0cb72;
  480. font-size: $font-size-22;
  481. color: #4e4539;
  482. text-align: center;
  483. line-height: 32rpx;
  484. margin-left: 20rpx;
  485. &.sv {
  486. background: #333333;
  487. color: #f0cb72;
  488. }
  489. }
  490. }
  491. .list-ntel {
  492. width: 100%;
  493. height: 50rpx;
  494. float: left;
  495. line-height: 50rpx;
  496. text-align: left;
  497. font-size: $font-size-24;
  498. color: #666666;
  499. .list-link {
  500. display: inline-block;
  501. float: left;
  502. margin-right: 40rpx;
  503. }
  504. .list-texl {
  505. display: inline-block;
  506. float: left;
  507. }
  508. }
  509. .list-opera {
  510. width: 100%;
  511. height: 60rpx;
  512. display: flex;
  513. color: #166ce1;
  514. flex-direction: row;
  515. align-items: center;
  516. float: left;
  517. margin-top: 20rpx;
  518. .btn {
  519. width: 160rpx;
  520. height: 60rpx;
  521. line-height: 60rpx;
  522. border-radius: 30rpx;
  523. font-size: $font-size-24;
  524. color: $text-color;
  525. text-align: center;
  526. margin: 0 20rpx 0 0;
  527. position: relative;
  528. .opea-badge {
  529. position: absolute;
  530. right: -10rpx;
  531. top: -20rpx;
  532. }
  533. &.org {
  534. border: 1px solid #2769d5;
  535. color: #2769d5;
  536. }
  537. &.gre {
  538. border: 1px solid #e15616;
  539. color: #e15616;
  540. }
  541. &.doc {
  542. border: 1px solid #627386;
  543. color: #627386;
  544. }
  545. }
  546. }
  547. }
  548. }
  549. }
  550. .tabBar {
  551. width: 100%;
  552. height: 98rpx;
  553. background: #fff;
  554. border-top: 1px solid #e5e5e5;
  555. position: fixed;
  556. bottom: 0px;
  557. left: 0px;
  558. right: 0px;
  559. display: flex;
  560. align-items: center;
  561. justify-content: center;
  562. .tabBar_list {
  563. width: 86%;
  564. display: flex;
  565. justify-content: space-between;
  566. .tabBar_item {
  567. width: 120rpx;
  568. display: flex;
  569. justify-content: center;
  570. align-items: center;
  571. flex-direction: column;
  572. font-size: 20rpx;
  573. color: #999999;
  574. &.current {
  575. color: #166ce1;
  576. .iconfont {
  577. color: #166ce1;
  578. }
  579. }
  580. &.current1 {
  581. color: #16e15c;
  582. .iconfont {
  583. color: #16e15c;
  584. }
  585. }
  586. &.current2 {
  587. color: #ff0000;
  588. .iconfont {
  589. color: #ff0000;
  590. }
  591. }
  592. .iconfont {
  593. width: 48rpx;
  594. height: 48rpx;
  595. display: block;
  596. margin-bottom: 2rpx;
  597. text-align: center;
  598. font-size: 46rpx;
  599. color: #999999;
  600. }
  601. }
  602. }
  603. }
  604. .nav_active {
  605. color: $color-system;
  606. }
  607. </style>