分享图编辑优化

This commit is contained in:
yulixing 2019-10-12 15:27:42 +08:00
parent b7239d6887
commit 233a17f9a7

View File

@ -134,7 +134,7 @@
<el-form-item <el-form-item
label="分享规则" label="分享规则"
prop="ad_cd.reg" prop="ad_cd.reg"
v-if="shareForm.type === 5" v-if="customize"
> >
<el-input v-model="shareForm.ad_cd.reg" /> <el-input v-model="shareForm.ad_cd.reg" />
<span class="ipt-tip">分享与广告交替规则如分享2次后广告5次填写: S-2,A-5</span> <span class="ipt-tip">分享与广告交替规则如分享2次后广告5次填写: S-2,A-5</span>
@ -142,6 +142,7 @@
<el-form-item <el-form-item
label="分享次数" label="分享次数"
prop="share_count" prop="share_count"
v-if="!customize"
> >
<el-input v-model.number="shareForm.share_count" /> <el-input v-model.number="shareForm.share_count" />
<span class="ipt-tip">分享首先的情况下, 分享n次后, 将切换成广告, 0代表不限次数</span> <span class="ipt-tip">分享首先的情况下, 分享n次后, 将切换成广告, 0代表不限次数</span>
@ -160,7 +161,11 @@
> >
<el-col :span="2"> <el-col :span="2">
<div class="img-box"> <div class="img-box">
<el-image class="img img-fit" :src="item.share_image" fit="cover"></el-image> <el-image
class="img img-fit"
:src="item.share_image"
fit="cover"
></el-image>
</div> </div>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -210,6 +215,7 @@
<el-form-item <el-form-item
label="广告次数" label="广告次数"
prop="ad_count" prop="ad_count"
v-if="!customize"
> >
<el-input v-model.number="shareForm.ad_count" /> <el-input v-model.number="shareForm.ad_count" />
<span class="ipt-tip">广告首先的情况下, 最多播放广告n次后, 将切换成分享</span> <span class="ipt-tip">广告首先的情况下, 最多播放广告n次后, 将切换成分享</span>
@ -524,6 +530,7 @@ export default {
token: '', token: '',
onlyShare: false, onlyShare: false,
onlyAd: false, onlyAd: false,
customize: false,
curShareType: '', curShareType: '',
selectedShareType: [], selectedShareType: [],
platformsArr: [], platformsArr: [],
@ -537,7 +544,7 @@ export default {
ad_count: 0, ad_count: 0,
ad_cd: { ad_cd: {
iscapture: false, iscapture: false,
reg: '' reg: '',
}, },
type: 0, type: 0,
game_id: '', game_id: '',
@ -580,7 +587,9 @@ export default {
{required: true, message: '请至少添加一个分享组', trigger: 'blur'}, {required: true, message: '请至少添加一个分享组', trigger: 'blur'},
], ],
sex: [{required: true, message: '请选择性别', trigger: 'blur'}], sex: [{required: true, message: '请选择性别', trigger: 'blur'}],
'ad_cd.reg': [{required: true, message: '请填写分享规则', trigger: 'blur'}] 'ad_cd.reg': [
{required: true, message: '请填写分享规则', trigger: 'blur'},
],
}, },
imageUrl: '', imageUrl: '',
// modal - shareType // modal - shareType
@ -732,7 +741,7 @@ export default {
if (typeof this.shareForm.ad_cd !== 'object') { if (typeof this.shareForm.ad_cd !== 'object') {
this.shareForm.ad_cd = { this.shareForm.ad_cd = {
iscapture: false, iscapture: false,
reg: '' reg: '',
} }
} }
@ -740,6 +749,7 @@ export default {
this.curShareType = this.shareForm.share_type this.curShareType = this.shareForm.share_type
if (this.shareForm.type === 2) this.onlyShare = true if (this.shareForm.type === 2) this.onlyShare = true
if (this.shareForm.type === 3) this.onlyAd = true if (this.shareForm.type === 3) this.onlyAd = true
if (this.shareForm.type === 5) this.customize = true
} }
}) })
.catch(err => { .catch(err => {
@ -773,12 +783,19 @@ export default {
if (val === 2) { if (val === 2) {
this.onlyShare = true this.onlyShare = true
this.onlyAd = false this.onlyAd = false
this.customize = false
} else if (val === 3) { } else if (val === 3) {
this.onlyShare = false this.onlyShare = false
this.onlyAd = true this.onlyAd = true
this.customize = false
} else if (val === 5) {
this.onlyShare = false
this.onlyAd = false
this.customize = true
} else { } else {
this.onlyShare = false this.onlyShare = false
this.onlyAd = false this.onlyAd = false
this.customize = false
} }
}, },
changeShareType(val) { changeShareType(val) {
@ -872,10 +889,7 @@ export default {
this.shareForm.share_words = [] this.shareForm.share_words = []
this.shareForm.share_word = '' this.shareForm.share_word = ''
this.shareForm.share_image = '' this.shareForm.share_image = ''
this.shareForm.ad_cd = { this.shareForm.share_count = 0
iscapture: false,
reg: ''
}
} }
}, },
saveShare(data) { saveShare(data) {
@ -1163,7 +1177,9 @@ export default {
this.openModalShareGroup() this.openModalShareGroup()
}, },
updateShareImgUrl() { updateShareImgUrl() {
this.shareGroups[this.groupIndex].share_image = this.shareGroupForm.share_image this.shareGroups[
this.groupIndex
].share_image = this.shareGroupForm.share_image
this.closeModalShareGroup() this.closeModalShareGroup()
}, },
uploadSuccess(res, file) { uploadSuccess(res, file) {