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

相关文章
Desmos-可能是迄今为止最好用的免费Web端数学图像绘制工具
Desmos是一个在线绘制函数图像的网站,通过表达式,Desmos可以轻松的帮助你绘制你想绘制的图像,精准且方便。
2885 0
Desmos-可能是迄今为止最好用的免费Web端数学图像绘制工具
|
8天前
|
机器人 API 调度
基于 DMS Dify+Notebook+Airflow 实现 Agent 的一站式开发
本文提出“DMS Dify + Notebook + Airflow”三位一体架构,解决 Dify 在代码执行与定时调度上的局限。通过 Notebook 扩展 Python 环境,Airflow实现任务调度,构建可扩展、可运维的企业级智能 Agent 系统,提升大模型应用的工程化能力。
|
14天前
|
人工智能 数据可视化 Java
Spring AI Alibaba、Dify、LangGraph 与 LangChain 综合对比分析报告
本报告对比Spring AI Alibaba、Dify、LangGraph与LangChain四大AI开发框架,涵盖架构、性能、生态及适用场景。数据截至2025年10月,基于公开资料分析,实际发展可能随技术演进调整。
913 152
|
人工智能 前端开发 API
前端接入通义千问(Qwen)API:5 分钟实现你的 AI 问答助手
本文介绍如何在5分钟内通过前端接入通义千问(Qwen)API,快速打造一个AI问答助手。涵盖API配置、界面设计、流式响应、历史管理、错误重试等核心功能,并提供安全与性能优化建议,助你轻松集成智能对话能力到前端应用中。
651 154
|
负载均衡 Java 微服务
OpenFeign:让微服务调用像本地方法一样简单
OpenFeign是Spring Cloud中声明式微服务调用组件,通过接口注解简化远程调用,支持负载均衡、服务发现、熔断降级、自定义拦截器与编解码,提升微服务间通信开发效率与系统稳定性。
348 156