club-list.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  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">{{ club.name }}</text>
  50. <text class="list-hist" @click.stop="_goOperation(5, club)"
  51. ><text class="iconfont icon-dingdanxuanzhong"></text>订单列表</text
  52. >
  53. </view>
  54. <view class="list-opea">
  55. <text class="tags" v-if="club.vipFlag == 0 && club.userIdentity === 2">VIP</text>
  56. <text class="tags sv" v-if="club.vipFlag == 1">SVIP</text>
  57. <text
  58. class="tags sm"
  59. @click.stop="
  60. this.$api.navigateTo('/pages/service/service?id=1041&title=标签说明')
  61. "
  62. >{{ club.activeState }} <text class="iconfont icon-xiayibu"></text
  63. ></text>
  64. <text
  65. class="tags sm"
  66. @click.stop="
  67. this.$api.navigateTo('/pages/service/service?id=1041&title=标签说明')
  68. "
  69. >{{ club.customerValue }} <text class="iconfont icon-xiayibu"></text
  70. ></text>
  71. </view>
  72. </view>
  73. </view>
  74. <view class="club-list-bot">
  75. <view class="list-opea">
  76. <view class="btn org" @click.stop="_goOperation(1, club)"> <text>立即下单</text> </view>
  77. <view class="btn gre" @click.stop="_goOperation(2, club)"> <text>二手下单</text> </view>
  78. <view class="btn yel" @click.stop="_goOperation(3, club)"> <text>再次购买</text> </view>
  79. <view class="btn yeo" @click.stop="_goOperation(4, club)">
  80. <text>充值/下订金</text>
  81. </view>
  82. <view class="btn yel" @click.stop="_goOperation(6, club)">
  83. <text>购买优惠券</text>
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. <!--加载loadding-->
  89. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  90. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#ffffff'" :text="nomoreText"></tui-nomore>
  91. <!--加载loadding-->
  92. </scroll-view>
  93. </view>
  94. </view>
  95. </view>
  96. </template>
  97. <script>
  98. import authorize from '@/common/config/authorize.js'
  99. import tuiLoadmore from '@/components/tui-components/loadmore/loadmore'
  100. import tuiNomore from '@/components/tui-components/nomore/nomore'
  101. const defaultListQuery = {
  102. userIdentity: '',
  103. name: '',
  104. pageNum: 1,
  105. pageSize: 10,
  106. spId: 0,
  107. status: 66,
  108. type: 1,
  109. groupServiceId: 0
  110. }
  111. export default {
  112. components: {
  113. tuiLoadmore,
  114. tuiNomore
  115. },
  116. data() {
  117. return {
  118. isShowClose: false,
  119. isEmpty: false,
  120. nomoreText: '上拉显示更多',
  121. hasNextPage: false,
  122. loadding: false,
  123. pullUpOn: true,
  124. pullFlag: true,
  125. scrollHeight: '',
  126. currPage: '', //当前页面
  127. prevPage: '', //上一个页面
  128. clubList: [],
  129. listQuery: Object.assign({}, defaultListQuery)
  130. }
  131. },
  132. onLoad() {},
  133. methods: {
  134. async initGetStotage() {
  135. // 初始化
  136. const userInfo = await this.$api.getStorage()
  137. this.listQuery.spId = userInfo.serviceProviderId ? userInfo.serviceProviderId : 0
  138. this.GetSellerClubList()
  139. },
  140. searchClubList() {
  141. // 搜索
  142. this.GetSellerClubList()
  143. },
  144. GetSellerClubList() {
  145. this.listQuery.pageNum = 1
  146. this.SellerService.GetSellerClubList(this.listQuery)
  147. .then(response => {
  148. let data = response.data
  149. if (data.list && data.list.length > 0) {
  150. this.isEmpty = false
  151. this.hasNextPage = response.data.hasNextPage
  152. this.clubList = data.list
  153. this.pullFlag = false
  154. setTimeout(() => {
  155. this.pullFlag = true
  156. }, 500)
  157. if (this.hasNextPage) {
  158. this.pullUpOn = false
  159. this.nomoreText = '上拉显示更多'
  160. } else {
  161. this.pullUpOn = true
  162. this.loadding = false
  163. this.nomoreText = '已至底部'
  164. }
  165. } else {
  166. this.isEmpty = true
  167. }
  168. })
  169. .catch(error => {
  170. this.$util.msg(error.msg, 2000)
  171. })
  172. },
  173. getOnReachBottomData() {
  174. this.listQuery.pageNum += 1
  175. this.SellerService.GetSellerClubList(this.listQuery)
  176. .then(response => {
  177. let data = response.data
  178. if (data.list && data.list.length > 0) {
  179. this.hasNextPage = response.data.hasNextPage
  180. this.clubList = this.clubList.concat(data.list)
  181. this.pullFlag = false // 防上拉暴滑
  182. setTimeout(() => {
  183. this.pullFlag = true
  184. }, 500)
  185. if (this.hasNextPage) {
  186. this.pullUpOn = false
  187. this.nomoreText = '上拉显示更多'
  188. } else {
  189. this.pullUpOn = false
  190. this.loadding = false
  191. this.nomoreText = '已至底部'
  192. }
  193. }
  194. })
  195. .catch(error => {
  196. this.$util.msg(error.msg, 2000)
  197. })
  198. },
  199. onShowClose() {
  200. //输入框失去焦点时触发
  201. if (this.listQuery.name != '') {
  202. this.isShowClose = true
  203. } else {
  204. this.isShowClose = false
  205. }
  206. },
  207. delInputText() {
  208. //清除输入框内容
  209. this.listQuery.name = ''
  210. this.isShowClose = false
  211. },
  212. _goOperation(type, club) {
  213. const pathMap = {
  214. 1: '/pages/seller/cart/immediately',
  215. 2: '/pages/seller/cart/second',
  216. 3: '/pages/seller/cart/buyagain',
  217. 4: '/pages/seller/order/create-recharge-order',
  218. 5: '/pages/seller/order/order-historylist?listType=0',
  219. 6: '/pages/seller/cart/coupon',
  220. }
  221. this.$api.setStorage('orderUserInfo', club)
  222. this.$api.navigateTo(pathMap[type])
  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. width: 390rpx;
  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. .list-hist {
  368. display: block;
  369. float: right;
  370. color: #e19b30;
  371. font-size: $font-size-24;
  372. text-align: right;
  373. padding-right: 30rpx;
  374. .icon-dingdanxuanzhong {
  375. font-size: $font-size-34;
  376. color: #e19b30;
  377. }
  378. }
  379. }
  380. .list-opea {
  381. width: 100%;
  382. display: flex;
  383. flex: 4;
  384. color: #166ce1;
  385. flex-direction: row;
  386. align-items: center;
  387. .tags {
  388. display: inline-block;
  389. height: 36rpx;
  390. padding: 0 15rpx;
  391. border-radius: 8rpx;
  392. background: #f0cb72;
  393. font-size: $font-size-22;
  394. color: #4e4539;
  395. text-align: center;
  396. line-height: 36rpx;
  397. margin-left: 10rpx;
  398. margin-right: 10rpx;
  399. &.sv {
  400. background: #333333;
  401. color: #f0cb72;
  402. }
  403. &.sm {
  404. display: inline-block;
  405. height: 36rpx;
  406. box-sizing: border-box;
  407. padding: 0 8rpx 0 15rpx;
  408. border-radius: 8rpx;
  409. background: #faede5;
  410. font-size: $font-size-22;
  411. color: $color-system;
  412. text-align: center;
  413. line-height: 36rpx;
  414. margin-right: 10rpx;
  415. .icon-xiayibu {
  416. font-size: 20rpx;
  417. margin-left: 10rpx;
  418. }
  419. }
  420. }
  421. }
  422. }
  423. }
  424. .club-list-bot {
  425. width: 100%;
  426. height: auto;
  427. float: left;
  428. margin-top: 20rpx;
  429. .list-opea {
  430. width: 100%;
  431. flex: 1;
  432. color: #166ce1;
  433. flex-direction: row;
  434. align-items: center;
  435. .btn {
  436. width: 160rpx;
  437. height: 60rpx;
  438. line-height: 60rpx;
  439. border-radius: 30rpx;
  440. font-size: $font-size-24;
  441. color: $text-color;
  442. text-align: center;
  443. margin: 7rpx;
  444. float: left;
  445. &.org {
  446. background: rgba(22, 225, 77, 0.1);
  447. color: #16e14d;
  448. }
  449. &.gre {
  450. background: rgba(22, 123, 225, 0.1);
  451. color: #167be1;
  452. }
  453. &.yel {
  454. background: rgba(225, 86, 22, 0.1);
  455. color: #e15616;
  456. }
  457. &.yeo {
  458. background: #fff5cf;
  459. color: #ffaa01;
  460. }
  461. }
  462. }
  463. }
  464. }
  465. }
  466. </style>