list.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  1. <template>
  2. <view class="container club clearfix" :style="{paddingBottom:isIphoneX?'140rpx':'98rpx'}">
  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" @input="onShowClose" placeholder="请输入机构名称" maxlength="16"/>
  7. <text class="iconfont icon-shanchu1" v-if="isShowClose" @click="delInputText()"></text>
  8. </view>
  9. <view class="search-btn">
  10. <button class="search-btn" type="default" @click.stop="searchOpertor">搜索</button>
  11. </view>
  12. </view>
  13. <view class="club-main">
  14. <view v-if="isEmpty" class="empty-container">
  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.headimgurl ? item.headimgurl : '../../../static/temp/logo@3x.png'" mode=""></image></view>
  22. <view class="list-tel">
  23. <text class="txt">{{item.name}}</text>
  24. <text class="txt sm"><text class="txt-le">{{item.linkName}}</text>{{item.mobile}}</text>
  25. </view>
  26. </view>
  27. <view class="list-opea" v-if="tabCurrentIndex===2">
  28. <view class="opea-type-dell" @click.stop="checkData(item.clubID)">
  29. <text class="iconfont icon-xieboke"></text>
  30. <text>修改资料</text>
  31. </view>
  32. <view class="opea-type-dell or" @click.stop="orderHistory(item.clubID)">
  33. <text class="iconfont icon-dingdanxuanzhong"></text>
  34. <text>历史订单</text>
  35. </view>
  36. </view>
  37. <view class="list-opea" v-else>
  38. <view class="opea-type-cell" @click.stop="checkData(item.clubID)">
  39. <text class="iconfont icon-xieboke"></text>
  40. <text>修改资料</text>
  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 class="tabBar" :style="{height:isIphoneX?'140rpx':'98rpx'}">
  52. <view class="tabBar_list" :style="{paddingBottom:isIphoneX?'40rpx':''}">
  53. <view class="tabBar_item" :class="{ 'current' : tabCurrentIndex === 0}" @click="tabClick(0)" >
  54. <text class="iconfont icon-lishidingdan"></text>
  55. <view class="tabBar_name">待审核</view>
  56. </view>
  57. <view class="tabBar_item" :class="{ 'current1' : tabCurrentIndex === 1}" @click="tabClick(1)" >
  58. <text class="iconfont icon-shenhebutongguo"></text>
  59. <view class="tabBar_name">审核未通过</view>
  60. </view>
  61. <view class="tabBar_item" :class="{ 'current2' : tabCurrentIndex === 2}" @click="tabClick(2)" >
  62. <text class="iconfont icon-shenhetongguo"></text>
  63. <view class="tabBar_name">已上线</view>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. </template>
  69. <script>
  70. import authorize from '@/common/config/authorize.js'
  71. import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
  72. import tuiNomore from "@/components/tui-components/nomore/nomore"
  73. import { queryclubList, deleteclub , updateCode } from "@/api/operator.js"
  74. export default {
  75. components:{
  76. tuiLoadmore,
  77. tuiNomore,
  78. },
  79. data() {
  80. return {
  81. clubID:'',
  82. clubName:'',
  83. clubImage:'',
  84. linkman:'',
  85. clubMobile:'',
  86. isShowClose:false,
  87. searchInputVal:'',
  88. isEmpty:false,
  89. nomoreText: '上拉显示更多',
  90. userID:'',
  91. pageNum:1,
  92. pageSize:10,
  93. hasNextPage:false,
  94. loadding: false,
  95. pullUpOn: true,
  96. pullFlag: true,
  97. allowDataStatus:true,
  98. wrapperHeight:'100%',
  99. scrollHeight:'',
  100. deleteAddressId:'',
  101. currPage:'',//当前页面
  102. prevPage:'',//上一个页面
  103. tabCurrentIndex:0,
  104. clubList:[
  105. {headimgurl:'../../../static/temp/logo@3x.png',name:'上海默默美容会所管理机构',linkName:'郑先生',mobile:'13979770617',clubID:123},
  106. {headimgurl:'../../../static/temp/logo@3x.png',name:'上海默默美容会所管理机构',linkName:'郑先生',mobile:'13979770617',clubID:321},
  107. {headimgurl:'../../../static/temp/logo@3x.png',name:'上海默默美容会所管理机构',linkName:'郑先生',mobile:'13979770617',clubID:456},
  108. {headimgurl:'../../../static/temp/logo@3x.png',name:'上海默默美容会所管理机构',linkName:'郑先生',mobile:'13979770617',clubID:567},
  109. ],
  110. isIphoneX:this.$store.state.isIphoneX,
  111. show_index:0,//控制显示那个组件
  112. }
  113. },
  114. onLoad(){
  115. this.setScrollHeight();
  116. },
  117. methods: {
  118. setScrollHeight() {
  119. // 窗口高度 - 底部距离
  120. setTimeout(()=> {
  121. const query = wx.createSelectorQuery().in(this);
  122. query.selectAll('.add-btn').boundingClientRect();
  123. query.exec(res => {
  124. if(res[0][0]){
  125. let winHeight = this.$api.getWindowHeight(),
  126. eleTop = res[0][0].top - 1;
  127. this.scrollHeight = eleTop;
  128. }
  129. })
  130. }, 500)
  131. },
  132. searchOpertor(){
  133. this.pageNum=1
  134. this.initclubList()
  135. },
  136. initclubList(){
  137. let params = {clubID:this.clubID,pageNum:1,pageSize:this.pageSize,linkName:this.linkman,mobile:this.clubMobile}
  138. queryclubList(params).then(response =>{
  139. let responseData = response.data
  140. if(responseData.results&&responseData.results.length > 0){
  141. this.isEmpty = false
  142. this.hasNextPage = response.data.hasNextPage
  143. this.clubList =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 = true
  151. this.loadding = false
  152. this.nomoreText = '已至底部'
  153. }
  154. }else{
  155. this.isEmpty = true
  156. }
  157. }).catch(response =>{
  158. this.$util.msg(response.msg,2000)
  159. })
  160. },
  161. getOnReachBottomData(){
  162. this.pageNum+=1
  163. let params = {pageNum:this.pageNum,pageSize:this.pageSize,linkName:this.linkman,mobile:this.clubMobile}
  164. queryclubList(params).then(response =>{
  165. let responseData = response.data
  166. if(responseData.results&&responseData.results.length > 0){
  167. this.hasNextPage = response.data.hasNextPage
  168. this.clubList = this.clubList.concat(responseData.results)
  169. this.pullFlag = false;// 防上拉暴滑
  170. setTimeout(()=>{this.pullFlag = true;},500)
  171. if(this.hasNextPage){
  172. this.pullUpOn = false
  173. this.nomoreText = '上拉显示更多'
  174. }else{
  175. this.pullUpOn = false
  176. this.loadding = false
  177. this.nomoreText = '已至底部'
  178. }
  179. }
  180. }).catch(response =>{
  181. this.$util.msg(response.msg,2000)
  182. })
  183. },
  184. rexpStautsColor(status) {
  185. let textColor = ''
  186. switch (status) {
  187. case '1':
  188. textColor = '#55BB00'
  189. break
  190. case '2':
  191. textColor = '#0056BB'
  192. break
  193. case '3':
  194. textColor = '#BB0000'
  195. break
  196. }
  197. return textColor
  198. },
  199. tabClick(index) {//商品详情&&供应商信息tab切换
  200. this.tabCurrentIndex = index;
  201. console.log(this.tabCurrentIndex)
  202. },
  203. checkData(id){
  204. switch(this.tabCurrentIndex){
  205. case 0:
  206. this.$api.navigateTo(`/market/pages/login/information?id=${id}`)
  207. break;
  208. case 1:
  209. this.$api.navigateTo(`/market/pages/login/apply?id=${id}`)
  210. break;
  211. case 2:
  212. this.$api.navigateTo(`/market/pages/login/information?id=${id}`)
  213. break;
  214. }
  215. },
  216. orderHistory(id){
  217. this.$api.navigateTo(`/market/pages/order/order-history?id=${id}`)
  218. },
  219. onShowClose () {//输入框失去焦点时触发
  220. if(this.searchInputVal != ''){
  221. this.isShowClose = true
  222. }else{
  223. this.isShowClose = false
  224. }
  225. },
  226. delInputText(){//清除输入框内容
  227. this.searchInputVal = ''
  228. this.isShowClose = false
  229. }
  230. },
  231. onReachBottom() {
  232. if(this.hasNextPage){
  233. this.loadding = true
  234. this.pullUpOn = true
  235. this.getOnReachBottomData()
  236. }
  237. },
  238. onShow() {
  239. this.$api.getCommonStorage('clubInfo').then(response =>{
  240. console.log(response)
  241. this.clubID = response.clubID
  242. this.clubName = response.name
  243. this.clubImage = response.image
  244. this.pageNum = 1;
  245. // this.initclubList();
  246. })
  247. }
  248. }
  249. </script>
  250. <style lang='scss'>
  251. page {
  252. height: auto;
  253. }
  254. page,.container{
  255. /* padding-bottom: 120upx; */
  256. background: #F7F7F7;
  257. border-top: 1px solid #EBEBEB;
  258. }
  259. .container{
  260. position: relative;
  261. }
  262. .club-search{
  263. height: 64rpx;
  264. width: 702rpx;
  265. padding: 24rpx;
  266. background: #FFFFFF;
  267. display: flex;
  268. align-items: center;
  269. margin-bottom: 20rpx;
  270. .search-from{
  271. width: 582rpx;
  272. height: 64rpx;
  273. background: #F7F7F7;
  274. border-radius: 14rpx;
  275. float: left;
  276. position: relative;
  277. .input{
  278. width: 500rpx;
  279. height: 64rpx;
  280. float: left;
  281. line-height: 64rpx;
  282. color: $text-color;
  283. font-size: $font-size-24;
  284. }
  285. .icon-iconfonticonfontsousuo1{
  286. width: 64rpx;
  287. height: 64rpx;
  288. line-height: 64rpx;
  289. text-align: center;
  290. display: block;
  291. font-size: $font-size-38;
  292. float: left;
  293. color: #999999;
  294. }
  295. .icon-shanchu1{
  296. font-size: $font-size-32;
  297. color: #999999;
  298. position: absolute;
  299. width: 64rpx;
  300. height: 64rpx;
  301. line-height: 64rpx;
  302. text-align: center;
  303. top: 0;
  304. right: 0;
  305. z-index: 10;
  306. }
  307. }
  308. .search-btn{
  309. width: 120rpx;
  310. line-height: 64rpx;
  311. text-align: center;
  312. font-size: $font-size-28;
  313. color: $color-system;
  314. float: left;
  315. background: #FFFFFF;
  316. }
  317. }
  318. .club-main{
  319. .list{
  320. display: flex;
  321. align-items: center;
  322. width: 702rpx;
  323. height: 92rpx;
  324. padding: 24rpx;
  325. background: #FFFFFF;
  326. position: relative;
  327. border-bottom: 1px solid #EBEBEB;
  328. .list-left{
  329. display: flex;
  330. flex: 8;
  331. .list-head{
  332. width: 92rpx;
  333. height: 92rpx;
  334. border-radius: 14rpx;
  335. image{
  336. width: 92rpx;
  337. height: 92rpx;
  338. border-radius: 14rpx;
  339. }
  340. }
  341. .list-tel{
  342. margin-left: 18rpx;
  343. .txt{
  344. display: flex;
  345. flex: 1;
  346. font-size: $font-size-28;
  347. color: $text-color;
  348. line-height: 46rpx;
  349. &.sm{
  350. font-size: $font-size-24;
  351. color: #666666;
  352. .txt-le{
  353. margin-right: 26rpx;
  354. }
  355. }
  356. }
  357. }
  358. }
  359. .list-opea{
  360. display: flex;
  361. flex: 2;
  362. color: #166CE1;
  363. flex-direction: column;
  364. .opea-type-cell{
  365. font-size: 24rpx;
  366. .iconfont{
  367. font-size: 34rpx;
  368. margin-right: 5rpx;
  369. }
  370. }
  371. .opea-type-dell{
  372. line-height: 46rpx;
  373. font-size: 24rpx;
  374. &.or{
  375. color: #E19B16;
  376. }
  377. .iconfont{
  378. font-size: 34rpx;
  379. margin-right: 5rpx;
  380. }
  381. }
  382. }
  383. }
  384. }
  385. .tabBar{
  386. width:100%;
  387. height: 98rpx;
  388. background: #fff;
  389. border-top:1px solid #E5E5E5;
  390. position: fixed;
  391. bottom:0px;
  392. left:0px;
  393. right:0px;
  394. display: flex;
  395. align-items: center;
  396. justify-content: center;
  397. .tabBar_list{
  398. width:86%;
  399. display: flex;
  400. justify-content: space-between;
  401. .tabBar_item{
  402. width:120rpx;
  403. display: flex;
  404. justify-content: center;
  405. align-items: center;
  406. flex-direction: column;
  407. font-size: 20rpx;
  408. color: #999999;
  409. &.current{
  410. color: #166CE1;
  411. .iconfont{
  412. color:#166CE1;
  413. }
  414. }
  415. &.current1{
  416. color: #FF0000;
  417. .iconfont{
  418. color:#FF0000;
  419. }
  420. }
  421. &.current2{
  422. color: #16E15C;
  423. .iconfont{
  424. color:#16E15C;
  425. }
  426. }
  427. .iconfont{
  428. width:48rpx;
  429. height: 48rpx;
  430. display: block;
  431. margin-bottom:2rpx;
  432. text-align: center;
  433. font-size: 46rpx;
  434. color: #999999;
  435. }
  436. }
  437. }
  438. }
  439. .nav_active{
  440. color: $color-system;
  441. }
  442. </style>