club-list.vue 8.0 KB

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