|
@@ -1190,6 +1190,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
handleAdd() {
|
|
handleAdd() {
|
|
|
this.reset();
|
|
this.reset();
|
|
|
|
|
+ this.form.uploadType = 1; // 默认播放线路:线路一
|
|
|
this.form.courseId = this.courseId;
|
|
this.form.courseId = this.courseId;
|
|
|
this.open = true;
|
|
this.open = true;
|
|
|
this.title = "添加课堂视频";
|
|
this.title = "添加课堂视频";
|
|
@@ -1214,7 +1215,15 @@ export default {
|
|
|
console.log(response);
|
|
console.log(response);
|
|
|
this.form = response.data;
|
|
this.form = response.data;
|
|
|
this.$set(this.form, 'courseIntroImg', response.data.courseIntroImg || null);
|
|
this.$set(this.form, 'courseIntroImg', response.data.courseIntroImg || null);
|
|
|
- this.$set(this.form, 'isOnPut', response.data.isOnPut !== undefined ? response.data.isOnPut : 0);
|
|
|
|
|
|
|
+ this.$set(this.form, 'isOnPut', response.data.isOnPut !== undefined ? Number(response.data.isOnPut) : 0);
|
|
|
|
|
+ // 后端字段需为数字;null 时 el-radio 会误选中「是」(1)
|
|
|
|
|
+ this.$set(this.form, 'isProduct', response.data.isProduct != null ? Number(response.data.isProduct) : 0);
|
|
|
|
|
+ this.$set(this.form, 'isFirst', response.data.isFirst != null ? Number(response.data.isFirst) : 0);
|
|
|
|
|
+ this.$set(this.form, 'isSpeed', response.data.isSpeed != null ? Number(response.data.isSpeed) : 0);
|
|
|
|
|
+ if (this.form.isProduct !== 1) {
|
|
|
|
|
+ this.$set(this.form, 'courseProducts', []);
|
|
|
|
|
+ this.form.productId = null;
|
|
|
|
|
+ }
|
|
|
if(!!this.form.randomRedPacketRules){
|
|
if(!!this.form.randomRedPacketRules){
|
|
|
this.$set(this.form, 'randomRedPacketRulesArr', JSON.parse(this.form.randomRedPacketRules)) ;
|
|
this.$set(this.form, 'randomRedPacketRulesArr', JSON.parse(this.form.randomRedPacketRules)) ;
|
|
|
// this.form.randomRedPacketRulesArr = JSON.parse(this.form.randomRedPacketRules);
|
|
// this.form.randomRedPacketRulesArr = JSON.parse(this.form.randomRedPacketRules);
|
|
@@ -1283,8 +1292,11 @@ export default {
|
|
|
if (this.packageList.length > 0) {
|
|
if (this.packageList.length > 0) {
|
|
|
this.form.packageJson = JSON.stringify(this.packageList);
|
|
this.form.packageJson = JSON.stringify(this.packageList);
|
|
|
}
|
|
}
|
|
|
- if (this.form.courseProducts != null) {
|
|
|
|
|
|
|
+ if (this.form.isProduct === 1 && this.form.courseProducts != null && this.form.courseProducts.length > 0) {
|
|
|
this.form.productId = this.form.courseProducts.map(item => item.id).join(',');
|
|
this.form.productId = this.form.courseProducts.map(item => item.id).join(',');
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.form.productId = null;
|
|
|
|
|
+ this.form.courseProducts = [];
|
|
|
}
|
|
}
|
|
|
if(!!this.form.randomRedPacketRulesArr){
|
|
if(!!this.form.randomRedPacketRulesArr){
|
|
|
let rulesJson = JSON.stringify(this.form.randomRedPacketRulesArr);
|
|
let rulesJson = JSON.stringify(this.form.randomRedPacketRulesArr);
|