list.vue 11 KB

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