|
|
|
@ -36,9 +36,17 @@
|
|
|
|
|
/> |
|
|
|
|
</template> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-col :span="12"> |
|
|
|
|
<el-form-item label="砍价产品主图片"> |
|
|
|
|
<single-pic v-model="form.image" style="width: 500px" type="image" :num="1" :width="150" :height="150" /> |
|
|
|
|
<single-pic v-model="form.image" type="image" :num="1" :width="150" :height="150" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="12"> |
|
|
|
|
<el-form-item label="产品链接图"> |
|
|
|
|
<single-pic v-model="form.linkImage" type="image" :num="1" :width="150" :height="150" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
|
|
|
|
|
<el-form-item label="砍价产品轮播图"> |
|
|
|
|
<MaterialList v-model="form.sliderImageArr" style="width: 500px" type="image" :num="4" :width="150" :height="150" /> |
|
|
|
|
</el-form-item> |
|
|
|
@ -63,15 +71,16 @@
|
|
|
|
|
<el-form-item label="单次砍最低价"> |
|
|
|
|
<el-input-number v-model="form.bargainMinPrice" /> |
|
|
|
|
</el-form-item> --> |
|
|
|
|
<el-form-item label="单用户砍价次数"> |
|
|
|
|
<el-input-number v-model="form.bargainNum" /> |
|
|
|
|
<el-form-item label="成本价"> |
|
|
|
|
<el-input-number v-model="form.cost" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="砍价状态"> |
|
|
|
|
<el-radio v-model="form.status" :label="1">开启</el-radio> |
|
|
|
|
<el-radio v-model="form.status" :label="0" style="width: 110px;">关闭</el-radio> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="成本价"> |
|
|
|
|
<el-input-number v-model="form.cost" /> |
|
|
|
|
|
|
|
|
|
<el-form-item label="砍价人数"> |
|
|
|
|
<el-input-number v-model="form.bargainNum" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="排序"> |
|
|
|
|
<el-input-number v-model="form.sort" /> |
|
|
|
@ -102,7 +111,7 @@
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import cgood from '@/views/components/good' |
|
|
|
|
import { add, edit } from '@/api/bxg/yxStoreBargain' |
|
|
|
|
import { add, edit ,getBargainInfo} from '@/api/bxg/yxStoreBargain' |
|
|
|
|
import editor from '../../components/Editor' |
|
|
|
|
import MaterialList from '@/components/material' |
|
|
|
|
import singlePic from '@/components/singlematerial' |
|
|
|
@ -139,6 +148,7 @@ export default {
|
|
|
|
|
productId: '', |
|
|
|
|
title: '', |
|
|
|
|
image: '', |
|
|
|
|
linkImage:'', |
|
|
|
|
unitName: '', |
|
|
|
|
stock: '', |
|
|
|
|
sales: '', |
|
|
|
@ -181,6 +191,12 @@ export default {
|
|
|
|
|
this.form1.good.image = this.form.image |
|
|
|
|
this.form1.good.productId = this.form.productId |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
'form.linkImage': function(val) { |
|
|
|
|
if(val){ |
|
|
|
|
this.form.linkImage=val |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
'form.sliderImageArr': function(val) { |
|
|
|
|
console.log("aaa:"+val) |
|
|
|
@ -191,20 +207,37 @@ export default {
|
|
|
|
|
'form1.good.productId': { |
|
|
|
|
handler(val,oldVal){ |
|
|
|
|
if(val){ |
|
|
|
|
this.getBargainInfo() |
|
|
|
|
this.getInfoChooseGood (val) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
deep:true//对象内部的属性监听,也叫深度监听 |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// mounted() { |
|
|
|
|
// this.getBargainInfo() |
|
|
|
|
// }, |
|
|
|
|
methods: { |
|
|
|
|
//砍价独立链接图 |
|
|
|
|
getBargainInfo(){ |
|
|
|
|
let that=this |
|
|
|
|
let id=this.form.id |
|
|
|
|
getBargainInfo(id).then(res=>{ |
|
|
|
|
console.log('res',res,this.form.linkImage) |
|
|
|
|
if(res.linkImage==null||res.linkImage==undefined){ |
|
|
|
|
that.form.linkImage='' |
|
|
|
|
}else{ |
|
|
|
|
that.form.linkImage=res.linkImage; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 详情选择商品生成规格用 |
|
|
|
|
getInfoChooseGood (id) { |
|
|
|
|
|
|
|
|
|
let that = this; |
|
|
|
|
getInfo(id).then(async res => { |
|
|
|
|
let data = res.productInfo; |
|
|
|
|
console.info('data:'+JSON.stringify(data)) |
|
|
|
|
// console.info('data:'+JSON.stringify(data)) |
|
|
|
|
if(data){ |
|
|
|
|
let cate_id = parseInt(data.cate_id) || 0; |
|
|
|
|
//that.form = data; |
|
|
|
@ -219,7 +252,7 @@ export default {
|
|
|
|
|
that.form.imageArr = data.image |
|
|
|
|
that.form.sliderImageArr = data.slider_image |
|
|
|
|
that.form.status = 1 |
|
|
|
|
//that.form.minPrice = 0 |
|
|
|
|
// //that.form.minPrice = 0 |
|
|
|
|
//that.form.num = 1 |
|
|
|
|
//that.form.bargainMaxPrice = 0 |
|
|
|
|
//that.form.bargainMinPrice = 0 |
|
|
|
@ -293,6 +326,7 @@ export default {
|
|
|
|
|
productId: '', |
|
|
|
|
title: '', |
|
|
|
|
image: '', |
|
|
|
|
linkImage:'', |
|
|
|
|
unitName: '', |
|
|
|
|
stock: '', |
|
|
|
|
sales: '', |
|
|
|
|