club-list.vue 9.5 KB

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