1、内嵌web ,web内用api对象

2021-03-15 18:47

阅读:495

YPE HTML>

标签:nbsp   for   scale   meta   url   detection   sea   art   phone   

1、

DOCTYPE html>
html>
head>
    meta charset="UTF-8">
    meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    title>云APItitle>
    link rel="stylesheet" type="text/css" href="./css/api.css"/>
    link rel="stylesheet" type="text/css" href="./css/style.css"/>
head>
body>
  header>
  header>
body>
script type="text/javascript" src="script/api.js">script>
script type="text/javascript">
    apiready = function () {
      var closeAPP = {
          count: 0,
          timer: null,
          time: 1500
      }
      api.addEventListener({
            name: keyback
          }, function(ret, err) {
          closeAPP.count++;
          if(closeAPP.count >= 2){
              api.closeWidget({
                  id: A6028342539653,
                  silent: true,
                  })
          }
          else{
                /*api.toast({
                    msg: ‘再按一次退出应用‘,
                    duration: closeAPP.time,
                    location: ‘bottom‘
                });*/
                browser.historyBack(
                    function(ret, err) {
                        if (!ret.status) {
                            //api.closeWin();
                            //直接退出,不用closeWin() 这种强硬的方式
                        }
                    }
                );
            }
            clearTimeout(closeAPP.timer);
            closeAPP.timer = setTimeout(function(){
                    closeAPP.count = 0;
            },closeAPP.time)
        });
        //双击退出APP
        $api.fixStatusBar( $api.dom(header) );
        api.setStatusBarStyle({
            style: dark,
            color: #6ab494
        });
        api.openWin({
            name: page1,
            url: http://suyijie.weiyouqq.com,
            pageParam: {
                name: test
            }
        });
        /*



script>
        body>
        html>
        */
    }
  script>
html>

 

1、内嵌web ,web内用api对象

标签:nbsp   for   scale   meta   url   detection   sea   art   phone   

原文地址:https://www.cnblogs.com/fger/p/12407206.html


评论


亲,登录后才可以留言!