Browse Source

修复拼团页面缓存问题

master
sj 2 years ago
parent
commit
faea52e6f9
  1. 4
      .env.dev
  2. 31
      src/views/bxg/activity/bargain/form.vue
  3. 1
      src/views/bxg/activity/bargain/index.vue
  4. 24
      src/views/bxg/activity/combination/form.vue
  5. 17
      src/views/bxg/activity/seckill/form.vue

4
.env.dev

@ -5,7 +5,9 @@ ENV = 'development'
VUE_APP_TITLE = 后台管理系统 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 VUE_CLI_BABEL_TRANSPILE_MODULES = true

31
src/views/bxg/activity/bargain/form.vue

@ -78,7 +78,7 @@
<el-radio v-model="form.status" :label="1">开启</el-radio> <el-radio v-model="form.status" :label="1">开启</el-radio>
<el-radio v-model="form.status" :label="0" style="width: 110px;">关闭</el-radio> <el-radio v-model="form.status" :label="0" style="width: 110px;">关闭</el-radio>
</el-form-item> </el-form-item>
<el-form-item label="砍价人数"> <el-form-item label="砍价人数">
<el-input-number v-model="form.bargainNum" /> <el-input-number v-model="form.bargainNum" />
</el-form-item> </el-form-item>
@ -207,7 +207,6 @@ export default {
'form1.good.productId': { 'form1.good.productId': {
handler(val,oldVal){ handler(val,oldVal){
if(val){ if(val){
this.getBargainInfo()
this.getInfoChooseGood (val) this.getInfoChooseGood (val)
} }
}, },
@ -218,22 +217,22 @@ export default {
// this.getBargainInfo() // this.getBargainInfo()
// }, // },
methods: { methods: {
// // //
getBargainInfo(){ // getBargainInfo(){
let that=this // let that=this
let id=this.form.id // let id=this.form.id
getBargainInfo(id).then(res=>{ // getBargainInfo(id).then(res=>{
console.log('res',res,this.form.linkImage) // console.log('res',res,this.form.linkImage)
if(res.linkImage==null||res.linkImage==undefined){ // if(res.linkImage==null||res.linkImage==undefined){
that.form.linkImage='' // that.form.linkImage=''
}else{ // }else{
that.form.linkImage=res.linkImage; // that.form.linkImage=res.linkImage;
} // }
}) // })
}, // },
// //
getInfoChooseGood (id) { getInfoChooseGood (id) {
let that = this; let that = this;
getInfo(id).then(async res => { getInfo(id).then(async res => {
let data = res.productInfo; let data = res.productInfo;

1
src/views/bxg/activity/bargain/index.vue

@ -145,6 +145,7 @@ export default {
unitName: data.unitName, unitName: data.unitName,
stock: data.stock, stock: data.stock,
sales: data.sales, sales: data.sales,
linkImage: data.linkImage==null?'':data.linkImage,
images: data.images, images: data.images,
imageArr: data.image.split(','), imageArr: data.image.split(','),
sliderImageArr: data.images.split(','), sliderImageArr: data.images.split(','),

24
src/views/bxg/activity/combination/form.vue

@ -432,10 +432,14 @@ export default {
console.info("oldval:" + oldVal) console.info("oldval:" + oldVal)
if (val) { if (val) {
this.getInfoChooseGood(val) this.getInfoChooseGood(val)
this.getInfo()
} }
}, },
}, },
}, },
// created() {
// this.getInfoChooseGood(this.form1.good.productId)
// },
mounted() { mounted() {
this.getInfo(); this.getInfo();
}, },
@ -623,8 +627,11 @@ export default {
let cate_id = parseInt(data.cate_id) || 0; let cate_id = parseInt(data.cate_id) || 0;
this.attrs = data.items || []; this.attrs = data.items || [];
that.formValidate = data; that.formValidate = data;
if(data.linkImage==null||data.linkImage){ // console.log('',data)
if(data.linkImage==null||data.linkImage==undefined){
that.formValidate.linkImage='' that.formValidate.linkImage=''
}else {
that.formValidate.linkImage=data.linkImage
} }
that.formValidate.cate_id = cate_id; that.formValidate.cate_id = cate_id;
that.oneFormValidate = [data.attr]; that.oneFormValidate = [data.attr];
@ -670,6 +677,7 @@ export default {
// //
handleSubmit(name) { handleSubmit(name) {
console.log("!this.$route.params.id",!this.$route.params.id);
this.$refs[name].validate((valid) => { this.$refs[name].validate((valid) => {
if (valid) { if (valid) {
if (this.formValidate.spec_type === 0) { if (this.formValidate.spec_type === 0) {
@ -694,7 +702,9 @@ export default {
type: 'success' type: 'success'
}); });
setTimeout(() => { setTimeout(() => {
this.resetForm() if (!this.$route.params.id){
this.resetForm() //
}
this.$router.push({path: '/bxg/activity/combination'}); this.$router.push({path: '/bxg/activity/combination'});
}, 500); }, 500);
}).catch(res => { }).catch(res => {
@ -711,6 +721,16 @@ export default {
}, },
resetForm(){ resetForm(){
this.$refs['formValidate'].resetFields() this.$refs['formValidate'].resetFields()
this.form1={
good: {
productId: null,
storeName: null,
image: null,
otPrice: null,
price: null,
}
},
this.oneFormValidate=[ this.oneFormValidate=[
{ {
imageArr: [], imageArr: [],

17
src/views/bxg/activity/seckill/form.vue

@ -613,9 +613,9 @@ export default {
this.attrs = data.items || []; this.attrs = data.items || [];
that.formValidate = data; that.formValidate = data;
console.log('data111111111',data) console.log('data111111111',data)
// if(data.linkImage==null){ if(data.linkImage==null||data.linkImage==undefined){
// that.formValidate.linkImage = ''; that.formValidate.linkImage = '';
// } }
that.formValidate.cate_id = cate_id; that.formValidate.cate_id = cate_id;
that.oneFormValidate = [data.attr]; that.oneFormValidate = [data.attr];
that.formValidate.header = []; that.formValidate.header = [];
@ -752,6 +752,16 @@ export default {
}, },
resetForm(){ resetForm(){
this.$refs['formValidate'].resetFields() this.$refs['formValidate'].resetFields()
this.form1={
good:{
productId: null,
storeName: null,
image: null,
otPrice: null,
price: null,
cform: null
}
},
this.formValidate={ this.formValidate={
slider_image: [], slider_image: [],
otPrice: '', otPrice: '',
@ -765,6 +775,7 @@ export default {
merId: '', merId: '',
image: '', image: '',
images: '', images: '',
linkImage:'',
imageArr:[], imageArr:[],
sliderImageArr: [], sliderImageArr: [],
title: '', title: '',

Loading…
Cancel
Save