master
xy 1 year ago
parent 0905bfc811
commit 43e09edf6c

@ -1,6 +1,9 @@
//api集合
let apiApp = {
schoolList: '/api/mobile/school/index',
schoolDetail: '/api/mobile/school/detail',
area: '/api/mobile/school/area',
score: '/api/mobile/school/score',
}
const apiUser = {
appletLogin: '/api/mobile/user/applet-login',
@ -25,6 +28,10 @@ const install = (Vue, vm) => {
const sendSms = (params = {}) => vm.$u.get(apiUser.sendSms, params)
//
const schoolList = (params = {}) => vm.$u.get(apiApp.schoolList, params)
const schoolDetail = (params = {}) => vm.$u.get(apiApp.schoolDetail, params)
const area = (params = {}) => vm.$u.get(apiApp.area, params)
const score = (params = {}) => vm.$u.get(apiApp.score, params)
// 将各个定义的接口名称统一放进对象挂载到vm.$u.api(因为vm就是this也即this.$u.api)下
vm.$u.api = {
// 用户相关
@ -36,6 +43,10 @@ const install = (Vue, vm) => {
bindMobile,
sendSms,
//
schoolList,
schoolDetail,
area,
score
};
}

@ -3,10 +3,11 @@
<view class="search-bar">
<view class="search-bar__input">
<u-input
v-model="select.keyword"
v-model="select.school_name"
:height="26"
placeholder="请输入学校名称"
style="flex: 1; margin-right: 40rpx"
@input="$u.debounce(() => getList(true), 1000)"
></u-input>
<u-icon name="search" color="#333" :size="30"></u-icon>
</view>
@ -32,6 +33,7 @@
@confirm="({ year }) => {
select.year = year
closeDropdown()
getList(true)
}"
></u-picker>
</view>
@ -39,7 +41,8 @@
<u-dropdown-item
v-model="select.area_id"
title="区域"
:options="options1"
:options="areaList"
@change="getList(true)"
></u-dropdown-item>
</u-dropdown>
<view class="wrap">
@ -51,15 +54,19 @@
</view>
<view
class="table__row"
v-for="(item, index) in tableData"
v-for="(item, index) in list"
:key="index"
>
<text class="table__row-item">{{ item.star }}</text>
<text class="table__row-item">{{ item.school }}</text>
<text class="table__row-item">{{ item.score }}</text>
<text class="table__row-item">{{ item.school ? item.school.star : '' }}</text>
<text class="table__row-item">{{ item.school ? item.school.name : '' }}</text>
<text class="table__row-item">{{ item.total_score }}</text>
</view>
</view>
</view>
<u-loadmore
:status="loadStatus"
:margin-top="20"
></u-loadmore>
<u-back-top :scroll-top="scrollTop"></u-back-top>
</view>
</template>
@ -73,41 +80,76 @@ export default {
keyword: "",
year: new Date().getFullYear().toString(),
area_id: "",
school_name: ""
},
scrollTop: 0,
tableData: [
{ star: "四星", school: "苏州中学园区", score: "680>" },
{ star: "四星", school: "苏州中学园区", score: "142" },
{ star: "四星", school: "苏州中学园区", score: "959" },
// ...
],
options1: [
{
label: "默认排序",
value: 1,
},
{
label: "距离优先",
value: 2,
},
{
label: "价格优先",
value: 3,
},
],
areaList: [],
list: [],
total: 0,
loadStatus: 'loadmore'
};
},
methods: {
async getArea() {
try {
const res = await this.$u.api.area()
this.areaList = [{
label: '全部',
value: ''
},...res.list.map(i => ({
label: i.name,
value: i.id
}))]
} catch (err) {
console.error(err)
}
},
closeDropdown() {
this.$refs.uDropdown.close();
},
async getList(isRefresh) {
if (isRefresh) {
this.select.page = 1;
this.loadStatus = 'loadmore'
}
if (this.loadStatus === 'nomore') return
try {
this.loadStatus = 'loading'
const { list: res } = await this.$u.api.score(this.select);
console.log(res);
this.total = res.total;
if (isRefresh) {
this.list.length = 0;
}
this.list.push(...res.data)
if (this.list.length >= res.total) {
this.loadStatus = 'nomore'
} else {
this.select.page++;
this.loadStatus = 'loadmore'
}
} catch (err) {
console.error(err);
this.loadStatus = 'loadmore'
} finally {
uni.stopPullDownRefresh()
}
}
},
created() {
this.getArea()
this.getList(true)
},
onReady() {
this.defaultTime = this.$moment().format('YYYY-MM-DD HH:mm:ss')
},
onPageScroll(e) {
this.scrollTop = e.scrollTop;
},
onReachBottom() {
this.getList()
},
};
</script>

