You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
173 lines
3.3 KiB
173 lines
3.3 KiB
<template>
|
|
<view class="pageBgImg">
|
|
<topNavbar title="找驾校"></topNavbar>
|
|
<view class="pad">
|
|
<view class="searchCon">
|
|
<searchRow placeholder="搜索驾校、教练…"></searchRow>
|
|
</view>
|
|
<view class="navBox">
|
|
<view class="tab" v-for="(item,index) in tabData" :key="index" :class="{active: currentTab==item.id}" @click="tabClick(item)">
|
|
{{ item.text }}</view>
|
|
<view class="screen" @click="$goPage('/pages/indexEntry/findShcool/screen/screen')">
|
|
<view class="txt">筛选</view>
|
|
<view class="screenIcon">
|
|
<image src="../../../static/images/index/ic_shaixuan.png" mode=""></image>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="ul">
|
|
<view class="li" v-for="(item,index) in listData" :key="index" >
|
|
<schoolItme :item="item" @click.native="goPage(item)"/>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view style="padding-bottom: 20rpx;">
|
|
<u-loadmore :status="status" />
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import schoolItme from './comp/schoolItem.vue'
|
|
import { schoolPage } from '@/config/api.js'
|
|
export default {
|
|
components: { schoolItme },
|
|
data() {
|
|
return {
|
|
currentTab: 0,
|
|
tabData: [{
|
|
text: '全部',
|
|
id: 0
|
|
},
|
|
{
|
|
text: '场地优先',
|
|
id: 1
|
|
},
|
|
{
|
|
text: '距离优先',
|
|
id: 2
|
|
},
|
|
{
|
|
text: '好评优先',
|
|
id: 3
|
|
},
|
|
],
|
|
params: {
|
|
pageNo: 1,
|
|
pageSize: 20,
|
|
lat: 30.27419537786047,
|
|
lng: 120.20633397715788,
|
|
},
|
|
total: 20,
|
|
listData: [],
|
|
status: 'loading'
|
|
}
|
|
},
|
|
onLoad() {
|
|
this.schoolPageFn()
|
|
},
|
|
onPullDownRefresh() {
|
|
this.listInit()
|
|
},
|
|
onReachBottom() {
|
|
if(this.total>this.listData.length) {
|
|
this.schoolPageFn()
|
|
}
|
|
},
|
|
methods: {
|
|
goPage(item) {
|
|
this.$goPage('/pages/indexEntry/findShcool/shcoolDetail/shcoolDetail?schoolId='+ item.id)
|
|
},
|
|
tabClick(item) {
|
|
this.currentTab = item.id
|
|
},
|
|
async listInit() {
|
|
await this.schoolPageFn()
|
|
uni.stopPullDownRefresh()
|
|
},
|
|
// 获取驾校列表
|
|
async schoolPageFn() {
|
|
const {data: res} = await schoolPage(this.params)
|
|
this.params.pageNo ++
|
|
this.listData.push(...res.list)
|
|
this.total = res.total
|
|
if(this.listData.length>=this.total) this.status = 'nomore'
|
|
console.log(res)
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.pageBgImg {
|
|
width: 100%;
|
|
min-height: 100vh;
|
|
.searchCon {
|
|
padding: 0 0 24rpx 0;
|
|
}
|
|
.navBox {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
padding-bottom: 48rpx;
|
|
.tab {
|
|
display: flex;
|
|
font-size: 28rpx;
|
|
color: #fff;
|
|
|
|
&.active {
|
|
position: relative;
|
|
|
|
&::before {
|
|
content: '';
|
|
position: absolute;
|
|
bottom: -14rpx;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
width: 50rpx;
|
|
height: 4rpx;
|
|
background-color: #fff;
|
|
border-radius: 0 0 2rpx 2rpx;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
.screen {
|
|
width: 150rpx;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
position: relative;
|
|
&::before {
|
|
content: '';
|
|
position: absolute;
|
|
left: 0;
|
|
top: 10rpx;
|
|
width: 1px;
|
|
background: #fff;
|
|
height: 26rpx;
|
|
|
|
}
|
|
.txt {
|
|
font-size: 28rpx;
|
|
color: #fff;
|
|
margin-right: 10rpx;
|
|
}
|
|
|
|
.screenIcon {
|
|
width: 32rpx;
|
|
height: 32rpx;
|
|
}
|
|
}
|
|
}
|
|
|
|
.ul {
|
|
width: 100%;
|
|
.li {
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
</style>
|