Commit b4ad1e14 by 高淑倩

add: 下单页商品信息

parent 05b28005
...@@ -8,7 +8,9 @@ wxService.page({ ...@@ -8,7 +8,9 @@ wxService.page({
data: { data: {
addressInfo: '', addressInfo: '',
showSelectCoupon: false, showSelectCoupon: false,
skuIds: [] skuIds: [],
trolleySku2Buy: Array,
currentOrderList: Array
}, },
/** /**
...@@ -22,34 +24,39 @@ wxService.page({ ...@@ -22,34 +24,39 @@ wxService.page({
*/ */
onShow: function () { onShow: function () {
let trolleySku2Buy = this.options.trolleySku2Buy let trolleySku2Buy = this.options.trolleySku2Buy
console.log('thtrolleySku2Bu', JSON.parse(trolleySku2Buy))
// 下单 && 计算优惠价 // 下单 && 计算优惠价
if(trolleySku2Buy.length){ if (trolleySku2Buy.length) {
// this.getBill(trolleySku2Buy) // 下单 this.setData({ trolleySku2Buy }, () => {
this.calPreferentialPrice(trolleySku2Buy) // 计算优惠价 this.calPreferentialPrice(trolleySku2Buy) // 计算优惠价
})
} }
}, },
// 下单 // 计算优惠价
getBill(trolleySku2Buy) { calPreferentialPrice(trolleySku2Buy) {
wx.showLoading({ wx.showLoading({
title: '加载中' title: '加载中'
}) })
wxService.post(`/sale/trade/buyer/bill`,trolleySku2Buy).then(res => { wxService.post(`/sale/trade/buyer/preview`, trolleySku2Buy).then(res => {
if (res) { if (res) {
const { result, data } = res.data const { result, data } = res.data
if (result == 0) { if (result == 0) {
wx.hideLoading() wx.hideLoading()
console.log('data', data) console.log('data', data)
this.setData({ currentOrderList: data })
} }
} }
}) })
}, },
// 计算优惠价 handelGobuy() {
calPreferentialPrice(trolleySku2Buy) { const { trolleySku2Buy } = this.data
this.getBill(trolleySku2Buy) // 下单
},
// 下单
getBill(trolleySku2Buy) {
wx.showLoading({ wx.showLoading({
title: '加载中' title: '加载中'
}) })
wxService.post(`/sale/trade/buyer/preview`,trolleySku2Buy).then(res => { wxService.post(`/sale/trade/buyer/bill`, trolleySku2Buy).then(res => {
if (res) { if (res) {
const { result, data } = res.data const { result, data } = res.data
if (result == 0) { if (result == 0) {
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
"list": [] "list": []
}, },
"miniprogram": { "miniprogram": {
"current": 23, "current": 17,
"list": [ "list": [
{ {
"id": -1, "id": -1,
...@@ -147,10 +147,10 @@ ...@@ -147,10 +147,10 @@
"scene": null "scene": null
}, },
{ {
"id": -1, "id": 17,
"name": "确认订单", "name": "确认订单",
"pathName": "pages/confirmOrder/confirmOrder", "pathName": "pages/confirmOrder/confirmOrder",
"query": "", "query": "trolleySku2Buy=[{\"count\":3,\"skuId\":1556108807316001},{\"count\":1,\"skuId\":1556108807316000}]",
"scene": null "scene": null
}, },
{ {
......
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