|
@@ -24,13 +24,16 @@ Page({
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad: function (options) {
|
|
|
- var that = this;
|
|
|
- that.orderSn = options.ordersn
|
|
|
+ // var that = this;
|
|
|
+ // that.orderSn = options.ordersn
|
|
|
+ if(!options.ordersn){
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.setData({
|
|
|
orderSn: options.ordersn,
|
|
|
})
|
|
|
- this.getOrder(that.orderSn);
|
|
|
- this.data.orderSn = options.ordersn;
|
|
|
+ this.getOrder(options.ordersn);
|
|
|
+ // this.data.orderSn = options.ordersn;
|
|
|
},
|
|
|
|
|
|
|
|
@@ -58,10 +61,12 @@ Page({
|
|
|
* 订单数据--查询
|
|
|
*/
|
|
|
selectOrder: async function(orderSn) {
|
|
|
+
|
|
|
let res = await WelfareMall.getOrder({
|
|
|
mobile: getMobileCache(),
|
|
|
orderSn: orderSn,
|
|
|
})
|
|
|
+ this.userOrderistView(res.data)
|
|
|
await this.changeOrder(res.data.orderSn,res.data.status.value,res.data.status.showText);
|
|
|
},
|
|
|
|
|
@@ -145,14 +150,15 @@ Page({
|
|
|
return;
|
|
|
}
|
|
|
that.data.repeat = true;
|
|
|
- let result = await WelfareMall.getOrderParams(that.data.orderSn,wx.getStorageSync('loginInfo').openId);
|
|
|
+ let result = await WelfareMall.getOrderParams(that.data.orderSn,wx.getStorageSync('loginInfo').openId,true);
|
|
|
let res = result.data
|
|
|
- wx.requestPayment({
|
|
|
+ wx.requestOrderPayment({
|
|
|
timeStamp: res.wxPrePayVo.timeStamp,
|
|
|
package: res.wxPrePayVo.pack,
|
|
|
nonceStr: res.wxPrePayVo.nonceStr,
|
|
|
signType: res.wxPrePayVo.signType,
|
|
|
paySign: res.wxPrePayVo.paySign,
|
|
|
+ orderInfo:res.orderInfo,
|
|
|
success: function (res) {
|
|
|
//支付成功
|
|
|
console.log(res);
|
|
@@ -240,9 +246,10 @@ Page({
|
|
|
orderSn: that.data.orderSn,
|
|
|
reason: reason,
|
|
|
});
|
|
|
- await that.cancel();
|
|
|
- // await that.onLoad(that.options);
|
|
|
+ that.cancel();
|
|
|
+
|
|
|
await that.selectOrder(that.data.orderSn);
|
|
|
+
|
|
|
// await wx.navigateTo({
|
|
|
// url: "../refund/refund?orderSn=" + that.data.orderSn
|
|
|
// })
|