移动端V1.0
This commit is contained in:
293
pages/outstanding-graduate/apply.vue
Normal file
293
pages/outstanding-graduate/apply.vue
Normal file
@@ -0,0 +1,293 @@
|
||||
<template>
|
||||
<view class="add">
|
||||
<view class="form-item">
|
||||
<label>学年</label>
|
||||
<picker v-if="yearOptions.length>0" range-key="stuYearName" :value="yearOptionsIndex" :range="yearOptions"
|
||||
@change="onYearChange">
|
||||
<view class="uni-input">
|
||||
<text class="val">{{ yearOptions[yearOptionsIndex].stuYearName || '请选择学年' }}</text>
|
||||
<uni-icons type="down" size="16" color="#202020"></uni-icons>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<label> <text class="tip">*</text> 第二课堂学分总分值</label>
|
||||
<input type="number" placeholder="请输入" v-model="valiFormData.classTwo" />
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<label><text class="tip">*</text>青年大学习学习率</label>
|
||||
<input type="text" v-model="valiFormData.youthStudy" placeholder="请输入" />
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<label><text class="tip">*</text>政治面貌</label>
|
||||
<picker :range="politicsOptions" @change="onPoliticsChange">
|
||||
<view class="uni-input">
|
||||
<text class="val">{{ politicsOptions[selectedPoliticsOptionIndex] || '请选择政治面貌' }}</text>
|
||||
<uni-icons type="down" size="16" color="#202020"></uni-icons>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<label><text class="tip">*</text>职务</label>
|
||||
<input type="text" v-model="valiFormData.classPost" placeholder="请输入" />
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<label><text class="tip">*</text>获奖情况</label>
|
||||
<textarea placeholder="请输入" v-model="valiFormData.goodHis"></textarea>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<label><text class="tip">*</text>主要事迹</label>
|
||||
<textarea class="main-his" placeholder="字数100字以上" v-model="valiFormData.mainHis"></textarea>
|
||||
</view>
|
||||
<view class="btns">
|
||||
<!-- <button @click="onSave" :disabled="isSubmitting">保存</button> -->
|
||||
<button @click="onSubmit" :disabled="isSubmitting">提交</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
validateFormFields
|
||||
} from "@/utils/validateForm.js"
|
||||
import {
|
||||
listEnableYear,
|
||||
doApply
|
||||
} from "@/api/outstanding-graduate/outstanding-graduate.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isSubmitting: false, //表单提交标志位
|
||||
// 校验表单数据
|
||||
valiFormData: {
|
||||
classTwo: '',
|
||||
youthStudy: '',
|
||||
zzmm: '',
|
||||
classPost: '',
|
||||
goodHis: '',
|
||||
mainHis: '',
|
||||
stuYearId: ''
|
||||
},
|
||||
politicsOptions: ['群众', '团员', '党员'], // 政治面貌
|
||||
selectedPoliticsOptionIndex: -1, // 当前选中的政治面貌索引
|
||||
yearOptions: [], // 学年
|
||||
yearOptionsIndex: 0, // 当前选中的学年索引
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.listEnableYear();
|
||||
},
|
||||
methods: {
|
||||
//选择学年
|
||||
onYearChange(e) {
|
||||
this.yearOptionsIndex = e.detail.value;
|
||||
this.valiFormData.stuYearId = this.yearOptions[this.yearOptionsIndex].id;
|
||||
},
|
||||
//选择政治面貌
|
||||
onPoliticsChange(e) {
|
||||
this.selectedPoliticsOptionIndex = e.detail.value;
|
||||
this.valiFormData.zzmm = this.politicsOptions[this.selectedPoliticsOptionIndex];
|
||||
},
|
||||
//获取学年
|
||||
async listEnableYear() {
|
||||
let res = await listEnableYear();
|
||||
if (res.code == 200) {
|
||||
this.yearOptions = res.rows;
|
||||
this.valiFormData.stuYearId = this.yearOptions[this.yearOptionsIndex].id;
|
||||
}
|
||||
},
|
||||
onSave(ref) {},
|
||||
onSubmit() {
|
||||
const requiredFields = [
|
||||
'classTwo',
|
||||
'youthStudy',
|
||||
'zzmm',
|
||||
'classPost',
|
||||
'goodHis',
|
||||
'mainHis',
|
||||
];
|
||||
if (!validateFormFields(requiredFields, this.valiFormData)) {
|
||||
return;
|
||||
}
|
||||
if (this.valiFormData.mainHis.length < 100) {
|
||||
uni.showToast({
|
||||
title: "主要事迹字数需要100字以上",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.isSubmitting = true; // 设置为正在提交
|
||||
uni.showLoading({
|
||||
title: "正在提交",
|
||||
success: () => {
|
||||
doApply(this.valiFormData).then(res => {
|
||||
if (res.code == 200) {
|
||||
uni.showToast({
|
||||
title: "申请成功"
|
||||
})
|
||||
this.isSubmitting = false;
|
||||
toBackPage(500, (page) => {
|
||||
page.getListOwnApply();
|
||||
this.isSubmitting = false;
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.add {
|
||||
background-color: #F5F5F7;
|
||||
padding: 10px;
|
||||
padding-bottom: 80px;
|
||||
|
||||
.form-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 22rpx 40rpx;
|
||||
background-color: white;
|
||||
margin-bottom: 20rpx;
|
||||
border-radius: 16rpx;
|
||||
|
||||
.tip {
|
||||
color: red;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
label {
|
||||
margin-bottom: 20rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
input {
|
||||
border: 1px solid #E1E1E1;
|
||||
border-radius: 10rpx;
|
||||
height: 70rpx;
|
||||
padding-left: 30rpx;
|
||||
|
||||
.input-placeholder {
|
||||
color: #b6b6b6;
|
||||
}
|
||||
}
|
||||
|
||||
textarea {
|
||||
border: 1px solid #E1E1E1;
|
||||
border-radius: 10rpx;
|
||||
width: 100%;
|
||||
height:250rpx;
|
||||
padding: 30rpx;
|
||||
&.main-his{
|
||||
height:500rpx;
|
||||
}
|
||||
.input-placeholder {
|
||||
color: #b6b6b6;
|
||||
}
|
||||
}
|
||||
|
||||
picker {
|
||||
border: 1px solid #E1E1E1;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
padding: 0 30rpx;
|
||||
|
||||
.uni-input {
|
||||
display: flex;
|
||||
color: #797979;
|
||||
|
||||
.val {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.upload-img {
|
||||
border: 1px solid #E1E1E1;
|
||||
padding: 20rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
|
||||
.tip {
|
||||
margin-top: 15rpx;
|
||||
color: #7a7a7a;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.img-list {
|
||||
border: 1px solid #D8D8D8;
|
||||
border-radius: 20rpx;
|
||||
|
||||
.imgs {
|
||||
padding: 22rpx;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.img {
|
||||
position: relative;
|
||||
width: 160rpx;
|
||||
height: 170rpx;
|
||||
margin-bottom: 15rpx;
|
||||
margin-right: 15rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.remove {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
color: white;
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
width: 52rpx;
|
||||
height: 52rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 50%;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.btn {
|
||||
border-top: 1px solid #D8D8D8;
|
||||
height: 100rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btns {
|
||||
padding: 10px;
|
||||
display: flex;
|
||||
background: white;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 999;
|
||||
|
||||
button {
|
||||
flex: 1;
|
||||
background-color: #1890FF;
|
||||
color: white;
|
||||
&[disabled] {
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
109
pages/outstanding-graduate/detail.vue
Normal file
109
pages/outstanding-graduate/detail.vue
Normal file
@@ -0,0 +1,109 @@
|
||||
<template>
|
||||
<view class="detail">
|
||||
<view class="card">
|
||||
<!-- <view class="title">查看详情</view> -->
|
||||
<view class="row">
|
||||
<label>学年:</label>
|
||||
<label>{{year}}</label>
|
||||
</view>
|
||||
<view class="row">
|
||||
<label>政治面貌:</label>
|
||||
<label>{{detail.zzmm}}</label>
|
||||
</view>
|
||||
<view class="row">
|
||||
<label>职务:</label>
|
||||
<label>{{detail.classPost}}</label>
|
||||
</view>
|
||||
<view class="row">
|
||||
<label>第二课堂学分总分值认定:</label>
|
||||
<label>{{detail.classTwo}}</label>
|
||||
</view>
|
||||
<view class="row">
|
||||
<label>青年大学习学习率:</label>
|
||||
<label>{{detail.youthStudy}}</label>
|
||||
</view>
|
||||
<view class="row column">
|
||||
<label>获奖情况:</label>
|
||||
<textarea v-model="detail.goodHis"></textarea>
|
||||
</view>
|
||||
<view class="row column">
|
||||
<label>主要事迹:</label>
|
||||
<textarea v-model="detail.mainHis"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getBiyeapply
|
||||
} from "@/api/outstanding-graduate/outstanding-graduate.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
detail:null,
|
||||
year:""
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.year=option.year;
|
||||
this.getDetail(option.id);
|
||||
},
|
||||
methods: {
|
||||
async getDetail(id) {
|
||||
let res = await getBiyeapply(id);
|
||||
if (res.code == 200) {
|
||||
console.log(res);
|
||||
this.detail=res.data;
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.detail {
|
||||
height: calc(100vh - 44px);
|
||||
background-color: #F5F5F7;
|
||||
padding: 8rpx 30rpx 0;
|
||||
|
||||
.card {
|
||||
margin: 20rpx 0rpx 0;
|
||||
padding: 30rpx;
|
||||
background-color: white;
|
||||
border-radius: 20rpx;
|
||||
|
||||
.title {
|
||||
font-weight: bold;
|
||||
color: #202020;
|
||||
display: inline-block;
|
||||
font-size: 30rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.row {
|
||||
margin-bottom: 30rpx;
|
||||
display: flex;
|
||||
&>label:first-child {
|
||||
color: #9C9C9C;
|
||||
margin-right: 40rpx;
|
||||
}
|
||||
&>label:last-child {
|
||||
text-align: right;
|
||||
flex: 1;
|
||||
|
||||
}
|
||||
}
|
||||
.column{
|
||||
flex-direction: column;
|
||||
textarea{
|
||||
width: 100%;
|
||||
margin-top: 15rpx;
|
||||
height: 400rpx;
|
||||
font-size:28rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
357
pages/outstanding-graduate/index.vue
Normal file
357
pages/outstanding-graduate/index.vue
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user