Commit 9db81c6f by 高淑倩

预览

parent 2defa835
...@@ -7,6 +7,8 @@ wxService.page({ ...@@ -7,6 +7,8 @@ wxService.page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
couponId: null,
checkByPremium: false,
addressInfo: [], addressInfo: [],
showSelectCoupon: false, showSelectCoupon: false,
skuIds: [], skuIds: [],
...@@ -47,8 +49,13 @@ wxService.page({ ...@@ -47,8 +49,13 @@ wxService.page({
// 下单 && 计算优惠价 // 下单 && 计算优惠价
this.setData({ trolleySku2Buy: tradeDto }, () => { this.setData({ trolleySku2Buy: tradeDto.trolleySku2Buy }, () => {
this.calPreferentialPrice(tradeDto) // 计算优惠价 const { trolleySku2Buy, checkByPremium } = this.data
let params = {
checkByPremium,
trolleySku2Buy
}
this.calPreferentialPrice(params) // 计算优惠价
}) })
this.initCitys() this.initCitys()
...@@ -191,11 +198,11 @@ wxService.page({ ...@@ -191,11 +198,11 @@ wxService.page({
wxService.router('/pages/myAddress/myAddress') wxService.router('/pages/myAddress/myAddress')
}, },
// 计算优惠价 // 计算优惠价
calPreferentialPrice(tradeDto) { calPreferentialPrice(params) {
wx.showLoading({ wx.showLoading({
title: '加载中' title: '加载中'
}) })
wxService.post(`/sale/trade/buyer/preview`, tradeDto).then(res => { wxService.post(`/sale/trade/buyer/preview`, params).then(res => {
if (res) { if (res) {
const { result, data } = res.data const { result, data } = res.data
if (result == 0) { if (result == 0) {
...@@ -206,15 +213,20 @@ wxService.page({ ...@@ -206,15 +213,20 @@ wxService.page({
}) })
}, },
handelGobuy() { handelGobuy() {
const { trolleySku2Buy } = this.data const { trolleySku2Buy, couponId } = this.data
this.getBill(trolleySku2Buy) // 下单 let params = {
couponId,
trolleySku2Buy
}
console.log('params', params, trolleySku2Buy)
this.getBill(params) // 下单
}, },
// 下单 // 下单
getBill(trolleySku2Buy) { getBill(params) {
wx.showLoading({ wx.showLoading({
title: '加载中' title: '加载中'
}) })
wxService.post(`/sale/trade/buyer/bill`, trolleySku2Buy).then(res => { wxService.post(`/sale/trade/buyer/bill`, params).then(res => {
if (res) { if (res) {
const { result, data } = res.data const { result, data } = res.data
if (result == 0) { if (result == 0) {
......
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