|
@@ -15,6 +15,7 @@ Page({
|
|
|
noMore: false,
|
|
|
isLogin: false,
|
|
|
orderDetail: null,
|
|
|
+ orderSn: '',
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -25,9 +26,11 @@ Page({
|
|
|
that.orderSn = options.ordersn
|
|
|
this.setData({
|
|
|
isLogin: getMobileCache() != '',
|
|
|
+ orderSn: options.ordersn,
|
|
|
})
|
|
|
if(this.data.isLogin){
|
|
|
this.getOrder(that.orderSn);
|
|
|
+ this.data.orderSn = options.ordersn;
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -60,6 +63,45 @@ Page({
|
|
|
})
|
|
|
},
|
|
|
|
|
|
+ // 取消订单
|
|
|
+ toCancelOrder(e) {
|
|
|
+ wx.showModal({
|
|
|
+ title: '取消订单',
|
|
|
+ content: '',
|
|
|
+ showCancel: true,//是否显示取消按钮
|
|
|
+ cancelText:"取消",//默认是“取消”
|
|
|
+ cancelColor:'black',//取消文字的颜色
|
|
|
+ confirmText:"确定",//默认是“确定”
|
|
|
+ confirmColor: 'black',//确定文字的颜色
|
|
|
+ success: res => {if (res.cancel) {
|
|
|
+ //点击取消,默认隐藏弹框
|
|
|
+ } else {
|
|
|
+ //点击确定
|
|
|
+ WelfareMall.cancelOrder({
|
|
|
+ mobile: getMobileCache(),
|
|
|
+ orderSn: this.data.orderSn,
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ wx.showToast({
|
|
|
+ title: '取消订单成功',
|
|
|
+ icon: 'none',
|
|
|
+ duration: 1500
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.data.lock = false
|
|
|
+ }).catch(_ => {
|
|
|
+ console.log(_)
|
|
|
+ this.data.lock = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: function (res) {
|
|
|
+ console.log(res)
|
|
|
+ },//接口调用失败的回调函数
|
|
|
+ })
|
|
|
+
|
|
|
+},
|
|
|
+
|
|
|
/**
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
*/
|