Commit 4e7d4871 by 高淑倩

商品详情页

parent 9f6658cb
......@@ -171,31 +171,39 @@ Component({
}
}
const trolleySku = {
count: this.data.proNum,
skuId: this.data.skuId
}
// 加入购物车
wxService.post('/sale/trolley/put', trolleySku).then(res => {
if (res) {
const { result } = res.data
if (result == 0) {
wx.showToast({
title: '添加成功,在购物车等亲~',
icon: 'none'
})
this.setData({
show: false
})
this.triggerEvent('skuselect', {
selectSku: this.data.curSpec,
counts: this.data.proNum,
// this.triggerEvent('skuselect', {
// selectSku: this.data.curSku,
// counts: this.data.proNum,
// isAllowArrive: this.data.isAllowArrive,
// clickDataStock: this.data.clickDataStock
})
}
}
})
// })
// const trolleySku = {
// count: this.data.proNum,
// skuId: this.data.skuId
// }
// // 加入购物车
// wxService.post('/sale/trolley/put', trolleySku).then(res => {
// if (res) {
// const { result } = res.data
// if (result == 0) {
// wx.showToast({
// title: '添加成功,在购物车等亲~',
// icon: 'none'
// })
// this.setData({
// show: false
// })
// this.triggerEvent('skuselect', {
// selectSku: this.data.curSpec,
// counts: this.data.proNum,
// // isAllowArrive: this.data.isAllowArrive,
// // clickDataStock: this.data.clickDataStock
// })
// }
// }
// })
},
......
......@@ -51,6 +51,12 @@ wxService.page({
// 商品加入购物车
// xm_bi.Event.stat("skuAddToCart", { "amount":"666","skuId":'abcd1234'});
},
goBuy: function (event) {
this.setData({
showSkuPopup: true,
showSkuPopupType: 'buy'
})
},
// 分享
onTapShare() {
......@@ -222,7 +228,7 @@ wxService.page({
},
confirmClick(event){
console.log(event)
console.log('confirmClick',event)
var selectSkuName = []
for (let i in event.detail.selectSku){
selectSkuName.push(event.detail.selectSku[i].name)
......@@ -231,6 +237,13 @@ wxService.page({
this.setData({
selectSkuName: selectSkuStr
})
if (this.data.showSkuPopupType == 'cart') {
// 加入购物车
} else if (this.data.showSkuPopupType == 'buy') {
// 下单页面
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment