|
@@ -16,6 +16,9 @@ Page({
|
|
|
isLogin: false,
|
|
|
orderDetail: null,
|
|
|
orderSn: '',
|
|
|
+ hidden: true,
|
|
|
+ reason: '',
|
|
|
+ inputValue: null,
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -144,6 +147,80 @@ Page({
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
+ * 取消
|
|
|
+ */
|
|
|
+ getMode: function(){
|
|
|
+ this.setData({
|
|
|
+ hidden: false,
|
|
|
+ inputValue: '',
|
|
|
+ });
|
|
|
+},
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 取消
|
|
|
+ */
|
|
|
+ cancel: function(){
|
|
|
+ this.setData({
|
|
|
+ hidden: true,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 提交
|
|
|
+ */
|
|
|
+ confirm: function(){
|
|
|
+ this.setData({
|
|
|
+ hidden: false
|
|
|
+ });
|
|
|
+ var res = this.data.reason;
|
|
|
+ console.log(res);
|
|
|
+ if(res == null || res =='' || res == undefined){
|
|
|
+ wx.showToast({
|
|
|
+ title: '退款原因必填',
|
|
|
+ icon: 'none',
|
|
|
+ duration: 1500
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.goRefund(res);
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 退款原因
|
|
|
+ */
|
|
|
+ getReason: function(e){
|
|
|
+ this.setData({
|
|
|
+ reason: e.detail.value
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * 申请退款
|
|
|
+ */
|
|
|
+ goRefund: function(reason) {
|
|
|
+ WelfareMall.orderRefund({
|
|
|
+ mobile: getMobileCache(),
|
|
|
+ orderSn: this.data.orderSn,
|
|
|
+ reason: reason,
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.cancel();
|
|
|
+ this.onLoad(this.options);
|
|
|
+ const url = "../refund/refund?orderSn=" + this.data.orderSn
|
|
|
+ wx.navigateTo({
|
|
|
+ url
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.data.lock = false
|
|
|
+ }).catch(_ => {
|
|
|
+ console.log(_)
|
|
|
+ this.cancel();
|
|
|
+ this.data.lock = false
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
*/
|
|
|
onReady: function () {
|