Commit 672d90c6 by 谢中龙

消息通知逻辑判断

parent 623dc73b
......@@ -749,8 +749,6 @@ wxService.page({
wx.requestPayment(Object.assign({
success(res) {
wx.hideLoading()
// 支付成功页面
//消息订阅
let baseUserInfo = wx.getStorageSync('_baseUserInfo');
wxService.post(`${'/merchant/message/wxSubMsgMapping/getListByParams'}`, {
......@@ -758,11 +756,20 @@ wxService.page({
sourceFrom: 2,
switchType: 3
}).then(res => {
let tempArr = res.data.data;
let tempArr = res.data.data ? res.data.data : [];
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 => {
tempids.push(item.templateId);
})
});
wx.requestSubscribeMessage({
tmplIds: tempids,
success: (res)=>{
......@@ -772,15 +779,20 @@ wxService.page({
memberId: baseUserInfo.memberId,
scenarioId:tempArr[i].scenarioId,
templateId: tempArr[i].templateId
}).then(resp => { })
}).then(resp => {});
}
},
complete: (res)=>{
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) {
......
......@@ -96,11 +96,23 @@ wxService.page({
sourceFrom: 2,
switchType: 3
}).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 = [];
tempArr.map(item => {
tempids.push(item.templateId);
})
});
wx.requestSubscribeMessage({
tmplIds: tempids,
success: (res)=>{
......@@ -119,14 +131,23 @@ wxService.page({
});
// 订单列表
setTimeout(() => {
// wxService.router(`/pages/order/order`).search({params})
wx.navigateBack({
delta: 1
});
}, 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