<template>
|
<div class="applyPage">
|
<van-nav-bar
|
title="试用申请"
|
left-text=""
|
right-text=""
|
left-arrow
|
@click-left="onClickLeft"
|
/>
|
<div class="pageTitle">旅游教育出版社教师教材试用申请表</div>
|
<div class="eleContent">
|
<div class="bookInfo">
|
<div class="title">教材申请</div>
|
<div class="book-example">
|
<div class="imgBox">
|
<img :src="textBookInfo.icon" class="autoImg" alt />
|
</div>
|
<div class="bookname">{{ textBookInfo.name }}</div>
|
</div>
|
</div>
|
<div class="formBox">
|
<div class="title">授课情况</div>
|
<van-form ref="formData">
|
<van-cell-group>
|
<van-field
|
v-model="formData.courseName"
|
label="课程名称:"
|
required
|
:rules="[{ required: true, message: '请输入课程名称' }]"
|
/>
|
<van-field
|
v-model="formData.studentLevel"
|
label="学生层次:"
|
required
|
:rules="[{ required: true, message: '请输入学生层次' }]"
|
/>
|
<van-field
|
v-model="formData.studentsNumber"
|
required
|
label="学生人数/年:"
|
:rules="[{ required: true, message: '请输入学生人数/年' }]"
|
/>
|
<van-field
|
v-model="formData.teachingMaterialPress"
|
required
|
label="现用教材出版社:"
|
:rules="[{ required: true, message: '请输入现用教材出版社' }]"
|
/>
|
<van-field
|
v-model="formData.teachingMaterials"
|
required
|
label="所用教材:"
|
:rules="[{ required: true, message: '请输入所用教材' }]"
|
/>
|
</van-cell-group>
|
<div class="vanBtn">
|
<van-button
|
round
|
block
|
type="info"
|
@click="onSubmit"
|
v-if="!btnLoading"
|
>
|
提交
|
</van-button>
|
</div>
|
</van-form>
|
</div>
|
</div>
|
</div>
|
</template>
|
<script>
|
import Vue from "vue";
|
import { Toast, SwipeCell, Dialog } from "vant";
|
import { mapState } from "vuex";
|
Vue.use(Dialog);
|
Vue.use(SwipeCell);
|
export default {
|
data() {
|
return {
|
textBookInfo: {},
|
formData: {
|
courseName: "",
|
studentLevel: "",
|
studentsNumber: "",
|
teachingMaterialPress: "",
|
teachingMaterials: ""
|
},
|
btnLoading: false
|
};
|
},
|
computed: {
|
...mapState(["userInfo"])
|
},
|
created() {
|
this.textBookInfo = JSON.parse(this.$route.query.bookInfo);
|
this.getType();
|
},
|
methods: {
|
getType() {
|
const data = {
|
refCodes: ["tourism_digitalTextbooksApplication"]
|
};
|
this.MG.resource.getCmsTypeByRefCode(data).then(res => {
|
this.description = res[0].description;
|
this.formData.workInfo = res[0].cmsTypeLinks[0].children;
|
});
|
},
|
onSubmit() {
|
var that = this;
|
for (const key in that.formData) {
|
if (that.formData[key] == "") {
|
Toast.fail("请填写所需资料");
|
return false;
|
}
|
}
|
this.btnLoading = true;
|
const data = {
|
topicIdOrRefCode: "applyDigitalBook",
|
name: this.userInfo.name || "",
|
content: JSON.stringify(that.textBookInfo),
|
state: "WaitAudit",
|
type: "applyDigitalBook",
|
cmsTypeRefCode: "tourism_digitalTextbooksApplication ",
|
newDataListRequest: this.tool.worksDataBytool(
|
this.formData.workInfo,
|
this.formData
|
),
|
};
|
this.MG.ugc.newTopicMessage(data).then((res) => {
|
this.loading = false;
|
if (res) {
|
Dialog.confirm({
|
title: "提示",
|
message: "您的试用申请已提交,管理员审核中!",
|
confirmButtonText: "确定",
|
cancelButtonText: "取消"
|
})
|
.then(() => {
|
this.$router.push({
|
name: "myApplyBook"
|
});
|
})
|
.catch(() => {
|
this.$router.go(-1);
|
});
|
}
|
});
|
},
|
|
onClickLeft() {
|
var that = this;
|
that.$router.go(-1);
|
}
|
}
|
};
|
</script>
|
<style scoped>
|
.pageTitle {
|
font-size: 16px;
|
text-align: center;
|
padding: 20px 0;
|
font-weight: bold;
|
border-bottom: 2px dashed #dcdcdc;
|
}
|
|
.bookInfo {
|
padding: 0 15px;
|
}
|
.book-example {
|
width: 200px;
|
margin: 0 auto;
|
}
|
.imgBox {
|
box-shadow: 0 3px 6px 1px #00000029;
|
position: relative;
|
width: 134px;
|
height: 180px;
|
margin: 0 auto;
|
border-radius: 5px;
|
overflow: hidden;
|
}
|
.bookname {
|
margin: 10px;
|
font-size:16px;
|
|
}
|
|
.formBox {
|
padding: 0 15px;
|
}
|
.title {
|
font-size: 14px;
|
font-weight: bold;
|
padding: 10px 0;
|
margin: 10px 0;
|
}
|
|
.vanBtn {
|
width: 100%;
|
padding: 16px;
|
background: #fff;
|
position: relative;
|
bottom: 0px;
|
z-index: 100;
|
}
|
.box >>> .van-tabs__line {
|
background-color: #3586ff !important;
|
}
|
.formBox >>> .van-field__label {
|
width: auto !important;
|
}
|
</style>
|