补结算单ios返回App

This commit is contained in:
2023-08-24 13:16:42 +08:00
parent 9cdb61835c
commit 65d6d73590

View File

@ -113,7 +113,15 @@ export default {
}else{ }else{
this.$toast(result.msg) this.$toast(result.msg)
setTimeout(()=>{ setTimeout(()=>{
window.android.sendMessage("goBack"); let data = {"action":"goBack","params":""}
var u = navigator.userAgent;
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
// var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
if(isiOS){
window.webkit.messageHandlers.nativeObject.postMessage(data);
}else {
window.android.sendMessage("goBack");
}
},2000) },2000)
} }
} }