Commit 69ddb7ad by 高淑倩

add: cart

parent 36fb13c9
...@@ -213,13 +213,12 @@ wxService.page({ ...@@ -213,13 +213,12 @@ wxService.page({
let cartListData = this.data.cartList || [] let cartListData = this.data.cartList || []
if (!cartListData) return false if (!cartListData) return false
// cartListData.filter(item => { // 选中的商品信息 cartListData.filter(item => { // 选中的商品信息
// return item.checked return item.checked
// }).map(function (item) { }).map(function (item) {
// goodsIds.push(item.promotionId) goodsIds.push(item.skuId)
// specIds.push(item.selectSku.id) quantitys.push(item.count)
// quantitys.push(item.quantity) })
// })
if (goodsIds.length == 0) { if (goodsIds.length == 0) {
wx.showToast({ wx.showToast({
title: '请选择商品', title: '请选择商品',
...@@ -228,38 +227,38 @@ wxService.page({ ...@@ -228,38 +227,38 @@ wxService.page({
return false return false
} }
// 去下单页 // 去下单页
// this.handleGoBuy() this.handleGoBuy()
}, },
handleGoBuy() { handleGoBuy() {
// 下单 // 下单
wx.showLoading({ wx.showLoading({
title: '加载中' title: '加载中'
}) })
wxService.post(`/sale/trade/buyer/create`).then(res => { // wxService.post(`/sale/trade/buyer/create`).then(res => {
if (!res) return false; // if (!res) return false;
const { result, data } = res && res.data || res && res.result // const { result, data } = res && res.data || res && res.result
if (result == 0) { // if (result == 0) {
delete data.appId // delete data.appId
wx.requestPayment(Object.assign({ // wx.requestPayment(Object.assign({
success(res) { // success(res) {
wx.hideLoading() // wx.hideLoading()
wx.showToast({ // wx.showToast({
title: '支付成功', // title: '支付成功',
icon: 'none', // icon: 'none',
mask: true // mask: true
}) // })
}, // },
fail(res) { // fail(res) {
wx.hideLoading() // wx.hideLoading()
wx.showToast({ // wx.showToast({
title: '支付失败', // title: '支付失败',
icon: 'none', // icon: 'none',
mask: true // mask: true
}) // })
} // }
}, data)) // }, data))
} // }
}) // })
}, },
// 调整商品 /trolley/add // 调整商品 /trolley/add
editOk() { editOk() {
......
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