...
|
...
|
@@ -4,15 +4,8 @@ |
|
|
<view class="top">
|
|
|
<view class="search">
|
|
|
<image class="icon" src="../../static/sousuo_icon@2x.png"></image>
|
|
|
<input
|
|
|
type="text"
|
|
|
placeholder="请输入搜索内容"
|
|
|
class="input"
|
|
|
placeholder-style="color:rgba(189,196,206,1);font-size:28rpx;"
|
|
|
style="font-size:28rpx;"
|
|
|
v-model="word"
|
|
|
@confirm="getschoollistk"
|
|
|
/>
|
|
|
<input type="text" placeholder="请输入搜索内容" class="input" placeholder-style="color:rgba(189,196,206,1);font-size:28rpx;"
|
|
|
style="font-size:28rpx;" v-model="word" @confirm="getschoollistk" />
|
|
|
</view>
|
|
|
<view class="searchBtn" @click="getschoollistk">搜索</view>
|
|
|
</view>
|
...
|
...
|
@@ -21,17 +14,20 @@ |
|
|
<view class="diqu" :class="{ active: active2 }" @click="diquShow">地区</view>
|
|
|
<view class="paimingPopup" v-if="isPaimingShow">
|
|
|
<view class="title" @click="selectalllevel" :class="levelindex==-2?'selactive':''">全部</view>
|
|
|
<view class="item" @click="paimingHide" :class="levelindex==index?'selactive':''" :data-id="item.id" :data-index="index" v-for="(item, index) in levelList" :key="index">{{ item.name }}</view>
|
|
|
<view class="item" @click="paimingHide" :class="levelindex==index?'selactive':''" :data-id="item.id" :data-index="index"
|
|
|
v-for="(item, index) in levelList" :key="index">{{ item.name }}</view>
|
|
|
<!-- <view class="item" @click="paimingHide">{{item.name}}</view> -->
|
|
|
</view>
|
|
|
<view class="diquPopup" v-if="isDiquShow">
|
|
|
<view class="title" @click="selectallprovince" :class="selpro==-1?'selactive':''" :data-index="-2">全部地区</view>
|
|
|
<view class="cont">
|
|
|
<view class="colum">
|
|
|
<view class="item" :class="selpro==index?'selactive':''" @click="selectprovince" v-for="(item, index) in provinceList" :key="index" :data-index="index" :data-id="item.code">{{ item.name }}</view>
|
|
|
<view class="item" :class="selpro==index?'selactive':''" @click="selectprovince" v-for="(item, index) in provinceList"
|
|
|
:key="index" :data-index="index" :data-id="item.code">{{ item.name }}</view>
|
|
|
</view>
|
|
|
<view class="colum">
|
|
|
<view class="item" :class="selcity==index?'selactive':''" @click="selectcity" v-for="(item, index) in cityList" :key="index" :data-index="index" :data-id="item.code">{{ item.name }}</view>
|
|
|
<view class="item" :class="selcity==index?'selactive':''" @click="selectcity" v-for="(item, index) in cityList"
|
|
|
:key="index" :data-index="index" :data-id="item.code">{{ item.name }}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
...
|
...
|
@@ -39,25 +35,28 @@ |
|
|
</view>
|
|
|
|
|
|
<view class="nodata" v-if="schoolList.length==0">暂无数据</view>
|
|
|
|
|
|
<view class="contentBox" v-else>
|
|
|
<!-- <scroll-view :scroll-top="scrollTop" scroll-y="true" @scrolltolower="lower" v-else> -->
|
|
|
<scroll-view class="contentBox" :scroll-top="scrollTop" scroll-y="true" @scrolltolower="lower" v-else>
|
|
|
<view class="item" v-for="(item, index) in schoolList" :key="index" @click="godetail(item)">
|
|
|
<view class="title">{{ item.name }}</view>
|
|
|
<image class="icon" :src="item.icon_image"></image>
|
|
|
</view>
|
|
|
</view>
|
|
|
</scroll-view>
|
|
|
|
|
|
<!-- </scroll-view> -->
|
|
|
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import app from '../../App.vue';
|
|
|
import app from '../../App.vue';
|
|
|
|
|
|
export default {
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
selpro:-1,
|
|
|
selcity:-1,
|
|
|
levelindex:-1,
|
|
|
selpro: -1,
|
|
|
selcity: -1,
|
|
|
levelindex: -1,
|
|
|
isPaimingShow: false,
|
|
|
isDiquShow: false,
|
|
|
active1: false,
|
...
|
...
|
@@ -71,7 +70,9 @@ export default { |
|
|
schoolList: [],
|
|
|
word: '',
|
|
|
page: '1',
|
|
|
levelList: []
|
|
|
levelList: [],
|
|
|
scrollTop:0,
|
|
|
nomore:false
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
...
|
...
|
@@ -81,14 +82,14 @@ export default { |
|
|
(this.active1 = true), (this.active2 = false);
|
|
|
},
|
|
|
paimingHide(e) {
|
|
|
let id=e.currentTarget.dataset.id;
|
|
|
let index=e.currentTarget.dataset.index;
|
|
|
|
|
|
this.levelindex=index;
|
|
|
this.city_id='';
|
|
|
this.level_id=id;
|
|
|
this.page=1;
|
|
|
this.schoolList=[];
|
|
|
let id = e.currentTarget.dataset.id;
|
|
|
let index = e.currentTarget.dataset.index;
|
|
|
|
|
|
this.levelindex = index;
|
|
|
this.city_id = '';
|
|
|
this.level_id = id;
|
|
|
this.page = 1;
|
|
|
this.schoolList = [];
|
|
|
this.getschoollist();
|
|
|
this.isPaimingShow = false;
|
|
|
(this.active1 = false), (this.active2 = false);
|
...
|
...
|
@@ -133,44 +134,44 @@ export default { |
|
|
//点击选中的省
|
|
|
selectprovince(e) {
|
|
|
this.province_id = e.currentTarget.dataset.id;
|
|
|
this.selpro=e.currentTarget.dataset.index;
|
|
|
this.selcity=-1;
|
|
|
this.selpro = e.currentTarget.dataset.index;
|
|
|
this.selcity = -1;
|
|
|
this.getAllCity();
|
|
|
},
|
|
|
//点击全部省
|
|
|
selectallprovince() {
|
|
|
this.selpro=-2;
|
|
|
this.selcity=-1;
|
|
|
this.city_id='';
|
|
|
this.city_id='';
|
|
|
this.level_id='';
|
|
|
this.page=1;
|
|
|
this.schoolList=[];
|
|
|
this.selpro = -2;
|
|
|
this.selcity = -1;
|
|
|
this.city_id = '';
|
|
|
this.city_id = '';
|
|
|
this.level_id = '';
|
|
|
this.page = 1;
|
|
|
this.schoolList = [];
|
|
|
this.getschoollist();
|
|
|
|
|
|
this.isDiquShow = false;
|
|
|
},
|
|
|
getschoollistk(){
|
|
|
this.page=1;
|
|
|
this.schoolList=[];
|
|
|
getschoollistk() {
|
|
|
this.page = 1;
|
|
|
this.schoolList = [];
|
|
|
|
|
|
this.getschoollist();
|
|
|
},
|
|
|
//点击选中全部市
|
|
|
selectallcity() {
|
|
|
this.level_id='';
|
|
|
this.page=1;
|
|
|
this.schoolList=[];
|
|
|
this.level_id = '';
|
|
|
this.page = 1;
|
|
|
this.schoolList = [];
|
|
|
this.isDiquShow = false;
|
|
|
this.getschoollist();
|
|
|
},
|
|
|
//点击选中的市
|
|
|
selectcity(e) {
|
|
|
this.city_id = e.currentTarget.dataset.id;
|
|
|
this.selcity=e.currentTarget.dataset.index;
|
|
|
this.level_id='';
|
|
|
this.page=1;
|
|
|
this.schoolList=[];
|
|
|
this.selcity = e.currentTarget.dataset.index;
|
|
|
this.level_id = '';
|
|
|
this.page = 1;
|
|
|
this.schoolList = [];
|
|
|
this.getschoollist();
|
|
|
this.isDiquShow = false;
|
|
|
},
|
...
|
...
|
@@ -197,10 +198,19 @@ export default { |
|
|
level_id: that.level_id,
|
|
|
city_id: that.city_id
|
|
|
};
|
|
|
app.post(url, params,'post')
|
|
|
app.post(url, params, 'post')
|
|
|
.then(res => {
|
|
|
console.log(res);
|
|
|
that.schoolList =that.schoolList.concat(res) ;
|
|
|
that.schoolList = that.schoolList.concat(res);
|
|
|
if(that.page>1){
|
|
|
if(res.length==0){
|
|
|
that.nomore=true
|
|
|
uni.showToast({
|
|
|
title:'没有更多了~',
|
|
|
icon:'none'
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
.catch(err => {});
|
|
|
},
|
...
|
...
|
@@ -220,11 +230,11 @@ export default { |
|
|
//点击全部排名
|
|
|
selectalllevel() {
|
|
|
this.isPaimingShow = false;
|
|
|
this.levelindex=-2;
|
|
|
this.level_id='';
|
|
|
this.province_id='';
|
|
|
this.page=1;
|
|
|
this.schoolList=[];
|
|
|
this.levelindex = -2;
|
|
|
this.level_id = '';
|
|
|
this.province_id = '';
|
|
|
this.page = 1;
|
|
|
this.schoolList = [];
|
|
|
this.getschoollist();
|
|
|
},
|
|
|
// 进入学校详情页
|
...
|
...
|
@@ -233,6 +243,18 @@ export default { |
|
|
uni.navigateTo({
|
|
|
url: './schoolDetails?id=' + id
|
|
|
});
|
|
|
},
|
|
|
// 触底事件
|
|
|
lower(){
|
|
|
if(this.nomore==false){
|
|
|
console.log(34389349889)
|
|
|
let newpage = this.page;
|
|
|
|
|
|
newpage++;
|
|
|
this.page = newpage;
|
|
|
this.getschoollist();
|
|
|
}
|
|
|
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
...
|
...
|
@@ -241,30 +263,46 @@ export default { |
|
|
this.getAllLevel();
|
|
|
},
|
|
|
onReachBottom() {
|
|
|
let newpage=this.page;
|
|
|
newpage++;
|
|
|
this.page=newpage;
|
|
|
this.getschoollist();
|
|
|
// console.log(34348493989)
|
|
|
// let newpage = this.page;
|
|
|
|
|
|
// newpage++;
|
|
|
// this.page = newpage;
|
|
|
// this.getschoollist();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
};
|
|
|
// onReachBottom: function() {
|
|
|
|
|
|
// }
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|
|
|
page{
|
|
|
page {
|
|
|
height: 100%;
|
|
|
width: 100%;
|
|
|
}
|
|
|
.content {
|
|
|
}
|
|
|
|
|
|
.content {
|
|
|
background-color: rgba(249, 249, 249, 1);
|
|
|
height: 100%;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
|
|
|
.top {
|
|
|
padding: 18rpx 32rpx;
|
|
|
display: flex;
|
|
|
// display: flex;
|
|
|
background-color: #fff;
|
|
|
}
|
|
|
.conet_top{
|
|
|
position: fixed;
|
|
|
top:0;
|
|
|
left:0;
|
|
|
width:750rpx;
|
|
|
}
|
|
|
|
|
|
.search {
|
|
|
display: flex;
|
|
|
align-items: center;
|
...
|
...
|
@@ -275,22 +313,26 @@ page{ |
|
|
border-radius: 40rpx;
|
|
|
padding: 0 28rpx;
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
.icon {
|
|
|
width: 30rpx;
|
|
|
height: 30rpx;
|
|
|
}
|
|
|
|
|
|
.input {
|
|
|
height: 64rpx;
|
|
|
width: 500rpx;
|
|
|
text-align: center;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
.searchBtn {
|
|
|
color: rgba(6, 18, 30, 1);
|
|
|
font-size: 28rpx;
|
|
|
line-height: 64rpx;
|
|
|
margin-left: 20rpx;
|
|
|
}
|
|
|
|
|
|
.type {
|
|
|
display: flex;
|
|
|
color: rgba(6, 18, 30, 1);
|
...
|
...
|
@@ -298,10 +340,12 @@ page{ |
|
|
background-color: #fff;
|
|
|
padding: 24rpx 32rpx;
|
|
|
margin-top: 2rpx;
|
|
|
|
|
|
.paiming,
|
|
|
.diqu {
|
|
|
margin-right: 72rpx;
|
|
|
}
|
|
|
|
|
|
.paimingPopup,
|
|
|
.diquPopup {
|
|
|
width: 750rpx;
|
...
|
...
|
@@ -315,19 +359,23 @@ page{ |
|
|
z-index: 999;
|
|
|
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.06);
|
|
|
border-top: 1rpx solid rgba(249, 249, 249, 1);
|
|
|
|
|
|
.item {
|
|
|
margin-bottom: 22rpx;
|
|
|
// height: 74rpx;
|
|
|
width: 170rpx;
|
|
|
}
|
|
|
|
|
|
.title {
|
|
|
margin-bottom: 20rpx;
|
|
|
}
|
|
|
|
|
|
.cont {
|
|
|
display: flex;
|
|
|
// flex-direction: column;
|
|
|
flex-wrap: wrap;
|
|
|
justify-content: start;
|
|
|
|
|
|
.colum {
|
|
|
overflow: auto;
|
|
|
height: 500rpx;
|
...
|
...
|
@@ -335,15 +383,19 @@ page{ |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
.active {
|
|
|
color: #05849d;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
.contentBox {
|
|
|
padding: 24rpx 32rpx;
|
|
|
padding: 24rpx 32rpx 0;
|
|
|
box-sizing: border-box;
|
|
|
flex: 1;
|
|
|
// flex: 1;
|
|
|
overflow-y: scroll;
|
|
|
margin-top:276rpx;
|
|
|
|
|
|
.item {
|
|
|
width: 686rpx;
|
|
|
height: 160rpx;
|
...
|
...
|
@@ -357,9 +409,11 @@ page{ |
|
|
padding: 0 40rpx;
|
|
|
box-sizing: border-box;
|
|
|
margin-bottom: 24rpx;
|
|
|
|
|
|
.title {
|
|
|
line-height: 160rpx;
|
|
|
}
|
|
|
|
|
|
.icon {
|
|
|
width: 120rpx;
|
|
|
height: 120rpx;
|
...
|
...
|
@@ -368,5 +422,5 @@ page{ |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</style> |
...
|
...
|
|