课程信息
-
日期:{{ selectedCourse.date }}
+
日期:{{ selectedCourse.date }}
时间:{{ selectedCourse.period }}
+
主题:{{ selectedCourse.theme }}
老师:{{ selectedCourse.teacher ? selectedCourse.teacher.name : '' }}
@@ -169,35 +170,58 @@
width: 120,
},{
prop: 'date',
- label: '日期',
+ label: '上课日期',
align: 'center',
width: 120,
}, {
prop: 'period',
- label: '时间 ',
+ label: '上课时间',
align: 'center',
width: 180,
- }, {
+ },
+
+ // {
+ // prop: 'start_time',
+ // label: '开始时间',
+ // align: 'center',
+ // width: 120,
+ // }, {
+ // prop: 'end_time',
+ // label: '结束时间',
+ // align: 'center',
+ // width: 120,
+ // },
+ {
prop: 'teacher.name',
label: '授课老师',
align: 'center',
width: 120,
}, {
- prop: 'sex',
+ prop: 'teacher.sex',
label: '性别',
- align: 'left'
+ align: 'left',
+ align: 'center',
+ width:80
}, {
- prop: 'mobile',
- label: '联系方式',
- align: 'left'
+ prop: 'teacher.mobile',
+ label: '联系方式',
+ align: 'center',
+ width: 180,
}, {
prop: 'address',
label: '上课地点',
- align: 'left'
+ align: 'left',
+ width: 240,
+ }, {
+ prop: 'address_detail',
+ label: '签到地点',
+ align: 'left',
+ width: 240,
}, {
prop: 'teacher.introduce',
label: '老师简介',
- align: 'left'
+ align: 'left',
+ width: 240,
}],
materialDialogVisible: false, // 上传课件模态框的可见性
selectedCourse: {}, // 当前选中的课程内容
diff --git a/src/views/course/components/editClass.vue b/src/views/course/components/editClass.vue
index 23377c3..a8c5bb8 100644
--- a/src/views/course/components/editClass.vue
+++ b/src/views/course/components/editClass.vue
@@ -5,23 +5,37 @@
+
+
+
-
+
-
+
+
+
+
-
+
上传新课件
-
点击上传
@@ -133,17 +150,28 @@
type: 'add',
id: '',
teacher_options: [],
+ mapparams: {
+ zoom: 11
+ },
+ mapform: [],
form: {
date: '',
- period: '',
+ // timeRange: [],
+ period:'',
teacher_id: "",
theme: '',
address: '',
- introduce: '',
+ address_detail: '',
+ latitude: '',
+ longitude: '',
+ // introduce: '',
files: [], // 现有课件列表
},
rules: {
-
+ date: [{
+ required: true,
+ message: '请选择上课日期'
+ }]
},
uploadAction: `${process.env.VUE_APP_UPLOAD_API}`, // 上传文件的URL
uploadHeaders: {
@@ -163,16 +191,26 @@
this.teacher_options.map(item => {
if (e === item.id) {
this.form.teacher_id = item.id
- this.form.introduce = item.introduce
+ // this.form.introduce = item.introduce
}
})
}
console.log("e", e)
},
+ changeTime(e) {
+ console.log("eeee", e)
+ if (e) {
+ this.form.start_time = e[0]
+ this.form.end_time = e[1]
+ } else {
+ this.form.start_time = ''
+ this.form.end_time = ''
+ }
+ },
submit() {
if (this.id) {
this.form.id = this.id
- }else{
+ } else {
this.form.id = ''
}
@@ -181,9 +219,9 @@
const newFileIds = this.newFileList.map(file => {
return file.response ? file.response.id : file.id;
});
-
+
// 合并现有文件ID和新上传的文件ID,排除已删除的文件ID
- const finalFileIds = [...existingFileIds, ...newFileIds].filter(id =>
+ const finalFileIds = [...existingFileIds, ...newFileIds].filter(id =>
!this.removedFileIds.includes(id)
);
@@ -191,18 +229,16 @@
...this.form,
file_ids: finalFileIds
};
-
save(submitData).then(res => {
this.$message({
type: 'success',
message: '保存课表成功'
})
- saveTeacher({
- id: this.form.teacher_id,
- introduce: this.form.introduce
- }).then(res => {
+ // saveTeacher({
+ // id: this.form.teacher_id
+ // }).then(res => {
- })
+ // })
this.isShow = false
this.$emit('refresh')
// this.active = 1
@@ -214,8 +250,13 @@
id: this.id,
show_relation: ['teacher']
}).then(res => {
- this.form = this.base.deepCopy(res)
- this.form.introduce = res.teacher.introduce
+ this.form = this.base.requestToForm(res, this.form)
+ this.form.files = res.files ? res.files : []
+ // this.form.timeRange = [this.form.start_time ? this.form.start_time : '', this.form.end_time ? this.form
+ // .end_time : ''
+ // ]
+ // this.form.introduce = res.teacher.introduce
+ this.mapform = [res.longitude, res.latitude, res.address_detail]
})
},
// 下载文件
@@ -276,13 +317,17 @@
}
} else {
this.id = ''
+ this.mapform = []
this.form = {
date: '',
- period: '',
+ // timeRange: [],
+ period:'',
teacher_id: "",
theme: '',
address: '',
- introduce: '',
+ address_detail: '',
+ latitude: '',
+ longitude: '',
files: [], // 重置课件列表
}
this.newFileList = [] // 重置新上传文件列表
@@ -290,21 +335,31 @@
this.$refs['dialog'].reset()
}
},
+ mapform(newVal, oldVal) {
+ console.log(newVal)
+ this.form.longitude = newVal[0]
+ this.form.latitude = newVal[1]
+ this.form.address_detail = newVal[2]
+ }
}
}
+
diff --git a/src/views/courseQr/index.vue b/src/views/courseQr/index.vue
index 6c12fb8..a680f97 100644
--- a/src/views/courseQr/index.vue
+++ b/src/views/courseQr/index.vue
@@ -1,209 +1,434 @@
-
-
-
-
-
-
-
-
-
- 选择课程
-
+
+
+
+
+
+
+
+
+
+ 选择课表
+
+
+
+
+
+
+
+
+
-
-
{{ course.name }}
-
- {{ course.time }}
- {{ course.location }}
- {{ course.teacher }}
-
-
-
-
-
-
-
-
- 课程签到二维码
-
-
-
-
请选择课程生成二维码
-
选择左侧课程后,将自动生成对应的签到二维码
-
-
-
-
{{ selectedCourse.name }}
-
-
![二维码]()
-
-
-
课程信息
-
-
时间:{{ selectedCourse.time }}
-
地点:{{ selectedCourse.location }}
-
主讲:{{ selectedCourse.teacher }}
-
类型:{{ getTypeName(selectedCourse.type) }}
+
+
+
{{ course.theme }}
+
+ {{ course.date }} - {{course.period}}
+ {{ course.address }}
+ {{ course.teacher.name }}
-
- 下载二维码
- 预览签到页
- 复制链接
-
-
-
-
使用说明
-
- - 学员扫描此二维码可直接进入课程签到页面
- - 二维码包含课程信息,自动识别对应课程
- - 支持微信扫一扫
- - 建议在课程开始前30分钟展示二维码
- - 可下载二维码图片用于打印或分享
-
-
-
-
-
-
-
-
-
+
+