list.vue 14 KB

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