|
@@ -18,6 +18,8 @@ Page({
|
|
transfee: '',
|
|
transfee: '',
|
|
reduceAmount: '',
|
|
reduceAmount: '',
|
|
actualTotal: '',
|
|
actualTotal: '',
|
|
|
|
+ prodid: '',
|
|
|
|
+ shopId: '',
|
|
prodid: ''
|
|
prodid: ''
|
|
},
|
|
},
|
|
|
|
|
|
@@ -62,6 +64,7 @@ Page({
|
|
transfee: res.transfee,
|
|
transfee: res.transfee,
|
|
reduceAmount: res.reduceAmount,
|
|
reduceAmount: res.reduceAmount,
|
|
actualTotal: res.actualTotal,
|
|
actualTotal: res.actualTotal,
|
|
|
|
+ shopId: res.shopId
|
|
});
|
|
});
|
|
wx.hideLoading();
|
|
wx.hideLoading();
|
|
}
|
|
}
|
|
@@ -70,6 +73,44 @@ Page({
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 加入购物车
|
|
|
|
+ */
|
|
|
|
+ addToCart: function(event) {
|
|
|
|
+ let index = event.currentTarget.dataset.index
|
|
|
|
+ // if (!this.orderItemDtos) {
|
|
|
|
+ // console.log(1213)
|
|
|
|
+ // return;
|
|
|
|
+ // }
|
|
|
|
+ var ths = this;
|
|
|
|
+ wx.showLoading({
|
|
|
|
+ mask: true
|
|
|
|
+ });
|
|
|
|
+ var params = {
|
|
|
|
+ url: "/p/shopCart/changeItem",
|
|
|
|
+ method: "POST",
|
|
|
|
+ data: {
|
|
|
|
+ basketId: 0,
|
|
|
|
+ count: this.data.orderItemDtos[index].prodCount,
|
|
|
|
+ prodId: this.data.orderItemDtos[index].prodId,
|
|
|
|
+ shopId: this.data.shopId,
|
|
|
|
+ skuId: this.data.orderItemDtos[index].skuId
|
|
|
|
+ },
|
|
|
|
+ callBack: function(res) {
|
|
|
|
+ //console.log(res);
|
|
|
|
+ wx.hideLoading();
|
|
|
|
+ wx.showToast({
|
|
|
|
+ title: "加入购物车成功",
|
|
|
|
+ icon: "none"
|
|
|
|
+ })
|
|
|
|
+ wx.switchTab({
|
|
|
|
+ url: '/pages/basket/basket',
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ http.request(params);
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
* 生命周期函数--监听页面初次渲染完成
|