添加 HTML 资源路径到 pubspec.yaml;更新 Auth 页面以使用新的 Webview 组件加载本地 HTML 文件;重构 WebviewPage 以支持加载本地资产和注入 JavaScript 通信桥接;清理不必要的导入和注释。
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<style>
|
||||
.aa {
|
||||
|
||||
|
||||
margin: 100px;
|
||||
width: 200px;
|
||||
height: 100px;
|
||||
border-radius: 20px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
|
||||
<button class="aa" onclick="postMsgToAPP()">向 APP 发送数据</button>
|
||||
</body>
|
||||
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
if (window.__appInstallData) {
|
||||
return;
|
||||
}
|
||||
|
||||
window.__appInstallData = true;
|
||||
|
||||
window.AppBridge.token = 'xxx';
|
||||
window.AppBridge.playId = 'xxx';
|
||||
|
||||
///TODO 后续业务
|
||||
|
||||
})();
|
||||
function postMsgToAPP() {
|
||||
window.AppBridge.postMessage(JSON.stringify({ type: 'navigator_pop', value: null }))
|
||||
console.log(window.AppBridge.token)
|
||||
console.log(window.AppBridge.playId)
|
||||
}
|
||||
</script>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user