club-list.vue 14 KB

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