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.

673 lines
19 KiB

<template>
<view class="container safe-area-inset-bottom">
<image class="bkg" src="~@/static/me/wave.png" mode="widthFix"></image>
<view class="wrap" v-if="step === 1">
<view class="year-picker">
<view class="year-picker__title">报考年份</view>
<u-input class="year-picker__input"
v-model="form.year"
type="select"
:height="60"
border
border-color="#b2b2b2"
:custom-style="{
color: '#6c6f70'
}"
@click="isShowTime = true"></u-input>
</view>
<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>
</view>
</view>
<u-button
shape="circle"
ripple
:custom-style="{
'background-image': 'linear-gradient(263deg, rgba(31,142,247,0.9) 0%, rgba(17,100,247,0.9981153777569027) 78%, rgba(17,100,247,0.9999999999999999) 78%)',
height: '76rpx',
'line-height': '76rpx',
'margin-top': '110rpx',
'width': '450rpx',
'color': '#fff'
}"
@click="() => {
if (form.area_id) {
getSchools()
stepClick('next')
} else {
$u.toast('请选择区域')
}
}">下一步</u-button>
</view>
<view class="wrap" v-if="step === 2">
<view class="card">
<view class="card__title">基本信息</view>
<u-form :model="form" ref="uForm" label-width="auto">
<u-form-item label="学生姓名" required prop="name">
<u-input v-model="form.name" placeholder="请输入" input-align="right" />
</u-form-item>
<u-form-item label="性别" prop="sex">
<u-input type="select" v-model="form.sex" placeholder="请选择" input-align="right" @click="isShowSex = true"/>
</u-form-item>
<u-form-item label="准考证" required prop="number">
<u-input v-model="form.number" placeholder="请输入" input-align="right" />
</u-form-item>
<u-form-item label="考生类型" required prop="type">
<u-input v-model="form.type" placeholder="请输入" input-align="right" />
</u-form-item>
<u-form-item label="民族" prop="nationality">
<u-input v-model="form.nationality" placeholder="请输入" input-align="right" />
</u-form-item>
<u-form-item label="户籍地址" required prop="address">
<u-input v-model="form.address" placeholder="请输入" input-align="right" />
</u-form-item>
<u-form-item label="移动电话" required prop="mobile">
<u-input v-model="form.mobile" placeholder="请输入" input-align="right" />
</u-form-item>
<u-form-item label="毕业学校" required prop="school">
<u-input v-model="form.school" placeholder="请输入" input-align="right" />
</u-form-item>
</u-form>
</view>
<view class="btns">
<u-button
shape="circle"
ripple
:custom-style="{
'background-image': 'linear-gradient(263deg, rgba(31,142,247,0.9) 0%, rgba(17,100,247,0.9981153777569027) 78%, rgba(17,100,247,0.9999999999999999) 78%)',
height: '76rpx',
'line-height': '76rpx',
'margin-top': '110rpx',
'width': '290rpx',
'color': '#fff'
}"
@click="stepClick('prev')">上一步</u-button>
<u-button
shape="circle"
ripple
:custom-style="{
'background-image': 'linear-gradient(263deg, rgba(31,142,247,0.9) 0%, rgba(17,100,247,0.9981153777569027) 78%, rgba(17,100,247,0.9999999999999999) 78%)',
height: '76rpx',
'line-height': '76rpx',
'margin-top': '110rpx',
'width': '290rpx',
'color': '#fff',
'margin-left': '64rpx'
}"
@click="validForm">下一步</u-button>
</view>
</view>
<view class="wrap" v-if="step === 3">
<view class="picked-data">
<view>{{ form.year }}年</view>
<view>{{ formArea }}</view>
</view>
<view class="step3-panel">
<view class="step3-panel__title">自主招生(含课程基地实验项目)</view>
<view class="step3-panel__content">
<view class="step3-panel__content--independent">
<view>
其他专业是否服从
</view>
<u-radio-group v-model="form.is_independent" active-color="#3066f0">
<u-radio
:name="1"
>
</u-radio>
<u-radio
:name="0"
>
</u-radio>
</u-radio-group>
</view>
<view class="step3-panel__content--school">
<view>
<view style="flex: 0.3;text-align: center;">代码</view>
<view style="flex: 0.7;text-align: center; margin-left: 22rpx;">学校名称</view>
</view>
<view style="margin-top: 30rpx;">
<view style="flex: 0.3;">
<u-input disabled v-model="form.school_code" :height="50" border border-color="#e0e0e0" @click="isShowSchool = true"></u-input>
</view>
<view style="flex: 0.7; margin-left: 22rpx;">
<u-input disabled v-model="form.school_name" :height="50" border border-color="#e0e0e0" @click="isShowSchool = true"></u-input>
</view>
</view>
</view>
</view>
</view>
<view class="btns">
<u-button
shape="circle"
ripple
:custom-style="{
'background-image': 'linear-gradient(263deg, rgba(31,142,247,0.9) 0%, rgba(17,100,247,0.9981153777569027) 78%, rgba(17,100,247,0.9999999999999999) 78%)',
height: '76rpx',
'line-height': '76rpx',
'margin-top': '110rpx',
'width': '290rpx',
'color': '#fff'
}"
@click="stepClick('prev')">上一步</u-button>
<u-button
shape="circle"
ripple
:custom-style="{
'background-image': 'linear-gradient(263deg, rgba(31,142,247,0.9) 0%, rgba(17,100,247,0.9981153777569027) 78%, rgba(17,100,247,0.9999999999999999) 78%)',
height: '76rpx',
'line-height': '76rpx',
'margin-top': '110rpx',
'width': '290rpx',
'color': '#fff',
'margin-left': '64rpx'
}"
@click="stepClick('next')">下一步</u-button>
</view>
</view>
<view class="wrap" v-if="step === 4">
<view class="picked-data">
<view>{{ form.year }}年</view>
<view>{{ formArea }}</view>
</view>
<view class="step4-panel">
<view class="step4-panel__title">自主招生(含课程基地实验项目)</view>
<view class="step4-panel__content">
<u-input type="textarea"
:clearable="false"
placeholder="请输入课程基地实验项目"
v-model="form.evaluation"
:height="500"
:custom-style="{
background: '#f6f8f7',
color: '#a7a7a7',
'font-size': '28rpx',
'border-radius': '20rpx',
'padding': '40rpx'
}"></u-input>
</view>
</view>
<view class="btns">
<u-button
shape="circle"
ripple
:custom-style="{
'background-image': 'linear-gradient(263deg, rgba(31,142,247,0.9) 0%, rgba(17,100,247,0.9981153777569027) 78%, rgba(17,100,247,0.9999999999999999) 78%)',
height: '76rpx',
'line-height': '76rpx',
'margin-top': '110rpx',
'width': '290rpx',
'color': '#fff'
}"
@click="stepClick('prev')">上一步</u-button>
<u-button
shape="circle"
ripple
:custom-style="{
'background-image': 'linear-gradient(263deg, rgba(31,142,247,0.9) 0%, rgba(17,100,247,0.9981153777569027) 78%, rgba(17,100,247,0.9999999999999999) 78%)',
height: '76rpx',
'line-height': '76rpx',
'margin-top': '110rpx',
'width': '290rpx',
'color': '#fff',
'margin-left': '64rpx'
}"
@click="submit">提交</u-button>
</view>
</view>
<u-picker
v-model="isShowTime"
mode="time"
:params="{
year: true,
month: false,
day: false,
hour: false,
minute: false,
second: false
}"
@confirm="e => form.year = e.year"></u-picker>
<u-select v-model="isShowSex" :list="sexList" @confirm="e => form.sex = e[0].value"></u-select>
<u-select v-model="isShowSchool" :list="schoolList" @confirm="e => {form.school_code = e[0].value;form.school_name = e[0].label}"></u-select>
<u-toast ref="uToast" />
</view>
</template>
<script>
export default {
data() {
return {
isShowSchool: false,
isShowSex: false,
sexList: [
{
value: '男',
label: '男'
},
{
value: '女',
label: '女'
},
{
value: '保密',
label: '保密'
}
],
isShowTime: false,
step: 1,
schoolList: [],
areaList: [],
form: {
year: new Date().getFullYear().toString(),
area_id: "",
name: "",
sex: "",
number: "",
type: "",
nationality: "",
address: "",
mobile: "",
school: "",
is_independent: "",
school_code: "",
school_name: "",
evaluation: ""
},
rules: {
name: [
{
required: true,
message: '请输入学生姓名'
}
],
number: [
{
required: true,
message: '请输入准考证号'
}
],
type: [
{
required: true,
message: '请输入考试类型'
}
],
address: [
{
required: true,
message: '请输入户籍地址'
}
],
mobile: [
{
required: true,
message: '请输入手机号'
},
{
validator: (rule, value, callback) => {
return this.$u.test.mobile(value);
},
message: '手机号码不正确'
}
],
school: [
{
required: true,
message: '请输入毕业学校'
}
]
}
};
},
methods: {
async getSchools() {
try {
const { list } = await this.$u.api.schoolList({
page: 1,
page_size: 9999,
area_id: this.form.area_id
})
this.schoolList = list.data.map(school => ({
value: school.code,
label: school.name,
extra: school.id
}))
} catch (err) {
console.error(err)
}
},
validForm() {
this.$refs['uForm'].validate(valid => {
if (valid) {
this.stepClick('next')
}
})
},
stepClick(type='next') {
if (type === 'next') {
if (this.step < 4) {
this.step = this.step + 1
if (this.step === 2) {
this.$nextTick(_ => {
this.$refs['uForm'].setRules(this.rules)
})
}
}
} else if (type === 'prev') {
if (this.step > 1) {
this.step = this.step - 1
}
}
},
async getArea() {
try {
const res = await this.$u.api.area({
is_show:1
})
this.areaList = res.list
} catch (err) {
console.error(err)
}
},
async submit() {
try {
const res = await this.$u.api.independentRecruitmentsSubmit(this.form)
this.$u.route({
url: '/package_sub/pages/FormSuccess/FormSuccess',
params: {
title: "自主招生志愿填报"
}
})
} catch (err) {
console.error(err)
}
},
setTitle() {
uni.setNavigationBarTitle({
title: `自主招生志愿填报 - Step ${this.step}/4`
})
}
},
computed: {
formArea() {
return this.areaList?.find(i => i.id === this.form.area_id)?.name
}
},
watch: {
step(newVal) {
this.setTitle()
}
},
onShow() {
this.setTitle()
},
onReady() {
try {
this.$refs['uForm'].setRules(this.rules)
} catch (err) {
}
},
created() {
this.getArea()
},
}
</script>
<style lang="scss">
.container {
position: relative;
min-height: 100vh;
width: 100vw;
background: #eaf8fe;
.bkg {
width: 100vw;
position: fixed;
top: 0;
left: 0;
}
.wrap {
z-index: 3;
position: relative;
padding-top: 40rpx;
.year-picker {
background: #fff;
display: flex;
align-items: center;
margin: 0 24rpx;
padding: 32rpx 75rpx 32rpx 60rpx;
border-radius: 20rpx;
filter: drop-shadow(-2.179rpx 3.355rpx 2.5rpx rgba(208,209,209,0.3));
&__title {
font-size: 30rpx;
text-transform: uppercase;
color: #333333;
font-weight: 500;
}
&__input {
flex: 1;
margin-left: 32rpx;
}
}
.area-pick {
margin: 0 24rpx;
&__title {
font-size: 30rpx;
text-transform: uppercase;
color: #333333;
font-weight: 500;
padding: 42rpx 0 38rpx 60rpx;
}
&__panel {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 22rpx 28rpx;
$colors:
linear-gradient(0deg, #309cfe 0%, #58e5ff 100%),
linear-gradient(0deg, #309cfe 0%, #58e5ff 100%),
linear-gradient(0deg, #2f69fd 0%, #51bcfe 100%),
linear-gradient(0deg, #2f69fd 0%, #51bcfe 100%),
linear-gradient(0deg, #2941fc 0%, #587bff 100%),
linear-gradient(0deg, #2941fc 0%, #587bff 100%),
linear-gradient(0deg, #280bb7 0%, #5776fe 100%),
linear-gradient(0deg, #280bb7 0%, #5776fe 100%);
.area-item {
border-radius: 15rpx;
font-size: 46rpx;
text-transform: uppercase;
color: #ffffff;
font-weight: 500;
text-align: center;
padding: 60rpx 0;
filter: drop-shadow(0 4rpx 2rpx rgba(0,0,0,0.3));
position: relative;
overflow: hidden;
&::before {
content: '';
opacity: 0.302;
width: 192rpx;
height: 192rpx;
border-radius: 96rpx;
background-image: linear-gradient(0deg, #309cfe 0%, #58c2ff 100%);
position: absolute;
top: -140rpx;
right: -38rpx;
}
&::after {
content: '';
opacity: 0.149;
width: 192rpx;
height: 192rpx;
border-radius: 96rpx;
background-color: #b9e1fd;
position: absolute;
bottom: -148rpx;
left: -44rpx;
}
&__tag {
z-index: 4;
position: absolute;
top: 10rpx;
right: 10rpx;
}
}
@for $i from 1 through length($colors) {
.area-item:nth-child(n + #{$i}) {
background: nth($colors, $i);
}
}
}
}
.picked-data {
display: flex;
align-items: center;
border-radius: 20rpx;
filter: drop-shadow(-2.179rpx 3.355rpx 2.5rpx rgba(208,209,209,0.3));
background-color: rgba(255, 255, 255, 0.5);
margin: 20rpx 24rpx 0;
padding: 26rpx 160rpx;
& > view {
flex: 1;
text-align: center;
font-size: 32rpx;
text-transform: uppercase;
color: #333333;
font-weight: bold;
}
}
.step3-panel {
margin: 28rpx 24rpx 0;
border-radius: 20rpx;
filter: drop-shadow(-2.179rpx 3.355rpx 2.5rpx rgba(208,209,209,0.3));
background-color: #ffffff;
&__title {
border-radius: 20rpx;
background-color: #fbf2e8;
font-size: 28rpx;
text-transform: uppercase;
color: #e77817;
font-weight: 500;
padding: 30rpx 0;
text-align: center;
}
&__content {
min-height: 20vh;
padding: 66rpx 34rpx 66rpx 28rpx;
&--independent {
display: flex;
align-items: center;
& > view:nth-child(1) {
font-size: 24rpx;
text-transform: uppercase;
color: #333333;
font-weight: 500;
margin-right: 112rpx;
}
}
&--school {
margin-top: 76rpx;
& > view:nth-child(1) {
font-size: 24rpx;
text-transform: uppercase;
color: #333333;
font-weight: 500;
}
& > view {
display: flex;
align-items: center;
}
}
}
}
.step4-panel {
border-radius: 20rpx;
filter: drop-shadow(-2.179rpx 3.355rpx 2.5rpx rgba(208,209,209,0.3));
background-color: #ffffff;
margin: 26rpx 24rpx 0;
padding: 46rpx 40rpx 52rpx;
&__title {
font-size: 28rpx;
text-transform: uppercase;
color: #333333;
font-weight: 500;
padding-bottom: 40rpx;
}
&__content {
}
}
}
}
.btns {
display: flex;
align-items: center;
justify-content: center;
}
.card {
margin: 20rpx 24rpx 0;
border-radius: 20rpx;
filter: drop-shadow(-2.179rpx 3.355rpx 2.5rpx rgba(208,209,209,0.3));
background-color: #ffffff;
padding: 32rpx 36rpx 40rpx 40rpx;
&__title {
display: inline-block;
font-size: 30rpx;
text-transform: uppercase;
color: #333333;
font-weight: 500;
padding: 0 10rpx;
z-index: 3;
position: relative;
&::after {
content: '';
background: linear-gradient(to right, #2e63ef, #4187f2);
height: 6rpx;
border-radius: 4rpx;
z-index: 0;
position: absolute;
bottom: 4rpx;
left: 0;
right: 0;
}
}
}
</style>