@ -1,72 +1,92 @@
<template>
<view class="container safe-area-inset-bottom">
<view class="container safe-area-inset-bottom u-skeleton">
<view class="top-panel">
<view class="left">
<image class="top-panel__img" :src="vuex_default_icon" mode="aspectFill"></image>
<image class="top-panel__img u-skeleton-circle" :src="(detail.icon && detail.icon.url) ? detail.icon.url : vuex_default_icon" mode="aspectFill"></image>
</view>
<view class="right">
<view class="top-panel__name">
苏州中学
<view class="top-panel__name u-skeleton-fillet">
{{ detail.name }}
</view>
<view class="top-panel__tags">
<view class="top-panel__tags--area">姑苏区</view>
<view class="top-panel__tags--type">初中</view>
<view class="top-panel__tags--area">{{ detail.area ? detail.area.name : '' }}</view>
<view class="top-panel__tags--type" v-for="(tag, index1) in detail.type" :key="index1">{{ tag }}</view>
</view>
<view class="top-panel__info">
办学性质公办
<view class="top-panel__info u-skeleton-fillet">
办学性质{{ detail.nature === 1 ? '公办' : (detail.nature === 2 ? '民办' : '-') }}
</view>
</view>
</view>
<view class="card">
<view class="card u-skeleton-rect">
<view class="card__title">
概况
</view>
<view class="card__content paragraph">
学校是江苏省重点中学江苏省四星级普通高中江苏省高品质示范高中建设立项学校
<view class="card__content">
<u-parse :html="detail.introduce"></u-parse>
</view>
</view>
<view class="card">
<view class="card u-skeleton-rect">
<view class="card__title">
分数线
历年统招分数线
</view>
<view class="card__content">
<view class="card__content--row">
<text>2024</text><text>680</text>
</view>
<view class="card__content--row">
<text>2024</text><text>680</text>
<view class="card__content--row" v-for="item in detail.school_scores" :key="item.id">
<text>{{ item.year }}</text><text>{{ item.total_score }}</text>
</view>
</view>
</view>
<view class="card">
<view class="card u-skeleton-rect">
<view class="card__title">
介绍
师资力量
</view>
<view class="card__content paragraph">
江苏省苏州中学校Suzhou High School of Jiangsu Province简称苏州中学苏中位于江苏省苏州市是由苏州市教育局主管的一所公办普通高级中学学校是江苏省重点中学江苏省四星级普通高中江苏省高品质示范高中建设立项学校 学校前身可以追溯到北宋景祐二年创建的苏州府学其后更名紫阳书院校士馆江苏师范学堂江苏省立第一师范学校江苏省立苏州中学私立弘毅中学私立青云中学苏南苏州中学江苏省苏州高级中学东方红战校东方红丝织厂战校苏州市第九中学1978正式更名为江苏省苏州中学
<view class="card__content">
<u-parse :html="detail.teacher"></u-parse>
</view>
</view>
<view class="card">
<view class="card__title">
师资力量
班型
</view>
<view class="card__content paragraph">
2024年12月江苏省苏州中学公布其赴高校招聘2025年应届高层次优秀毕业生录用名单名单显示苏州中学录用的13名毕业生中清华大学毕业生6人北京大学毕业生4人博士毕业生8人硕士毕业生5人并无一人是师范专业毕业 [49] 截至2022年12月学校有教职员工300多人 [43]截至2016年5月学校有教育名家2人省人民教育家培养对象1人教育领军人才1人教授级高级教师8人特级教师16人名教师18人学科带头人79人
<u-parse :html="detail.class"></u-parse>
</view>
</view>
<u-skeleton :loading="loading" :animation="true" bgColor="#FFF"></u-skeleton>
</view>
</template>
<script>
export default {
data() {
return {};
return {
loading: true,
detail: {}
};
},
methods: {
async getDetail(id) {
this.loading = true
try {
const { list } = await this.$u.api.schoolDetail({
id
})
this.detail = list
} catch (err) {
console.error(err)
} finally {
this.loading = false
}
}
},
onLoad(options) {
if (options.id) {
this.getDetail(options.id)
}
},
}
</script>

