|
<template>
|
<div class="customPage">
|
<div>
|
<el-form-item label="展示图片:">
|
<custom-upload-img
|
@handle-success="handleSuccess"
|
@handle-remove="handleRemove"
|
:fileList="fileList"
|
:form="form"
|
>
|
</custom-upload-img>
|
</el-form-item>
|
<el-form-item required label="跳转路径:">
|
{{form.type === '4' ? '把用户引导到限时秒杀界面' :'把用户引导到优惠券领取界面'}}
|
<!-- <el-input
|
class="diyInput"
|
v-model="form.link"
|
placeholder="请输入跳转链接"
|
></el-input> -->
|
</el-form-item>
|
</div>
|
<div v-show="form.type&&form.type !== '5'">
|
<el-form-item required label="展示商品:">
|
<el-radio-group @change="changeIsDisplayProd" v-model="form.isDisplayProd">
|
<el-radio label="2">否</el-radio>
|
<el-radio label="1">是(默认展示前六个商品)</el-radio>
|
</el-radio-group>
|
</el-form-item>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import { mapMutations } from 'vuex'
|
export default {
|
props: ['form'],
|
data() {
|
return {}
|
},
|
computed: {
|
fileList() {
|
return this.form.fileUrl ? [{ url: this.form.fileUrl }] : []
|
}
|
},
|
methods: {
|
...mapMutations(['updateCurrent']),
|
/**
|
*当是展示商品时
|
*/
|
changeIsDisplayProd(val) {
|
if (val === '1') {
|
this.updateCurrent({ x: 10, w: 355, h: this.form.h + 250 })
|
} else {
|
this.updateCurrent({ h: this.form.h - 250 })
|
}
|
},
|
/**
|
* 获取上传成功的图片
|
*/
|
handleSuccess(data) {
|
this.fileList.push({
|
url: data.url
|
})
|
this.updateCurrent({ fileUrl: data.url })
|
},
|
/**
|
* 移除图片
|
*/
|
handleRemove(data) {
|
this.updateCurrent({ fileUrl: null })
|
}
|
}
|
}
|
</script>
|
|
<style>
|
</style>
|