博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
apiCloud中openFrameGroup传参
阅读量:6860 次
发布时间:2019-06-26

本文共 2515 字,大约阅读时间需要 8 分钟。

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        });    }});

转载地址:http://tcxyl.baihongyu.com/

你可能感兴趣的文章
html标签的target属性应用
查看>>
长连接
查看>>
MySQL数据库权限操作指南
查看>>
rabbitmq的web管理界面无法使用guest用户登录
查看>>
HBase的集群搭建(1、3、5节点都适用)
查看>>
将复杂form表单序列化serialize-object.js
查看>>
C语言 · 出现次数最多的数
查看>>
正则获取HTML代码中img的src地址
查看>>
Java 根据当前时间获取明天、当前周的周五、当前月的最后一天
查看>>
3.View绘制分析笔记之onLayout
查看>>
linux语言设置i18n(转)
查看>>
双链表插入 删除详解
查看>>
迄今为止计算机视觉领域超有实力的研究人物主页
查看>>
Java中值类型和引用类型的区别
查看>>
php 页面间传递数据
查看>>
[Node.js] Initialize a LoopBack Node.js Project through the CLI
查看>>
nginx补丁格式说明(CVE-2016-4450为例)
查看>>
C#编程(八十一)---------- 捕获异常
查看>>
Kinect2.0点云数据获取
查看>>
Omi新成员omi-router正式发布
查看>>