@ -3,65 +3,73 @@
<view class="search-bar">
<view class="search-bar__input">
<u-input
v-model="select.keyword"
v-model="select.name"
:height="26"
placeholder="请输入学校名称"
style="flex: 1; margin-right: 40rpx"
@input="$u.debounce(() => getList(true), 1000)"
></u-input>
<u-icon name="search" color="#333" :size="30"></u-icon>
</view>
</view>
<u-dropdown ref="uDropdown" inactive-color="#333" :height="80">
<u-dropdown-item
v-model="select.year"
v-model="select.type"
title="学段"
:options="options1">
:options="typeList"
@change="getList(true)">
</u-dropdown-item>
<u-dropdown-item
v-model="select.year"
v-model="select.area_id"
title="区域"
:options="options1"
:options="areaList"
@change="getList(true)"
></u-dropdown-item>
<u-dropdown-item
v-model="select.year"
v-model="select.nature"
title="性质"
:options="options1"
:options="natureList"
@change="getList(true)"
></u-dropdown-item>
</u-dropdown>
<view class="wrap">
<view class="list">
<view
class="list-item"
v-for="i in 20"
:key="i"
v-for="i in list"
:key="i.id"
@click="$u.route({
url: '/package_sub/pages/SchoolDetail/SchoolDetail',
params: {
id: ''
id: i.id
}
})">
<view class="left">
<image mode="aspectFill" class="list-item__img" :src="vuex_default_icon"></image>
<image mode="aspectFill" class="list-item__img" :src="(i.icon && i.icon.url) ? i.icon.url : vuex_default_icon"></image>
</view>
<view class="right">
<view class="list-item__title">
<text>苏州中学</text>
<text>{{ i.name }}</text>
<u-icon name="arrow-right" color="#333" :size="30"></u-icon>
</view>
<view class="list-item__tags">
<view class="list-item__tags--area">
姑苏区
{{ i.area ? i.area.name : '' }}
</view>
<view class="list-item__tags--type">
初中
<view class="list-item__tags--type" v-for="(tag, index1) in i.type" :key="index1">
{{ tag }}
</view>
</view>
<view class="list-item__info">
办学性质公办
办学性质{{ i.nature === 1 ? '公办' : (i.nature === 2 ? '民办' : '-') }}
</view>
</view>
</view>
</view>
<u-loadmore
:status="loadStatus"
:margin-top="20"
></u-loadmore>
</view>
<u-back-top :scroll-top="scrollTop"></u-back-top>
</view>
@ -73,35 +81,99 @@ export default {
return {
defaultTime: '',
select: {
keyword: "",
year: new Date().getFullYear().toString(),
name: "",
type: "",
nature: "",
area_id: "",
page: 1,
page_size: 10
},
scrollTop: 0,
tableData: [
],
options1: [
typeList: ['全部', '初中', '中专', '3+3', '五年制大专', '中本贯通5+2', '中本贯通3+4', '综合高中', '高中'].map(i => ({ label: i, value: i === '全部' ? '' : i })),
natureList: [
{
label: "默认排序",
value: 1,
label: "全部",
value: '',
},
{
label: "距离优先",
value: 2,
label: "公办",
value: 1,
},
{
label: "价格优先",
value: 3,
},
label: "民办",
value: 2,
}
],
areaList: [],
total: 0,
list: [],
loadStatus: 'loadmore',
};
},
methods: {
async getArea() {
try {
const res = await this.$u.api.area()
this.areaList = [{
label: '全部',
value: ''
},...res.list.map(i => ({
label: i.name,
value: i.id
}))]
} catch (err) {
console.error(err)
}
},
async getList(isRefresh=false) {
if (isRefresh) {
this.select.page = 1;
this.loadStatus = 'loadmore'
}
if (this.loadStatus === 'nomore') return
try {
this.loadStatus = 'loading'
const { list: res } = await this.$u.api.schoolList(this.select);
console.log(res);
this.total = res.total;
if (isRefresh) {
this.list.length = 0;
}
this.list.push(...res.data)
if (this.list.length >= res.total) {
this.loadStatus = 'nomore'
} else {
this.select.page++;
this.loadStatus = 'loadmore'
}
} catch (err) {
console.error(err);
this.loadStatus = 'loadmore'
} finally {
uni.stopPullDownRefresh()
}
}
},
computed: {
},
onPullDownRefresh() {
this.getList(true)
},
onPageScroll(e) {
this.scrollTop = e.scrollTop;
},
created() {
this.getArea()
this.getList(true)
},
onReachBottom() {
this.getList()
},
};
</script>
@ -171,6 +243,7 @@ export default {
.list-item__tags {
display: flex;
align-items: center;
flex-wrap: wrap;
padding-top: 20rpx;
&--area {

@ -6,27 +6,27 @@
<view class="info">
<image class="info__avatar" :src="vuex_user.headimgurl || vuex_default_icon" mode="aspectFill"></image>
<view class="info__name">
<text v-if="vuex_token">{{ vuex_user.nickname || '' }}</text>
<text v-if="vuex_user.mobile">{{ vuex_user.nickname || '' }}</text>
<u-button v-else shape="circle" size="mini" plain type="primary" @click="$u.route({ url: '/pages/login/login' })">去登录</u-button>
</view>
</view>
<view class="panel">
<view class="row" v-if="vuex_token">
<view class="row" v-if="vuex_user.mobile">
<image class="row__icon" src="~@/static/me/ico1.png" mode="aspectFill"></image>
<view class="row__text">我的模拟填报</view>
<view class="row__arrow">
<u-icon name="arrow-right" :size="38" color="#a7a7a7"></u-icon>
</view>
</view>
<view class="row" v-if="vuex_token">
<view class="row" v-if="vuex_user.mobile">
<image class="row__icon" src="~@/static/me/ico2.png" mode="aspectFit"></image>
<view class="row__text">自主招生</view>
<view class="row__arrow">
<u-icon name="arrow-right" :size="38" color="#a7a7a7"></u-icon>
</view>
</view>
<view class="row" v-if="vuex_token" @click="$u.route({ url: '/package_sub/pages/StudentInfo/StudentInfo' })">
<view class="row" v-if="vuex_user.mobile" @click="$u.route({ url: '/package_sub/pages/StudentInfo/StudentInfo' })">
<image class="row__icon" src="~@/static/me/ico3.png" mode="aspectFit"></image>
<view class="row__text">个人资料</view>
<view class="row__arrow">
@ -40,7 +40,7 @@
<u-icon name="arrow-right" :size="38" color="#a7a7a7"></u-icon>
</view>
</view>
<view class="row" v-if="vuex_token" @click="logout">
<view class="row" v-if="vuex_user.mobile" @click="logout">
<image class="row__icon" src="~@/static/me/ico5.png" mode="aspectFit"></image>
<view class="row__text">退出登录</view>
<view class="row__arrow">

Loading…
Cancel
Save