From f95aef88aea66fe7c0f924c3a454af4331c47e9d Mon Sep 17 00:00:00 2001 From: yulixing Date: Wed, 21 Aug 2019 10:33:14 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=B9=BF=E5=91=8A=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ad/edit.vue | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) 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)