开始使用 API对象 布局容器和栅格系统 Color 色彩 Button 按钮 Tag 标签 Badge 数字角标 List 列表 Grid 宫格 Card 卡片 Noticebar 通告 Steps 步骤条 Icon 图标 Srarch 搜索 侧滑菜单 图片上传 图片预览 图片裁剪 图片主色 星级评价 选择器 下拉选择 选项卡 生成二维码 复制剪贴板 物流信息 加入购物车 波浪特效 水球图 倒计时 雪花飘落 loading动画 toast消息提示弹窗 dialog提示窗 actionsheet操作表 actionmenu分享弹窗 popover菜单 picker多级联动 poster广告弹窗 keypad数字键盘 chatbox js聊天输入框

actionmenu分享弹窗

需要先引入相关的CSS和JS文件:

<link rel="stylesheet" type="text/css" href="static/css/aui.min.css"/>

<link rel="stylesheet" type="text/css" href="static/css/aui.actionmenu.css"/>

<script src="static/js/aui.min.js" type="text/javascript" charset="utf-8"></script>

<script src="static/js/aui.actionmenu.js" type="text/javascript" charset="utf-8"></script>

参数介绍

参数 类型 描述 默认值 必选
title string 标题 ''
warp string 父容器元素 ‘body’
items arr 菜单列表[{name: “”, icon: “”, iconColor: “”, img: “”}] []
mask boolean 是否显示遮罩蒙版 true
touchClose boolean 触摸遮罩是否关闭模态弹窗 true
cancle string 取消按钮 ‘’
location string 位置 bottom:位于底部,从底部弹出显示middle:位于页面中心位置 ‘bottom’
theme number 主题样式(1: 非全屏宽度; 2: 全屏宽度) 1

示例代码

<div class="container">
    <header class="aui-header">
        <a class="aui-header-left" onclick="aui.closeWin()"><i class="iconfont iconreturn"></i></a>
        <div class="aui-header-title">actionMenu底部菜单</div>
    </header>
    <div class="aui-content">
        <lable class="aui-list-title">以分享弹窗为例:</lable>
        <button class="aui-btn aui-btn-blue actionmenu-0">底部非全屏弹出菜单</button>
        <button class="aui-btn aui-btn-blue actionmenu-1">页面中心非全屏弹出菜单</button>
        <button class="aui-btn aui-btn-blue actionmenu-2">底部全屏弹出菜单</button>
        <button class="aui-btn aui-btn-blue actionmenu-3">底部全屏弹出菜单(无图标)</button>
    </div>
</div>
<script type="text/javascript">
    window.addEventListener("load", function(){
        var btns = document.querySelectorAll(".aui-btn");
        for(var i = 0; i < btns.length; i++){
            aui.touchDom(btns[i], "#FFF", "var(--aui-blue)", "1px solid var(--aui-blue)");
        }
        //底部非全屏弹出菜单
        document.querySelector(".actionmenu-0").addEventListener("click", function(){
            aui.actionMenu({
                title: '分享至',
                mask: true,
                touchClose: true,
                items: [
                    {name: "微信", img: "../../../static/img/weixin.png"},
                    {name: "朋友圈", img: "../../../static/img/pengyouquan.png"},
                    {name: "QQ", img: "../../../static/img/QQ.png"},
                    {name: "微博", img: "../../../static/img/weibo.png"}
                ],
                cancle: "取消",
                theme: 1,
                location: "bottom"
            },function(ret){
                console.log(ret.index);
            });
        });
        //页面中心非全屏弹出菜单
        document.querySelector(".actionmenu-1").addEventListener("click", function(){
            aui.actionMenu({
                title: '分享至',
                mask: true,
                touchClose: true,
                items: [
                    {name: '微信', icon: 'iconweixin', iconColor: '#1AA034'},
                    {name: '朋友圈', icon: 'iconpengyouquan', iconColor: '#EB3C3B'},
                    {name: 'QQ', icon: 'iconqq', iconColor: '#30A5DD'},
                    {name: '微博', icon: 'iconweibo', iconColor: '#FF7C60'}
                ],
                cancle: "取消",
                theme: 1,
                location: "middle"
            },function(ret){
                console.log(ret.index);
            });
        });
        //底部全屏弹出菜单
        document.querySelector(".actionmenu-2").addEventListener("click", function(){
            aui.actionMenu({
                title: '分享至',
                mask: true,
                touchClose: true,
                items: [
                    {name: '微信', icon: 'iconweixin', iconColor: '#1AA034'},
                    {name: '朋友圈', icon: 'iconpengyouquan', iconColor: '#EB3C3B'},
                    {name: 'QQ', icon: 'iconqq', iconColor: '#30A5DD'},
                    {name: '微博', icon: 'iconweibo', iconColor: '#FF7C60'}
                ],
                cancle: "取消",
                theme: 2,
                location: "bottom"
            },function(ret){
                console.log(ret.index);
            });
        });
        //底部全屏弹出菜单(无图标)
        document.querySelector(".actionmenu-3").addEventListener("click", function(){
            aui.actionMenu({
                title: '分享至',
                mask: true,
                touchClose: true,
                items: [
                    {name: '微信'},
                    {name: '朋友圈'},
                    {name: 'QQ'},
                    {name: '微博'}
                ],
                cancle: "取消",
                theme: 2,
                location: "bottom"
            },function(ret){
                console.log(ret.index);
            });
        });
    });
</script>