club-list.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  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="_goHistory(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="_goImmediately(club)"> <text>立即下单</text> </view>
  63. <view class="btn gre" @click.stop="_goSecond(club)"> <text>二手下单</text> </view>
  64. <view class="btn yel" @click.stop="_goBuyagain(club)"> <text>再次购买</text> </view>
  65. <view class="btn yeo" @click.stop="_goRechargeOrder(club)">
  66. <text>充值/下订金</text>
  67. </view>
  68. <view class="btn yel" @click.stop="_goBuyagain(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. _goImmediately(item) {
  216. this.$api.setStorage('orderUserInfo', item)
  217. this.$api.navigateTo('/pages/seller/cart/immediately')
  218. },
  219. _goBuyagain(item) {
  220. this.$api.setStorage('orderUserInfo', item)
  221. this.$api.navigateTo('/pages/seller/cart/buyagain')
  222. },
  223. _goRechargeOrder(item) {
  224. this.$api.setStorage('orderUserInfo', item)
  225. this.$api.navigateTo('/pages/seller/order/create-recharge-order')
  226. },
  227. _goSecond(item) {
  228. this.$api.setStorage('orderUserInfo', item)
  229. this.$api.navigateTo('/pages/seller/cart/second')
  230. },
  231. _goHistory(item) {
  232. this.$api.setStorage('orderUserInfo', item)
  233. this.$api.navigateTo(`/pages/seller/order/order-historylist?clubID=${item.clubID}&listType=0`)
  234. }
  235. },
  236. onReachBottom() {
  237. if (this.hasNextPage) {
  238. this.loadding = true
  239. this.pullUpOn = true
  240. this.getOnReachBottomData()
  241. }
  242. },
  243. onShow() {
  244. this.$api.getStorage().then(response => {
  245. this.serviceProviderId = response.serviceProviderId
  246. this.pageNum = 1
  247. this.initclubList()
  248. })
  249. }
  250. }
  251. </script>
  252. <style lang="scss">
  253. page {
  254. height: auto;
  255. }
  256. page,
  257. .container {
  258. /* padding-bottom: 120upx; */
  259. background: #f7f7f7;
  260. }
  261. .container {
  262. position: relative;
  263. }
  264. .club-search {
  265. height: 64rpx;
  266. width: 702rpx;
  267. padding: 24rpx;
  268. background: #ffffff;
  269. display: flex;
  270. align-items: center;
  271. position: fixed;
  272. top: 0;
  273. left: 0;
  274. z-index: 999;
  275. .search-from {
  276. width: 582rpx;
  277. height: 64rpx;
  278. background: #f7f7f7;
  279. border-radius: 32rpx;
  280. float: left;
  281. position: relative;
  282. .icon-iconfonticonfontsousuo1 {
  283. width: 64rpx;
  284. height: 64rpx;
  285. line-height: 64rpx;
  286. text-align: center;
  287. display: block;
  288. font-size: $font-size-38;
  289. float: left;
  290. color: #999999;
  291. }
  292. .icon-shanchu1 {
  293. font-size: $font-size-32;
  294. color: #999999;
  295. position: absolute;
  296. width: 64rpx;
  297. height: 64rpx;
  298. line-height: 64rpx;
  299. text-align: center;
  300. top: 0;
  301. right: 0;
  302. z-index: 10;
  303. }
  304. .input {
  305. width: 500rpx;
  306. height: 64rpx;
  307. float: left;
  308. line-height: 64rpx;
  309. color: $text-color;
  310. font-size: $font-size-24;
  311. }
  312. }
  313. .search-btn {
  314. width: 120rpx;
  315. line-height: 64rpx;
  316. text-align: center;
  317. font-size: $font-size-28;
  318. color: $color-system;
  319. float: left;
  320. background: #ffffff;
  321. }
  322. }
  323. .club-main {
  324. padding-top: 122rpx;
  325. .list {
  326. align-items: center;
  327. width: 702rpx;
  328. height: auto;
  329. padding: 24rpx;
  330. background: #ffffff;
  331. position: relative;
  332. border-bottom: 1px solid #ebebeb;
  333. float: left;
  334. .club-list-top {
  335. width: 100%;
  336. height: 140rpx;
  337. float: left;
  338. display: flex;
  339. align-items: center;
  340. .list-left {
  341. height: 140rpx;
  342. flex: 2;
  343. margin-right: 10rpx;
  344. .list-head {
  345. width: 140rpx;
  346. height: 140rpx;
  347. border-radius: 14rpx;
  348. image {
  349. width: 140rpx;
  350. height: 140rpx;
  351. border-radius: 14rpx;
  352. }
  353. }
  354. }
  355. .list-item {
  356. height: 140rpx;
  357. flex: 8;
  358. display: flex;
  359. flex-direction: column;
  360. .list-title {
  361. flex: 2;
  362. line-height: 80rpx;
  363. width: 100%;
  364. font-size: $font-size-28;
  365. color: $text-color;
  366. padding-left: 11rpx;
  367. flex-direction: row;
  368. justify-content: flex-start;
  369. .list-name {
  370. width: 390rpx;
  371. display: block;
  372. float: left;
  373. text-align: left;
  374. -o-text-overflow: ellipsis;
  375. text-overflow: ellipsis;
  376. display: -webkit-box;
  377. word-break: break-all;
  378. -webkit-box-orient: vertical;
  379. -webkit-line-clamp: 1;
  380. overflow: hidden;
  381. }
  382. .list-hist {
  383. display: block;
  384. float: right;
  385. color: #e19b30;
  386. font-size: $font-size-24;
  387. text-align: right;
  388. padding-right: 30rpx;
  389. .icon-dingdanxuanzhong {
  390. font-size: $font-size-34;
  391. color: #e19b30;
  392. }
  393. }
  394. }
  395. .list-opea {
  396. width: 100%;
  397. display: flex;
  398. flex: 4;
  399. color: #166ce1;
  400. flex-direction: row;
  401. align-items: center;
  402. .tags {
  403. display: inline-block;
  404. width: 60rpx;
  405. height: 32rpx;
  406. border-radius: 8rpx;
  407. background: #f0cb72;
  408. font-size: $font-size-22;
  409. color: #4e4539;
  410. text-align: center;
  411. line-height: 32rpx;
  412. margin-left: 10rpx;
  413. &.sv {
  414. background: #333333;
  415. color: #f0cb72;
  416. }
  417. }
  418. }
  419. }
  420. }
  421. .club-list-bot {
  422. width: 100%;
  423. height: auto;
  424. float: left;
  425. margin-top: 20rpx;
  426. .list-opea {
  427. width: 100%;
  428. flex: 1;
  429. color: #166ce1;
  430. flex-direction: row;
  431. align-items: center;
  432. .btn {
  433. width: 160rpx;
  434. height: 60rpx;
  435. line-height: 60rpx;
  436. border-radius: 30rpx;
  437. font-size: $font-size-24;
  438. color: $text-color;
  439. text-align: center;
  440. margin: 7rpx;
  441. float: left;
  442. &.org {
  443. background: rgba(22, 225, 77, 0.1);
  444. color: #16e14d;
  445. }
  446. &.gre {
  447. background: rgba(22, 123, 225, 0.1);
  448. color: #167be1;
  449. }
  450. &.yel {
  451. background: rgba(225, 86, 22, 0.1);
  452. color: #e15616;
  453. }
  454. &.yeo {
  455. background: #fff5cf;
  456. color: #ffaa01;
  457. }
  458. }
  459. }
  460. }
  461. }
  462. }
  463. </style>