list.vue 14 KB

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