|
@@ -94,6 +94,12 @@ Page({
|
|
|
duration: 1500
|
|
|
});
|
|
|
this.onLoad(this.options);
|
|
|
+ //获取当前页面的页面栈
|
|
|
+ var page = getCurrentPages();
|
|
|
+ //获取上一个页面的页面栈
|
|
|
+ var lastPage = page[page.length-2];
|
|
|
+ lastPage.onLoad(this.options);
|
|
|
+ console.log(this.options);
|
|
|
}
|
|
|
this.data.lock = false
|
|
|
}).catch(_ => {
|
|
@@ -113,9 +119,8 @@ Page({
|
|
|
* 获取订单参数
|
|
|
*/
|
|
|
async goPay() {
|
|
|
- console.log(wx.getStorageSync('loginInfo').openId)
|
|
|
- let result = await WelfareMall.getOrderParams(this.data.orderSn,wx.getStorageSync('loginInfo').openId);
|
|
|
- console.log(res);
|
|
|
+ var that = this;
|
|
|
+ let result = await WelfareMall.getOrderParams(that.data.orderSn,wx.getStorageSync('loginInfo').openId);
|
|
|
let res = result.data
|
|
|
wx.requestPayment({
|
|
|
timeStamp: res.wxPrePayVo.timeStamp,
|
|
@@ -126,7 +131,13 @@ Page({
|
|
|
success: function (res) {
|
|
|
//支付成功
|
|
|
console.log(res);
|
|
|
- this.onLoad(this.options);
|
|
|
+ //刷新当前页面
|
|
|
+ that.onLoad(that.options);
|
|
|
+ //获取当前页面的页面栈
|
|
|
+ var page = getCurrentPages();
|
|
|
+ //获取上一个页面的页面栈
|
|
|
+ var lastPage = page[page.length-2];
|
|
|
+ lastPage.onLoad(that.options);
|
|
|
},
|
|
|
fail: function (res) {
|
|
|
console.log(res);
|
|
@@ -141,7 +152,7 @@ Page({
|
|
|
getMode: function(){
|
|
|
this.setData({
|
|
|
hidden: false,
|
|
|
- inputValue: '',
|
|
|
+ inputValue: null,
|
|
|
});
|
|
|
},
|
|
|
|
|
@@ -150,7 +161,8 @@ Page({
|
|
|
*/
|
|
|
cancel: function(){
|
|
|
this.setData({
|
|
|
- hidden: true,
|
|
|
+ hidden: true,
|
|
|
+ inputValue: null,
|
|
|
});
|
|
|
},
|
|
|
/**
|
|
@@ -187,22 +199,28 @@ Page({
|
|
|
* 申请退款
|
|
|
*/
|
|
|
goRefund: function(reason) {
|
|
|
+ var that = this;
|
|
|
WelfareMall.orderRefund({
|
|
|
mobile: getMobileCache(),
|
|
|
- orderSn: this.data.orderSn,
|
|
|
+ orderSn: that.data.orderSn,
|
|
|
reason: reason,
|
|
|
}).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
- this.cancel();
|
|
|
- this.onLoad(this.options);
|
|
|
- const url = "../refund/refund?orderSn=" + this.data.orderSn
|
|
|
+ that.cancel();
|
|
|
+ that.onLoad(that.options);
|
|
|
+ //获取当前页面的页面栈
|
|
|
+ var page = getCurrentPages();
|
|
|
+ //获取上一个页面的页面栈
|
|
|
+ var lastPage = page[page.length-2];
|
|
|
+ lastPage.onLoad(that.options);
|
|
|
+ const url = "../refund/refund?orderSn=" + that.data.orderSn
|
|
|
wx.navigateTo({
|
|
|
url
|
|
|
})
|
|
|
}
|
|
|
}).catch(_ => {
|
|
|
console.log(_)
|
|
|
- this.cancel();
|
|
|
+ that.cancel();
|
|
|
})
|
|
|
|
|
|
},
|