帖子
帖子
用户
博客
课程
123下一页
返回列表 发新帖
71
帖子
2
勋章
2159
Y币
还有就是反复弹出的报错提示:Uncaught SyntaxError: Unexpected token e at main.html : 1
71
帖子
2
勋章
2159
Y币
还有就是反复弹出的报错提示:Uncaught SyntaxError: Unexpected token e at main.html : 1
71
帖子
2
勋章
2159
Y币
还有就是反复弹出的报错提示:Uncaught SyntaxError: Unexpected token e at main.html : 1
71
帖子
2
勋章
2159
Y币
<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>首页Window</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
   <style>
      header {
      position: relative;
      width: 100%;
      height: 50px;
      background-color: #e1017e;
    }

    header.left{
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
      height: 50px;
    }

    header.left.arrow{
      position: absolute;
      bottom: 21px;
      left:11px;
      width: 13px;
      height: 8px;
      background: url(../image/arrow_down.png);
      background-size: 13px 8px;
      background-position: center center;
      background-repeat: no-repeat;
      -webkit-transition:200ms;
      transition: 200ms;
    }

      header.left.arrow.active{
        -webkitransform:rotate(180deg);
        transform: rotate(180deg);
      }

      header.left.city{
        position: relative;
        z-index: 2;
        width: 100%;
        height: 50px;
        padding-left: 27px;
        box-sizing: border-box;
        line-height: 50px;
        font-size: 14px;
        color: #fff;
        text-align: left;
      }
      header.center{
        width: 100%;
        height: 50px;
        background: url(../image/home_title.png);
        background-size: 74px 19px;
        background-position: center center;
        background-repeat: no-repeat;
      }

      header.right{
        position: absolute;
        bottom: 0;
        right: 0;
        width: 40px;
        height: 50px;
        background: url(../image/home_membercenter.png);
        background-size: 30px 30px;
        background-position: center center;
        background-repeat: no-repeat;
      }

      nav{
        display: -webkit-box;
        display: -webkit-flex;
        display: flex;
        -webkit-box-orient:horizontal;
        -webkit-flex-flow:row;
        flex-flow: row;
        position: relative;
        width: 100%;
        height: 40px;
        background-color: #e10173;
      }

      nav.menu{
        -webkit-box-flex:1;
        -webkit-flex:1;
        flex:1;
        width: 100%;
        height: 40px;
        line-height: 40px;
        font-size: 13px;
        color: #f973b8;
        text-align: center;
      }

      nav.menu.selected{
        font-size: 14px;
        color: #fff;
        font-weight: bolder;
      }
    </style>
</head>

<body>
  <header id="header">
    <div class="left"tapmode onclick="fnOpenCitySelectFrame();">
      <div class="arrow" id="arrow"></div>
      <div class="city" id="city">北京市</div>
    </div>
    <div class="center"></div>
    <div class="right"tapmode onclick="fnOpenPersonCenterWin();"></div>
  </header>
  <nav id="nav">
      <div class="menu selected" tapmode="selected" onclick="fnSetNavMenuIndex(0);">水果</div>
      <div class="menu" tapmode="selected" onclick="fnSetNavMenuIndex(1);">食材</div>
      <div class="menu" tapmode="selected" onclick="fnSetNavMenuIndex(2);">零食</div>
      <div class="menu" tapmode="selected" onclick="fnSetNavMenuIndex(3);">牛奶</div>
      <div class="menu" tapmode="selected" onclick="fnSetNavMenuIndex(4);">蔬菜</div>
  </nav>


</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript">

apiready = function() {

  initEventListenner();

  initLocation();

  var header = $api.byid('header');
  var nav =$api.byId('nav');

  $api.fixStatusBar(header);

  headerH = $api.offset(header).h;
  navH = $api.offset(nav).h;

  menus = $api.domAll(nav, '.menu');
}
  function fnOpenCitySelectFrame(){
    api.openFrame({
        name: 'cityselect_frame',
        url: './cityselect_frame.html',
        rect: {
            x: 0,
            y: 50,
            w: 'auto',
            h: 'auto'
        },
        pageParam: {
            name: 'test'
        },
        bounces: true,
        bgColor: 'rgba(0,0,0,0)',
        vScrollBarEnabled: true,
        hScrollBarEnabled: true
    });

  }
  function fnOpenPersonCenterWin(){
      api.openWin({
          name: 'login',
          url: './html/login.html',
          pageParam: {
              name: 'test'
          }
      });

  }
</script>

</html>

