zoukankan      html  css  js  c++  java
  • apiCloud中openFrameGroup传参

    apiCloud中openFrameGroup传参

    1.无效的

    api.openFrameGroup({ // 打开 frame 组
        name: 'group',
        scrollEnabled: false,
        rect: {
            x: 0, 
            y: 0, 
            w: api.winWidth, 
            h: api.winHeight-$api.dom('footer').offsetHeight
        },
        pageParam:{
            'footer_height':$api.dom('footer').offsetHeight
        },
        index: 0,
        frames: frames
    }, function (ret, err) {
    
    });
    

    在新页面怎么获取都得不到数据。

    2.正确的,将参数放入frames中

    var eFooterLis = $api.domAll('#footer .aui-bar-tab-item'),
        frames = []; // 选择所有匹配的DOM元素
    for (var i = 0,len = eFooterLis.length; i < len; i++) {
            // 判断是否登录
            var username = $api.getStorage('customer_id');
            var url = './html/frame'+i+'.html';
            if (i==4 && !username) {
                url = './html/userLogin.html';
            }
            frames.push( { 
                name: 'frame'+i, 
                url: url,
                bgColor : 'rgba(0,0,0,.2)',
                bounces:true,
                pageParam:{
                    'footer_height':$api.dom('footer').offsetHeight
                },
            } )
    }
    
    api.openFrameGroup({ // 打开 frame 组
        name: 'group',
        scrollEnabled: false,
        rect: {
            x: 0,
            y: 0,
            w: api.winWidth,
            h: api.winHeight-$api.dom('footer').offsetHeight
        },
        index: 0,
        frames: frames
    }, function (ret, err) {
    
    });
    

    新页面获取参数

    var footer_height = api.pageParam.footer_height;
    // 获取菜单
    api.ajax({
        url: BASE_SH_REQUEST_URL+'/?g=Api&m=Home&a=getRootCategory',
        method: 'get',
        data: {}
    }, function(json, err) {
        if (json.status == '1') {
            var interText = doT.template($("#root_category_tmpl").text());
            $("#root_category").html(interText(json.info));
            var swiper_menu = new Swiper('#scroller.swiper-container', {
                slidesPerView: 4,
                paginationClickable: true,
                spaceBetween: 5
            });
    
    
            var header = $api.byId('main');
            $api.fixStatusBar(header);
            var pos = $api.offset(header);
    
            api.setStatusBarStyle({ // 设置头部颜色
                style: 'dark'
            });
    
            api.openFrame({
                name: 'frame0Con',
                url: 'frame0Con.html',
                rect:{
                    x: 0,
                    y: pos.h,
                    w: api.winWidth,
                    h: api.winHeight - pos.h - footer_height,
                },
                bounces: true,
                opaque: true,
                vScrollBarEnabled: false,
                reload: true,
                pageParam:{
                }
            });
    
        } else {
            var toast = new auiToast();
            toast.fail({
                title: json.msg,
                duration: 2000
            });
        }
    });
    
  • 相关阅读:
    【Android】Handler的应用(二):从服务器端加载JSON数据的优化
    [置顶] IOS 开发之 CocoaPods讲解
    POJ 1068 (13.10.11)
    android使用百度地图、定位SDK实现地图和定位功能!(最新、可用+吐槽)
    C++笔记(1)
    WCF讲解
    php5 图片验证码一例
    PHP5 GD库生成图形验证码(汉字)
    mysql中limit的用法实例解析
    Limit参数优化MySQL查询的方法
  • 原文地址:https://www.cnblogs.com/jiqing9006/p/5970207.html
Copyright © 2011-2022 走看看