修复拼团页面缓存问题
This commit is contained in:
@@ -5,7 +5,9 @@ ENV = 'development'
|
||||
VUE_APP_TITLE = 后台管理系统
|
||||
|
||||
# 后台管理系统/开发环境
|
||||
VUE_APP_BASE_API = 'http://192.168.18.147:48080'
|
||||
#VUE_APP_BASE_API = 'http://192.168.18.147:48080'
|
||||
VUE_APP_BASE_API = 'http://192.168.10.113:48080'
|
||||
|
||||
|
||||
# 路由懒加载
|
||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||
|
||||
@@ -207,7 +207,6 @@ export default {
|
||||
'form1.good.productId': {
|
||||
handler(val,oldVal){
|
||||
if(val){
|
||||
this.getBargainInfo()
|
||||
this.getInfoChooseGood (val)
|
||||
}
|
||||
},
|
||||
@@ -218,19 +217,19 @@ export default {
|
||||
// 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;
|
||||
}
|
||||
})
|
||||
},
|
||||
// //砍价独立链接图
|
||||
// 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) {
|
||||
|
||||
|
||||
@@ -145,6 +145,7 @@ export default {
|
||||
unitName: data.unitName,
|
||||
stock: data.stock,
|
||||
sales: data.sales,
|
||||
linkImage: data.linkImage==null?'':data.linkImage,
|
||||
images: data.images,
|
||||
imageArr: data.image.split(','),
|
||||
sliderImageArr: data.images.split(','),
|
||||
|
||||
@@ -432,10 +432,14 @@ export default {
|
||||
console.info("oldval:" + oldVal)
|
||||
if (val) {
|
||||
this.getInfoChooseGood(val)
|
||||
this.getInfo()
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
// created() {
|
||||
// this.getInfoChooseGood(this.form1.good.productId)
|
||||
// },
|
||||
mounted() {
|
||||
this.getInfo();
|
||||
},
|
||||
@@ -623,8 +627,11 @@ export default {
|
||||
let cate_id = parseInt(data.cate_id) || 0;
|
||||
this.attrs = data.items || [];
|
||||
that.formValidate = data;
|
||||
if(data.linkImage==null||data.linkImage){
|
||||
// console.log('调用?',data)
|
||||
if(data.linkImage==null||data.linkImage==undefined){
|
||||
that.formValidate.linkImage=''
|
||||
}else {
|
||||
that.formValidate.linkImage=data.linkImage
|
||||
}
|
||||
that.formValidate.cate_id = cate_id;
|
||||
that.oneFormValidate = [data.attr];
|
||||
@@ -670,6 +677,7 @@ export default {
|
||||
|
||||
// 提交
|
||||
handleSubmit(name) {
|
||||
console.log("!this.$route.params.id",!this.$route.params.id);
|
||||
this.$refs[name].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.formValidate.spec_type === 0) {
|
||||
@@ -694,7 +702,9 @@ export default {
|
||||
type: 'success'
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.resetForm()
|
||||
if (!this.$route.params.id){
|
||||
this.resetForm() //新增清除缓存
|
||||
}
|
||||
this.$router.push({path: '/bxg/activity/combination'});
|
||||
}, 500);
|
||||
}).catch(res => {
|
||||
@@ -711,6 +721,16 @@ export default {
|
||||
},
|
||||
resetForm(){
|
||||
this.$refs['formValidate'].resetFields()
|
||||
this.form1={
|
||||
good: {
|
||||
productId: null,
|
||||
storeName: null,
|
||||
image: null,
|
||||
otPrice: null,
|
||||
price: null,
|
||||
|
||||
}
|
||||
},
|
||||
this.oneFormValidate=[
|
||||
{
|
||||
imageArr: [],
|
||||
|
||||
@@ -613,9 +613,9 @@ export default {
|
||||
this.attrs = data.items || [];
|
||||
that.formValidate = data;
|
||||
console.log('data111111111',data)
|
||||
// if(data.linkImage==null){
|
||||
// that.formValidate.linkImage = '';
|
||||
// }
|
||||
if(data.linkImage==null||data.linkImage==undefined){
|
||||
that.formValidate.linkImage = '';
|
||||
}
|
||||
that.formValidate.cate_id = cate_id;
|
||||
that.oneFormValidate = [data.attr];
|
||||
that.formValidate.header = [];
|
||||
@@ -752,6 +752,16 @@ export default {
|
||||
},
|
||||
resetForm(){
|
||||
this.$refs['formValidate'].resetFields()
|
||||
this.form1={
|
||||
good:{
|
||||
productId: null,
|
||||
storeName: null,
|
||||
image: null,
|
||||
otPrice: null,
|
||||
price: null,
|
||||
cform: null
|
||||
}
|
||||
},
|
||||
this.formValidate={
|
||||
slider_image: [],
|
||||
otPrice: '',
|
||||
@@ -765,6 +775,7 @@ export default {
|
||||
merId: '',
|
||||
image: '',
|
||||
images: '',
|
||||
linkImage:'',
|
||||
imageArr:[],
|
||||
sliderImageArr: [],
|
||||
title: '',
|
||||
|
||||
Reference in New Issue
Block a user