1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8"/>
- <meta name="referrer" content="no-referrer">
- <script>
- var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
- CSS.supports('top: constant(a)'))
- document.write(
- '<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
- (coverSupport ? ', viewport-fit=cover' : '') + '" />')
- </script>
- <title></title>
- <!--preload-links-->
- <!--app-context-->
- </head>
- <body>
- <div id="app"><!--app-html--></div>
- <script type="module" src="/main.js"></script>
- <script>
- document.addEventListener('UniAppJSBridgeReady', function () {
- uni.webView.postMessage({
- data: {
- action: 'setPlatform'
- }
- });
- window.backup = (from) => {
- if (from === 'backbutton') {
- const routes = getCurrentPages();
- const route = routes[routes.length - 1].route;
- if ([
- 'pages/login/login',
- 'pages/index/index',
- 'pages/ie/portal',
- 'pages/personal-center/index/index'
- ].includes(route)) {
- uni.webView.postMessage({
- data: {
- action: 'quit'
- }
- });
- } else {
- uni.navigateBack();
- }
- }
- };
- // 默认为h5平台
- window.platform = 'h5';
- window.setPlatform = (platform) => {
- window.platform = platform;
- window.dispatchEvent(new Event('platformChange'));
- };
- });
- </script>
- </body>
- </html>
|