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="searchInputVal"
  11. @input="onShowClose"
  12. @confirm="initclubList()"
  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)"> <text>购买优惠券</text> </view>
  69. </view>
  70. </view>
  71. </view>
  72. <!--加载loadding-->
  73. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  74. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#ffffff'" :text="nomoreText"></tui-nomore>
  75. <!--加载loadding-->
  76. </scroll-view>
  77. </view>
  78. </view>
  79. </view>
  80. </template>
  81. <script>
  82. import authorize from '@/common/config/authorize.js'
  83. import tuiLoadmore from '@/components/tui-components/loadmore/loadmore'
  84. import tuiNomore from '@/components/tui-components/nomore/nomore'
  85. export default {
  86. components: {
  87. tuiLoadmore,
  88. tuiNomore
  89. },
  90. data() {
  91. return {
  92. serviceProviderId: '',
  93. isShowClose: false,
  94. searchInputVal: '',
  95. isEmpty: false,
  96. nomoreText: '上拉显示更多',
  97. status: 66,
  98. pageNum: 1,
  99. pageSize: 10,
  100. hasNextPage: false,
  101. loadding: false,
  102. pullUpOn: true,
  103. pullFlag: true,
  104. scrollHeight: '',
  105. currPage: '', //当前页面
  106. prevPage: '', //上一个页面
  107. clubList: []
  108. }
  109. },
  110. onLoad() {
  111. this.setScrollHeight()
  112. },
  113. methods: {
  114. setScrollHeight() {
  115. // 窗口高度 - 底部距离
  116. setTimeout(() => {
  117. const query = wx.createSelectorQuery().in(this)
  118. query.selectAll('.add-btn').boundingClientRect()
  119. query.exec(res => {
  120. if (res[0][0]) {
  121. let winHeight = this.$api.getWindowHeight(),
  122. eleTop = res[0][0].top - 1
  123. this.scrollHeight = eleTop
  124. }
  125. })
  126. }, 500)
  127. },
  128. searchClubList() {
  129. this.pageNum = 1
  130. this.initclubList()
  131. },
  132. initclubList() {
  133. let params = {
  134. userIdentity: '',
  135. name: this.searchInputVal,
  136. pageNum: 1,
  137. pageSize: this.pageSize,
  138. spId: this.serviceProviderId,
  139. status: this.status
  140. }
  141. this.SellerService.GetSellerClubList(params)
  142. .then(response => {
  143. let data = response.data
  144. if (data.list && data.list.length > 0) {
  145. this.isEmpty = false
  146. this.hasNextPage = response.data.hasNextPage
  147. this.clubList = data.list
  148. this.pullFlag = false
  149. setTimeout(() => {
  150. this.pullFlag = true
  151. }, 500)
  152. if (this.hasNextPage) {
  153. this.pullUpOn = false
  154. this.nomoreText = '上拉显示更多'
  155. } else {
  156. this.pullUpOn = true
  157. this.loadding = false
  158. this.nomoreText = '已至底部'
  159. }
  160. } else {
  161. this.isEmpty = true
  162. }
  163. })
  164. .catch(error => {
  165. this.$util.msg(error.msg, 2000)
  166. })
  167. },
  168. getOnReachBottomData() {
  169. this.pageNum += 1
  170. let params = {
  171. userIdentity: '',
  172. name: this.searchInputVal,
  173. pageNum: this.pageNum,
  174. pageSize: this.pageSize,
  175. spId: this.serviceProviderId,
  176. status: this.status
  177. }
  178. this.SellerService.GetSellerClubList(params)
  179. .then(response => {
  180. let data = response.data
  181. if (data.list && data.list.length > 0) {
  182. this.hasNextPage = response.data.hasNextPage
  183. this.clubList = this.clubList.concat(data.list)
  184. this.pullFlag = false // 防上拉暴滑
  185. setTimeout(() => {
  186. this.pullFlag = true
  187. }, 500)
  188. if (this.hasNextPage) {
  189. this.pullUpOn = false
  190. this.nomoreText = '上拉显示更多'
  191. } else {
  192. this.pullUpOn = false
  193. this.loadding = false
  194. this.nomoreText = '已至底部'
  195. }
  196. }
  197. })
  198. .catch(error => {
  199. this.$util.msg(error.msg, 2000)
  200. })
  201. },
  202. onShowClose() {
  203. //输入框失去焦点时触发
  204. if (this.searchInputVal != '') {
  205. this.isShowClose = true
  206. } else {
  207. this.isShowClose = false
  208. }
  209. },
  210. delInputText() {
  211. //清除输入框内容
  212. this.searchInputVal = ''
  213. this.isShowClose = false
  214. },
  215. _goOperation(type,club){
  216. this.$api.setStorage('orderUserInfo', club)
  217. switch(type){
  218. case 1:
  219. this.$api.navigateTo('/pages/seller/cart/immediately')
  220. break
  221. case 2:
  222. this.$api.navigateTo('/pages/seller/cart/second')
  223. break
  224. case 3:
  225. this.$api.navigateTo('/pages/seller/cart/buyagain')
  226. break
  227. case 4:
  228. this.$api.navigateTo('/pages/seller/order/create-recharge-order')
  229. break
  230. case 5:
  231. this.$api.navigateTo('/pages/seller/order/order-historylist?listType=0')
  232. break
  233. case 6:
  234. this.$api.navigateTo('/pages/seller/cart/coupon')
  235. break
  236. }
  237. }
  238. },
  239. onReachBottom() {
  240. if (this.hasNextPage) {
  241. this.loadding = true
  242. this.pullUpOn = true
  243. this.getOnReachBottomData()
  244. }
  245. },
  246. onShow() {
  247. this.$api.getStorage().then(response => {
  248. this.serviceProviderId = response.serviceProviderId
  249. this.pageNum = 1
  250. this.initclubList()
  251. })
  252. }
  253. }
  254. </script>
  255. <style lang="scss">
  256. page {
  257. height: auto;
  258. }
  259. page,
  260. .container {
  261. /* padding-bottom: 120upx; */
  262. background: #f7f7f7;
  263. }
  264. .container {
  265. position: relative;
  266. }
  267. .club-search {
  268. height: 64rpx;
  269. width: 702rpx;
  270. padding: 24rpx;
  271. background: #ffffff;
  272. display: flex;
  273. align-items: center;
  274. position: fixed;
  275. top: 0;
  276. left: 0;
  277. z-index: 999;
  278. .search-from {
  279. width: 582rpx;
  280. height: 64rpx;
  281. background: #f7f7f7;
  282. border-radius: 32rpx;
  283. float: left;
  284. position: relative;
  285. .icon-iconfonticonfontsousuo1 {
  286. width: 64rpx;
  287. height: 64rpx;
  288. line-height: 64rpx;
  289. text-align: center;
  290. display: block;
  291. font-size: $font-size-38;
  292. float: left;
  293. color: #999999;
  294. }
  295. .icon-shanchu1 {
  296. font-size: $font-size-32;
  297. color: #999999;
  298. position: absolute;
  299. width: 64rpx;
  300. height: 64rpx;
  301. line-height: 64rpx;
  302. text-align: center;
  303. top: 0;
  304. right: 0;
  305. z-index: 10;
  306. }
  307. .input {
  308. width: 500rpx;
  309. height: 64rpx;
  310. float: left;
  311. line-height: 64rpx;
  312. color: $text-color;
  313. font-size: $font-size-24;
  314. }
  315. }
  316. .search-btn {
  317. width: 120rpx;
  318. line-height: 64rpx;
  319. text-align: center;
  320. font-size: $font-size-28;
  321. color: $color-system;
  322. float: left;
  323. background: #ffffff;
  324. }
  325. }
  326. .club-main {
  327. padding-top: 122rpx;
  328. .list {
  329. align-items: center;
  330. width: 702rpx;
  331. height: auto;
  332. padding: 24rpx;
  333. background: #ffffff;
  334. position: relative;
  335. border-bottom: 1px solid #ebebeb;
  336. float: left;
  337. .club-list-top {
  338. width: 100%;
  339. height: 140rpx;
  340. float: left;
  341. display: flex;
  342. align-items: center;
  343. .list-left {
  344. height: 140rpx;
  345. flex: 2;
  346. margin-right: 10rpx;
  347. .list-head {
  348. width: 140rpx;
  349. height: 140rpx;
  350. border-radius: 14rpx;
  351. image {
  352. width: 140rpx;
  353. height: 140rpx;
  354. border-radius: 14rpx;
  355. }
  356. }
  357. }
  358. .list-item {
  359. height: 140rpx;
  360. flex: 8;
  361. display: flex;
  362. flex-direction: column;
  363. .list-title {
  364. flex: 2;
  365. line-height: 80rpx;
  366. width: 100%;
  367. font-size: $font-size-28;
  368. color: $text-color;
  369. padding-left: 11rpx;
  370. flex-direction: row;
  371. justify-content: flex-start;
  372. .list-name {
  373. width: 390rpx;
  374. display: block;
  375. float: left;
  376. text-align: left;
  377. -o-text-overflow: ellipsis;
  378. text-overflow: ellipsis;
  379. display: -webkit-box;
  380. word-break: break-all;
  381. -webkit-box-orient: vertical;
  382. -webkit-line-clamp: 1;
  383. overflow: hidden;
  384. }
  385. .list-hist {
  386. display: block;
  387. float: right;
  388. color: #e19b30;
  389. font-size: $font-size-24;
  390. text-align: right;
  391. padding-right: 30rpx;
  392. .icon-dingdanxuanzhong {
  393. font-size: $font-size-34;
  394. color: #e19b30;
  395. }
  396. }
  397. }
  398. .list-opea {
  399. width: 100%;
  400. display: flex;
  401. flex: 4;
  402. color: #166ce1;
  403. flex-direction: row;
  404. align-items: center;
  405. .tags {
  406. display: inline-block;
  407. width: 60rpx;
  408. height: 32rpx;
  409. border-radius: 8rpx;
  410. background: #f0cb72;
  411. font-size: $font-size-22;
  412. color: #4e4539;
  413. text-align: center;
  414. line-height: 32rpx;
  415. margin-left: 10rpx;
  416. &.sv {
  417. background: #333333;
  418. color: #f0cb72;
  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>