club-list.vue 9.5 KB

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