list.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  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. <text class="tags xf">新分配</text>
  63. </view>
  64. <view class="list-ntel">
  65. <text class="list-link">{{ club.linkMan ? club.linkMan : '' }}</text>
  66. <text class="list-texl">{{ club.contractMobile ? club.contractMobile : '' }}</text>
  67. </view>
  68. <view class="list-opera">
  69. <button class="btn org" @click.stop="checkData(club)">修改资料</button>
  70. <view class="btn gre" @click.stop="orderHistory(club)">
  71. 历史订单
  72. <text
  73. v-if="club.orderNum > 0"
  74. class="opea-badge uni-badge uni-badge-error uni-small uni-badge--small icon-num"
  75. >
  76. {{ showBadge(club.orderNum) }}
  77. </text>
  78. </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" bgcolor="#f7f7f7" :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 data = response.data
  181. if (data.list && data.list.length > 0) {
  182. this.isEmpty = false
  183. this.hasNextPage = response.data.hasNextPage
  184. this.clubList = data.list
  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 data = response.data
  217. if (data.list && data.list.length > 0) {
  218. this.hasNextPage = response.data.hasNextPage
  219. this.clubList = this.clubList.concat(data.list)
  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.pageNum = 1
  263. this.initclubList()
  264. break
  265. case 1:
  266. this.pageNum = 1
  267. this.userIdentity = 2
  268. this.listStatus = 90
  269. this.initclubList()
  270. break
  271. }
  272. },
  273. checkData(club) {
  274. //修改机构资料
  275. switch (this.tabCurrentNum) {
  276. case 0:
  277. this.$api.navigateTo(`/pages/seller/login/apply?userID=${club.userId}`)
  278. break
  279. case 1:
  280. this.$api.navigateTo(`/pages/seller/login/information?userID=${club.userId}`)
  281. break
  282. }
  283. },
  284. orderHistory(club) {
  285. //跳转机构历史订单
  286. this.$api.setStorage('orderUserInfo', club)
  287. this.$api.navigateTo(`/pages/seller/order/order-historylist?clubId=${club.clubId}&listType=0`)
  288. },
  289. onShowClose() {
  290. //输入框失去焦点时触发
  291. if (this.searchInputVal != '') {
  292. this.isShowClose = true
  293. } else {
  294. this.isShowClose = false
  295. }
  296. },
  297. delInputText() {
  298. //清除输入框内容
  299. this.searchInputVal = ''
  300. this.isShowClose = false
  301. },
  302. showBadge(n) {
  303. let num = ''
  304. if (n > 100) {
  305. num = 99
  306. } else {
  307. num = n
  308. }
  309. return num
  310. }
  311. },
  312. onReachBottom() {
  313. if (this.hasNextPage) {
  314. this.loadding = true
  315. this.pullUpOn = true
  316. this.getOnReachBottomData()
  317. }
  318. },
  319. onShow() {
  320. this.$api.getStorage().then(response => {
  321. this.serviceProviderId = response.serviceProviderId
  322. this.pageNum = 1
  323. this.initclubList()
  324. })
  325. }
  326. }
  327. </script>
  328. <style lang="scss">
  329. page {
  330. height: auto;
  331. }
  332. page,
  333. .container {
  334. /* padding-bottom: 120upx; */
  335. background: #f7f7f7;
  336. }
  337. .container {
  338. position: relative;
  339. }
  340. .club-search {
  341. height: auto;
  342. width: 100%;
  343. padding: 24rpx 0 0 0;
  344. background: #ffffff;
  345. display: flex;
  346. flex-direction: column;
  347. position: fixed;
  348. top: 0;
  349. left: 0;
  350. z-index: 999;
  351. .search-top {
  352. flex: 1;
  353. display: flex;
  354. align-items: center;
  355. padding: 24rpx;
  356. .search-from {
  357. width: 582rpx;
  358. height: 64rpx;
  359. background: #f7f7f7;
  360. border-radius: 32rpx;
  361. float: left;
  362. position: relative;
  363. .input {
  364. width: 500rpx;
  365. height: 64rpx;
  366. float: left;
  367. line-height: 64rpx;
  368. color: $text-color;
  369. font-size: $font-size-24;
  370. }
  371. .icon-iconfonticonfontsousuo1 {
  372. width: 64rpx;
  373. height: 64rpx;
  374. line-height: 64rpx;
  375. text-align: center;
  376. display: block;
  377. font-size: $font-size-38;
  378. float: left;
  379. color: #999999;
  380. }
  381. .icon-shanchu1 {
  382. font-size: $font-size-32;
  383. color: #999999;
  384. position: absolute;
  385. width: 64rpx;
  386. height: 64rpx;
  387. line-height: 64rpx;
  388. text-align: center;
  389. top: 0;
  390. right: 0;
  391. z-index: 10;
  392. }
  393. }
  394. .search-btn {
  395. width: 120rpx;
  396. line-height: 64rpx;
  397. text-align: center;
  398. font-size: $font-size-28;
  399. color: $color-system;
  400. float: left;
  401. background: #ffffff;
  402. }
  403. }
  404. .search-tab {
  405. height: 80rpx;
  406. display: flex;
  407. flex: 1;
  408. background: #ffffff;
  409. border-bottom: 1px solid #efefef;
  410. .tab-item {
  411. flex: 1;
  412. line-height: 80rpx;
  413. text-align: center;
  414. color: $text-color;
  415. font-size: $font-size-28;
  416. position: relative;
  417. .item-text {
  418. padding: 10rpx 0;
  419. border-bottom: 2px solid #ffffff;
  420. }
  421. &:nth-child(1)::before {
  422. content: '';
  423. width: 2px;
  424. height: 50rpx;
  425. position: absolute;
  426. right: 0;
  427. top: 15rpx;
  428. background: #ebebeb;
  429. }
  430. &.current {
  431. color: $color-system;
  432. .item-text {
  433. border-color: $color-system;
  434. }
  435. }
  436. }
  437. }
  438. }
  439. .club-main {
  440. padding-top: 224rpx;
  441. .list {
  442. width: 100%;
  443. height: 228rpx;
  444. padding: 24rpx;
  445. box-sizing: border-box;
  446. background: #ffffff;
  447. position: relative;
  448. border-bottom: 1px solid #ebebeb;
  449. .list-logo {
  450. width: 180rpx;
  451. height: 180rpx;
  452. float: left;
  453. image {
  454. width: 180rpx;
  455. height: 180rpx;
  456. border-radius: 8rpx;
  457. }
  458. }
  459. .list-content {
  460. width: 498rpx;
  461. height: 180rpx;
  462. float: right;
  463. .list-name {
  464. width: 100%;
  465. height: 50rpx;
  466. float: left;
  467. line-height: 50rpx;
  468. text-align: left;
  469. font-size: $font-size-26;
  470. color: #333333;
  471. .tags {
  472. display: inline-block;
  473. height: 36rpx;
  474. box-sizing: border-box;
  475. padding: 0 15rpx;
  476. border-radius: 8rpx;
  477. background: #f0cb72;
  478. font-size: $font-size-22;
  479. color: #4e4539;
  480. text-align: center;
  481. line-height: 36rpx;
  482. margin-left: 20rpx;
  483. margin-top: 7rpx;
  484. &.sv {
  485. background: #333333;
  486. color: #f0cb72;
  487. }
  488. &.xf {
  489. background-color: #F94B4B;
  490. color: #ffffff;
  491. }
  492. }
  493. }
  494. .list-ntel {
  495. width: 100%;
  496. height: 50rpx;
  497. float: left;
  498. line-height: 50rpx;
  499. text-align: left;
  500. font-size: $font-size-24;
  501. color: #666666;
  502. .list-link {
  503. display: inline-block;
  504. float: left;
  505. margin-right: 40rpx;
  506. }
  507. .list-texl {
  508. display: inline-block;
  509. float: left;
  510. }
  511. }
  512. .list-opera {
  513. width: 100%;
  514. height: 60rpx;
  515. display: flex;
  516. color: #166ce1;
  517. flex-direction: row;
  518. align-items: center;
  519. float: left;
  520. margin-top: 20rpx;
  521. .btn {
  522. width: 160rpx;
  523. height: 60rpx;
  524. line-height: 60rpx;
  525. border-radius: 30rpx;
  526. font-size: $font-size-24;
  527. color: $text-color;
  528. text-align: center;
  529. margin: 0 20rpx 0 0;
  530. position: relative;
  531. .opea-badge {
  532. position: absolute;
  533. right: -10rpx;
  534. top: -20rpx;
  535. }
  536. &.org {
  537. border: 1px solid #2769d5;
  538. color: #2769d5;
  539. }
  540. &.gre {
  541. border: 1px solid #e15616;
  542. color: #e15616;
  543. }
  544. &.doc {
  545. border: 1px solid #627386;
  546. color: #627386;
  547. }
  548. }
  549. }
  550. }
  551. }
  552. }
  553. .tabBar {
  554. width: 100%;
  555. height: 98rpx;
  556. background: #fff;
  557. border-top: 1px solid #e5e5e5;
  558. position: fixed;
  559. bottom: 0px;
  560. left: 0px;
  561. right: 0px;
  562. z-index: 99;
  563. display: flex;
  564. align-items: center;
  565. justify-content: center;
  566. .tabBar_list {
  567. width: 86%;
  568. display: flex;
  569. justify-content: space-between;
  570. .tabBar_item {
  571. width: 120rpx;
  572. display: flex;
  573. justify-content: center;
  574. align-items: center;
  575. flex-direction: column;
  576. font-size: 20rpx;
  577. color: #999999;
  578. &.current {
  579. color: #166ce1;
  580. .iconfont {
  581. color: #166ce1;
  582. }
  583. }
  584. &.current1 {
  585. color: #16e15c;
  586. .iconfont {
  587. color: #16e15c;
  588. }
  589. }
  590. &.current2 {
  591. color: #ff0000;
  592. .iconfont {
  593. color: #ff0000;
  594. }
  595. }
  596. .iconfont {
  597. width: 48rpx;
  598. height: 48rpx;
  599. display: block;
  600. margin-bottom: 2rpx;
  601. text-align: center;
  602. font-size: 46rpx;
  603. color: #999999;
  604. }
  605. }
  606. }
  607. }
  608. .nav_active {
  609. color: $color-system;
  610. }
  611. </style>