This commit is contained in:
2020-08-03 18:38:04 +08:00
parent 0bc6be9b9f
commit d54a378a9e
12 changed files with 193 additions and 82 deletions

View File

@@ -201,7 +201,8 @@ export default {
showSpec: false, // 是否显示选择规格
goodsNumber: 1,
sel: "", // 拼接的规格
quanxuan: false, // 规格是否选择
quanxuan: false, // 规格是否选择
debounce: true,
}
},
components: {
@@ -224,6 +225,7 @@ export default {
this.setTitle();
},
onShow() {
this.debounce = true;
this.showSpec = false;
this.showGroupUser = false;
this.showInvolvementUser = false;
@@ -235,34 +237,6 @@ export default {
clearInterval(this.timer);
},
methods: {
// init() {
// this.id = this.$store.state.goods_id;
// this.type = this.$store.getters.getGoodsType;
// const info = this.$store.getters.getGoodsInfo;
// // 拼团商品
// if(this.type == 2) {
// this.user_suc = info.user_suc;
// this.groupUser = info.user;
// this.pintuan_id = info.pintuan_id;
// }
// // 秒杀商品
// if (this.type == 3) {
// this.groupbuyInfo = this.$store.state.groupbuyInfo;
// this.setSpikeTime();
// }
// // console.log(this.groupbuyInfo);
// this.goodsInfo = info.goods;
// // 设置轮播图
// let list = [];
// info.goods_image[0].forEach(item => {
// let temp = {
// image: item
// }
// list.push(temp);
// })
// this.list = list;
// this.setTitle();
// },
setSwiperList(list) {
let img = [];
list.forEach(item => {
@@ -331,7 +305,7 @@ export default {
break;
}
},
// 普通商品
// 普通商品详情
ordinaryDetails(id) {
this.$u.api.getGoodsDetails({ id: id }).then((res)=>{
if (res.errCode == 0) {
@@ -343,7 +317,7 @@ export default {
}
})
},
// 拼团
// 拼团详情
pinTuanDetails(id) {
this.$u.api.getPinTuanDetails({
pintuan_id: id
@@ -358,7 +332,7 @@ export default {
}
})
},
// 秒杀
// 秒杀详情
spikeGoodsDetails(id) {
this.$u.api.getSpikeInfo({
groupbuy_id: id
@@ -388,6 +362,8 @@ export default {
* @params {Number} ifcart 结算方式 1:购物车 0:直接结算(立即购买/拼团/秒杀)
**/
settlementOrder({type, num = this.goodsNumber, ifcart = 0} = {}) {
if(!this.debounce) return;
this.debounce = false;
let params = {
ifcart: ifcart,
cart_id: [this.goodsInfo.goods_id + '|' + num],
@@ -413,6 +389,8 @@ export default {
this.$u.route({
url: '/pageC/cart/ConfirmOrder'
})
} else {
this.debounce = true;
}
})
},