|
|
@@ -24,9 +24,9 @@ Page({ |
|
|
|
onLoad(options) { |
|
|
|
let that = this; |
|
|
|
console.log(options); |
|
|
|
console.log(options.couponChannelId); |
|
|
|
console.log(options.couponId); |
|
|
|
console.log("传的变量的名字叫Id"); |
|
|
|
console.log("couponChannelId" + options.couponChannelId); |
|
|
|
console.log("couponId" + options.couponId); |
|
|
|
console.log("传的变量的名字叫couponId"); |
|
|
|
/** |
|
|
|
* 首页banner detail couponlist传过来的值 |
|
|
|
* iambannercoupon |
|
|
@@ -43,32 +43,17 @@ Page({ |
|
|
|
// // this.orderFunc(); |
|
|
|
// } |
|
|
|
// else { |
|
|
|
if (options.couponChannelId == "iambannercoupon") { |
|
|
|
that.setData({ |
|
|
|
couponId: options.couponId |
|
|
|
}); |
|
|
|
/** |
|
|
|
* 待解决 |
|
|
|
*/ |
|
|
|
var parmer = { |
|
|
|
url: config.api.bannercoupondetai, |
|
|
|
data: { |
|
|
|
couponId: options.couponId |
|
|
|
} |
|
|
|
}; |
|
|
|
} else { |
|
|
|
that.setData({ |
|
|
|
couponChannelId: options.couponChannelId, |
|
|
|
couponId: options.couponId |
|
|
|
}); |
|
|
|
var parmer = { |
|
|
|
url: config.api.couponDetail, |
|
|
|
data: { |
|
|
|
couponChannelId: options.couponChannelId |
|
|
|
} |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
// } |
|
|
|
that.setData({ |
|
|
|
couponChannelId: options.couponChannelId, |
|
|
|
couponId: options.couponId |
|
|
|
}); |
|
|
|
var parmer = { |
|
|
|
url: config.api.couponDetail, |
|
|
|
data: { |
|
|
|
couponChannelId: options.couponChannelId |
|
|
|
} |
|
|
|
}; |
|
|
|
Http.get(parmer).then(res => { |
|
|
|
console.log(res); |
|
|
|
console.log("details"); |
|
|
@@ -234,14 +219,11 @@ Page({ |
|
|
|
if (res.errMsg == "requestPayment:ok") { |
|
|
|
wx.showToast({ |
|
|
|
title: "购买成功", |
|
|
|
duration: 2500 |
|
|
|
duration: 2500, |
|
|
|
}); |
|
|
|
/** |
|
|
|
* 用户支付成功以后跳转到券包列表 |
|
|
|
*/ |
|
|
|
wx.redirectTo({ |
|
|
|
url: '/pages/couponorder/index/index', |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
@@ -256,21 +238,6 @@ Page({ |
|
|
|
// var url = res.data.url; |
|
|
|
// console.log("get url", url); |
|
|
|
if (res.errMsg == "requestPayment:ok") { |
|
|
|
wx.showModal({ |
|
|
|
title: "提示", |
|
|
|
content: "支付成功" |
|
|
|
}); |
|
|
|
// if (url) { |
|
|
|
// setTimeout(function () { |
|
|
|
// wx.redirectTo({ |
|
|
|
// url: "/pages" + url |
|
|
|
// }); |
|
|
|
// }, 2000); |
|
|
|
// } else { |
|
|
|
// setTimeout(() => { |
|
|
|
// wx.navigateBack(); |
|
|
|
// }, 2000); |
|
|
|
// } |
|
|
|
} else { |
|
|
|
wx.showToast({ |
|
|
|
title: "支付失败", |
|
|
|