club-list.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408
  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="_goBuyagain(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('/seller/pages/cart/immediately')
  180. },
  181. _goBuyagain(item ){
  182. this.$api.setStorage('orderUserInfo',item)
  183. this.$api.navigateTo('/seller/pages/cart/buyagain')
  184. },
  185. _goSecond(item ){
  186. this.$api.setStorage('orderUserInfo',item)
  187. this.$api.navigateTo('/seller/pages/cart/second')
  188. },
  189. _goHistory(item){
  190. this.$api.setStorage('orderUserInfo',item)
  191. this.$api.navigateTo(`/seller/pages/order/order-historylist?clubID=${item.clubID}&listType=0`)
  192. }
  193. },
  194. onReachBottom() {
  195. if(this.hasNextPage){
  196. this.loadding = true
  197. this.pullUpOn = true
  198. this.getOnReachBottomData()
  199. }
  200. },
  201. onShow() {
  202. this.$api.getStorage().then(response =>{
  203. this.serviceProviderId = response.serviceProviderId
  204. this.pageNum = 1;
  205. this.initclubList();
  206. })
  207. }
  208. }
  209. </script>
  210. <style lang='scss'>
  211. page {
  212. height: auto;
  213. }
  214. page,.container{
  215. /* padding-bottom: 120upx; */
  216. background: #F7F7F7;
  217. }
  218. .container{
  219. position: relative;
  220. }
  221. .club-search{
  222. height: 64rpx;
  223. width: 702rpx;
  224. padding: 24rpx;
  225. background: #FFFFFF;
  226. display: flex;
  227. align-items: center;
  228. position: fixed;
  229. top: 0;
  230. left: 0;
  231. z-index: 999;
  232. .search-from{
  233. width: 582rpx;
  234. height: 64rpx;
  235. background: #F7F7F7;
  236. border-radius: 32rpx;
  237. float: left;
  238. position: relative;
  239. .icon-iconfonticonfontsousuo1{
  240. width: 64rpx;
  241. height: 64rpx;
  242. line-height: 64rpx;
  243. text-align: center;
  244. display: block;
  245. font-size: $font-size-38;
  246. float: left;
  247. color: #999999;
  248. }
  249. .icon-shanchu1{
  250. font-size: $font-size-32;
  251. color: #999999;
  252. position: absolute;
  253. width: 64rpx;
  254. height: 64rpx;
  255. line-height: 64rpx;
  256. text-align: center;
  257. top: 0;
  258. right: 0;
  259. z-index: 10;
  260. }
  261. .input{
  262. width: 500rpx;
  263. height: 64rpx;
  264. float: left;
  265. line-height: 64rpx;
  266. color: $text-color;
  267. font-size: $font-size-24;
  268. }
  269. }
  270. .search-btn{
  271. width: 120rpx;
  272. line-height: 64rpx;
  273. text-align: center;
  274. font-size: $font-size-28;
  275. color: $color-system;
  276. float: left;
  277. background: #FFFFFF;
  278. }
  279. }
  280. .club-main{
  281. padding-top: 122rpx;
  282. .list{
  283. align-items: center;
  284. width: 702rpx;
  285. height: auto;
  286. padding: 24rpx;
  287. background: #FFFFFF;
  288. position: relative;
  289. border-bottom: 1px solid #EBEBEB;
  290. float: left;
  291. .club-list-top{
  292. width: 100%;
  293. height: 140rpx;
  294. float: left;
  295. display: flex;
  296. align-items: center;
  297. .list-left{
  298. height: 140rpx;
  299. flex: 2;
  300. margin-right: 10rpx;
  301. .list-head{
  302. width: 140rpx;
  303. height: 140rpx;
  304. border-radius: 14rpx;
  305. image{
  306. width: 140rpx;
  307. height: 140rpx;
  308. border-radius: 14rpx;
  309. }
  310. }
  311. }
  312. .list-item{
  313. height: 140rpx;
  314. flex: 8;
  315. display: flex;
  316. flex-direction:column ;
  317. .list-title{
  318. flex: 2;
  319. line-height: 80rpx;
  320. width: 100%;
  321. font-size: $font-size-28;
  322. color: $text-color;
  323. padding-left: 11rpx;
  324. flex-direction: row;
  325. justify-content: flex-start;
  326. .list-name{
  327. width: 390rpx;
  328. display: block;
  329. float: left;
  330. text-align: left;
  331. -o-text-overflow: ellipsis;
  332. text-overflow: ellipsis;
  333. display: -webkit-box;
  334. word-break: break-all;
  335. -webkit-box-orient: vertical;
  336. -webkit-line-clamp: 1;
  337. overflow: hidden;
  338. }
  339. .list-hist{
  340. display: block;
  341. float: right;
  342. color: #E19B30;
  343. font-size: $font-size-24;
  344. text-align: right;
  345. padding-right: 30rpx;
  346. .icon-dingdanxuanzhong{
  347. font-size: $font-size-34;
  348. color: #E19B30;
  349. }
  350. }
  351. }
  352. .list-opea{
  353. width: 100%;
  354. display: flex;
  355. flex: 4;
  356. color: #166CE1;
  357. flex-direction: row;
  358. align-items: center;
  359. }
  360. }
  361. }
  362. .club-list-bot{
  363. width: 100%;
  364. height: 60rpx;
  365. float: left;
  366. margin-top: 20rpx;
  367. .list-opea{
  368. width: 100%;
  369. display: flex;
  370. flex: 1;
  371. color: #166CE1;
  372. flex-direction: row;
  373. align-items: center;
  374. .btn{
  375. width: 160rpx;
  376. height: 60rpx;
  377. line-height: 60rpx;
  378. border-radius: 30rpx;
  379. font-size: $font-size-24;
  380. color: $text-color;
  381. text-align: center;
  382. margin: 0 15rpx;
  383. &.org{
  384. background:rgba(22,225,77,.1);
  385. color: #16E14D;
  386. }
  387. &.gre{
  388. background:rgba(22,123,225,.1);
  389. color: #167BE1;
  390. }
  391. &.yel{
  392. background:rgba(225,86,22,.1);
  393. color: #E15616;
  394. }
  395. &.yeo{
  396. background: #fff5cf;
  397. color: #ffaa01;
  398. }
  399. }
  400. }
  401. }
  402. }
  403. }
  404. </style>