|
@@ -1,163 +0,0 @@
|
|
|
-<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover"><title>功道云</title><script src=html5plus://ready></script><script src=static/js/polyfill.min.js></script><script>//某些情况下安卓没有提前注入plus对象,导致异常,有这种情况出现直接reload,直到plus存在
|
|
|
- if (window.navigator.userAgent.toLowerCase().match(/html5plus/i) == 'html5plus') {
|
|
|
- if (!window.plus) {
|
|
|
- window.location.reload()
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- if (window.plus) {
|
|
|
-
|
|
|
- function set_item(key, val){
|
|
|
- if(window.plus){
|
|
|
- return plus.storage.setItem(key, val)
|
|
|
- }else{
|
|
|
- return localStorage.setItem(key, val)
|
|
|
- }
|
|
|
- }
|
|
|
- function get_item(key){
|
|
|
- if(window.plus){
|
|
|
- return plus.storage.getItem(key)
|
|
|
- }else{
|
|
|
- return localStorage.getItem(key)
|
|
|
- }
|
|
|
- }
|
|
|
- //plus.storage.removeItem('first_init')
|
|
|
- if(!get_item('first_init') && plus.webview.currentWebview().id == plus.runtime.appid){
|
|
|
- set_item('first_init', '1');
|
|
|
- plus.io.requestFileSystem( plus.io.PRIVATE_WWW, function( fs ) {
|
|
|
- var full_url = 'file://'+fs.root.fullPath+'init.html'
|
|
|
- var init_w = plus.webview.create(full_url,full_url);
|
|
|
- init_w.show()
|
|
|
- }, function ( e ) {
|
|
|
- console.log(e)
|
|
|
- } );
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- plus.navigator.setStatusBarStyle('light');
|
|
|
- document.documentElement.style.backgroundColor = '#26A2FF';
|
|
|
- plus.navigator.setStatusBarBackground('#26A2FF');
|
|
|
-
|
|
|
- function setBadgeNumber(newNum) {
|
|
|
- plus.runtime.setBadgeNumber(newNum);
|
|
|
- if (plus.os.name != 'Android') {
|
|
|
- var GeTuiSdk = plus.ios.importClass('GeTuiSdk');
|
|
|
- GeTuiSdk.setBadge(newNum);
|
|
|
- }
|
|
|
- }
|
|
|
- if (plus.navigator.isImmersedStatusbar()) {
|
|
|
- var bar_height = plus.navigator.getStatusbarHeight();
|
|
|
- document.documentElement.style.marginTop = bar_height + 'px';
|
|
|
- document.documentElement.style.height = 'calc(100vh - ' + bar_height + 'px)'
|
|
|
- document.documentElement.classList.add('app_view_html')
|
|
|
- var myEvent = new Event('resize');
|
|
|
- window.dispatchEvent(myEvent);
|
|
|
- plus.webview.currentWebview().setStyle({
|
|
|
- softinputMode: "adjustResize",
|
|
|
- })
|
|
|
- }
|
|
|
- var first = null
|
|
|
- //解决在hbuilder中ios打包后,获取焦点失效的bug
|
|
|
- //setInterval(function () {
|
|
|
- var wv_current = plus.webview.currentWebview().nativeInstanceObject()
|
|
|
- if (plus.os.name != 'Android') {
|
|
|
- wv_current.plusCallMethod({
|
|
|
- 'setKeyboardDisplayRequiresUserAction': false
|
|
|
- })
|
|
|
- }
|
|
|
- var webview = plus.webview.all();
|
|
|
- webview = webview[webview.length - 1]
|
|
|
- //}, 1000)
|
|
|
-
|
|
|
- plus.key.addEventListener('backbutton', function (e) {
|
|
|
- if (plus.storage.getItem('qr_scaning')) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- webview.canBack(function (e) {
|
|
|
- if (e.canBack) {
|
|
|
- webview.back()
|
|
|
- } else {
|
|
|
- if (webview.id == plus.runtime.appid) {
|
|
|
- //首次按键,提示‘再按一次退出应用’
|
|
|
- if (!first) {
|
|
|
- first = new Date().getTime()
|
|
|
- plus.nativeUI.toast("再按一次退出应用");
|
|
|
- setTimeout(function () {
|
|
|
- first = null
|
|
|
- }, 1000)
|
|
|
- } else {
|
|
|
- if (new Date().getTime() - first < 1500) {
|
|
|
- plus.runtime.quit()
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- webview.close();
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- var wgtVer = null;
|
|
|
- plus.runtime.getProperty(plus.runtime.appid, function (inf) {
|
|
|
- wgtVer = inf.version
|
|
|
- });
|
|
|
- }
|
|
|
- window.onload = function () {
|
|
|
- if(window.plus){
|
|
|
- document.body.classList.add('on_app')
|
|
|
- }
|
|
|
- (function (window) {
|
|
|
- window.addEventListener('focusout', function () {
|
|
|
- //软键盘收起的事件处理
|
|
|
- window.setTimeout(function () {
|
|
|
- if (!(document.activeElement && (document.activeElement.type == 'textarea' || document.activeElement.type == 'text' || document.activeElement.type == 'password' || document.activeElement.type == 'search'||document.activeElement.type == 'tel'))) {
|
|
|
- let ua = window.navigator.userAgent.toLowerCase();
|
|
|
- if (ua.match(/MicroMessenger/i) == 'micromessenger') {
|
|
|
- window.scroll(0, 0)
|
|
|
- }
|
|
|
- }
|
|
|
- }, 300)
|
|
|
- });
|
|
|
- var winW = document.documentElement.clientWidth || window.innerWidth
|
|
|
- if (winW > 750) {
|
|
|
- winW = 750
|
|
|
- }
|
|
|
- var fontSize = Math.round(winW / 7.5)
|
|
|
- if (fontSize % 2 > 0) {
|
|
|
- fontSize += 1
|
|
|
- }
|
|
|
-
|
|
|
- setInterval(function () {
|
|
|
- document.body.style.height = '100%'
|
|
|
- }, 100)
|
|
|
- document.documentElement.style.fontSize = fontSize + 'px'
|
|
|
- window.onresize = function () {
|
|
|
- if (window.plus) {
|
|
|
- setTimeout(function () {
|
|
|
- var bar_height = plus.navigator.getStatusbarHeight();
|
|
|
- document.documentElement.style.marginTop = bar_height + 'px';
|
|
|
- document.documentElement.style.backgroundColor = '#26A2FF';
|
|
|
- document.documentElement.style.height = 'calc(100vh - ' + bar_height + 'px)'
|
|
|
- }, 100)
|
|
|
- }
|
|
|
-
|
|
|
- var winW = document.documentElement.clientWidth || window.innerWidth
|
|
|
- document.body.clientWidth
|
|
|
- if (winW > 750) {
|
|
|
- winW = 750
|
|
|
- }
|
|
|
- fontSize = Math.round(winW / 7.5)
|
|
|
- if (fontSize % 2 > 0) {
|
|
|
- fontSize += 1
|
|
|
- }
|
|
|
- document.documentElement.style.fontSize = fontSize + 'px'
|
|
|
- }
|
|
|
- setTimeout(function () {
|
|
|
- document.body.style.opacity = 1;
|
|
|
- document.documentElement.style.opacity = 1;
|
|
|
- if (window.plus && plus.webview.currentWebview().id == plus.runtime.appid) {
|
|
|
- localStorage.setItem('window_height', plus.screen.resolutionHeight + 1)
|
|
|
- }
|
|
|
- }, 100)
|
|
|
- }(window))
|
|
|
- }</script><link href=static/css/app.230a2dbceb66d57820714d9875d53bd0.css rel=stylesheet></head><body style="opacity: 0"><div id=app></div><script type=text/javascript src=static/js/manifest.4a037527fea76740a08f.1706754571694.js></script><script type=text/javascript src=static/js/vendor.6c6692f02cee66fefacd.1706754571694.js></script><script type=text/javascript src=static/js/app.7f53808dc2a6bcea6c1b.1706754571694.js></script></body><script type=text/javascript src="https://webapi.amap.com/maps?v=1.4.15&key=bc53b742b79c85c83ed94ef921facf93&plugin=AMap.Geocoder"></script><script src="https://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script></html>
|