index.html2023.6

<!DOCTYPE html>
<html lang="en" style="font-size: 10vw">

<head>
      <meta charset="utf-8">
      <!-- <meta name="viewport" content="width=device-width,initial-scale=1.0"> -->
      <meta name="viewport"
            content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
      <!-- 启用360浏览器的极速模式(webkit) -->
      <meta name="renderer" content="webkit">
      <!-- 避免IE使用兼容模式 -->
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <!-- 针对手持设备优化,主要是针对一些老的不识别viewport的浏览器,比如黑莓 -->
      <meta name="HandheldFriendly" content="true">
      <!-- 微软的老式浏览器 -->
      <meta name="MobileOptimized" content="320">
      <!-- uc强制竖屏 -->
      <meta name="screen-orientation" content="portrait">
      <!-- QQ强制竖屏 -->
      <meta name="x5-orientation" content="portrait">
      <!-- UC强制全屏 -->
      <meta name="full-screen" content="yes">
      <!-- QQ强制全屏 -->
      <meta name="x5-fullscreen" content="true">
      <!-- UC应用模式 -->
      <meta name="browsermode" content="application">
      <!-- QQ应用模式 -->
      <meta name="x5-page-mode" content="app">
      <!-- windows phone 点击无高光 -->
      <meta name="msapplication-tap-highlight" content="no">
      <meta content="telephone=no" name="format-detection" />
      <meta name="huaban" content="nopin" />
      <link rel="icon" type="image/x-icon" href="/favicon.ico">
      <title>爱回收闪电修</title>
      <script src="/config.js"></script>
      <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
      <meta http-equiv="X-UA-Compatible" content="IE=edge">

      <meta name="viewport"
            content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
      <script src="./node_modules/amfe-flexible/index.js"></script>
      <link rel="icon" href="<%= BASE_URL %>favicon.ico">
      <title><%= htmlWebpackPlugin.options.title %></title>


      <!--    //这个是固定的用这个链接就可以-->
      <script src="https://3gimg.qq.com/lightmap/components/geolocation/geolocation.min.js"></script>
      <script charset="utf-8" src="http://map.qq.com/api/js?v=2.exp&key=BWTBZ-2TE32-UKEUP-CMJPZ-KYC4H-DZBHZ"></script>

      <!--    第二个定位-->

      <script src="https://3gimg.qq.com/lightmap/components/geolocation/geolocation.min.js"></script>
      <style>
            @media only screen and (max-width: 360px) and (min-width: 320px) {
                  html {
                        font-size: 13.65px;
                  }
            }

            @media only screen and (max-width: 375px) and (min-width: 360px) {
                  html {
                        font-size: 23.4375px;
                  }
            }

            @media only screen and (max-width: 390px) and (min-width: 375px) {
                  html {
                        font-size: 23.4375px;
                  }
            }

            @media only screen and (max-width: 414px) and (min-width: 390px) {
                  html {
                        font-size: 17.64px;
                  }
            }

            @media only screen and (max-width: 640px) and (min-width: 414px) {
                  html {
                        font-size: 17.664px;
                  }
            }

            @media screen and (min-width: 640px) {
                  html {
                        font-size: 27.31px;
                  }
            }

            html,
            body {
                  overflow: hidden;
                  overflow-y: auto;
            }
      </style>
</head>

<body>
      <noscript>
            <strong></strong>
      </noscript>
      <div id="app">



      </div>


      <!--    -->
      <div id="pos-area">
            <!--      <p id="demo">点击下面的按钮,获得对应信息:<br /></p>-->
            <!--    </div>-->

            <!--    <div id="btn-area">-->
            <!--      <button onClick="geolocation.getLocation(showPosition, showErr, options)">获取精确定位信息</button>-->
            <!--      <button onClick="geolocation.getIpLocation(showPosition, showErr)">获取粗糙定位信息</button>-->
            <!--      <button onClick="showWatchPosition()">开始监听位置</button>-->
            <!--      <button onClick="showClearWatch()">停止监听位置</button>-->
      </div>
      <script type="text/JavaScript">
            var geolocation = new qq.maps.Geolocation("BWTBZ-2TE32-UKEUP-CMJPZ-KYC4H-DZBHZ", "myapp");

      document.getElementById("pos-area").style.height = (document.body.clientHeight - 110) + 'px';

      var positionNum = 0;
      var options = {timeout: 8000};

      function showPosition(position) {
        positionNum ++;
        // document.getElementById("demo").innerHTML += "序号:" + positionNum;
        //document.getElementById("demo").appendChild(document.createElement('pre')).innerHTML = JSON.stringify(position, null, 4);
        var kkk=JSON.parse(JSON.stringify(position, null, 4))
        document.getElementById("demo").innerHTML = kkk.nation+kkk.province+kkk.addr;
        //alert(JSON.stringify(position, null, 4))
        document.getElementById("pos-area").scrollTop = document.getElementById("pos-area").scrollHeight;

        //console.log("许先生",document.getElementById('demo').innerHTML)
        //console.log(document.getElementById("demo").appendChild(document.createElement('pre')).innerHTML)


      };

      function showErr() {
        positionNum ++;
        // document.getElementById("demo").innerHTML += "序号:" + positionNum;
        document.getElementById("demo").appendChild(document.createElement('p')).innerHTML = "定位失败!";
        document.getElementById("pos-area").scrollTop = document.getElementById("pos-area").scrollHeight;
      };

      // function showWatchPosition() {
      //   document.getElementById("demo").innerHTML += "开始监听位置!<br /><br />";
      //   geolocation.watchPosition(showPosition);
      //   document.getElementById("pos-area").scrollTop = document.getElementById("pos-area").scrollHeight;
      // };
      //
      // function showClearWatch() {
      //   geolocation.clearWatch();
      //   document.getElementById("demo").innerHTML += "停止监听位置!<br /><br />";
      //   document.getElementById("pos-area").scrollTop = document.getElementById("pos-area").scrollHeight;
      // };
    </script>

      <!--    -->














      <!-- built files will be auto injected -->
      <!--
     在iphone 5 中1rem=16px;
     html font-size =16px=1rem;
   -->
      <script>
            //得到手机屏幕的宽度
            let htmlWidth = document.documentElement.clientWidth || document.body.clientWidth;
            console.log('htmlWidth', htmlWidth)
            //得到html的Dom元素
            let htmlDom = document.getElementsByTagName('html')[0];
            // if(htmlWidth>640){//超过640大小的,字体根部都是16px
            //   htmlWidth=640;
            //   console.log('htmlWidth-true',htmlWidth)
            // }
            //设置根元素字体大小
            htmlDom.style.fontSize = htmlWidth / 40 + 'px';
      </script>
</body>

</html>


所有代码

评论者:[[ schemeInfo.user.username ]]

评论内容:[[ schemeInfo.pbody ]]

评论时间:[[ schemeInfo.ptime ]]





发表你的评论:

提交评论
上一篇:
下一篇: