club-list.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  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 class="input"
  7. type="text"
  8. confirm-type="search"
  9. v-model="searchInputVal"
  10. @input="onShowClose"
  11. @confirm="initclubList()"
  12. placeholder="机构名称/联系人"
  13. maxlength="12"/>
  14. <text class="iconfont icon-shanchu1" v-if="isShowClose" @click="delInputText()"></text>
  15. </view>
  16. <view class="search-btn">
  17. <button class="search-btn" type="default" @click.stop="searchClubList">搜索</button>
  18. </view>
  19. </view>
  20. <view class="club-main">
  21. <view v-if="isEmpty" class="empty-container">
  22. <image class="club-empty-image" src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AY2ZjAABpmnBICH4247.png" mode="aspectFit"></image>
  23. <view class="txt">暂无机构数据</view>
  24. </view>
  25. <view v-else class="club-list">
  26. <scroll-view scroll-y="true" >
  27. <view class="list" v-for="(item, index) in clubList" :key="index">
  28. <view class="club-list-top">
  29. <view class="list-left">
  30. <view class="list-head"><image :src="item.headpic ? item.headpic : 'https://static.caimei365.com/app/img/icon/icon-club@3x.png'" mode=""></image></view>
  31. </view>
  32. <view class="list-item">
  33. <view class="list-title">
  34. <text class="list-name">{{item.name}}</text>
  35. <text class="list-hist" @click.stop="_goHistory(item)"><text class="iconfont icon-dingdanxuanzhong"></text>订单列表</text>
  36. </view>
  37. <view class="list-opea">
  38. </view>
  39. </view>
  40. </view>
  41. <view class="club-list-bot">
  42. <view class="list-opea">
  43. <view class="btn org" @click.stop="_goImmediately(item)">
  44. <text>立即下单</text>
  45. </view>
  46. <view class="btn gre" @click.stop="_goSecond(item)">
  47. <text>二手下单</text>
  48. </view>
  49. <view class="btn yel" @click.stop="_goBuyagain(item)">
  50. <text>再次购买</text>
  51. </view>
  52. <view class="btn yeo" @click.stop="_goRechargeOrder(item)">
  53. <text>充值/下订金</text>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. <!--加载loadding-->
  59. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  60. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#ffffff'" :text='nomoreText'></tui-nomore>
  61. <!--加载loadding-->
  62. </scroll-view>
  63. </view>
  64. </view>
  65. </view>
  66. </template>
  67. <script>
  68. import authorize from '@/common/config/authorize.js'
  69. import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
  70. import tuiNomore from "@/components/tui-components/nomore/nomore"
  71. export default {
  72. components:{
  73. tuiLoadmore,
  74. tuiNomore,
  75. },
  76. data() {
  77. return {
  78. serviceProviderId:'',
  79. isShowClose:false,
  80. searchInputVal:'',
  81. isEmpty:false,
  82. nomoreText: '上拉显示更多',
  83. status:66,
  84. pageNum:1,
  85. pageSize:10,
  86. hasNextPage:false,
  87. loadding: false,
  88. pullUpOn: true,
  89. pullFlag: true,
  90. scrollHeight:'',
  91. currPage:'',//当前页面
  92. prevPage:'',//上一个页面
  93. clubList:[],
  94. }
  95. },
  96. onLoad(){
  97. this.setScrollHeight();
  98. },
  99. methods: {
  100. setScrollHeight() {
  101. // 窗口高度 - 底部距离
  102. setTimeout(()=> {
  103. const query = wx.createSelectorQuery().in(this);
  104. query.selectAll('.add-btn').boundingClientRect();
  105. query.exec(res => {
  106. if(res[0][0]){
  107. let winHeight = this.$api.getWindowHeight(),
  108. eleTop = res[0][0].top - 1;
  109. this.scrollHeight = eleTop;
  110. }
  111. })
  112. }, 500)
  113. },
  114. searchClubList(){
  115. this.pageNum=1
  116. this.initclubList()
  117. },
  118. initclubList(){
  119. let params = {userIdentity:'',name:this.searchInputVal,pageNum:1,pageSize:this.pageSize,spId:this.serviceProviderId,status:this.status}
  120. this.SellerService.GetSellerClubList(params).then(response =>{
  121. let responseData = response.data
  122. if(responseData.results&&responseData.results.length > 0){
  123. this.isEmpty = false
  124. this.hasNextPage = response.data.hasNextPage
  125. this.clubList =responseData.results
  126. this.pullFlag = false;
  127. setTimeout(()=>{this.pullFlag = true;},500)
  128. if(this.hasNextPage){
  129. this.pullUpOn = false
  130. this.nomoreText = '上拉显示更多'
  131. }else{
  132. this.pullUpOn = true
  133. this.loadding = false
  134. this.nomoreText = '已至底部'
  135. }
  136. }else{
  137. this.isEmpty = true
  138. }
  139. }).catch(error =>{
  140. this.$util.msg(error.msg,2000)
  141. })
  142. },
  143. getOnReachBottomData(){
  144. this.pageNum+=1
  145. let params = {userIdentity:'',name:this.searchInputVal,pageNum:this.pageNum,pageSize:this.pageSize,spId:this.serviceProviderId,status:this.status}
  146. this.SellerService.GetSellerClubList(params).then(response =>{
  147. let responseData = response.data
  148. if(responseData.results&&responseData.results.length > 0){
  149. this.hasNextPage = response.data.hasNextPage
  150. this.clubList = this.clubList.concat(responseData.results)
  151. this.pullFlag = false;// 防上拉暴滑
  152. setTimeout(()=>{this.pullFlag = true;},500)
  153. if(this.hasNextPage){
  154. this.pullUpOn = false
  155. this.nomoreText = '上拉显示更多'
  156. }else{
  157. this.pullUpOn = false
  158. this.loadding = false
  159. this.nomoreText = '已至底部'
  160. }
  161. }
  162. }).catch(error =>{
  163. this.$util.msg(error.msg,2000)
  164. })
  165. },
  166. onShowClose () {//输入框失去焦点时触发
  167. if(this.searchInputVal != ''){
  168. this.isShowClose = true
  169. }else{
  170. this.isShowClose = false
  171. }
  172. },
  173. delInputText(){//清除输入框内容
  174. this.searchInputVal = ''
  175. this.isShowClose = false
  176. },
  177. _goImmediately(item){
  178. this.$api.setStorage('orderUserInfo',item)
  179. this.$api.navigateTo('/pages/seller/cart/immediately')
  180. },
  181. _goBuyagain(item ){
  182. this.$api.setStorage('orderUserInfo',item)
  183. this.$api.navigateTo('/pages/seller/cart/buyagain')
  184. },
  185. _goRechargeOrder(item){
  186. this.$api.setStorage('orderUserInfo',item)
  187. this.$api.navigateTo('/pages/seller/order/create-recharge-order')
  188. },
  189. _goSecond(item ){
  190. this.$api.setStorage('orderUserInfo',item)
  191. this.$api.navigateTo('/pages/seller/cart/second')
  192. },
  193. _goHistory(item){
  194. this.$api.setStorage('orderUserInfo',item)
  195. this.$api.navigateTo(`/pages/seller/order/order-historylist?clubID=${item.clubID}&listType=0`)
  196. }
  197. },
  198. onReachBottom() {
  199. if(this.hasNextPage){
  200. this.loadding = true
  201. this.pullUpOn = true
  202. this.getOnReachBottomData()
  203. }
  204. },
  205. onShow() {
  206. this.$api.getStorage().then(response =>{
  207. this.serviceProviderId = response.serviceProviderId
  208. this.pageNum = 1;
  209. this.initclubList();
  210. })
  211. }
  212. }
  213. </script>
  214. <style lang='scss'>
  215. page {
  216. height: auto;
  217. }
  218. page,.container{
  219. /* padding-bottom: 120upx; */
  220. background: #F7F7F7;
  221. }
  222. .container{
  223. position: relative;
  224. }
  225. .club-search{
  226. height: 64rpx;
  227. width: 702rpx;
  228. padding: 24rpx;
  229. background: #FFFFFF;
  230. display: flex;
  231. align-items: center;
  232. position: fixed;
  233. top: 0;
  234. left: 0;
  235. z-index: 999;
  236. .search-from{
  237. width: 582rpx;
  238. height: 64rpx;
  239. background: #F7F7F7;
  240. border-radius: 32rpx;
  241. float: left;
  242. position: relative;
  243. .icon-iconfonticonfontsousuo1{
  244. width: 64rpx;
  245. height: 64rpx;
  246. line-height: 64rpx;
  247. text-align: center;
  248. display: block;
  249. font-size: $font-size-38;
  250. float: left;
  251. color: #999999;
  252. }
  253. .icon-shanchu1{
  254. font-size: $font-size-32;
  255. color: #999999;
  256. position: absolute;
  257. width: 64rpx;
  258. height: 64rpx;
  259. line-height: 64rpx;
  260. text-align: center;
  261. top: 0;
  262. right: 0;
  263. z-index: 10;
  264. }
  265. .input{
  266. width: 500rpx;
  267. height: 64rpx;
  268. float: left;
  269. line-height: 64rpx;
  270. color: $text-color;
  271. font-size: $font-size-24;
  272. }
  273. }
  274. .search-btn{
  275. width: 120rpx;
  276. line-height: 64rpx;
  277. text-align: center;
  278. font-size: $font-size-28;
  279. color: $color-system;
  280. float: left;
  281. background: #FFFFFF;
  282. }
  283. }
  284. .club-main{
  285. padding-top: 122rpx;
  286. .list{
  287. align-items: center;
  288. width: 702rpx;
  289. height: auto;
  290. padding: 24rpx;
  291. background: #FFFFFF;
  292. position: relative;
  293. border-bottom: 1px solid #EBEBEB;
  294. float: left;
  295. .club-list-top{
  296. width: 100%;
  297. height: 140rpx;
  298. float: left;
  299. display: flex;
  300. align-items: center;
  301. .list-left{
  302. height: 140rpx;
  303. flex: 2;
  304. margin-right: 10rpx;
  305. .list-head{
  306. width: 140rpx;
  307. height: 140rpx;
  308. border-radius: 14rpx;
  309. image{
  310. width: 140rpx;
  311. height: 140rpx;
  312. border-radius: 14rpx;
  313. }
  314. }
  315. }
  316. .list-item{
  317. height: 140rpx;
  318. flex: 8;
  319. display: flex;
  320. flex-direction:column ;
  321. .list-title{
  322. flex: 2;
  323. line-height: 80rpx;
  324. width: 100%;
  325. font-size: $font-size-28;
  326. color: $text-color;
  327. padding-left: 11rpx;
  328. flex-direction: row;
  329. justify-content: flex-start;
  330. .list-name{
  331. width: 390rpx;
  332. display: block;
  333. float: left;
  334. text-align: left;
  335. -o-text-overflow: ellipsis;
  336. text-overflow: ellipsis;
  337. display: -webkit-box;
  338. word-break: break-all;
  339. -webkit-box-orient: vertical;
  340. -webkit-line-clamp: 1;
  341. overflow: hidden;
  342. }
  343. .list-hist{
  344. display: block;
  345. float: right;
  346. color: #E19B30;
  347. font-size: $font-size-24;
  348. text-align: right;
  349. padding-right: 30rpx;
  350. .icon-dingdanxuanzhong{
  351. font-size: $font-size-34;
  352. color: #E19B30;
  353. }
  354. }
  355. }
  356. .list-opea{
  357. width: 100%;
  358. display: flex;
  359. flex: 4;
  360. color: #166CE1;
  361. flex-direction: row;
  362. align-items: center;
  363. }
  364. }
  365. }
  366. .club-list-bot{
  367. width: 100%;
  368. height: 60rpx;
  369. float: left;
  370. margin-top: 20rpx;
  371. .list-opea{
  372. width: 100%;
  373. display: flex;
  374. flex: 1;
  375. color: #166CE1;
  376. flex-direction: row;
  377. align-items: center;
  378. .btn{
  379. width: 160rpx;
  380. height: 60rpx;
  381. line-height: 60rpx;
  382. border-radius: 30rpx;
  383. font-size: $font-size-24;
  384. color: $text-color;
  385. text-align: center;
  386. margin: 0 15rpx;
  387. &.org{
  388. background:rgba(22,225,77,.1);
  389. color: #16E14D;
  390. }
  391. &.gre{
  392. background:rgba(22,123,225,.1);
  393. color: #167BE1;
  394. }
  395. &.yel{
  396. background:rgba(225,86,22,.1);
  397. color: #E15616;
  398. }
  399. &.yeo{
  400. background: #fff5cf;
  401. color: #ffaa01;
  402. }
  403. }
  404. }
  405. }
  406. }
  407. }
  408. </style>