Commit 672d90c6 by 谢中龙

消息通知逻辑判断

parent 623dc73b
...@@ -748,9 +748,7 @@ wxService.page({ ...@@ -748,9 +748,7 @@ wxService.page({
let amount = data.amount || 0 let amount = data.amount || 0
wx.requestPayment(Object.assign({ wx.requestPayment(Object.assign({
success(res) { success(res) {
wx.hideLoading() wx.hideLoading()
// 支付成功页面
//消息订阅 //消息订阅
let baseUserInfo = wx.getStorageSync('_baseUserInfo'); let baseUserInfo = wx.getStorageSync('_baseUserInfo');
wxService.post(`${'/merchant/message/wxSubMsgMapping/getListByParams'}`, { wxService.post(`${'/merchant/message/wxSubMsgMapping/getListByParams'}`, {
...@@ -758,11 +756,20 @@ wxService.page({ ...@@ -758,11 +756,20 @@ wxService.page({
sourceFrom: 2, sourceFrom: 2,
switchType: 3 switchType: 3
}).then(res => { }).then(res => {
let tempArr = res.data.data; let tempArr = res.data.data ? res.data.data : [];
let tempids = []; let currentType = _this.data.currentType;
if (tempArr.length == 0){
wx.redirectTo({
url: `/subPackage/page/pages/paymentStatus/paymentStatus?status=S&amount=${amount}&type=${currentType}`,
});
return ;
}
let tempids = [];
tempArr.map(item => { tempArr.map(item => {
tempids.push(item.templateId); tempids.push(item.templateId);
}) });
wx.requestSubscribeMessage({ wx.requestSubscribeMessage({
tmplIds: tempids, tmplIds: tempids,
success: (res)=>{ success: (res)=>{
...@@ -772,15 +779,20 @@ wxService.page({ ...@@ -772,15 +779,20 @@ wxService.page({
memberId: baseUserInfo.memberId, memberId: baseUserInfo.memberId,
scenarioId:tempArr[i].scenarioId, scenarioId:tempArr[i].scenarioId,
templateId: tempArr[i].templateId templateId: tempArr[i].templateId
}).then(resp => { }) }).then(resp => {});
} }
}, },
complete: (res)=>{ complete: (res)=>{
wx.redirectTo({ wx.redirectTo({
url: `/subPackage/page/pages/paymentStatus/paymentStatus?status=S&amount=${amount}&type=${_this.data.currentType}`, url: `/subPackage/page/pages/paymentStatus/paymentStatus?status=S&amount=${amount}&type=${currentType}`,
}); });
} }
}) })
}).catch(err => {
let currentType = _this.data.currentType;
wx.redirectTo({
url: `/subPackage/page/pages/paymentStatus/paymentStatus?status=S&amount=${amount}&type=${currentType}`,
});
}) })
}, },
fail(res) { fail(res) {
......
...@@ -96,11 +96,23 @@ wxService.page({ ...@@ -96,11 +96,23 @@ wxService.page({
sourceFrom: 2, sourceFrom: 2,
switchType: 3 switchType: 3
}).then(res => { }).then(res => {
let tempArr = res.data.data; let tempArr = res.data.data ? res.data.data :[];
if(tempArr.length == 0){
wx.showToast({
title: '申请退款成功',
});
setTimeout(() => {
wx.navigateBack({
delta: 1
});
}, 2000);
return ;
}
let tempids = []; let tempids = [];
tempArr.map(item => { tempArr.map(item => {
tempids.push(item.templateId); tempids.push(item.templateId);
}) });
wx.requestSubscribeMessage({ wx.requestSubscribeMessage({
tmplIds: tempids, tmplIds: tempids,
success: (res)=>{ success: (res)=>{
...@@ -119,14 +131,23 @@ wxService.page({ ...@@ -119,14 +131,23 @@ wxService.page({
}); });
// 订单列表 // 订单列表
setTimeout(() => { setTimeout(() => {
// wxService.router(`/pages/order/order`).search({params}) wx.navigateBack({
wx.navigateBack({ delta: 1
delta: 1 });
});
}, 2000) }, 2000)
} }
}) })
}) }).catch(err => {
wx.showToast({
title: '申请退款成功',
});
// 订单列表
setTimeout(() => {
wx.navigateBack({
delta: 1
});
}, 2000)
});
} }
} }
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment