Commit 9db81c6f by 高淑倩

预览

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