fix: 修复钉钉点击返回打开空白

This commit is contained in:
zhangds 2024-02-27 17:46:13 +08:00
parent 5afe39166c
commit 79d219b2d8
2 changed files with 19 additions and 8 deletions

View File

@ -17,6 +17,7 @@
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/loading.js"></script> <script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/loading.js"></script>
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/api2_0.js"></script> <script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/api2_0.js"></script>
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/tabs.js"></script> <script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/tabs.js"></script>
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/libs.js"></script>
</head> </head>
<style scoped> <style scoped>
* { * {
@ -407,7 +408,7 @@
.then(({ data, code, }) => { .then(({ data, code, }) => {
if (code === 200) { if (code === 200) {
sessionStorage.setItem('orderNumber', data[0].order_number); sessionStorage.setItem('orderNumber', data[0].order_number);
window.location.replace('/orderDetails/cardOrder.html'); locationReplace('/orderDetails/cardOrder.html');
} }
}); });
} else { } else {
@ -567,24 +568,24 @@
* receive_mode: 1 支付宝 2 H5 * receive_mode: 1 支付宝 2 H5
*/ */
if (type == 1) { if (type == 1) {
window.location.replace("./exchange.html"); locationReplace("./exchange.html");
} }
if (type == 2) { if (type == 2) {
if (entity.channel === 3) { if (entity.channel === 3) {
window.location.replace("./ysf-reduce.html"); locationReplace("./ysf-reduce.html");
} else if (entity.channel === 1 && entity.receive_mode === 2) { } else if (entity.channel === 1 && entity.receive_mode === 2) {
window.location.replace("./zfb-reduce.html"); locationReplace("./zfb-reduce.html");
} else { } else {
window.location.replace("./reduce.html"); locationReplace("./reduce.html");
} }
} }
if (type == 3) { if (type == 3) {
if (entity.channel === 3) { if (entity.channel === 3) {
window.location.replace("./ysf.html"); locationReplace("./ysf.html");
} else if (entity.channel === 1 && entity.receive_mode === 2) { } else if (entity.channel === 1 && entity.receive_mode === 2) {
window.location.replace("./zfb-redPackets.html"); locationReplace("./zfb-redPackets.html");
} else { } else {
window.location.replace("./redPackets.html"); locationReplace("./redPackets.html");
} }
} }
}, },

View File

@ -22,3 +22,13 @@ const settlementFun = (token, settlementType) => {
} }
}); });
}; };
// 兼容IOS 返回
const locationReplace = (url) => {
if (history.replaceState) {
history.replaceState(null, document.title, url);
history.go(0);
} else {
location.replace(url);
}
};