Commit 6f742c2d by 高淑倩

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

parent 4e6e0c85
...@@ -175,43 +175,12 @@ Component({ ...@@ -175,43 +175,12 @@ Component({
skuId: this.data.skuId, skuId: this.data.skuId,
count: this.data.proNum, count: this.data.proNum,
}) })
// this.triggerEvent('skuselect', { // this.triggerEvent('skuselect', {
// selectSku: this.data.curSku, // selectSku: this.data.curSku,
// counts: this.data.proNum, // counts: this.data.proNum,
// isAllowArrive: this.data.isAllowArrive, // isAllowArrive: this.data.isAllowArrive,
// clickDataStock: this.data.clickDataStock // 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) { // 输入数量 inputNum: function (e) { // 输入数量
var newNum = e.detail.value var newNum = e.detail.value
......
...@@ -229,7 +229,6 @@ wxService.page({ ...@@ -229,7 +229,6 @@ wxService.page({
confirmClick(event) { confirmClick(event) {
const { skuId, count } = event.detail const { skuId, count } = event.detail
console.log('父组件', skuId, count)
const trolleySku = { const trolleySku = {
count, count,
skuId skuId
...@@ -248,8 +247,21 @@ wxService.page({ ...@@ -248,8 +247,21 @@ wxService.page({
// 加入购物车 // 加入购物车
this.getPutCart(trolleySku) this.getPutCart(trolleySku)
} else if (this.data.showSkuPopupType == 'buy') { } 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 购物车 // put 购物车
...@@ -262,7 +274,7 @@ wxService.page({ ...@@ -262,7 +274,7 @@ wxService.page({
if (res) { if (res) {
const { result } = res.data const { result } = res.data
if (result == 0) { if (result == 0) {
// 关闭弹框 // 关闭弹框
this.setData({ this.setData({
showSkuPopup: false 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