fixing bug 8.11

This commit is contained in:
2020-08-11 15:38:43 +08:00
parent c01470b52d
commit 37d8ab7a2b
10 changed files with 170 additions and 98 deletions

View File

@@ -196,7 +196,7 @@ export default {
goodsInfo: {}, // 商品信息
storeInfo: {}, // 店铺信息
glist: [], // 规格列表
id: 0, // 商品id/秒杀id/拼团 id
id: 0, // 商品id
type: '', // 商品类型 商品详情 1普通 2拼团 3秒杀 4优惠券
groupUser: [], // 拼团用户
user_suc: [], // 拼团成功用户
@@ -215,7 +215,9 @@ export default {
sel: "", // 拼接的规格
quanxuan: false, // 规格是否选择
debounce: true, // 防止多次提交订单
storeid:0 // 店铺id
storeid:0, // 店铺 id
pintuan_id: '', // 拼团 id
groupbuy_id: '', // 秒杀 id
}
},
components: {
@@ -383,10 +385,10 @@ export default {
this.ordinaryDetails(id);
break;
case 2:
this.pinTuanDetails(id);
this.pinTuanDetails();
break;
case 3:
this.spikeGoodsDetails(id);
this.spikeGoodsDetails();
break;
default:
break;
@@ -394,38 +396,40 @@ export default {
},
// 普通商品详情
ordinaryDetails(id) {
this.$u.api.getGoodsDetails({ id: id }).then((res)=>{
// console.log(res)
this.$u.api.getGoodsDetails({ id: id }).then(res => {
if (res.errCode == 0) {
this.evaluate = res.data.goods_evaluate_info;
this.goodsInfo = res.data.goods;
this.storeInfo = res.data.store;
this.setSwiperList(res.data.goods_image);
this.glist = res.data.spec_list;
this.storeid = res.data.store.store_id
// console.log(this.goodsInfo.mobile_body);
this.storeid = res.data.store.store_id;
this.type = res.data.view_type;
this.setTitle();
if(this.type == 1) {
this.id = res.data.goods.goods_id;
} else if(this.type == 2) {
this.id = res.data.goods.pintuan_id;
this.getGoodsDetails(this.id);
this.id = res.data.goods.goods_id;
this.pintuan_id = res.data.goods.pintuan_id;
this.getGoodsDetails();
} else if(this.type == 3) {
this.id = res.data.groupbuy_id;
this.getGoodsDetails(this.id);
this.id = res.data.goods.goods_id;
this.groupbuy_id = res.data.groupbuy_id;
this.getGoodsDetails();
}
}
})
},
// 拼团详情
pinTuanDetails(id) {
pinTuanDetails() {
this.$u.api.getPinTuanDetails({
pintuan_id: id
pintuan_id: this.pintuan_id,
goods_id: this.id,
}).then(res => {
if(res.errCode == 0) {
this.evaluate = res.data.data.goods_evaluate_info;
this.goodsInfo = res.data.data.goods;
this.pintuan_id = res.data.data.pintuan_id;
this.setSwiperList(res.data.data.goods_image);
this.glist = res.data.data.spec_list;
this.user_suc = res.data.data.user_suc;
@@ -435,13 +439,14 @@ export default {
})
},
// 秒杀详情
spikeGoodsDetails(id) {
spikeGoodsDetails() {
this.$u.api.getSpikeInfo({
groupbuy_id: id
groupbuy_id: this.groupbuy_id,
goods_id: this.id,
}).then(res => {
if(res.errCode == 0) {
// this.id = res.data.groupbuy_id;
this.groupbuyInfo = res.data.groupbuyInfo;
this.groupbuy_id = res.data.groupbuyInfo.groupbuy_id;
this.evaluate = res.data.goodsInfo.goods_evaluate_info;
this.goodsInfo = res.data.goodsInfo.goods;
this.setSwiperList(res.data.goodsInfo.goods_image);
@@ -497,16 +502,14 @@ export default {
}
if(this.type == 2) {
if(type == 'involvement') {
// const userId = uni.getStorageSync('user_info').member.member_id;
this.$store.commit('setGroupHeadId', this.involvemenGroupInfo[0].user_id);
// console.log(this.$store.state.pintuangroup_headid);
Object.assign(params, {
pintuan_id: this.id,
pintuan_id: this.pintuan_id,
pintuangroup_id: this.involvemenGroupInfo[0].pintuangroup_id,
})
} else {
Object.assign(params, {
pintuan_id: this.id,
pintuan_id: this.pintuan_id,
})
}
}
@@ -519,6 +522,7 @@ export default {
url: '/pageC/cart/ConfirmOrder'
})
} else {
this.$u.toast(res.message);
this.debounce = true;
}
})
@@ -555,8 +559,9 @@ export default {
// console.log(id)
// 选择完规格后设商品type = 1
// this.type = 1;
this.getGoodsDetails(this.glist[id])
// 改变 goods_id
this.id = this.glist[id];
this.getGoodsDetails();
},
// 设置页面标题
setTitle() {