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