fix ad edit

This commit is contained in:
yulixing 2019-09-26 16:12:33 +08:00
parent 881e595226
commit 79db3f7635
2 changed files with 28 additions and 14 deletions

View File

@ -513,12 +513,22 @@ export default {
: ''
}
//
const gameid = this.adForm.gameid
const locationid = this.adForm.locationid
const appid = this.adForm.ad_property.appid
const jump_param = this.adForm.ad_property.jump_param
const link = this.adForm.ad_property.link
this.changePlatform(this.adForm.channelid)
this.adForm.gameid = gameid
this.changeGame()
this.adForm.locationid = locationid
this.adForm.ad_property.appid = appid
this.changeTarget(this.adForm.ad_property.appid)
this.adForm.ad_property.jump_param = jump_param
this.adForm.ad_property.link = link
const targetList = await this.getJumpList({
game_id: this.adForm.gameid,
platform_id: this.adForm.channelid,
@ -591,7 +601,7 @@ export default {
validate(formName) {
return new Promise((resolve, reject) => {
this.$refs[formName].validate(valid => {
valid ? resolve(true) : reject()
resolve(valid)
})
})
},
@ -670,6 +680,9 @@ export default {
},
async changeGame(val) {
this.adForm.locationid = ''
this.adForm.ad_property.appid = ''
this.adForm.ad_property.link = ''
this.adForm.ad_property.jump_param = ''
const location = await this.getAdPos({
channelid: this.adForm.channelid,
gameid: this.adForm.gameid,
@ -687,9 +700,6 @@ export default {
}
})
this.adForm.ad_property.appid = ''
this.adForm.ad_property.link = ''
this.adForm.ad_property.jump_param = ''
this.targetList = {}
const targetList = await this.getJumpList({
game_id: this.adForm.gameid,
@ -698,6 +708,8 @@ export default {
this.targetList = targetList.result
},
changeTarget(val) {
this.adForm.ad_property.link = ''
this.adForm.ad_property.jump_param = ''
let target
for (let i = 0; i < this.targetList.length; i++) {
if (this.targetList[i].t_appid === val) {
@ -735,18 +747,21 @@ export default {
this.$message.error('请按要求填写表单')
return
}
const adInfo = JSON.parse(JSON.stringify(this.adForm))
this.adForm.ad_property = JSON.stringify(this.adForm.ad_property)
this.adForm.locationid = JSON.stringify(this.adForm.locationid)
adInfo.ad_property = JSON.stringify(adInfo.ad_property)
adInfo.locationid = JSON.stringify(adInfo.locationid)
this.adForm.begin_time = this.adForm.dateRange[0]
this.adForm.end_time = this.adForm.dateRange[1]
// delete this.adForm.dateRange
if (this.adForm.id) {
this.adForm.status = 0
const result = await this.updateAd(this.adForm)
adInfo.begin_time = adInfo.dateRange[0]
adInfo.end_time = adInfo.dateRange[1]
if (adInfo.id) {
adInfo.status = 0
const result = await this.updateAd(adInfo)
} else {
const result = await this.addAd(this.adForm)
const result = await this.addAd(adInfo)
}
this.$message.success('广告信息保存成功,已提交审核!')
this.$router.push('/ad/list')

View File

@ -420,7 +420,6 @@ export default {
try {
this.isLoaded = true
const params = {}
console.log(this.filterForm)
if (this.filterForm.game_id) params.game_id = this.filterForm.game_id
if (this.filterForm.platform_id)
params.platform_id = this.filterForm.platform_id