|
|
@ -11,7 +11,8 @@ |
|
|
<Col span="24"> |
|
|
<Col span="24"> |
|
|
<FormItem label="广告位置" prop="position"> |
|
|
<FormItem label="广告位置" prop="position"> |
|
|
<Select v-model="form.position" style="width:200px"> |
|
|
<Select v-model="form.position" style="width:200px"> |
|
|
<Option v-for="item in dictData" :value="item.value" :key="item.value">{{ item.title }}</Option> |
|
|
<Option v-for="item in dictData" :value="item.value" :key="item.value">{{ item.title }} |
|
|
|
|
|
</Option> |
|
|
</Select> |
|
|
</Select> |
|
|
</FormItem> |
|
|
</FormItem> |
|
|
</Col> |
|
|
</Col> |
|
|
@ -19,16 +20,26 @@ |
|
|
<Row :gutter="32"> |
|
|
<Row :gutter="32"> |
|
|
<Col span="12"> |
|
|
<Col span="12"> |
|
|
<FormItem label="商家名" prop="value"> |
|
|
<FormItem label="商家名" prop="value"> |
|
|
<Select v-model="form.merchantId" filterable @on-change="checkShop" :remote-method="sreachShop" :loading="loading1"> |
|
|
<Select v-model="form.merchantId" filterable @on-change="checkShop" |
|
|
<Option v-for="item in shopList" v-model="item.value" :key="item.value">{{ item.label }}</Option> |
|
|
:remote-method="sreachShop" :loading="loading1"> |
|
|
|
|
|
<Option v-for="item in shopList" v-model="item.value" :key="item.value">{{ item.label }} |
|
|
|
|
|
</Option> |
|
|
</Select> |
|
|
</Select> |
|
|
</FormItem> |
|
|
</FormItem> |
|
|
</Col> |
|
|
</Col> |
|
|
</Row> |
|
|
</Row> |
|
|
<Row :gutter="32"> |
|
|
<Row :gutter="32"> |
|
|
<Col span="24"> |
|
|
<Col span="24"> |
|
|
|
|
|
|
|
|
<FormItem label="广告图" prop="adImage"> |
|
|
<FormItem label="广告图" prop="adImage"> |
|
|
<upload-pic-input v-model="form.adImage"></upload-pic-input> |
|
|
<div v-for="(item,index) in adList" :key="index" style="display: flex;line-height: 30px;"> |
|
|
|
|
|
<upload-pic-input v-model="item.pic"></upload-pic-input> |
|
|
|
|
|
<Icon @click="delOne(index)" type="ios-trash-outline" v-if="adList.length>1" size="30" |
|
|
|
|
|
color="red" /> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div v-if="form.position == 'home_top'" style="margin-top:10px;" @click="addOne"> |
|
|
|
|
|
<Icon type="ios-add-circle-outline" size="30" color="#000" /> |
|
|
|
|
|
</div> |
|
|
</FormItem> |
|
|
</FormItem> |
|
|
</Col> |
|
|
</Col> |
|
|
</Row> |
|
|
</Row> |
|
|
@ -49,7 +60,8 @@ |
|
|
<Row :gutter="32"> |
|
|
<Row :gutter="32"> |
|
|
<Col span="24"> |
|
|
<Col span="24"> |
|
|
<FormItem label="广告关联商品" prop="productList1"> |
|
|
<FormItem label="广告关联商品" prop="productList1"> |
|
|
<div @click="checkGoods" style="display: flex;height: 35px;width: 100%;border: 1px solid #eee;padding: 0 0 0 10px;border-radius: 5px;line-height: 35px;"> |
|
|
<div @click="checkGoods" |
|
|
|
|
|
style="display: flex;height: 35px;width: 100%;border: 1px solid #eee;padding: 0 0 0 10px;border-radius: 5px;line-height: 35px;"> |
|
|
<div style="flex: 1;">{{form.productList1.productName}}</div> |
|
|
<div style="flex: 1;">{{form.productList1.productName}}</div> |
|
|
<Icon type="ios-arrow-forward" size="24" style="line-height: 35px;" /> |
|
|
<Icon type="ios-arrow-forward" size="24" style="line-height: 35px;" /> |
|
|
</div> |
|
|
</div> |
|
|
@ -118,6 +130,9 @@ |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
|
|
|
adList: [{ |
|
|
|
|
|
pic: '' |
|
|
|
|
|
}], |
|
|
loading1: false, |
|
|
loading1: false, |
|
|
aaVisiable: false, |
|
|
aaVisiable: false, |
|
|
shopList: [], |
|
|
shopList: [], |
|
|
@ -187,10 +202,23 @@ |
|
|
methods: { |
|
|
methods: { |
|
|
init() { |
|
|
init() { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
addOne() { |
|
|
|
|
|
let data = { |
|
|
|
|
|
pic: '' |
|
|
|
|
|
} |
|
|
|
|
|
this.adList.push(data) |
|
|
|
|
|
}, |
|
|
|
|
|
delOne(i) { |
|
|
|
|
|
this.adList.splice(i, 1); |
|
|
}, |
|
|
}, |
|
|
submit() { |
|
|
submit() { |
|
|
this.form.productList.push(this.form.productList1) |
|
|
this.form.productList.push(this.form.productList1) |
|
|
this.form.linkUrl = '/package1/group/groupBuySingle?type=shop&item=' |
|
|
this.form.linkUrl = '/package1/group/groupBuySingle?type=shop&item=' |
|
|
|
|
|
this.form.adImage = '' |
|
|
|
|
|
for (let i = 0; i < this.adList.length; i++) { |
|
|
|
|
|
this.form.adImage += this.adList[i].pic + ',' |
|
|
|
|
|
} |
|
|
this.$refs.form.validate((valid) => { |
|
|
this.$refs.form.validate((valid) => { |
|
|
if (valid) { |
|
|
if (valid) { |
|
|
if (this.type == "1") { |
|
|
if (this.type == "1") { |
|
|
@ -362,6 +390,21 @@ |
|
|
// 回显 |
|
|
// 回显 |
|
|
this.form = data; |
|
|
this.form = data; |
|
|
|
|
|
|
|
|
|
|
|
// 判断字符串中是否包含逗号 |
|
|
|
|
|
if (this.form.adImage.indexOf(',') !== -1) { |
|
|
|
|
|
// 有逗号:先按逗号分割,再过滤掉空字符串或纯空白字符串,最后映射为 {pic: url} 对象数组 |
|
|
|
|
|
this.adList = this.form.adImage |
|
|
|
|
|
.split(',') |
|
|
|
|
|
.filter(item => item.trim() !== '') // 过滤掉空项 |
|
|
|
|
|
.map(url => ({ |
|
|
|
|
|
pic: url.trim() |
|
|
|
|
|
})); |
|
|
|
|
|
} else { |
|
|
|
|
|
// 没有逗号:整个字符串作为一个对象 |
|
|
|
|
|
this.adList = [{ |
|
|
|
|
|
pic: this.form.adImage.trim() |
|
|
|
|
|
}]; |
|
|
|
|
|
} |
|
|
getShopData(this.searchForm).then((res) => { |
|
|
getShopData(this.searchForm).then((res) => { |
|
|
this.loading = false; |
|
|
this.loading = false; |
|
|
if (res.success) { |
|
|
if (res.success) { |
|
|
|