+广告属性
This commit is contained in:
parent
dd8e50744f
commit
ab71289373
@ -102,6 +102,34 @@
|
||||
/>
|
||||
<span class="ipt-tip"></span>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="广告优先级"
|
||||
prop="ad_sort"
|
||||
>
|
||||
<el-select
|
||||
v-model="adForm.ad_sort"
|
||||
placeholder="请选择广告优先级"
|
||||
class="w100"
|
||||
:disabled="!writeable"
|
||||
>
|
||||
<el-option
|
||||
label="按固定次数推广"
|
||||
:value="0"
|
||||
/>
|
||||
<el-option
|
||||
label="个性化推荐"
|
||||
:value="1"
|
||||
/>
|
||||
<el-option
|
||||
label="长期推广"
|
||||
:value="2"
|
||||
/>
|
||||
<el-option
|
||||
label="系统默认推广"
|
||||
:value="3"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="广告标题"
|
||||
prop="ad_title"
|
||||
@ -161,6 +189,7 @@
|
||||
v-model="adForm.jump_status"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
:disabled="!writeable"
|
||||
>
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
@ -175,34 +204,17 @@
|
||||
:disabled="!writeable"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
label="广告优先级"
|
||||
prop="ad_sort"
|
||||
label="是否抖动"
|
||||
prop="ad_property.is_shake"
|
||||
>
|
||||
<el-select
|
||||
v-model="adForm.ad_sort"
|
||||
placeholder="请选择广告优先级"
|
||||
class="w100"
|
||||
<el-switch
|
||||
v-model="adForm.ad_property.is_shake"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
:disabled="!writeable"
|
||||
>
|
||||
<el-option
|
||||
label="按固定次数推广"
|
||||
:value="0"
|
||||
/>
|
||||
<el-option
|
||||
label="个性化推荐"
|
||||
:value="1"
|
||||
/>
|
||||
<el-option
|
||||
label="长期推广"
|
||||
:value="2"
|
||||
/>
|
||||
<el-option
|
||||
label="系统默认推广"
|
||||
:value="3"
|
||||
/>
|
||||
</el-select>
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
@ -211,7 +223,10 @@
|
||||
@click="submit('adForm')"
|
||||
v-if="writeable"
|
||||
>提交</el-button>
|
||||
<el-button @click="resetForm('adForm')" v-if="writeable">重置</el-button>
|
||||
<el-button
|
||||
@click="resetForm('adForm')"
|
||||
v-if="writeable"
|
||||
>重置</el-button>
|
||||
<el-button @click="goBack">返回</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -265,7 +280,10 @@ export default {
|
||||
ad_sort: 0,
|
||||
status: 0,
|
||||
dateRange: [],
|
||||
companyid: 0
|
||||
companyid: 0,
|
||||
ad_property: {
|
||||
is_shake: 0
|
||||
} //用于拓展属性
|
||||
},
|
||||
adFormRules: {
|
||||
name: [{ required: true, message: '请输入广告名称', trigger: 'blur' }],
|
||||
@ -286,7 +304,10 @@ export default {
|
||||
{ required: true, validator: validateJumpParams, trigger: 'blur' }
|
||||
],
|
||||
ad_num: [
|
||||
{ type: 'number', message: '计划书必须是数值', trigger: 'blur' }
|
||||
{ type: 'number', message: '计划数必须是数值', trigger: 'blur' }
|
||||
],
|
||||
'ad_property.is_shake': [
|
||||
{ type: 'number', message: '该项必须是数值', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -296,10 +317,6 @@ export default {
|
||||
this.modeList = modeList
|
||||
this.typeList = typeList
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const areaListRes = await this.getAdAreaList()
|
||||
areaListRes.adAreaList.map(item => {
|
||||
this.areaList[item.area_id] = item.name
|
||||
@ -336,6 +353,15 @@ export default {
|
||||
this.formDate(adData.end_time)
|
||||
]
|
||||
this.adForm = adData
|
||||
this.adForm.ad_property = this.adForm.ad_property
|
||||
? JSON.parse(this.adForm.ad_property)
|
||||
: ''
|
||||
|
||||
if (typeof this.adForm.ad_property !== 'object') {
|
||||
this.adForm.ad_property = {
|
||||
is_shake: 0
|
||||
}
|
||||
}
|
||||
const gameid = this.adForm.gameid
|
||||
const locationid = this.adForm.locationid
|
||||
this.changePlatform(this.adForm.channelid)
|
||||
@ -355,10 +381,9 @@ export default {
|
||||
this.changeGame()
|
||||
}
|
||||
|
||||
|
||||
// 判断该条广告是否可编辑: 新增、未通过
|
||||
|
||||
this.writeable = (this.adForm.status === 2 || !hasAd) ? true : false
|
||||
this.writeable = this.adForm.status === 2 || !hasAd ? true : false
|
||||
},
|
||||
methods: {
|
||||
// common
|
||||
@ -513,6 +538,9 @@ export default {
|
||||
this.$message.error('请按要求填写表单')
|
||||
return
|
||||
}
|
||||
|
||||
this.adForm.ad_property = JSON.stringify(this.adForm.ad_property)
|
||||
|
||||
this.adForm.begin_time = this.adForm.dateRange[0]
|
||||
this.adForm.end_time = this.adForm.dateRange[1]
|
||||
// delete this.adForm.dateRange
|
||||
|
Loading…
x
Reference in New Issue
Block a user