fix: 优化包码结算判断逻辑

This commit is contained in:
zhangds 2024-02-23 10:26:09 +08:00
parent 14325ee48e
commit 6fec59bea4
1 changed files with 11 additions and 6 deletions

View File

@ -164,8 +164,9 @@
localStorage.setItem('haskey', keyCode);
// 判断是否是包码逻辑
if (res.data.settlement_data) {
self.goToPackKey({ token: res.data.token, settlement_data: res.data.settlement_data });
}
this.openDialog('正在加载商品...');
localStorage.setItem('entryLink', window.location.href);//存储起始页链接
@ -222,7 +223,7 @@
// 判断是否是包码 跳转对应的包码页面 ****
goToPackKey(data) {
// 第一步:判断是否为包码
if (data.settlement_data.settlement_type > 0) {
if (data.settlement_data && data.settlement_data.settlement_type > 0) {
// 存储数据
sessionStorage.setItem("bm_auth", JSON.stringify(data));
// 跳转包码页面
@ -289,7 +290,9 @@
localStorage.setItem('entryLink', window.location.href);//存储起始页链接
// 判断是否是包码逻辑
if (res.data.settlement_data) {
self.goToPackKey({ token: res.data.token, settlement_data: res.data.settlement_data });
}
// 存储
setTimeout(() => {
@ -330,9 +333,11 @@
};
let wait = await req.axiosPost('/key/loginFromMobileKey', data).then(res => {
if (res.code == 200) {
if (res.data.settlement_data) {
// 判断是否是包码逻辑
self.goToPackKey({ token: res.data.data, settlement_data: res.data.settlement_data });
}
getTokenList.push(res.data.token);
istoGoods = true;