Commit b4ad1e14 by 高淑倩

add: 下单页商品信息

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