diff --git a/src/views/ad/edit.vue b/src/views/ad/edit.vue index 52ce870..f748450 100644 --- a/src/views/ad/edit.vue +++ b/src/views/ad/edit.vue @@ -199,7 +199,18 @@ v-if="adForm.jump_status === 1" > + + + @@ -280,7 +291,10 @@ export default { name: 'AdEdit', data() { const validateJumpParams = (rule, value, callback) => { - if (this.adForm.jump_status === 1 && this.adForm.jump_param === '') { + if ( + this.adForm.jump_status === 1 && + (this.adForm.jump_param === '' || this.adForm.ad_property.appid === '') + ) { callback(new Error('请填写跳转参数')) } else { callback() @@ -321,7 +335,9 @@ export default { is_shake: 0, is_hot: 0, is_new: 0, - is_recommend: 0 + is_recommend: 0, + appid: '', + jump_param: '' } //用于拓展属性 }, adFormRules: { @@ -345,6 +361,12 @@ export default { ad_num: [ { type: 'number', message: '计划数必须是数值', trigger: 'blur' } ], + 'ad_property.jump_param': [ + { required: true, validator: validateJumpParams, trigger: 'blur' } + ], + 'ad_property.appid': [ + { required: true, validator: validateJumpParams, trigger: 'blur' } + ], 'ad_property.is_shake': [ { type: 'number', message: '是否抖动必须是数值', trigger: 'blur' } ], @@ -410,9 +432,19 @@ export default { is_shake: 0, is_hot: 0, is_new: 0, - is_recommend: 0 + is_recommend: 0, + appid: '', + jump_param: '' } } + + // 兼容跳转参数显示 + if (!this.adForm.ad_property.jump_param) { + this.adForm.ad_property.jump_param = this.adForm.jump_param + ? this.adForm.jump_param + : '' + } + const gameid = this.adForm.gameid const locationid = this.adForm.locationid this.changePlatform(this.adForm.channelid)