club-list.vue 24 KB

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