|
@@ -17,7 +17,6 @@ Page({
|
|
orderSn: '',
|
|
orderSn: '',
|
|
hidden: true,
|
|
hidden: true,
|
|
reason: '',
|
|
reason: '',
|
|
- inputValue: null,
|
|
|
|
},
|
|
},
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -93,13 +92,7 @@ Page({
|
|
icon: 'none',
|
|
icon: 'none',
|
|
duration: 1500
|
|
duration: 1500
|
|
});
|
|
});
|
|
- this.onLoad(this.options);
|
|
|
|
- //获取当前页面的页面栈
|
|
|
|
- var page = getCurrentPages();
|
|
|
|
- //获取上一个页面的页面栈
|
|
|
|
- var lastPage = page[page.length-2];
|
|
|
|
- lastPage.onLoad(this.options);
|
|
|
|
- console.log(this.options);
|
|
|
|
|
|
+ this.changeOrder(this.data.orderSn,4,'已取消');
|
|
}
|
|
}
|
|
this.data.lock = false
|
|
this.data.lock = false
|
|
}).catch(_ => {
|
|
}).catch(_ => {
|
|
@@ -131,13 +124,7 @@ Page({
|
|
success: function (res) {
|
|
success: function (res) {
|
|
//支付成功
|
|
//支付成功
|
|
console.log(res);
|
|
console.log(res);
|
|
- //刷新当前页面
|
|
|
|
- that.onLoad(that.options);
|
|
|
|
- //获取当前页面的页面栈
|
|
|
|
- var page = getCurrentPages();
|
|
|
|
- //获取上一个页面的页面栈
|
|
|
|
- var lastPage = page[page.length-2];
|
|
|
|
- lastPage.onLoad(that.options);
|
|
|
|
|
|
+ that.changeOrder(that.data.orderSn,2,'已支付');
|
|
},
|
|
},
|
|
fail: function (res) {
|
|
fail: function (res) {
|
|
console.log(res);
|
|
console.log(res);
|
|
@@ -152,7 +139,7 @@ Page({
|
|
getMode: function(){
|
|
getMode: function(){
|
|
this.setData({
|
|
this.setData({
|
|
hidden: false,
|
|
hidden: false,
|
|
- inputValue: null,
|
|
|
|
|
|
+ reason: '',
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
|
|
@@ -162,7 +149,7 @@ Page({
|
|
cancel: function(){
|
|
cancel: function(){
|
|
this.setData({
|
|
this.setData({
|
|
hidden: true,
|
|
hidden: true,
|
|
- inputValue: null,
|
|
|
|
|
|
+ reason: '',
|
|
});
|
|
});
|
|
},
|
|
},
|
|
/**
|
|
/**
|
|
@@ -208,11 +195,7 @@ Page({
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
that.cancel();
|
|
that.cancel();
|
|
that.onLoad(that.options);
|
|
that.onLoad(that.options);
|
|
- //获取当前页面的页面栈
|
|
|
|
- var page = getCurrentPages();
|
|
|
|
- //获取上一个页面的页面栈
|
|
|
|
- var lastPage = page[page.length-2];
|
|
|
|
- lastPage.onLoad(that.options);
|
|
|
|
|
|
+ that.changeOrder(that.data.orderSn,3,'已退款');
|
|
const url = "../refund/refund?orderSn=" + that.data.orderSn
|
|
const url = "../refund/refund?orderSn=" + that.data.orderSn
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
url
|
|
url
|
|
@@ -225,6 +208,30 @@ Page({
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ changeOrder: function(orderSn,status,showText){
|
|
|
|
+ var page = getCurrentPages();
|
|
|
|
+ //获取上一个页面的页面栈
|
|
|
|
+ var lastPage = page[page.length-2];
|
|
|
|
+ console.log(lastPage.data)
|
|
|
|
+ let oldOrderList = lastPage.data.orderList;
|
|
|
|
+ for(var i = 0;i<oldOrderList.length;i++){
|
|
|
|
+ if(orderSn == oldOrderList[i].orderSn){
|
|
|
|
+ oldOrderList[i].status.value = status
|
|
|
|
+ oldOrderList[i].status.showText = showText
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ wx.navigateBack({
|
|
|
|
+ delta: 1,
|
|
|
|
+ success:function(){
|
|
|
|
+ lastPage.setData({
|
|
|
|
+ orderList:oldOrderList
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ return;
|
|
|
|
+ },
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
*/
|
|
*/
|