123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- <!DOCTYPE html>
- <html lang=zh-CN>
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1">
-
- <style type="text/css">
- body{
- margin: 0;
- background-color: #f3f3f3;
- }
- iframe{
- width: 375px;
- height:100vh;
- background-color: #fff;
- box-sizing: content-box;
- border: none;
- }
-
- @media screen and (min-width: 450px) {
- iframe {
- position: fixed;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- margin: auto;
- /* border: rgba(0,0,0,1) solid 10px;
- border-top: rgba(0,0,0,1) solid 30px;
- border-bottom: rgba(0,0,0,1) solid 50px;
- border-radius: 35px;
- box-shadow: -10px 10px 30px #333333; */
- }
- }
- </style>
- <script type="text/javascript">
- window.isPC = true;
- window.onload = function(){
- if(window.innerWidth <= 420){
- window.location.pathname = '/TracerMethodology';
- }
- /* 监听电脑浏览器窗口尺寸改变 */
- window.onresize = function(){
- /* 窗口宽度 小于或等于420px 时,跳转回H5页面 */
- if(window.innerWidth <= 420){
- console.log('window.innerWidth <= 420');
- window.location.pathname = '/TracerMethodology';
-
- /* 若你的项目未设置根目录(默认为 / 时),则使用下方代码 */
- // window.location.pathname = '';
- }
- }
- }
- </script>
- </head>
- <body>
- <!-- <iframe id="frame" ></iframe> -->
- <!--
- 若你的项目未设置根目录(默认为 / 时),则使用下方代码
- <iframe src="/"></iframe>
- -->
- </body>
- <script type="text/javascript">
- // console.log('iframe',document.getElementById('frame'));
- function createIframe(id,url,width,height,onLoadCallback,timeOut,timeOutCallback){
- var timeOutVar = setTimeout(function(){
- clearTimeout(timeOutVar);
- timeOutCallback.apply(this, arguments);
- return ;
- }, timeOut);
- var iframe = document.createElement("iframe");
- iframe.id=id;
- iframe.width=width;
- iframe.height=height;
- iframe.src=url;
- if (iframe.attachEvent){
- iframe.attachEvent("onload", function(){
- clearTimeout(timeOutVar);
- onLoadCallback.apply(this, arguments);
- });
- } else {
- iframe.onload = function(){
- clearTimeout(timeOutVar);
- onLoadCallback.apply(this, arguments);
- };
- }
- document.body.appendChild(iframe);
- return iframe;
- }
-
- function onLoadCallback(){
- console.log('onLoadCallback');
- }
-
- function timeOutCallback(){
- console.log('timeOutCallback');
- }
-
- let hospSign = '';
- let query = window.location.search.substring(1);
- let vars = query.split("=");
- for (let i=0;i<vars.length;i++) {
-
- if(vars[i] == 'hospSign'){
- hospSign=vars[i+1];
- }
- }
-
-
-
- // localStorage.removeItem('hospSign');
- // localStorage.setItem('hospSign',hospSign);
-
- let url = `/TracerMethodology?hospSign=${hospSign}`;
-
- // console.log({hospSign,query,url});
-
- createIframe(
- 'frame',
- url,
- '100vw',
- '100vh',
- onLoadCallback,
- 1000,
- timeOutCallback
- );
- </script>
- </html>
|