9
帖子
0
勋章
5634
Y币
这个城市用的是模块还是什么 ?
你试试用真机编译一个自定义loader wifi同步测试一下
71
帖子
2
勋章
2159
Y币
<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>首页Window</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <style>
      header {
      position: relative;
      width: 100%;
      height: 50px;
      background-color: #e1017e;
    }

    header.left{
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
      height: 50px;
    }

    header.left.arrow{
      position: absolute;
      bottom: 21px;
      left:11px;
      width: 13px;
      height: 8px;
      background: url(../image/arrow_down.png);
      background-size: 13px 8px;
      background-position: center center;
      background-repeat: no-repeat;
      -webkit-transition:200ms;
      transition: 200ms;
    }

      header.left.arrow.active{
        -webkitransform:rotate(180deg);
        transform: rotate(180deg);
      }

      header.left.city{
        position: relative;
        z-index: 2;
        width: 100%;
        height: 50px;
        padding-left: 27px;
        box-sizing: border-box;
        line-height: 50px;
        font-size: 14px;
        color: #fff;
        text-align: left;
      }
      header.center{
        width: 100%;
        height: 50px;
        background: url(../image/home_title.png);
        background-size: 74px 19px;
        background-position: center center;
        background-repeat: no-repeat;
      }

      header.right{
        position: absolute;
        bottom: 0;
        right: 0;
        width: 40px;
        height: 50px;
        background: url(../image/home_membercenter.png);
        background-size: 30px 30px;
        background-position: center center;
        background-repeat: no-repeat;
      }

      nav{
        display: -webkit-box;
        display: -webkit-flex;
        display: flex;
        -webkit-box-orient:horizontal;
        -webkit-flex-flow:row;
        flex-flow: row;
        position: relative;
        width: 100%;
        height: 40px;
        background-color: #e10173;
      }

      nav.menu{
        -webkit-box-flex:1;
        -webkit-flex:1;
        flex:1;
        width: 100%;
        height: 40px;
        line-height: 40px;
        font-size: 13px;
        color: #f973b8;
        text-align: center;
      }

      nav.menu.selected{
        font-size: 14px;
        color: #fff;
        font-weight: bolder;
      }
    </style>
</head>

<body>
  <header id="header">
    <div class="left"tapmode onclick="fnOpenCitySelectFrame();">
      <div class="arrow" id="arrow"></div>
      <div class="city" id="city">北京市</div>
    </div>
    <div class="center"></div>
    <div class="right"tapmode onclick="fnOpenPersonCenterWin();"></div>
  </header>
  <nav id="nav">
      <div class="menu selected" tapmode="selected" onclick="fnSetNavMenuIndex(0);">水果</div>
      <div class="menu" tapmode="selected" onclick="fnSetNavMenuIndex(1);">食材</div>
      <div class="menu" tapmode="selected" onclick="fnSetNavMenuIndex(2);">零食</div>
      <div class="menu" tapmode="selected" onclick="fnSetNavMenuIndex(3);">牛奶</div>
      <div class="menu" tapmode="selected" onclick="fnSetNavMenuIndex(4);">蔬菜</div>
  </nav>


</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript">
apiready = function() {

  initEventListenner();

  initLocation();

  var header = $api.byid('header');
  var nav =$api.byId('nav');

  $api.fixStatusBar(header);

  headerH = $api.offset(header).h;
  navH = $api.offset(nav).h;

  menus = $api.domAll(nav, '.menu');





}
  function fnOpenCitySelectFrame(){
    api.openFrame({
        name: 'cityselect_frame',
        url: './cityselect_frame.html',
        rect: {
            x: 0,
            y: 50,
            w: 'auto',
            h: 'auto'
        },
        pageParam: {
            name: 'test'
        },
        bounces: true,
        bgColor: 'rgba(0,0,0,0)',
        vScrollBarEnabled: true,
        hScrollBarEnabled: true
    });

  }
  function fnOpenPersonCenterWin(){
      api.openWin({
          name: 'login',
          url: './html/login.html',
          pageParam: {
              name: 'test'
          }
      });

  }
</script>

</html>
71
帖子
2
勋章
2159
Y币
我用分屏对照,和源代码逐一核对,代码是一样的,但我就无法在模拟器和真机上同步出对应的效果
71
帖子
2
勋章
2159
Y币
微信截图4 316.png 我用的官方loader, 和这个有关是吗,应该用自定义loader,可是真的很奇怪,我用实时预览出来的,也是一样的有问题的
9
帖子
0
勋章
5634
Y币
这个用真机测试一下吧
用的官方loader是什么意思?
71
帖子
2
勋章
2159
Y币
哇塞,解决了,是在样式后面必须有空格在接后面的。。。我错了,让您费心了!
123下一页
您需要登录后才可以回帖 登录

本版积分规则