club-list.vue 11 KB

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