club-list.vue 8.3 KB

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