Commit 6f742c2d by 高淑倩

modify: 商品详情购买去下单页

parent 4e6e0c85
......@@ -175,43 +175,12 @@ Component({
skuId: this.data.skuId,
count: 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
// })
// }
// }
// })
},
inputNum: function (e) { // 输入数量
var newNum = e.detail.value
......
......@@ -229,7 +229,6 @@ wxService.page({
confirmClick(event) {
const { skuId, count } = event.detail
console.log('父组件', skuId, count)
const trolleySku = {
count,
skuId
......@@ -248,8 +247,21 @@ wxService.page({
// 加入购物车
this.getPutCart(trolleySku)
} else if (this.data.showSkuPopupType == 'buy') {
// 下单页面
console.log('buy')
// 关闭弹框
this.setData({
showSkuPopup: false
}, () => {
// 去下单页 && 参数
let trolleySku2Buy = []
trolleySku2Buy.push(trolleySku)
let parmas = {
trolleySku2Buy: JSON.stringify(trolleySku2Buy)
}
wxService
.router('/pages/confirmOrder/confirmOrder')
.search(parmas)
})
}
},
// put 购物车
......@@ -262,7 +274,7 @@ wxService.page({
if (res) {
const { result } = res.data
if (result == 0) {
// 关闭弹框
// 关闭弹框
this.setData({
showSkuPopup: false
})
......
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