club-list.vue 8.4 KB

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