-
Notifications
You must be signed in to change notification settings - Fork 0
/
for1.html
49 lines (46 loc) · 1.94 KB
/
for1.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no, viewport-fit=cover" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
<title>Document</title>
</head>
<body>
<div>加载中...</div>
<button id="btn-list" style="color: #000;">提交</button>
<script type="text/javascript" src="https://js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.2.js"></script>
<script>
window.onload = function () {
console.log('页面加载了')
document.addEventListener('UniAppJSBridgeReady', function () {
console.log('触发事件了')
// uni.getEnv(function (res) {
// console.log('当前环境:' + JSON.stringify(res));
// if (res.plus) {
// try {
// uni.navigateTo({
// url: '/pages/component/view/view'
// });
// } catch (error) {
// console.log(error, 'error')
// }
// }
// });
document.getElementById('btn-list').addEventListener('click', function (evt) {
var target = evt.target;
if (target.tagName === 'BUTTON') {
console.log('执行了')
uni.navigateTo({
url: '/pages/component/view/view'
});
}
});
});
}
</script>
</body>
</html>