master
xy 1 year ago
parent 2156e394b8
commit a584cbabdd

@ -34,9 +34,9 @@
<view class="area-pick">
<view class="area-pick__title">所在区域</view>
<view class="area-pick__panel">
<view v-for="item in areaList" :key="item.id" class="area-item" @click="form.area_id = item.id">
{{ item.name }}
<u-icon class="area-item__tag" v-if="form.area_id === item.id " name="checkmark-circle-fill" color="#fff" :size="64" />
<view v-for="(group, groupId) in groupArea" :key="groupId" class="area-item" @click="form.group = group.map(i => i.name).toString()">
{{ group.map(i => i.name).toString() }}
<u-icon class="area-item__tag" v-if="form.group === group.map(i => i.name).toString() " name="checkmark-circle-fill" color="#fff" :size="64" />
</view>
</view>
</view>
@ -53,7 +53,7 @@
'color': '#fff'
}"
@click="() => {
if (form.area_id) {
if (form.group) {
stepClick('next')
} else {
$u.toast('请选择区域')
@ -234,6 +234,7 @@
second: false
}"
@confirm="e => form.year = e.year"></u-picker>
<u-modal v-model="isShowWhite" content="您暂时没有填报权限" @confirm="$u.route({ type: 'back' })"></u-modal>
<u-modal v-model="isShowModal" content="确认提交数据?" show-cancel-button @confirm="submit"></u-modal>
<u-select v-model="isShowSchoolSelect" mode="mutil-column-auto" :list="schoolList" @confirm="schoolListConfirm" @cancel="schoolListCancel"></u-select>
@ -245,10 +246,12 @@
export default {
data() {
return {
isShowWhite: false,
isShowModal: false,
step: 1,
isShowTime: false,
areaList: [],
groupArea: {},
forSchoolName: {
code: '',
value: '',
@ -266,6 +269,7 @@ export default {
name: "",
finish_school: "",
examination_number: "",
group: "",
area_id: "",
year: new Date().getFullYear().toString(),
aspiration_id: ""
@ -439,7 +443,7 @@ export default {
async getConfig () {
try {
const { list } = await this.$u.api.batchIndex({
area_id: this.form.area_id,
group: this.form.group,
year: this.form.year
})
if (list.length > 0) {
@ -447,6 +451,8 @@ export default {
this.aspiration = list[0]
this.setTitle()
} else {
this.$u.toast("暂未获取到当年模版")
}
} catch (err) {
console.error(err)
@ -478,6 +484,14 @@ export default {
try {
const res = await this.$u.api.area()
this.areaList = res.list
this.groupArea = res.list?.reduce((acc, item) => {
const key = item.group;
if (!acc[key]) {
acc[key] = [];
}
acc[key].push(item);
return acc;
}, {})
} catch (err) {
console.error(err)
}
@ -559,6 +573,9 @@ export default {
},
onShow() {
this.setTitle()
if (!this.vuex_user.white) {
this.isShowWhite = true
}
},
created() {
this.getArea().then(_ => {
@ -667,6 +684,9 @@ export default {
filter: drop-shadow(0 4rpx 2rpx rgba(0, 0, 0, 0.3));
position: relative;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
&::before {
content: '';

@ -1,4 +1,11 @@
<template>
<page-meta
:page-style="`overflow:${
isShowRecommend
? 'hidden'
: 'visible'
};`"
></page-meta>
<view class="container safe-area-inset-bottom">
<image class="bkg" src="~@/static/me/wave.png" mode="widthFix"></image>
@ -23,7 +30,7 @@
<u-form-item label="所在县区" required prop="area_id">
<u-input type="select" :value="formArea" placeholder="请选择" input-align="right" @click="isShowAreaSelect = true" />
</u-form-item>
<u-form-item label="所在学校" required prop="school_id">
<u-form-item label="所在学校" prop="school_id">
<u-input type="select" :value="form.school_name" placeholder="请输入" input-align="right" @click="isShowSchoolSelect = true" />
</u-form-item>
</u-form>
@ -97,6 +104,66 @@
<u-select v-model="isShowAreaSelect"
:list="areaList"
@confirm="areaConfirm"></u-select>
<u-popup v-model="isShowRecommend" border-radius="10" mode="bottom" safe-area-inset-bottom length="90%" closeable :custom-style="{ 'background': '#eaf9fe' }">
<view>
<view class="recommend-panel" v-for="(value, key) in {top:'冲',steady:'稳',safeguard:'保'}" :key="key">
<view class="recommend-panel__title">
{{ value }}推荐学校
</view>
<view class="recommend-panel__content">
<view class="list">
<view
class="list-item"
v-for="i in recommends[key]"
:key="i.id"
@click="$u.route({
url: '/package_sub/pages/SchoolDetail/SchoolDetail',
params: {
id: i.id
}
})">
<view class="left">
<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>{{ 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">
{{ schoolArea(i.area_id) }}
</view>
<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>
</view>
</view>
<u-button
shape="circle"
:custom-style="{
background: 'linear-gradient(to right, #2e63ef, #4186f2)',
height: '76rpx',
'line-height': '76rpx',
'color': '#fff',
'font-size': '33rpx',
'letter-spacing': '5rpx',
'width': '450rpx',
'margin': '60rpx auto 0'
}"
@click="">去模拟填报</u-button>
</view>
</u-popup>
</view>
</template>
@ -135,26 +202,44 @@ export default {
is_stable: 1,
is_bare: 1
},
rules: {
area_id: [
{
required: true,
message: '请选择县区'
}
],
},
isShowAreaSelect: false,
areaList: [],
isShowSchoolSelect: false,
schoolList: [],
recommends: {
top: [],
steady: [],
safeguard: []
},
isShowRecommend: false,
};
},
watch: {
vuex_user(newVal) {
const keys = new Map([
vuex_user: {
handler: function (newVal) {
const keys = new Map([
['middle_exam_year', 'year'],
['name', 'name'],
['sex', 'sex'],
['nationality', 'nationality']
])
Array.from(keys.keys()).forEach(key => {
if (newVal[key]) {
this.form[keys.get(key)] = newVal[key]
}
})
])
Array.from(keys.keys()).forEach(key => {
if (newVal[key]) {
this.form[keys.get(key)] = newVal[key]
}
})
},
immediate: true
}
},
computed: {
@ -176,6 +261,11 @@ export default {
if (this.regionType === 'area') {
return [this.form.province,this.form.city]
}
},
schoolArea() {
return function (areaId) {
return this.areaList.find(i => i.value === areaId)?.label
}
}
},
methods: {
@ -240,8 +330,12 @@ export default {
console.log(res)
uni.showToast({
title: '提交成功',
icon: 'none'
icon: 'none',
duration: 1000
})
const { model } = res
this.recommends = model?.recommends
this.isShowRecommend = true
})
} catch (err) {
console.error(err)
@ -260,6 +354,9 @@ export default {
</script>
<style lang="scss">
.u-drawer-bottom {
background: #eaf9fe !important;
}
.container {
position: relative;
min-height: 100vh;
@ -355,4 +452,90 @@ export default {
margin-left: 18rpx;
}
}
.recommend-panel {
padding: 0 24rpx;
&__title {
font-size: 36rpx;
text-transform: uppercase;
color: #333333;
font-weight: bold;
padding: 44rpx 0;
}
&__content {
.list {
&-item {
padding: 24rpx 28rpx 24rpx 32rpx;
border-radius: 20rpx;
filter: drop-shadow(-2.179px 3.355px 2.5px rgba(208,209,209,0.3));
background-color: #ffffff;
display: flex;
justify-content: space-between;
align-items: center;
.left {
.list-item__img {
border-radius: 100%;
height: 150rpx;
width: 150rpx;
}
}
.right {
flex: 1;
margin-left: 34rpx;
.list-item__title {
display: flex;
align-items: center;
justify-content: space-between;
text {
max-width: 300rpx;
text-overflow: ellipsis;
overflow: hidden;
font-size: 30rpx;
color: #333333;
font-weight: 500;
}
}
.list-item__tags {
display: flex;
align-items: center;
flex-wrap: wrap;
padding-top: 20rpx;
&--area {
color: #1a95da;
font-size: 24rpx;
border-radius: 20rpx;
background-color: rgba(26, 149, 218, 0.2);
padding: 8rpx 18rpx;
}
&--type {
color: #dd9447;
font-size: 24rpx;
border-radius: 20rpx;
background-color: rgba(233, 144, 50, 0.2);
padding: 6rpx 18rpx;
}
& > view + view {
margin-left: 10rpx;
}
}
.list-item__info {
padding-top: 20rpx;
font-size: 24rpx;
text-transform: uppercase;
color: rgba(51, 51, 51, 0.8);
}
}
}
.list-item + .list-item {
margin-top: 24rpx;
}
}
}
}
</style>

@ -1,4 +1,11 @@
<template>
<page-meta
:page-style="`overflow:${
isShowQrcode
? 'hidden'
: 'visible'
};`"
></page-meta>
<view class="content" :style="{ 'padding-top': paddingTop + 'px' }">
<image class="bkg" src="~@/static/index/bkg.png" mode="aspectFill"></image>
@ -71,8 +78,28 @@
class="online-service"
src="~@/static/index/online-service.png"
mode="aspectFit"
@click="isShowQrcode = true"
></image>
<u-popup mode="center" v-model="isShowQrcode" border-radius="14">
<view class="customer-service">
<view class="customer-service__title">
系统提示
</view>
<view class="customer-service__body">
<view>
您需要联系我们的客服获取授权
</view>
<image mode="aspectFit" src="~@/static/logo.png"></image>
<view>
xx老师
</view>
<view>
电话xxxxxxxxxxx
</view>
</view>
</view>
</u-popup>
</view>
</template>
@ -80,6 +107,7 @@
export default {
data() {
return {
isShowQrcode: false,
banners: [],
};
},
@ -275,4 +303,36 @@ export default {
height: 140rpx;
z-index: 10;
}
.customer-service {
background: #eaf8fe;
padding: 20rpx 20rpx 40rpx;
&__title {
font-size: 36rpx;
text-transform: uppercase;
color: #333333;
font-weight: bold;
padding: 34rpx 20rpx 24rpx;
}
&__body {
color: #666;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
border-radius: 10rpx;
border: 2rpx solid #ccc;
margin: 20rpx 20rpx 0;
line-height: 2;
font-weight: 500;
padding: 10rpx 20rpx;
& > image {
width: 340rpx;
height: 340rpx;
margin: 10rpx 0;
}
}
}
</style>

@ -8,7 +8,7 @@
<view class="list-item__title--time">
填报时间{{ item.created_at }}
</view>
<view class="list-item__title--tag">
<view class="list-item__title--tag" v-if="false">
规划师已查看
</view>
</view>

Loading…
Cancel
Save