club-list.vue 23 KB

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