|
|
@@ -104,7 +104,7 @@
|
|
|
</el-form-item>
|
|
|
</el-card>
|
|
|
</div>
|
|
|
- <div v-if="item.contentType == 4 || item.contentType == 10 || item.contentType == 17">
|
|
|
+ <div v-if="item.contentType == 4 || item.contentType == 10 || item.contentType == 17 || item.contentType == 23">
|
|
|
<el-card class="box-card">
|
|
|
<el-form-item label="标题" prop="miniprogramTitle">
|
|
|
<el-input v-model="item.miniprogramTitle" placeholder="请输入小程序消息标题,最长为64字" />
|
|
|
@@ -204,7 +204,7 @@
|
|
|
</el-card>
|
|
|
</div>
|
|
|
|
|
|
- <div v-if="item.contentType == 12 || item.contentType == 18 || item.contentType == 19">
|
|
|
+ <div v-if="item.contentType == 12 || item.contentType == 18 || item.contentType == 19 || item.contentType == 24">
|
|
|
<el-card class="box-card">
|
|
|
<el-form-item label="直播间" >
|
|
|
<el-select v-model="item.liveId"
|
|
|
@@ -521,7 +521,8 @@ export default {
|
|
|
this.$set(this.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
|
|
|
}
|
|
|
|
|
|
- if ( this.setting[i].contentType == 4 || this.setting[i].contentType == 10 || this.setting[i].contentType == 17){
|
|
|
+ if ( this.setting[i].contentType == 4 || this.setting[i].contentType == 10 || this.setting[i].contentType == 17
|
|
|
+ || this.setting[i].contentType == 23){//新增APP 看课 跳转短链回填封面
|
|
|
this.$set(this.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
|
|
|
}
|
|
|
}
|
|
|
@@ -551,7 +552,8 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10 || this.setting[i].contentType == 17){
|
|
|
+ if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10 || this.setting[i].contentType == 17
|
|
|
+ || this.setting[i].contentType == 23){//新增APP 看课 跳转短链回填标题
|
|
|
this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
|
|
|
|
|
|
if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
|
|
|
@@ -779,7 +781,8 @@ export default {
|
|
|
this.$set(this.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
|
|
|
|
|
|
}
|
|
|
- if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10 || this.setting[i].contentType == 17){
|
|
|
+ if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10 || this.setting[i].contentType == 17
|
|
|
+ || this.setting[i].contentType == 23){
|
|
|
this.$set(this.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
|
|
|
|
|
|
}
|
|
|
@@ -806,7 +809,8 @@ export default {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10 || this.setting[i].contentType == 17){
|
|
|
+ if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10 || this.setting[i].contentType == 17
|
|
|
+ || this.setting[i].contentType == 23){
|
|
|
this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
|
|
|
|
|
|
if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
|
|
|
@@ -847,16 +851,35 @@ export default {
|
|
|
|
|
|
if (this.msgForm.draftStrategy==1){
|
|
|
|
|
|
- this.msgForm.setting=JSON.stringify(this.setting)
|
|
|
-
|
|
|
+ this.msgForm.setting = JSON.stringify(this.setting);
|
|
|
+ let jsonSetting = JSON.parse(this.msgForm.setting);
|
|
|
+ let hasLiveSetting = false;
|
|
|
+ let count = 0;
|
|
|
+ for (let index = 0; index < jsonSetting.length; index++) {
|
|
|
+ if (jsonSetting[index] && [12, 18, 19, 24].includes(Number(jsonSetting[index].contentType))) {
|
|
|
+ hasLiveSetting = true;
|
|
|
+ count++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (hasLiveSetting) {
|
|
|
+ if (this.msgForm.courseId) {
|
|
|
+ return this.$message.error("直播间不能选取课程");
|
|
|
+ }
|
|
|
+ if (this.msgForm.videoId) {
|
|
|
+ return this.$message.error("直播间不能选取课节");
|
|
|
+ }
|
|
|
+ if (count > 1) {
|
|
|
+ return this.$message.error("直播间一次只能发送一条");
|
|
|
+ }
|
|
|
+ }
|
|
|
if (this.setting.length <= 0) {
|
|
|
return this.$message.error("请添加规则")
|
|
|
}
|
|
|
- if (this.msgForm.courseId===null || this.msgForm.courseId===''){
|
|
|
+ if (!hasLiveSetting && !this.msgForm.courseId){
|
|
|
return this.$message.error("课程不能为空")
|
|
|
}
|
|
|
|
|
|
- if (this.msgForm.videoId===null || this.msgForm.videoId===''){
|
|
|
+ if (!hasLiveSetting && !this.msgForm.videoId){
|
|
|
return this.$message.error("课节不能为空")
|
|
|
}
|
|
|
|
|
|
@@ -884,10 +907,10 @@ export default {
|
|
|
return this.$message.error("链接地址不能为空")
|
|
|
}
|
|
|
|
|
|
- if ((this.setting[i].contentType == 4 || this.setting[i].contentType == 10 || this.setting[i].contentType == 17) && (this.setting[i].miniprogramTitle == null || this.setting[i].miniprogramTitle == "")) {
|
|
|
+ if ([4, 10, 17, 23, 24].includes(Number(this.setting[i].contentType)) && (this.setting[i].miniprogramTitle == null || this.setting[i].miniprogramTitle == "")) {
|
|
|
return this.$message.error("小程序消息标题不能为空")
|
|
|
}
|
|
|
- if ((this.setting[i].contentType == 4 || this.setting[i].contentType == 10 || this.setting[i].contentType == 17) && (this.setting[i].miniprogramPicUrl == null || this.setting[i].miniprogramPicUrl == "")) {
|
|
|
+ if ([4, 10, 17, 23, 24].includes(Number(this.setting[i].contentType)) && (this.setting[i].miniprogramPicUrl == null || this.setting[i].miniprogramPicUrl == "")) {
|
|
|
return this.$message.error("小程序封面地址不能为空")
|
|
|
}
|
|
|
|
|
|
@@ -904,6 +927,13 @@ export default {
|
|
|
if (this.setting[i].contentType == 7 && (this.setting[i].value == null || this.setting[i].value == "")) {
|
|
|
return this.$message.error("语音不能为空")
|
|
|
}
|
|
|
+ // 添加对福袋的验证
|
|
|
+ if (this.setting[i].contentType == 14 && (this.setting[i].luckyBagId == null || this.setting[i].luckyBagId === "")) {
|
|
|
+ return this.$message.error("福袋不能为空")
|
|
|
+ }
|
|
|
+ if ((this.setting[i].contentType == 12 || this.setting[i].contentType == 24) && (this.setting[i].liveId == null || this.setting[i].liveId == "")) {
|
|
|
+ return this.$message.error("直播间不能为空");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|