diff --git a/pages/coupon/detail/index.js b/pages/coupon/detail/index.js index 5437bf3..0ec593a 100644 --- a/pages/coupon/detail/index.js +++ b/pages/coupon/detail/index.js @@ -5,6 +5,7 @@ const util = require("../../../utils/util"); Page({ data: { data: {}, + couponChannelId: null, couponId: null, orderId: "", day: "", @@ -15,7 +16,7 @@ Page({ let that = this; console.log(options.id); that.setData({ - couponId:options.id + couponId: options.id }) console.log(options.targetAd); wx.showLoading({ @@ -29,7 +30,7 @@ Page({ url: config.api.couponDetail, data: { couponId: options.id, - targetAd:options.targetAd + targetAd: options.targetAd } }).then(res => { console.log(res); @@ -62,6 +63,7 @@ Page({ wx.hideLoading(); that.setData({ data: res.data, + couponChannelId: res.data.couponChannelId }); }); } @@ -159,13 +161,14 @@ Page({ // TODO 选取用户下的车牌 } else { Http.post({ - url: config.api.checkPhoneStatus, - data: {} - }) + url: config.api.checkPhoneStatus, + data: {} + }) .then(res => { return Http.post({ - url: config.api.orderSave, + url: config.api.freeCoupon, data: { + couponChannelId: that.data.couponChannelId, couponId: that.data.couponId } }); @@ -207,8 +210,7 @@ Page({ }); } else { // 免费券 - that - .payOrderUpdate(orderId, "0", 1) // 支付成功 + that.payOrderUpdate(orderId, "0", 1) // 支付成功 .then(res => { wx.showToast({ title: "支付成功",