| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <!-- <meta name="viewport" content="width=device-width,initial-scale=1.0"> -->
- <title>discern</title>
- </head>
- <body>
- <div id="app"></div>
- <!-- built files will be auto injected -->
- <script src="https://unpkg.com/vue-baidu-map"></script>
- <!-- <script src="http://api.map.baidu.com/api?v=2.0&ak=fdc489725992ba738397be65dc657d9e"></script> -->
- <script src="./static/clipper.js"></script>
- <script src="http://api.map.baidu.com/api?v=1.0&type=webgl&ak=rQxHPQX1ua21rWnXzTbUh5KSSUbnefxR"></script>
- <script src="https://code.bdstatic.com/npm/mapvgl@1.0.0-beta.51/dist/mapvgl.min.js"></script>
- <script src="https://mapv.baidu.com/gl/examples/static/common.js"></script>
- <script src="http://mapv.baidu.com/build/mapv.min.js"></script>
- <script src="http://api.map.baidu.com/library.InfoBox/1.2/src/InfoBox_min.js"></script>
- <script src="https://cdn.bootcss.com/tinymce/4.7.13/tinymce.min.js"></script>
- <script>
- ; /(iPhone|iPad|iPhone OS|Phone|iPod|iOS|Android)/i.test(navigator.userAgent) &&
- ((head = document.getElementsByTagName('head')),
- (viewport = document.createElement('meta')),
- (viewport.name = 'viewport'),
- (viewport.content =
- 'target-densitydpi=device-dpi, width=375px, user-scalable=no'),
- head.length > 0 && head[head.length - 1].appendChild(viewport))
- </script>
- <script>
- function showToast(msg, duration) {
- duration = isNaN(duration) ? 3000 : duration;
- var m = document.createElement('div');
- m.innerHTML = msg;
- m.style.cssText = "width:35%; min-width:180px; background:#000; opacity:0.6; height:auto;min-height: 30px; color:#fff; line-height:30px; text-align:center; border-radius:15px; position:fixed; top:85%; left:25%; z-index:999999;";
- document.body.appendChild(m);
- setTimeout(function () {
- var d = 0.5;
- m.style.webkitTransition = '-webkit-transform ' + d + 's ease-in, opacity ' + d + 's ease-in';
- m.style.opacity = '0';
- setTimeout(function () { document.body.removeChild(m) }, d * 1000);
- }, duration);
- }
- document.addEventListener('plusready', function () {
- var webview = plus.webview.currentWebview();
- plus.navigator.setStatusBarBackground('#65d1a3');//设置顶部颜色
- plus.key.addEventListener('backbutton', function () {
- webview.canBack(function (e) {
- if (e.canBack) {
- webview.back(-1);
- } else {
- //webview.close(); //hide,quit
- //plus.runtime.quit();
- //首页返回键处理
- //处理逻辑:1秒内,连续两次按返回键,则退出应用;
- var first = null;
- plus.key.addEventListener('backbutton', function () {
- //首次按键,提示‘再按一次退出应用’
- if (!first) {
- first = new Date().getTime();
- // console.log('再按一次退出应用');
- showToast("再点击一次,退出程序", 1500);
- setTimeout(function () {
- first = null;
- }, 1000);
- } else {
- if (new Date().getTime() - first < 1500) {
- plus.runtime.quit();
- }
- }
- }, false);
- }
- })
- });
- console.log(plus.display.resolutionHeight)
- });
- //定时器 异步运行
- function hello() {
- console.log("hello");
- }
- //使用方法名字执行方法
- var t1 = window.setTimeout(hello, 1000);
- var t2 = window.setTimeout("hello()", 3000);//使用字符串执行方法
- window.clearTimeout(t1);//去掉定时器
- </script>
- </body>
- </html>
|