club-list.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  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. </view>
  58. </view>
  59. </view>
  60. <view class="club-list-bot">
  61. <view class="list-opea">
  62. <view class="btn org" @click.stop="_goOperation(1, club)"> <text>立即下单</text> </view>
  63. <view class="btn gre" @click.stop="_goOperation(2, club)"> <text>二手下单</text> </view>
  64. <view class="btn yel" @click.stop="_goOperation(3, club)"> <text>再次购买</text> </view>
  65. <view class="btn yeo" @click.stop="_goOperation(4, club)">
  66. <text>充值/下订金</text>
  67. </view>
  68. <view class="btn yel" @click.stop="_goOperation(6, club)">
  69. <text>购买优惠券</text>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. <!--加载loadding-->
  75. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  76. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#ffffff'" :text="nomoreText"></tui-nomore>
  77. <!--加载loadding-->
  78. </scroll-view>
  79. </view>
  80. </view>
  81. </view>
  82. </template>
  83. <script>
  84. import authorize from '@/common/config/authorize.js'
  85. import tuiLoadmore from '@/components/tui-components/loadmore/loadmore'
  86. import tuiNomore from '@/components/tui-components/nomore/nomore'
  87. const defaultListQuery = {
  88. userIdentity: '',
  89. name: '',
  90. pageNum: 1,
  91. pageSize: 10,
  92. spId: 0,
  93. status: 66,
  94. type: 1,
  95. groupServiceId: 0
  96. }
  97. export default {
  98. components: {
  99. tuiLoadmore,
  100. tuiNomore
  101. },
  102. data() {
  103. return {
  104. isShowClose: false,
  105. isEmpty: false,
  106. nomoreText: '上拉显示更多',
  107. hasNextPage: false,
  108. loadding: false,
  109. pullUpOn: true,
  110. pullFlag: true,
  111. scrollHeight: '',
  112. currPage: '', //当前页面
  113. prevPage: '', //上一个页面
  114. clubList: [],
  115. listQuery: Object.assign({}, defaultListQuery)
  116. }
  117. },
  118. onLoad() {},
  119. methods: {
  120. async initGetStotage() {
  121. // 初始化
  122. const userInfo = await this.$api.getStorage()
  123. this.listQuery.spId = userInfo.serviceProviderId ? userInfo.serviceProviderId : 0
  124. this.GetSellerClubList()
  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
  139. this.pullFlag = false
  140. setTimeout(() => {
  141. this.pullFlag = true
  142. }, 500)
  143. if (this.hasNextPage) {
  144. this.pullUpOn = false
  145. this.nomoreText = '上拉显示更多'
  146. } else {
  147. this.pullUpOn = true
  148. this.loadding = false
  149. this.nomoreText = '已至底部'
  150. }
  151. } else {
  152. this.isEmpty = true
  153. }
  154. })
  155. .catch(error => {
  156. this.$util.msg(error.msg, 2000)
  157. })
  158. },
  159. getOnReachBottomData() {
  160. this.listQuery.pageNum += 1
  161. this.SellerService.GetSellerClubList(this.listQuery)
  162. .then(response => {
  163. let data = response.data
  164. if (data.list && data.list.length > 0) {
  165. this.hasNextPage = response.data.hasNextPage
  166. this.clubList = this.clubList.concat(data.list)
  167. this.pullFlag = false // 防上拉暴滑
  168. setTimeout(() => {
  169. this.pullFlag = true
  170. }, 500)
  171. if (this.hasNextPage) {
  172. this.pullUpOn = false
  173. this.nomoreText = '上拉显示更多'
  174. } else {
  175. this.pullUpOn = false
  176. this.loadding = false
  177. this.nomoreText = '已至底部'
  178. }
  179. }
  180. })
  181. .catch(error => {
  182. this.$util.msg(error.msg, 2000)
  183. })
  184. },
  185. onShowClose() {
  186. //输入框失去焦点时触发
  187. if (this.listQuery.name != '') {
  188. this.isShowClose = true
  189. } else {
  190. this.isShowClose = false
  191. }
  192. },
  193. delInputText() {
  194. //清除输入框内容
  195. this.listQuery.name = ''
  196. this.isShowClose = false
  197. },
  198. _goOperation(type, club) {
  199. this.$api.setStorage('orderUserInfo', club)
  200. switch (type) {
  201. case 1:
  202. this.$api.navigateTo('/pages/seller/cart/immediately')
  203. break
  204. case 2:
  205. this.$api.navigateTo('/pages/seller/cart/second')
  206. break
  207. case 3:
  208. this.$api.navigateTo('/pages/seller/cart/buyagain')
  209. break
  210. case 4:
  211. this.$api.navigateTo('/pages/seller/order/create-recharge-order')
  212. break
  213. case 5:
  214. this.$api.navigateTo('/pages/seller/order/order-historylist?listType=0')
  215. break
  216. case 6:
  217. this.$api.navigateTo('/pages/seller/cart/coupon')
  218. break
  219. }
  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: 64rpx;
  248. width: 702rpx;
  249. padding: 24rpx;
  250. background: #ffffff;
  251. display: flex;
  252. align-items: center;
  253. position: fixed;
  254. top: 0;
  255. left: 0;
  256. z-index: 999;
  257. .search-from {
  258. width: 582rpx;
  259. height: 64rpx;
  260. background: #f7f7f7;
  261. border-radius: 32rpx;
  262. float: left;
  263. position: relative;
  264. .icon-iconfonticonfontsousuo1 {
  265. width: 64rpx;
  266. height: 64rpx;
  267. line-height: 64rpx;
  268. text-align: center;
  269. display: block;
  270. font-size: $font-size-38;
  271. float: left;
  272. color: #999999;
  273. }
  274. .icon-shanchu1 {
  275. font-size: $font-size-32;
  276. color: #999999;
  277. position: absolute;
  278. width: 64rpx;
  279. height: 64rpx;
  280. line-height: 64rpx;
  281. text-align: center;
  282. top: 0;
  283. right: 0;
  284. z-index: 10;
  285. }
  286. .input {
  287. width: 500rpx;
  288. height: 64rpx;
  289. float: left;
  290. line-height: 64rpx;
  291. color: $text-color;
  292. font-size: $font-size-24;
  293. }
  294. }
  295. .search-btn {
  296. width: 120rpx;
  297. line-height: 64rpx;
  298. text-align: center;
  299. font-size: $font-size-28;
  300. color: $color-system;
  301. float: left;
  302. background: #ffffff;
  303. }
  304. }
  305. .club-main {
  306. padding-top: 122rpx;
  307. .list {
  308. align-items: center;
  309. width: 702rpx;
  310. height: auto;
  311. padding: 24rpx;
  312. background: #ffffff;
  313. position: relative;
  314. border-bottom: 1px solid #ebebeb;
  315. float: left;
  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: 14rpx;
  330. image {
  331. width: 140rpx;
  332. height: 140rpx;
  333. border-radius: 14rpx;
  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. width: 390rpx;
  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. .list-hist {
  365. display: block;
  366. float: right;
  367. color: #e19b30;
  368. font-size: $font-size-24;
  369. text-align: right;
  370. padding-right: 30rpx;
  371. .icon-dingdanxuanzhong {
  372. font-size: $font-size-34;
  373. color: #e19b30;
  374. }
  375. }
  376. }
  377. .list-opea {
  378. width: 100%;
  379. display: flex;
  380. flex: 4;
  381. color: #166ce1;
  382. flex-direction: row;
  383. align-items: center;
  384. .tags {
  385. display: inline-block;
  386. width: 60rpx;
  387. height: 32rpx;
  388. border-radius: 8rpx;
  389. background: #f0cb72;
  390. font-size: $font-size-22;
  391. color: #4e4539;
  392. text-align: center;
  393. line-height: 32rpx;
  394. margin-left: 10rpx;
  395. &.sv {
  396. background: #333333;
  397. color: #f0cb72;
  398. }
  399. }
  400. }
  401. }
  402. }
  403. .club-list-bot {
  404. width: 100%;
  405. height: auto;
  406. float: left;
  407. margin-top: 20rpx;
  408. .list-opea {
  409. width: 100%;
  410. flex: 1;
  411. color: #166ce1;
  412. flex-direction: row;
  413. align-items: center;
  414. .btn {
  415. width: 160rpx;
  416. height: 60rpx;
  417. line-height: 60rpx;
  418. border-radius: 30rpx;
  419. font-size: $font-size-24;
  420. color: $text-color;
  421. text-align: center;
  422. margin: 7rpx;
  423. float: left;
  424. &.org {
  425. background: rgba(22, 225, 77, 0.1);
  426. color: #16e14d;
  427. }
  428. &.gre {
  429. background: rgba(22, 123, 225, 0.1);
  430. color: #167be1;
  431. }
  432. &.yel {
  433. background: rgba(225, 86, 22, 0.1);
  434. color: #e15616;
  435. }
  436. &.yeo {
  437. background: #fff5cf;
  438. color: #ffaa01;
  439. }
  440. }
  441. }
  442. }
  443. }
  444. }
  445. </style>