apiclound学习笔记

参考文档:https://docs.apicloud.com/Client-API/api

1.openWin跳转页面及带参数

api.openWin({
    name: 'index',
    url: './index.html',
    pageParam:{name:'abc'} // 携带的参数,新页面中可以通过 api.pageParam 获取
  });

2.closeWin关闭当前页面

例:

<a class="aui-pull-left aui-btn aui-btn-outlined" onclick="api.closeWin()">
     <span class="aui-iconfont aui-icon-left"></span>
</a>

3.openTabLayout设置顶部、底部导航

var param = {
                name: 'nav-tab',
                title:'nav-tab',
                bgColor:'#fff',
                slidBackEnabled: false,
                hideNavigationBar: true, // 是否隐藏顶部导航
                // navigationBar: {
                //     hideBackButton: true
                // },
                tabBar: {
                    animated: true,
                    scrollEnabled: false,
                    list: [
                        {
                            text: "首页",
                            iconPath: "widget://image/footer/shouyes1.png",
                            selectedIconPath: "widget://image/footer/shouye2.png"
                        }, {
                            text: "菜谱",
                            iconPath: "widget://image/footer/caipus1.png",
                            selectedIconPath: "widget://image/footer/caipu2.png"
                        }, {
                            text: "社区",
                            iconPath: "widget://image/footer/shequs2.png",
                            selectedIconPath: "widget://image/footer/shequ2.png"
                        },
                        {
                            text: "购物车",
                            iconPath: "widget://image/footer/spcarts1.png",
                            selectedIconPath: "widget://image/footer/spcart2.png"
                        },
                        {
                            text: "我的",
                            iconPath: "widget://image/footer/wds1.png",
                            selectedIconPath: "widget://image/footer/wd2.png"
                        }
                    ],
                    frames: [
                        {
                            title: "首页",//tab切换时对应的标题
                            name: "index",
                            url: "widget://html/index.html",
                            //其他继承自openFrame的参数
                        }, {
                            title: "菜谱",
                            name: "tab_frm_2",
                            url: "widget://html/menu.html"
                            //其他继承自openFrame的参数
                        }, {
                            title: "社区",
                            name: "tab_frm_3",
                            url: "widget://html/community.html"
                            //其他继承自openFrame的参数
                        },
                        {
                            title: "购物车",
                            name: "tab_frm_3",
                            url: "widget://html/shopcart.html"
                            //其他继承自openFrame的参数
                        },
                        {
                            title: "我的",
                            name: "tab_frm_4",
                            url: "widget://html/my.html"
                            //其他继承自openFrame的参数
                        }
                    ]
                }
            }
            api.openTabLayout(param);

4.setTabBarAttr设置tabBar属性(实现底部导航点击切换)

api.setTabBarAttr({
     index:0, // 设置选中标签栏指定项
})

5.设置、获取、删除localStorage数据

$api.setStorage(key,val) // 设置
$api.getStorage(key) // 获取
$api.rmStorage(key) // 删除
$api.clearStorage () // 删除全部

连接地址: https://docs.apicloud.com/Front-end-Framework/framework-dev-guide#38

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值