club-list.vue 21 KB

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