club-list.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  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.headimgurl ? item.headimgurl : '../../../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.clubID)">
  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>
  38. </view>
  39. <!--加载loadding-->
  40. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  41. <tui-nomore :visible="!pullUpOn" bgcolor="#F7F7F7" :text='nomoreText'></tui-nomore>
  42. <!--加载loadding-->
  43. </scroll-view>
  44. </view>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. import authorize from '@/common/config/authorize.js'
  50. import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
  51. import tuiNomore from "@/components/tui-components/nomore/nomore"
  52. import { queryclubList, deleteclub , updateCode } from "@/api/operator.js"
  53. export default {
  54. components:{
  55. tuiLoadmore,
  56. tuiNomore,
  57. },
  58. data() {
  59. return {
  60. clubID:'',
  61. clubName:'',
  62. clubImage:'',
  63. linkman:'',
  64. clubMobile:'',
  65. isEmpty:false,
  66. nomoreText: '上拉显示更多',
  67. userID:'',
  68. pageNum:1,
  69. pageSize:10,
  70. hasNextPage:false,
  71. loadding: false,
  72. pullUpOn: true,
  73. pullFlag: true,
  74. allowDataStatus:true,
  75. wrapperHeight:'100%',
  76. scrollHeight:'',
  77. deleteAddressId:'',
  78. currPage:'',//当前页面
  79. prevPage:'',//上一个页面
  80. tabCurrentIndex:0,
  81. clubList:[
  82. {headimgurl:'../../../static/temp/logo@3x.png',name:'上海默默美容会所管理机构',linkName:'郑先生',mobile:'13979770617',clubID:123},
  83. {headimgurl:'../../../static/temp/logo@3x.png',name:'上海默默美容会所管理机构',linkName:'郑先生',mobile:'13979770617',clubID:321},
  84. {headimgurl:'../../../static/temp/logo@3x.png',name:'上海默默美容会所管理机构',linkName:'郑先生',mobile:'13979770617',clubID:456},
  85. {headimgurl:'../../../static/temp/logo@3x.png',name:'上海默默美容会所管理机构',linkName:'郑先生',mobile:'13979770617',clubID:567},
  86. ],
  87. }
  88. },
  89. onLoad(){
  90. this.setScrollHeight();
  91. },
  92. methods: {
  93. setScrollHeight() {
  94. // 窗口高度 - 底部距离
  95. setTimeout(()=> {
  96. const query = wx.createSelectorQuery().in(this);
  97. query.selectAll('.add-btn').boundingClientRect();
  98. query.exec(res => {
  99. if(res[0][0]){
  100. let winHeight = this.$api.getWindowHeight(),
  101. eleTop = res[0][0].top - 1;
  102. this.scrollHeight = eleTop;
  103. }
  104. })
  105. }, 500)
  106. },
  107. searchOpertor(){
  108. this.pageNum=1
  109. this.initclubList()
  110. },
  111. initclubList(){
  112. let params = {clubID:this.clubID,pageNum:1,pageSize:this.pageSize,linkName:this.linkman,mobile:this.clubMobile}
  113. queryclubList(params).then(response =>{
  114. let responseData = response.data
  115. if(responseData.results&&responseData.results.length > 0){
  116. this.isEmpty = false
  117. this.hasNextPage = response.data.hasNextPage
  118. this.clubList =responseData.results
  119. this.pullFlag = false;
  120. setTimeout(()=>{this.pullFlag = true;},500)
  121. if(this.hasNextPage){
  122. this.pullUpOn = false
  123. this.nomoreText = '上拉显示更多'
  124. }else{
  125. this.pullUpOn = true
  126. this.loadding = false
  127. this.nomoreText = '已至底部'
  128. }
  129. }else{
  130. this.isEmpty = true
  131. }
  132. }).catch(response =>{
  133. this.$util.msg(response.msg,2000)
  134. })
  135. },
  136. getOnReachBottomData(){
  137. this.pageNum+=1
  138. let params = {pageNum:this.pageNum,pageSize:this.pageSize,linkName:this.linkman,mobile:this.clubMobile}
  139. queryclubList(params).then(response =>{
  140. let responseData = response.data
  141. if(responseData.results&&responseData.results.length > 0){
  142. this.hasNextPage = response.data.hasNextPage
  143. this.clubList = this.clubList.concat(responseData.results)
  144. this.pullFlag = false;// 防上拉暴滑
  145. setTimeout(()=>{this.pullFlag = true;},500)
  146. if(this.hasNextPage){
  147. this.pullUpOn = false
  148. this.nomoreText = '上拉显示更多'
  149. }else{
  150. this.pullUpOn = false
  151. this.loadding = false
  152. this.nomoreText = '已至底部'
  153. }
  154. }
  155. }).catch(response =>{
  156. this.$util.msg(response.msg,2000)
  157. })
  158. },
  159. _goImmediately(id){
  160. this.$api.navigateTo(`/market/pages/order/order-immediately?id=${id}`)
  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. },
  169. onReachBottom() {
  170. if(this.hasNextPage){
  171. this.loadding = true
  172. this.pullUpOn = true
  173. this.getOnReachBottomData()
  174. }
  175. },
  176. onShow() {
  177. this.$api.getCommonStorage('clubInfo').then(response =>{
  178. console.log(response)
  179. this.clubID = response.clubID
  180. this.clubName = response.name
  181. this.clubImage = response.image
  182. this.pageNum = 1;
  183. // this.initclubList();
  184. })
  185. }
  186. }
  187. </script>
  188. <style lang='scss'>
  189. page {
  190. height: auto;
  191. }
  192. page,.container{
  193. /* padding-bottom: 120upx; */
  194. background: #F7F7F7;
  195. border-top: 1px solid #EBEBEB;
  196. }
  197. .container{
  198. position: relative;
  199. }
  200. .club-search{
  201. height: 64rpx;
  202. width: 702rpx;
  203. padding: 24rpx;
  204. background: #FFFFFF;
  205. display: flex;
  206. align-items: center;
  207. margin-bottom: 20rpx;
  208. .search-from{
  209. width: 582rpx;
  210. height: 64rpx;
  211. background: #F7F7F7;
  212. border-radius: 14rpx;
  213. float: left;
  214. .iconfont{
  215. width: 64rpx;
  216. height: 64rpx;
  217. line-height: 64rpx;
  218. text-align: center;
  219. display: block;
  220. font-size: $font-size-38;
  221. float: left;
  222. color: #999999;
  223. }
  224. .input{
  225. width: 500rpx;
  226. height: 64rpx;
  227. float: left;
  228. line-height: 64rpx;
  229. color: $text-color;
  230. font-size: $font-size-24;
  231. }
  232. }
  233. .search-btn{
  234. width: 120rpx;
  235. line-height: 64rpx;
  236. text-align: center;
  237. font-size: $font-size-28;
  238. color: $color-system;
  239. float: left;
  240. background: #FFFFFF;
  241. }
  242. }
  243. .club-main{
  244. .list{
  245. align-items: center;
  246. width: 702rpx;
  247. height: auto;
  248. padding: 24rpx;
  249. background: #FFFFFF;
  250. position: relative;
  251. border-bottom: 1px solid #EBEBEB;
  252. display: flex;
  253. .list-left{
  254. height: 140rpx;
  255. flex: 2;
  256. .list-head{
  257. width: 140rpx;
  258. height: 140rpx;
  259. image{
  260. width: 140rpx;
  261. height: 140rpx;
  262. }
  263. }
  264. }
  265. .list-item{
  266. height: 140rpx;
  267. flex: 8;
  268. display: flex;
  269. flex-direction:column ;
  270. .list-title{
  271. flex: 2;
  272. line-height: 40rpx;
  273. width: 100%;
  274. font-size: $font-size-28;
  275. color: $text-color;
  276. text-align: left;
  277. padding-left: 24rpx;
  278. }
  279. .list-opea{
  280. width: 100%;
  281. display: flex;
  282. color: #166CE1;
  283. flex-direction: row;
  284. align-items: center;
  285. justify-content: center;
  286. .btn{
  287. width: 156rpx;
  288. height: 60rpx;
  289. line-height: 60rpx;
  290. border-radius: 14rpx;
  291. font-size: $font-size-24;
  292. color: $text-color;
  293. text-align: center;
  294. margin: 0 12rpx;
  295. &.org{
  296. background:$color-system ;
  297. color: #FFFFFF;
  298. }
  299. &.gre{
  300. background:$color-system ;
  301. color: #FFFFFF;
  302. }
  303. &.yel{
  304. background:#FFFFFF ;
  305. border: 1px solid $text-color;
  306. }
  307. }
  308. }
  309. }
  310. }
  311. }
  312. </style>