club-list.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. <template>
  2. <view class="container club clearfix">
  3. <tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading="true"
  4. :loadingType="5" />
  5. <template v-else>
  6. <view class="club-search clearfix">
  7. <view class="search-from name">
  8. <text class="iconfont icon-iconfonticonfontsousuo1"></text>
  9. <input class="input" type="text" confirm-type="search" v-model="listQuery.name" @input="onShowClose"
  10. @confirm="GetSellerClubList()" placeholder="机构名称/联系人" maxlength="12" />
  11. <text class="iconfont icon-shanchu1" v-if="isShowClose" @click="delInputText()"></text>
  12. </view>
  13. <view class="search-btn">
  14. <button class="search-btn" type="default" @click.stop="searchClubList">搜索</button>
  15. </view>
  16. </view>
  17. <view class="club-main">
  18. <view v-if="isEmpty" class="empty-container">
  19. <image class="club-empty-image"
  20. src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AY2ZjAABpmnBICH4247.png"
  21. mode="aspectFit"></image>
  22. <view class="txt">暂无机构数据</view>
  23. </view>
  24. <view v-else class="club-list">
  25. <scroll-view scroll-y="true">
  26. <view class="list" v-for="(club, index) in clubList" :key="index">
  27. <view class="club-list-top">
  28. <view class="list-left">
  29. <view class="list-head">
  30. <image :src="
  31. club.headpic
  32. ? club.headpic
  33. : 'https://static.caimei365.com/app/img/icon/icon-club@3x.png'
  34. " mode=""></image>
  35. </view>
  36. </view>
  37. <view class="list-item">
  38. <view class="list-title">
  39. <text class="list-name">
  40. {{ club.name }}
  41. </text>
  42. <text class="tags"
  43. v-if="club.vipFlag == 0 && club.userIdentity === 2">VIP</text>
  44. <text class="tags sv" v-if="club.vipFlag == 1">SVIP</text>
  45. <text class="list-hist" @click.stop="handleClickOper(5, club)"><text
  46. class="iconfont icon-dingdanliebiao"></text>订单列表</text>
  47. </view>
  48. <view class="list-opea">
  49. <text class="tags sm" @click.stop="
  50. this.$api.navigateTo('/pages/service/service?id=1041&title=标签说明')
  51. ">{{ club.activeState }} <text class="iconfont icon-xiayibu"></text></text>
  52. <text class="tags sm" @click.stop="
  53. this.$api.navigateTo('/pages/service/service?id=1041&title=标签说明')
  54. ">{{ club.customerValue }} <text class="iconfont icon-xiayibu"></text></text>
  55. </view>
  56. </view>
  57. </view>
  58. <view class="club-list-bot">
  59. <view class="btn" @click.stop="handleClickOper(1, club)"> <text
  60. class="iconfont icon-lijixiadan"></text> 立即下单</view>
  61. <!-- <view class="btn" @click.stop="handleClickOper(3, club)"> <text class="iconfont icon-zaicigoumai1"></text> 再次购买</view>
  62. <view class="btn" @click.stop="handleClickOper(6, club)"> <text class="iconfont icon-youhuiquan"></text> 购买优惠券</view>
  63. <view class="btn" @click.stop="handleShowBubble(club,index)">
  64. <text class="iconfont icon-gengduo2"></text>
  65. <view class="btn-bubble" v-if="currentIndex === index && club.bubble">
  66. <view class="btn-view border" @click.stop="handleClickOper(2, club)">
  67. <text class="iconfont icon-ershouxiadan"></text> 二手下单
  68. </view>
  69. <view class="btn-view" @click.stop="handleClickOper(4, club)">
  70. <text class="iconfont icon-chongzhixiadingjin"></text> 充值/下订金
  71. </view>
  72. </view>
  73. </view> -->
  74. </view>
  75. </view>
  76. <!--加载loadding-->
  77. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  78. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#ffffff'" :text="nomoreText"></tui-nomore>
  79. <!--加载loadding-->
  80. </scroll-view>
  81. </view>
  82. </view>
  83. </template>
  84. </view>
  85. </template>
  86. <script>
  87. import authorize from '@/common/config/authorize.js'
  88. import tuiLoadmore from '@/components/tui-components/loadmore/loadmore'
  89. import tuiNomore from '@/components/tui-components/nomore/nomore'
  90. const defaultListQuery = {
  91. userIdentity: '',
  92. name: '',
  93. pageNum: 1,
  94. pageSize: 10,
  95. spId: 0,
  96. status: 66,
  97. type: 1,
  98. groupServiceId: 0
  99. }
  100. export default {
  101. components: {
  102. tuiLoadmore,
  103. tuiNomore
  104. },
  105. data() {
  106. return {
  107. skeletonShow:true,
  108. isShowClose: false,
  109. isEmpty: false,
  110. nomoreText: '上拉显示更多',
  111. hasNextPage: false,
  112. loadding: false,
  113. pullUpOn: true,
  114. pullFlag: true,
  115. scrollHeight: '',
  116. currPage: '', //当前页面
  117. prevPage: '', //上一个页面
  118. clubList: [],
  119. listQuery: Object.assign({}, defaultListQuery),
  120. currentIndex: 0
  121. }
  122. },
  123. onLoad() {},
  124. methods: {
  125. async initGetStotage() {
  126. // 初始化
  127. const userInfo = await this.$api.getStorage()
  128. this.listQuery.spId = userInfo.serviceProviderId ? userInfo.serviceProviderId : 0
  129. this.GetSellerClubList()
  130. setTimeout(()=>{
  131. this.skeletonShow = false
  132. },1000)
  133. },
  134. searchClubList() {
  135. // 搜索
  136. this.GetSellerClubList()
  137. },
  138. GetSellerClubList() {
  139. this.listQuery.pageNum = 1
  140. this.SellerService.GetSellerClubList(this.listQuery)
  141. .then(response => {
  142. let data = response.data
  143. if (data.list && data.list.length > 0) {
  144. this.isEmpty = false
  145. this.hasNextPage = response.data.hasNextPage
  146. this.clubList = data.list.map((el, index) => {
  147. el.bubble = false
  148. return el
  149. })
  150. this.pullFlag = false
  151. setTimeout(() => {
  152. this.pullFlag = true
  153. }, 500)
  154. if (this.hasNextPage) {
  155. this.pullUpOn = false
  156. this.nomoreText = '上拉显示更多'
  157. } else {
  158. this.pullUpOn = true
  159. this.loadding = false
  160. this.nomoreText = '已至底部'
  161. }
  162. } else {
  163. this.isEmpty = true
  164. }
  165. })
  166. .catch(error => {
  167. this.$util.msg(error.msg, 2000)
  168. })
  169. },
  170. getOnReachBottomData() {
  171. this.listQuery.pageNum += 1
  172. this.SellerService.GetSellerClubList(this.listQuery)
  173. .then(response => {
  174. let data = response.data
  175. if (data.list && data.list.length > 0) {
  176. this.hasNextPage = response.data.hasNextPage
  177. this.clubList = this.clubList.concat(data.list)
  178. this.clubList = this.clubList.map((el, index) => {
  179. el.bubble = false
  180. return el
  181. })
  182. this.pullFlag = false // 防上拉暴滑
  183. setTimeout(() => {
  184. this.pullFlag = true
  185. }, 500)
  186. if (this.hasNextPage) {
  187. this.pullUpOn = false
  188. this.nomoreText = '上拉显示更多'
  189. } else {
  190. this.pullUpOn = false
  191. this.loadding = false
  192. this.nomoreText = '已至底部'
  193. }
  194. }
  195. })
  196. .catch(error => {
  197. this.$util.msg(error.msg, 2000)
  198. })
  199. },
  200. onShowClose() {
  201. //输入框失去焦点时触发
  202. if (this.listQuery.name != '') {
  203. this.isShowClose = true
  204. } else {
  205. this.isShowClose = false
  206. }
  207. },
  208. delInputText() {
  209. //清除输入框内容
  210. this.listQuery.name = ''
  211. this.isShowClose = false
  212. },
  213. handleClickOper(type, club) {
  214. const pathMap = {
  215. 1: '/pages/seller/cart/immediately',
  216. 2: '/pages/seller/cart/second',
  217. 3: '/pages/seller/cart/buyagain',
  218. 4: '/pages/seller/order/create-recharge-order',
  219. 5: '/pages/seller/order/order-historylist?listType=0',
  220. 6: '/pages/seller/cart/coupon',
  221. }
  222. this.$api.setStorage('orderUserInfo', club)
  223. this.$api.navigateTo(pathMap[type])
  224. },
  225. handleShowBubble(club, index) {
  226. this.currentIndex = index
  227. club.bubble = !club.bubble
  228. }
  229. },
  230. onReachBottom() {
  231. if (this.hasNextPage) {
  232. this.loadding = true
  233. this.pullUpOn = true
  234. this.getOnReachBottomData()
  235. }
  236. },
  237. onShow() {
  238. this.initGetStotage()
  239. }
  240. }
  241. </script>
  242. <style lang="scss">
  243. page {
  244. height: auto;
  245. }
  246. page,
  247. .container {
  248. /* padding-bottom: 120upx; */
  249. background: #f7f7f7;
  250. }
  251. .container {
  252. position: relative;
  253. }
  254. .club-search {
  255. height: 64rpx;
  256. width: 702rpx;
  257. padding: 24rpx;
  258. background: #ffffff;
  259. display: flex;
  260. align-items: center;
  261. position: fixed;
  262. top: 0;
  263. left: 0;
  264. z-index: 999;
  265. .search-from {
  266. width: 582rpx;
  267. height: 64rpx;
  268. background: #f7f7f7;
  269. border-radius: 32rpx;
  270. float: left;
  271. position: relative;
  272. .icon-iconfonticonfontsousuo1 {
  273. width: 64rpx;
  274. height: 64rpx;
  275. line-height: 64rpx;
  276. text-align: center;
  277. display: block;
  278. font-size: $font-size-38;
  279. float: left;
  280. color: #999999;
  281. }
  282. .icon-shanchu1 {
  283. font-size: $font-size-32;
  284. color: #999999;
  285. position: absolute;
  286. width: 64rpx;
  287. height: 64rpx;
  288. line-height: 64rpx;
  289. text-align: center;
  290. top: 0;
  291. right: 0;
  292. z-index: 10;
  293. }
  294. .input {
  295. width: 500rpx;
  296. height: 64rpx;
  297. float: left;
  298. line-height: 64rpx;
  299. color: $text-color;
  300. font-size: $font-size-24;
  301. }
  302. }
  303. .search-btn {
  304. width: 120rpx;
  305. line-height: 64rpx;
  306. text-align: center;
  307. font-size: $font-size-28;
  308. color: $color-system;
  309. float: left;
  310. background: #ffffff;
  311. }
  312. }
  313. .club-main {
  314. padding-top: 122rpx;
  315. .list {
  316. align-items: center;
  317. width: 702rpx;
  318. height: auto;
  319. padding: 24rpx;
  320. background: #ffffff;
  321. position: relative;
  322. border-bottom: 1px solid #ebebeb;
  323. float: left;
  324. .club-list-top {
  325. width: 100%;
  326. height: 140rpx;
  327. float: left;
  328. display: flex;
  329. align-items: center;
  330. .list-left {
  331. height: 140rpx;
  332. flex: 2;
  333. margin-right: 10rpx;
  334. .list-head {
  335. width: 140rpx;
  336. height: 140rpx;
  337. border-radius: 14rpx;
  338. image {
  339. width: 140rpx;
  340. height: 140rpx;
  341. border-radius: 14rpx;
  342. }
  343. }
  344. }
  345. .list-item {
  346. height: 140rpx;
  347. flex: 8;
  348. display: flex;
  349. flex-direction: column;
  350. .list-title {
  351. flex: 2;
  352. line-height: 80rpx;
  353. width: 100%;
  354. font-size: $font-size-28;
  355. color: $text-color;
  356. padding-left: 11rpx;
  357. flex-direction: row;
  358. justify-content: flex-start;
  359. .list-name {
  360. min-width: 100rpx;
  361. display: block;
  362. float: left;
  363. text-align: left;
  364. -o-text-overflow: ellipsis;
  365. text-overflow: ellipsis;
  366. display: -webkit-box;
  367. word-break: break-all;
  368. -webkit-box-orient: vertical;
  369. -webkit-line-clamp: 1;
  370. overflow: hidden;
  371. }
  372. .tags {
  373. display: inline-block;
  374. height: 36rpx;
  375. padding: 0 15rpx;
  376. border-radius: 8rpx;
  377. background: #f0cb72;
  378. font-size: $font-size-22;
  379. color: #4e4539;
  380. text-align: center;
  381. line-height: 36rpx;
  382. margin-left: 10rpx;
  383. margin-right: 10rpx;
  384. &.sv {
  385. background: #333333;
  386. color: #f0cb72;
  387. }
  388. }
  389. .list-hist {
  390. display: block;
  391. float: right;
  392. color: #1890F9;
  393. font-size: $font-size-24;
  394. text-align: right;
  395. padding-right: 30rpx;
  396. .icon-dingdanxuanzhong {
  397. font-size: $font-size-34;
  398. color: #1890F9;
  399. }
  400. }
  401. }
  402. .list-opea {
  403. width: 100%;
  404. display: flex;
  405. flex: 4;
  406. color: #166ce1;
  407. flex-direction: row;
  408. align-items: center;
  409. .tags {
  410. display: inline-block;
  411. height: 36rpx;
  412. padding: 0 15rpx;
  413. border-radius: 8rpx;
  414. background: #f0cb72;
  415. font-size: $font-size-22;
  416. color: #4e4539;
  417. text-align: center;
  418. line-height: 36rpx;
  419. margin-left: 10rpx;
  420. margin-right: 10rpx;
  421. &.sv {
  422. background: #333333;
  423. color: #f0cb72;
  424. }
  425. &.sm {
  426. display: inline-block;
  427. height: 36rpx;
  428. box-sizing: border-box;
  429. padding: 0 8rpx 0 15rpx;
  430. border-radius: 8rpx;
  431. background: #faede5;
  432. font-size: $font-size-22;
  433. color: $color-system;
  434. text-align: center;
  435. line-height: 36rpx;
  436. margin-right: 10rpx;
  437. .icon-xiayibu {
  438. font-size: 20rpx;
  439. margin-left: 10rpx;
  440. }
  441. }
  442. }
  443. }
  444. }
  445. }
  446. .club-list-bot {
  447. width: 100%;
  448. height: 80rpx;
  449. float: left;
  450. background-color: #F7F7F7;
  451. border-radius: 8rpx;
  452. margin-top: 20rpx;
  453. .btn {
  454. height: 80rpx;
  455. box-sizing: border-box;
  456. line-height: 80rpx;
  457. padding: 0 28rpx;
  458. font-size: $font-size-24;
  459. color: #333333;
  460. text-align: center;
  461. float: left;
  462. position: relative;
  463. // &:nth-child(1){
  464. // &:before{
  465. // content: '';
  466. // width: 1px;
  467. // height: 20rpx;
  468. // background-color: #B2B2B2;
  469. // position: absolute;
  470. // right: 0;
  471. // top: 30rpx;
  472. // }
  473. // }
  474. &:nth-child(2) {
  475. &:before {
  476. content: '';
  477. width: 1px;
  478. height: 20rpx;
  479. background-color: #B2B2B2;
  480. position: absolute;
  481. right: 0;
  482. top: 30rpx;
  483. }
  484. }
  485. &:nth-child(3) {
  486. &:before {
  487. content: '';
  488. width: 1px;
  489. height: 20rpx;
  490. background-color: #B2B2B2;
  491. position: absolute;
  492. right: 0;
  493. top: 30rpx;
  494. }
  495. }
  496. &:last-child {
  497. padding: 0 36rpx;
  498. .iconfont {
  499. font-weight: bold;
  500. }
  501. .btn-bubble {
  502. width: 200rpx;
  503. height: 160rpx;
  504. background: rgba(51, 51, 51, 0.8);
  505. position: absolute;
  506. top: -154rpx;
  507. right: 0;
  508. border-radius: 8rpx;
  509. &:before {
  510. content: '';
  511. width: 0;
  512. height: 0;
  513. border: 15rpx solid transparent;
  514. border-top: 15rpx solid rgba(51, 51, 51, 0.8);
  515. position: absolute;
  516. bottom: -28rpx;
  517. right: 42rpx;
  518. }
  519. .btn-view {
  520. width: 100%;
  521. height: 80rpx;
  522. box-sizing: border-box;
  523. line-height: 80rpx;
  524. font-size: $font-size-24;
  525. color: #FFFFFF;
  526. text-align: center;
  527. float: left;
  528. .iconfont {
  529. font-size: 28rpx;
  530. color: #FFFFFF;
  531. margin-right: 5rpx;
  532. font-weight: normal;
  533. }
  534. &.border {
  535. border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  536. }
  537. }
  538. }
  539. }
  540. .iconfont {
  541. font-size: 30rpx;
  542. color: #333333;
  543. margin-right: 5rpx;
  544. }
  545. }
  546. }
  547. }
  548. }
  549. </style>