Selaa lähdekoodia

支付添加couponChannelId

tags/2.2.4
Stormeye.Wu 6 vuotta sitten
vanhempi
commit
19f421f43d
1 muutettua tiedostoa jossa 10 lisäystä ja 8 poistoa
  1. +10
    -8
      pages/coupon/detail/index.js

+ 10
- 8
pages/coupon/detail/index.js Näytä tiedosto

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


Ladataan…
Peruuta
Tallenna