旅游教育出版社-数字教材移动端
QYF-GitLab1
昨天 8e3ee81b6ed824866734b7034604121f370f4201
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<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>