weui_weui组件库 - CSDN
精华内容
参与话题
  • WeUI 入门教程

    千次阅读 2019-01-13 16:19:52
               &...WeUI 是由微信官方设计团队专为微信移动 Web 应用设计的 UI 库:http://ww
                         

    WeUI 是由微信官方设计团队专为微信移动 Web 应用设计的 UI 库:http://www.weui.org.cn/?/article/1

    WeUI 是一套同微信原生视觉体验一致的基础样式库,为微信 Web 开发量身设计,可以令用户的使用感知更加统一。包含button、cell、dialog、toast、article、icon等各式元素。weui 我们只需要他的样式,下面demo下载地址:http://download.csdn.net/detail/cometwo/9442635

    ========================================================================

    使用方法,引入微信UI库即可,此次没用使用zepto.js,而是使用jquery,原理都一样 看之前尽量参考一下官方源码

    这里写图片描述
    这里写图片描述
    这里写图片描述
    这里写图片描述
    这里写图片描述
    这里写图片描述
    这里写图片描述
    这里写图片描述
    这里写图片描述
    这里写图片描述

    这里写图片描述
    这里写图片描述
    这里写图片描述

    <!DOCTYPE html><html>    <head>        <meta charset="UTF-8">        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">        <link rel="stylesheet" href="css/weui.min.css" />        <script type="text/javascript" src="jquery-2.1.0.min.js"></script>        <title></title>    </head>    <body>        <div class="box" style="padding: 10px;">            <h1 style="text-align: center;color: red;">Button</h1>            <a href="javascript:;" class="weui_btn weui_btn_primary">按钮1</a>            <a href="javascript:;" class="weui_btn weui_btn_disabled weui_btn_primary">按钮2</a>            <a href="javascript:;" class="weui_btn weui_btn_warn">确认3</a>            <a href="javascript:;" class="weui_btn weui_btn_disabled weui_btn_warn">确认4</a>            <a href="javascript:;" class="weui_btn weui_btn_default">按钮5</a>            <a href="javascript:;" class="weui_btn weui_btn_disabled weui_btn_default">按钮6</a>            <a href="javascript:;" class="weui_btn weui_btn_plain_default">按钮7</a>            <a href="javascript:;" class="weui_btn weui_btn_plain_primary">按钮8</a>            <a href="javascript:;" class="weui_btn weui_btn_mini weui_btn_primary">按钮9</a>            <a href="javascript:;" class="weui_btn weui_btn_mini weui_btn_default">按钮10</a>            <h1 style="text-align: center;color: red;">Cell</h1>            <div class="weui_cells_title">带说明的列表项</div>            <div class="weui_cells">                <div class="weui_cell">                    <div class="weui_cell_bd weui_cell_primary">                        <p>标题文字</p>                    </div>                    <div class="weui_cell_ft">说明文字</div>                </div>            </div>            <div class="weui_cells_title">带图标、说明的列表项</div>            <hr style="color: black;opacity: 0.5;" />            <div class="weui_cells_title">带图标、说明的列表项</div>            <div class="weui_cells">                <div class="weui_cell">                    <div class="weui_cell_hd"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAuCAMAAABgZ9sFAAAAVFBMVEXx8fHMzMzr6+vn5+fv7+/t7e3d3d2+vr7W1tbHx8eysrKdnZ3p6enk5OTR0dG7u7u3t7ejo6PY2Njh4eHf39/T09PExMSvr6+goKCqqqqnp6e4uLgcLY/OAAAAnklEQVRIx+3RSRLDIAxE0QYhAbGZPNu5/z0zrXHiqiz5W72FqhqtVuuXAl3iOV7iPV/iSsAqZa9BS7YOmMXnNNX4TWGxRMn3R6SxRNgy0bzXOW8EBO8SAClsPdB3psqlvG+Lw7ONXg/pTld52BjgSSkA3PV2OOemjIDcZQWgVvONw60q7sIpR38EnHPSMDQ4MjDjLPozhAkGrVbr/z0ANjAF4AcbXmYAAAAASUVORK5CYII="                        alt="" style="width:20px;margin-right:5px;display:block"></div>                    <div class="weui_cell_bd weui_cell_primary">                        <p>标题文字</p>                    </div>                    <div class="weui_cell_ft">说明文字</div>                </div>                <div class="weui_cell">                    <div class="weui_cell_hd"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAuCAMAAABgZ9sFAAAAVFBMVEXx8fHMzMzr6+vn5+fv7+/t7e3d3d2+vr7W1tbHx8eysrKdnZ3p6enk5OTR0dG7u7u3t7ejo6PY2Njh4eHf39/T09PExMSvr6+goKCqqqqnp6e4uLgcLY/OAAAAnklEQVRIx+3RSRLDIAxE0QYhAbGZPNu5/z0zrXHiqiz5W72FqhqtVuuXAl3iOV7iPV/iSsAqZa9BS7YOmMXnNNX4TWGxRMn3R6SxRNgy0bzXOW8EBO8SAClsPdB3psqlvG+Lw7ONXg/pTld52BjgSSkA3PV2OOemjIDcZQWgVvONw60q7sIpR38EnHPSMDQ4MjDjLPozhAkGrVbr/z0ANjAF4AcbXmYAAAAASUVORK5CYII="                        alt="" style="width:20px;margin-right:5px;display:block"></div>                    <div class="weui_cell_bd weui_cell_primary">                        <p>标题文字</p>                    </div>                    <div class="weui_cell_ft">说明文字</div>                </div>            </div>            <div class="weui_cells_title">带跳转的列表项</div>            <div class="weui_cells weui_cells_access">                <a class="weui_cell" href="javascript:;">                    <div class="weui_cell_bd weui_cell_primary">                        <p>cell standard</p>                    </div>                    <div class="weui_cell_ft">                    </div>                </a>                <a class="weui_cell" href="javascript:;">                    <div class="weui_cell_bd weui_cell_primary">                        <p>cell standard</p>                    </div>                    <div class="weui_cell_ft">                    </div>                </a>            </div>            <div class="weui_cells_title">带说明、跳转的列表项</div>            <div class="weui_cells weui_cells_access">                <a class="weui_cell" href="javascript:;">                    <div class="weui_cell_bd weui_cell_primary">                        <p>cell standard</p>                    </div>                    <div class="weui_cell_ft">说明文字</div>                </a>                <a class="weui_cell" href="javascript:;">                    <div class="weui_cell_bd weui_cell_primary">                        <p>cell standard</p>                    </div>                    <div class="weui_cell_ft">说明文字</div>                </a>            </div>            <div class="weui_cells_title">带图标、说明、跳转的列表项</div>            <div class="weui_cells weui_cells_access">                <a class="weui_cell" href="javascript:;">                    <div class="weui_cell_hd"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAuCAMAAABgZ9sFAAAAVFBMVEXx8fHMzMzr6+vn5+fv7+/t7e3d3d2+vr7W1tbHx8eysrKdnZ3p6enk5OTR0dG7u7u3t7ejo6PY2Njh4eHf39/T09PExMSvr6+goKCqqqqnp6e4uLgcLY/OAAAAnklEQVRIx+3RSRLDIAxE0QYhAbGZPNu5/z0zrXHiqiz5W72FqhqtVuuXAl3iOV7iPV/iSsAqZa9BS7YOmMXnNNX4TWGxRMn3R6SxRNgy0bzXOW8EBO8SAClsPdB3psqlvG+Lw7ONXg/pTld52BjgSSkA3PV2OOemjIDcZQWgVvONw60q7sIpR38EnHPSMDQ4MjDjLPozhAkGrVbr/z0ANjAF4AcbXmYAAAAASUVORK5CYII="                        alt="" style="width:20px;margin-right:5px;display:block"></div>                    <div class="weui_cell_bd weui_cell_primary">                        <p>cell standard</p>                    </div>                    <div class="weui_cell_ft">说明文字</div>                </a>                <a class="weui_cell" href="javascript:;">                    <div class="weui_cell_hd"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAuCAMAAABgZ9sFAAAAVFBMVEXx8fHMzMzr6+vn5+fv7+/t7e3d3d2+vr7W1tbHx8eysrKdnZ3p6enk5OTR0dG7u7u3t7ejo6PY2Njh4eHf39/T09PExMSvr6+goKCqqqqnp6e4uLgcLY/OAAAAnklEQVRIx+3RSRLDIAxE0QYhAbGZPNu5/z0zrXHiqiz5W72FqhqtVuuXAl3iOV7iPV/iSsAqZa9BS7YOmMXnNNX4TWGxRMn3R6SxRNgy0bzXOW8EBO8SAClsPdB3psqlvG+Lw7ONXg/pTld52BjgSSkA3PV2OOemjIDcZQWgVvONw60q7sIpR38EnHPSMDQ4MjDjLPozhAkGrVbr/z0ANjAF4AcbXmYAAAAASUVORK5CYII="                        alt="" style="width:20px;margin-right:5px;display:block"></div>                    <div class="weui_cell_bd weui_cell_primary">                        <p>cell standard</p>                    </div>                    <div class="weui_cell_ft">说明文字</div>                </a>            </div>            <div class="weui_cells_title">单选列表项</div>            <div class="weui_cells weui_cells_radio">                <label class="weui_cell weui_check_label" for="x11">                    <div class="weui_cell_bd weui_cell_primary">                        <p>cell standard</p>                    </div>                    <div class="weui_cell_ft">                        <input type="radio" class="weui_check" name="radio1" id="x11">                        <span class="weui_icon_checked"></span>                    </div>                </label>                <label class="weui_cell weui_check_label" for="x12">                    <div class="weui_cell_bd weui_cell_primary">                        <p>cell standard</p>                    </div>                    <div class="weui_cell_ft">                        <input type="radio" name="radio1" class="weui_check" id="x12" checked="checked">                        <span class="weui_icon_checked"></span>                    </div>                </label>            </div>            <div class="weui_cells_title">复选列表项</div>            <div class="weui_cells weui_cells_checkbox">                <label class="weui_cell weui_check_label" for="s11">                    <div class="weui_cell_hd">                        <input type="checkbox" class="weui_check" name="checkbox1" id="s11" checked="checked">                        <i class="weui_icon_checked"></i>                    </div>                    <div class="weui_cell_bd weui_cell_primary">                        <p>standard is dealt for u.1</p>                    </div>                </label>                <label class="weui_cell weui_check_label" for="s12">                    <div class="weui_cell_hd">                        <input type="checkbox" name="checkbox1" class="weui_check" id="s12">                        <i class="weui_icon_checked"></i>                    </div>                    <div class="weui_cell_bd weui_cell_primary">                        <p>standard is dealicient for u.2</p>                    </div>                </label>                <label class="weui_cell weui_check_label" for="s13">                    <div class="weui_cell_hd">                        <input type="checkbox" name="checkbox1" class="weui_check" id="s13">                        <i class="weui_icon_checked"></i>                    </div>                    <div class="weui_cell_bd weui_cell_primary">                        <p>standard is dealicient for u.3</p>                    </div>                </label>                <label class="weui_cell weui_check_label" for="s14">                    <div class="weui_cell_hd">                        <input type="checkbox" name="checkbox1" class="weui_check" id="s14">                        <i class="weui_icon_checked"></i>                    </div>                    <div class="weui_cell_bd weui_cell_primary">                        <p>standard is dealicient for u.4</p>                    </div>                </label>            </div>            <div class="weui_cells_title">开关1</div>            <div class="weui_cells weui_cells_form">                <div class="weui_cell weui_cell_switch">                    <div class="weui_cell_hd weui_cell_primary">标题文字1</div>                    <div class="weui_cell_ft">                        <input class="weui_switch" type="checkbox" />                    </div>                </div>            </div>            <div class="weui_cells_title">开关2</div>            <div class="weui_cells weui_cells_form">                <div class="weui_cell weui_cell_switch">                    <div class="weui_cell_hd weui_cell_primary">标题文字2</div>                    <div class="weui_cell_ft">                        <input class="weui_switch" type="checkbox" />                    </div>                </div>            </div>            <div class="weui_cells_title">表单</div>            <div class="weui_cells weui_cells_form">                <div class="weui_cell">                    <div class="weui_cell_hd">                        <label class="weui_label">qq</label>                    </div>                    <div class="weui_cell_bd weui_cell_primary">                        <input class="weui_input" type="number" pattern="[0-9]*" placeholder="请输入qq号" />                    </div>                </div>                <div class="weui_cell weui_vcode">                    <div class="weui_cell_hd">                        <label class="weui_label">验证码</label>                    </div>                    <div class="weui_cell_bd weui_cell_primary">                        <input class="weui_input" type="text" placeholder="请输入验证码(验证码不一定是纯数字,此处weUI有误:type=" text ")" />                    </div>                    <div class="weui_cell_ft">                        <img src="./images/vcode.jpg" />                    </div>                </div>                <div class="weui_cell">                    <div class="weui_cell_hd">                        <label class="weui_label">银行卡</label>                    </div>                    <div class="weui_cell_bd weui_cell_primary">                        <input class="weui_input" type="number" pattern="[0-9]*" placeholder="请输入银行卡号" />                    </div>                </div>                <div class="weui_cell weui_vcode weui_cell_warn">                    <div class="weui_cell_hd">                        <label class="weui_label">验证码</label>                    </div>                    <div class="weui_cell_bd weui_cell_primary">                        <input class="weui_input" type="number" placeholder="请输入验证码" />                    </div>                    <div class="weui_cell_ft">                        <i class="weui_icon_warn"></i>                        <img src="./images/vcode.jpg" />                    </div>                </div>            </div>            <div class="weui_cells_tips">底部说明文字底部说明文字</div>            <div class="weui_btn_area">                <a class="weui_btn weui_btn_primary" href="javascript:" id="showTooltips">确定</a>            </div>            <div class="weui_cells_title">上传</div>            <div class="weui_cells weui_cells_form">                <div class="weui_cell">                    <div class="weui_cell_bd weui_cell_primary">                        <div class="weui_uploader">                            <div class="weui_uploader_hd weui_cell">                                <div class="weui_cell_bd weui_cell_primary">图片上传</div>                                <div class="weui_cell_ft">0/2</div>                            </div>                            <div class="weui_uploader_bd">                                <ul class="weui_uploader_files">                                    <li class="weui_uploader_file" style="background-image:url(http://shp.qpic.cn/weixinsrc_pic/pScBR7sbqjOBJomcuvVJ6iacVrbMJaoJZkFUIq4nzQZUIqzTKziam7ibg/)"></li>                                    <li class="weui_uploader_file" style="background-image:url(http://shp.qpic.cn/weixinsrc_pic/pScBR7sbqjOBJomcuvVJ6iacVrbMJaoJZkFUIq4nzQZUIqzTKziam7ibg/)"></li>                                    <li class="weui_uploader_file" style="background-image:url(http://shp.qpic.cn/weixinsrc_pic/pScBR7sbqjOBJomcuvVJ6iacVrbMJaoJZkFUIq4nzQZUIqzTKziam7ibg/)"></li>                                    <li class="weui_uploader_file weui_uploader_status" style="background-image:url(http://shp.qpic.cn/weixinsrc_pic/pScBR7sbqjOBJomcuvVJ6iacVrbMJaoJZkFUIq4nzQZUIqzTKziam7ibg/)">                                        <div class="weui_uploader_status_content">                                            <i class="weui_icon_warn"></i>                                        </div>                                    </li>                                    <li class="weui_uploader_file weui_uploader_status" style="background-image:url(http://shp.qpic.cn/weixinsrc_pic/pScBR7sbqjOBJomcuvVJ6iacVrbMJaoJZkFUIq4nzQZUIqzTKziam7ibg/)">                                        <div class="weui_uploader_status_content">50%</div>                                    </li>                                </ul>                                <div class="weui_uploader_input_wrp">                                    <input class="weui_uploader_input" type="file" accept="image/jpg,image/jpeg,image/png,image/gif" multiple />                                </div>                            </div>                        </div>                    </div>                </div>            </div>            <div class="weui_cells_title">文本域</div>            <div class="weui_cells weui_cells_form">                <div class="weui_cell">                    <div class="weui_cell_bd weui_cell_primary">                        <textarea class="weui_textarea" placeholder="请输入评论" rows="3"></textarea>                        <div class="weui_textarea_counter"><span>0</span>/200</div>                    </div>                </div>            </div>            <div class="weui_toptips weui_warn js_tooltips">格式不对</div>            <div class="weui_cells_title">表单报错</div>            <div class="weui_cells weui_cells_form">                <div class="weui_cell weui_cell_warn">                    <div class="weui_cell_hd">                        <label for="" class="weui_label">卡号</label>                    </div>                    <div class="weui_cell_bd weui_cell_primary">                        <input class="weui_input" type="number" pattern="[0-9]*" value="weui input error" placeholder="请输入卡号1" />                    </div>                    <div class="weui_cell_ft">                        <i class="weui_icon_warn"></i>                    </div>                </div>                <div class="weui_cells_title">没有添加weui_cell_warn类</div>                <div class="weui_cell ">                    <div class="weui_cell_hd">                        <label for="" class="weui_label">卡号</label>                    </div>                    <div class="weui_cell_bd weui_cell_primary">                        <input class="weui_input" type="number" pattern="[0-9]*" value="weui input error" placeholder="请输入卡号2" />                    </div>                    <div class="weui_cell_ft">                        <i class="weui_icon_warn"></i>                    </div>                </div>                <div class="weui_cell">                    <div class="weui_cell_hd">                        <label for="" class="weui_label">日期</label>                    </div>                    <div class="weui_cell_bd weui_cell_primary">                        <input class="weui_input" type="date" value="" />                    </div>                </div>                <div class="weui_cell">                    <div class="weui_cell_hd">                        <label for="" class="weui_label">时间</label>                    </div>                    <div class="weui_cell_bd weui_cell_primary">                        <input class="weui_input" type="datetime-local" value="" placeholder="" />                    </div>                </div>            </div>            <div class="weui_cells_title">选择</div>            <div class="weui_cells">                <div class="weui_cell weui_cell_select weui_select_before">                    <div class="weui_cell_hd">                        <select class="weui_select" name="select2">                            <option value="1">+86</option>                            <option value="2">+80</option>                            <option value="3">+84</option>                            <option value="4">+87</option>                            <option value="4">+你大爷</option>                        </select>                    </div>                    <div class="weui_cell_bd weui_cell_primary">                        <input class="weui_input" type="number" pattern="[0-9]*" placeholder="请输入号码" />                    </div>                </div>            </div>            <div class="weui_cells_title">选择</div>            <div class="weui_cells">                <div class="weui_cell weui_cell_select">                    <div class="weui_cell_bd weui_cell_primary">                        <select class="weui_select" name="select1">                            <option selected="" value="1">微信号</option>                            <option value="2">QQ号</option>                            <option value="3">Email</option>                        </select>                    </div>                </div>                <div class="weui_cell weui_cell_select weui_select_after">                    <div class="weui_cell_hd">                        国家/地区                    </div>                    <div class="weui_cell_bd weui_cell_primary">                        <select class="weui_select" name="select2">                            <option value="1">中国</option>                            <option value="2">美国</option>                            <option value="3">英国</option>                        </select>                    </div>                </div>            </div>            <h1 style="text-align: center;color: red;">Toast</h1>            <a href="javascript:;" class="weui_btn weui_btn_primary" id="showToast">点击弹出Toast</a>            <a href="javascript:;" class="weui_btn weui_btn_primary" id="showLoadingToast">点击弹出Loading Toast</a>            <script>                $(function() {                    $('#showToast').click(function() {                        /**                         *1.delay函数是jquery 1.4.2新增的函数                         *2.hide函数里必须放一个0,不然延时不起作用                         */                        $('#toast').show().delay(3000).hide(0);                        //  $('#toast').fadeIn().delay(3000).fadeOut();                    });                    $('#showLoadingToast').click(function() {                        $('#loadingToast').fadeIn().delay(3000).fadeOut();                    });                })            </script>            <!--BEGIN toast-->            <div id="toast" style="display:none;">                <div class="weui_mask_transparent"></div>                <div class="weui_toast">                    <i class="weui_icon_toast"></i>                    <p class="weui_toast_content">已完成</p>                </div>            </div>            <!--end toast-->            <!-- loading toast -->            <div id="loadingToast" class="weui_loading_toast" style="display:none;">                <div class="weui_mask_transparent"></div>                <div class="weui_toast">                    <div class="weui_loading">                        <div class="weui_loading_leaf weui_loading_leaf_0"></div>                        <div class="weui_loading_leaf weui_loading_leaf_1"></div>                        <div class="weui_loading_leaf weui_loading_leaf_2"></div>                        <div class="weui_loading_leaf weui_loading_leaf_3"></div>                        <div class="weui_loading_leaf weui_loading_leaf_4"></div>                        <div class="weui_loading_leaf weui_loading_leaf_5"></div>                        <div class="weui_loading_leaf weui_loading_leaf_6"></div>                        <div class="weui_loading_leaf weui_loading_leaf_7"></div>                        <div class="weui_loading_leaf weui_loading_leaf_8"></div>                        <div class="weui_loading_leaf weui_loading_leaf_9"></div>                        <div class="weui_loading_leaf weui_loading_leaf_10"></div>                        <div class="weui_loading_leaf weui_loading_leaf_11"></div>                    </div>                    <p class="weui_toast_content">数据加载中</p>                </div>            </div>            <h1 style="text-align: center;color: red;">Dialog</h1>            <div class="bd spacing">                <a href="javascript:;" class="weui_btn weui_btn_primary" id="showDialog1">点击弹出Dialog样式一</a>                <a href="javascript:;" class="weui_btn weui_btn_primary" id="showDialog2">点击弹出Dialog样式二</a>            </div>            <script>                $(function() {                    $('#showDialog1').click(function() {                        $('#dialog1').show();                    });                    $('#quxioa').click(function() {                        alert('你点击了取消!!!');                        $('#dialog1').hide();                    });                    $('#ok').click(function() {                        alert('你点击了确认!!!');                    });                    $('#showDialog2').click(function() {                        $('#dialog2').show();                    });                    $('#ok1').click(function() {                        alert('你点击了确认!!!');                        $('#dialog2').hide();                    });                })            </script>            <!--BEGIN dialog1-->            <div class="weui_dialog_confirm" id="dialog1" style="display: none;">                <div class="weui_mask"></div>                <div class="weui_dialog">                    <div class="weui_dialog_hd"><strong class="weui_dialog_title">弹窗标题</strong></div>                    <div class="weui_dialog_bd">自定义弹窗内容,居左对齐显示,告知需要确认的信息等</div>                    <div class="weui_dialog_ft">                        <a id="quxioa" href="javascript:;" class="weui_btn_dialog default">取消</a>                        <a id="ok" href="javascript:;" class="weui_btn_dialog primary">确定</a>                    </div>                </div>            </div>            <!--END dialog1-->            <!--BEGIN dialog2-->            <div class="weui_dialog_alert" id="dialog2" style="display: none;">                <div class="weui_mask"></div>                <div class="weui_dialog">                    <div class="weui_dialog_hd"><strong class="weui_dialog_title">弹窗标题</strong></div>                    <div class="weui_dialog_bd">弹窗内容,告知当前页面信息等</div>                    <div class="weui_dialog_ft">                        <a id="ok1" href="javascript:;" class="weui_btn_dialog primary">确定</a>                    </div>                </div>            </div>            <h1 style="text-align: center;color: red;">Progress</h1>            <div class="weui_progress">                <div class="weui_progress_bar">                    <div id="prs" class="weui_progress_inner_bar js_progress" style="width: 0%;"></div>                </div>                <a href="javascript:;" class="weui_progress_opr">                    <i class="weui_icon_cancel"></i>                </a>            </div>            <br>            <div class="weui_progress">                <div class="weui_progress_bar">                    <div class="weui_progress_inner_bar js_progress" style="width: 50%;"></div>                </div>                <a href="javascript:;" class="weui_progress_opr">                    <i class="weui_icon_cancel"></i>                </a>            </div>            <br>            <div class="weui_progress">                <div class="weui_progress_bar">                    <div class="weui_progress_inner_bar js_progress" style="width: 80%;"></div>                </div>                <a href="javascript:;" class="weui_progress_opr">                    <i class="weui_icon_cancel"></i>                </a>            </div>            <div class="weui_btn_area">                <a href="javascript:;" class="weui_btn weui_btn_primary" id="btnStartProgress">上传</a>            </div>            <script>                $(function() {                    $('#btnStartProgress').click(function() {                        $('#prs').animate({                            width: "100%"                        }, 2000, function() {再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow
    
    展开全文
  • WeUI 详细介绍

    万次阅读 2018-05-06 19:44:06
    WeUI 是由微信官方设计团队专为微信移动 Web 应用设计的 UI 库。WeUI 是一套同微信原生视觉体验一致的基础样式库,为微信 Web 开发量身设计,可以令用户的使用感知更加统一。包含button、cell、dialog、toast、...

    WeUI 是由微信官方设计团队专为微信移动 Web 应用设计的 UI 库。

    WeUI 是一套同微信原生视觉体验一致的基础样式库,为微信 Web 开发量身设计,可以令用户的使用感知更加统一。包含buttoncelldialogtoastarticleicon等各式元素。

    使用

    方法一:

    使用bower进行安装

    bower install --save weui

    方法二:

    使用npm进行安装

    npm install --save weui

    开发

    git clone https://github.com/weui/weui.git
    cd weui
    npm install -g gulp
    npm install
    gulp -ws

    运行gulp -ws命令,会监听src目录下所有文件的变更,并且默认会在8080端口启动服务器,然后在浏览器打开 http://localhost:8080/example

    手机预览

    请用微信扫码 

    http://weui.github.io/weui/

    Button

    按钮可以使用a或者button标签。wap上要触发按钮的active态,必须触发ontouchstart事件,可以在body上加上ontouchstart=""全局触发。

    按钮常见的操作场景:确定、取消、警示,分别对应class:weui_btn_primaryweui_btn_defaultweui_btn_warn,每种场景都有自己的置灰态weui_btn_disabled,除此外还有一种镂空按钮weui_btn_plain_xxx,客户端webview里的按钮尺寸有两类,默认宽度100%,小型按钮宽度自适应,两边边框与文本间距0.75em:

    <a href="javascript:;" class="weui_btn weui_btn_primary">按钮</a>
    <a href="javascript:;" class="weui_btn weui_btn_disabled weui_btn_primary">按钮</a>
    <a href="javascript:;" class="weui_btn weui_btn_warn">确认</a>
    <a href="javascript:;" class="weui_btn weui_btn_disabled weui_btn_warn">确认</a>
    <a href="javascript:;" class="weui_btn weui_btn_default">按钮</a>
    <a href="javascript:;" class="weui_btn weui_btn_disabled weui_btn_default">按钮</a>
    <div class="button_sp_area">
        <a href="javascript:;" class="weui_btn weui_btn_plain_default">按钮</a>
        <a href="javascript:;" class="weui_btn weui_btn_plain_primary">按钮</a>
    
        <a href="javascript:;" class="weui_btn weui_btn_mini weui_btn_primary">按钮</a>
        <a href="javascript:;" class="weui_btn weui_btn_mini weui_btn_default">按钮</a>
    </div>

    Cell

    Cell,列表视图,用于将信息以列表的结构显示在页面上,是wap上最常用的内容结构。Cell由多个section组成,每个section包括section headerweui_cells_title以及cellsweui_cells

    cell由thumnailweui_cell_hd、bodyweui_cell_bd、accessoryweui_cell_ft三部分组成,cell采用自适应布局,在需要自适应的部分加上classweui_cell_primary即可:

    带说明的列表项

    <div class="weui_cells_title">带说明的列表项</div>
    <div class="weui_cells">
        <div class="weui_cell">
            <div class="weui_cell_bd weui_cell_primary">
                <p>标题文字</p>
            </div>
            <div class="weui_cell_ft">
                说明文字
            </div>
        </div>
    </div>

    Cell可根据需要进行各种自定义扩展,包括辅助说明、跳转、单选、复选等。下面以带图标、说明、跳转的列表项,其他情况可以直接参考example下的代码:

    <div class="weui_cells_title">带图标、说明、跳转的列表项</div>
    <div class="weui_cells weui_cells_access">
    
        <a class="weui_cell" href="javascript:;">
            <div class="weui_cell_hd">
                <img src="" alt="icon" style="width:20px;margin-right:5px;display:block">
            </div>
            <div class="weui_cell_bd weui_cell_primary">
                <p>cell standard</p>
            </div>
            <div class="weui_cell_ft">
                说明文字
            </div>
        </a>
        <a class="weui_cell" href="javascript:;">
            <div class="weui_cell_hd">
                <img src="" alt="icon" style="width:20px;margin-right:5px;display:block">
            </div>
            <div class="weui_cell_bd weui_cell_primary">
                <p>cell standard</p>
            </div>
            <div class="weui_cell_ft">
                说明文字
            </div>
        </a>
    </div>

    Dialog

    若系统的alert窗体无法满足网页的临时视图内容需求,则可以自定义实现与alert形式相似的dialog,并且在dialog中可以自定义地使用各种控件,来满足需求。

    <div class="weui_dialog_confirm">
        <div class="weui_mask"></div>
        <div class="weui_dialog">
            <div class="weui_dialog_hd"><strong class="weui_dialog_title">弹窗标题</strong></div>
            <div class="weui_dialog_bd">自定义弹窗内容<br>...</div>
            <div class="weui_dialog_ft">
                <a href="javascript:;" class="weui_btn_dialog default">取消</a>
                <a href="javascript:;" class="weui_btn_dialog primary">确定</a>
            </div>
        </div>
    </div>

    <div class="weui_dialog_alert">
        <div class="weui_mask"></div>
        <div class="weui_dialog">
            <div class="weui_dialog_hd"><strong class="weui_dialog_title">弹窗标题</strong></div>
            <div class="weui_dialog_bd">弹窗内容,告知当前页面信息等</div>
            <div class="weui_dialog_ft">
                <a href="javascript:;" class="weui_btn_dialog primary">确定</a>
            </div>
        </div>
    </div>

    Toast

    toast用于临时显示某些信息,并且会在数秒后自动消失。这些信息通常是轻量级操作的成功、失败或等待状态信息。

    <div id="toast" style="display: none;">
        <div class="weui_mask_transparent"></div>
        <div class="weui_toast">
            <i class="weui_icon_toast"></i>
            <p class="weui_toast_content">已完成</p>
        </div>
    </div>

    <div id="loadingToast" class="weui_loading_toast" style="display:none;">
        <div class="weui_mask_transparent"></div>
        <div class="weui_toast">
            <div class="weui_loading">            <!-- :) -->
                <div class="weui_loading_leaf weui_loading_leaf_0"></div>
                <div class="weui_loading_leaf weui_loading_leaf_1"></div>
                <div class="weui_loading_leaf weui_loading_leaf_2"></div>
                <div class="weui_loading_leaf weui_loading_leaf_3"></div>
                <div class="weui_loading_leaf weui_loading_leaf_4"></div>
                <div class="weui_loading_leaf weui_loading_leaf_5"></div>
                <div class="weui_loading_leaf weui_loading_leaf_6"></div>
                <div class="weui_loading_leaf weui_loading_leaf_7"></div>
                <div class="weui_loading_leaf weui_loading_leaf_8"></div>
                <div class="weui_loading_leaf weui_loading_leaf_9"></div>
                <div class="weui_loading_leaf weui_loading_leaf_10"></div>
                <div class="weui_loading_leaf weui_loading_leaf_11"></div>
            </div>
            <p class="weui_toast_content">数据加载中</p>
        </div>
    </div>

    Msg Page

    结果页通常来说可以认为进行一系列操作步骤后,作为流程结束的总结性页面。结果页的作用主要是告知用户操作处理结果以及必要的相关细节(可用于确认 之前的操作是否有误)等信息;若该流程用于开启或关闭某些重要功能,可在结果页增加与该功能相关的描述性内容;除此之外,结果页也可以承载一些附加价值操 作,例如提供抽奖、关注公众号等功能入口。

    <div class="weui_msg">
        <div class="weui_icon_area"><i class="weui_icon_success weui_icon_msg"></i></div>
        <div class="weui_text_area">
            <h2 class="weui_msg_title">操作成功</h2>
            <p class="weui_msg_desc">内容详情,可根据实际需要安排</p>
        </div>
        <div class="weui_opr_area">
            <p class="weui_btn_area">
                <a href="javascript:;" class="weui_btn weui_btn_primary">确定</a>
                <a href="javascript:;" class="weui_btn weui_btn_default">取消</a>
            </p>
        </div>
        <div class="weui_extra_area">
            <a href="">查看详情</a>
        </div>
    </div>

    Article

    文字视图显示大段文字,这些文字通常是页面上的主体内容。Article支持分段、多层标题、引用、内嵌图片、有/无序列表等富文本样式,并可响应用户的选择操作。

    在微信客户端webview中使用Article,必须保证文字有足够的可读性和可辨识性、使用规范字体、保证足够的段间距、段首无缩进。

    <article class="weui_article">
        <h1>大标题</h1>
        <section>
            <h2 class="title">章标题</h2>
            <section>
                <h3>1.1 节标题</h3>
                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
                    tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
                    quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
                    consequat. Duis aute</p>
            </section>
            <section>
                <h3>1.2 节标题</h3>
                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
                    tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
                    cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
                    proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
            </section>
        </section>
    </article>

    Icon

    原文网址:https://www.oschina.net/p/weui

    <i class="weui_icon_msg weui_icon_success"></i>
    <i class="weui_icon_msg weui_icon_info"></i>
    <i class="weui_icon_msg weui_icon_warn"></i>
    <i class="weui_icon_msg weui_icon_waiting"></i>
    <i class="weui_icon_safe weui_icon_safe_success"></i>
    <i class="weui_icon_safe weui_icon_safe_warn"></i>
    <div class="icon_sp_area">
        <i class="weui_icon_success"></i>
        <i class="weui_icon_success_circle"></i>
        <i class="weui_icon_success_no_circle"></i>
        <i class="weui_icon_info"></i>
        <i class="weui_icon_waiting"></i>
        <i class="weui_icon_waiting_circle"></i>
        <i class="weui_icon_circle"></i>
        <i class="weui_icon_warn"></i>
        <i class="weui_icon_download"></i>
    

    </div>

    展开全文
  • weUI的使用

    千次阅读 2019-03-04 23:27:51
    目标:学习将weUI在小程序中使用; 资源:“weUI for 小程序”` 不要选择weUI,之前下载了CSS文件,在小程序中并不支持。 步骤: 使用Github 将weUI 克隆至本地; 复制“/weui-wxss/dist/style/weui.wxss”至小...

    目标:学习将weUI在小程序中使用;

    资源:“weUI for 小程序”`

    不要选择weUI,之前下载了CSS文件,在小程序中并不支持。

    步骤:

    1. 使用Github 将weUI 克隆至本地;
    2. 复制“/weui-wxss/dist/style/weui.wxss”至小程序的style文件夹中;
    3. 在对应的page中进行引用相应的wxss‘
    //@import "../../style/weui.wxss"
    
    1. 在相应page的wxml文件中调用样式的Class既可以,官方view如下:
    <view class="page">
        <view class="page__hd">
            <view class="page__title">WeUI</view>
            <view class="page__desc">WeUI 是一套同微信原生视觉体验一致的基础样式库,由微信官方设计团队为微信内网页和微信小程序量身设计,令用户的使用感知更加统一。</view>
        </view>
        <view class="page__bd page__bd_spacing">
            <view class="kind-list">
                <block wx:for="{{list}}" wx:key="id">
                    <view class="kind-list__item">
                        <view id="{{item.id}}" class="weui-flex kind-list__item-hd {{item.open ? 'kind-list__item-hd_show' : ''}}" bindtap="kindToggle">
                            <view class="weui-flex__item">{{item.name}}</view>
                            <image class="kind-list__img" src="images/icon_nav_{{item.id}}.png"></image>
                        </view>
                        <view class="kind-list__item-bd {{item.open ? 'kind-list__item-bd_show' : ''}}">
                            <view class="weui-cells {{item.open ? 'weui-cells_show' : ''}}">
                                <block wx:for="{{item.pages}}" wx:for-item="page" wx:key="*this">
                                    <navigator url="{{page}}/{{page}}" class="weui-cell weui-cell_access">
                                        <view class="weui-cell__bd">{{page}}</view>
                                        <view class="weui-cell__ft weui-cell__ft_in-access"></view>
                                    </navigator>
                                </block>
                            </view>
                        </view>
                    </view>
                </block>
            </view>
        </view>
        <view class="page__ft">
            <image src="images/icon_footer.png" style="width: 84px; height: 19px;"></image>
        </view>
    </view>
    

    官方效果如下:
    weUI官方图片
    5. 使用:

    • 组件的wxml结构请看dist/example/下的组件
    • 样式文件可直接引用dist/style/weui.wxss,或者单独引用dist/style/widget下的组件的wxss
    1. 个人实例:
    <view class=''>
      <view class='weui-flex'>
        <view class='page_title'>
          标题2
        </view>
        <text class='page_desc'>
    这是一个用于打卡的App
      </text>
      </view>
      <view class='weui-cells'>
        <button class='weui-btn' type='primary'>添加打卡任务</button>
        <button class='weui-btn' type='warn'>已添加打卡任务</button>
      </view>
    </view>
    <view class='weui-footer_fixed-bottom'>
      I am footer.
    </view>
    

    样式:
    weUI sample

    展开全文
  • weui包说明:①weui标准版: weui-master.zip ②weui小程序版:weui-wxss-master.zip ③jQuery weui: jquery-weui-build.zip ④vue weui: vum-master.zip 。附微信官方开发者工具和教程说明文档。 所有资源全部来自...
  • weui 官方包

    2020-07-28 23:32:10
    weui 官方包,weui 官方包,weui 官方包,weui 官方包,weui 官方包
  • weui 列表控件

    万次阅读 2018-01-23 14:30:39
    下面是个列表 标题文字 说明文字 标题文字 说明文字 标题文字
    <!-- 列表组顶部说明文字 -->
    <div class="weui-cells__title">下面是个列表</div>
    <!-- 带说明的列表 -->
    <div class="weui-cells">
        <div class="weui-cell">
            <div class="weui-cell__bd">
                <p>标题文字</p>
            </div>
            <div class="weui-cell__ft">说明文字</div>
        </div>
    </div>
    <!-- 带图标和说明的列表项 -->
    <div class="weui-cells">
        <div class="weui-cell">
            <div class="weui-cell__hd"><img src="" alt="" style="width:20px;margin-right:5px;display:block"></div>
            <div class="weui-cell__bd">
                <p>标题文字</p>
            </div>
            <div class="weui-cell__ft">说明文字</div>
        </div>
    </div>
    <!-- 带跳转的列表 -->
    <div class="weui-cells">
        <a href="#" class="weui-cell weui-cell_access">
            <div class="weui-cell__bd">
                <p>标题文字</p>
            </div>
            <div class="weui-cell__ft"></div>
        </a>
    </div>
    <!-- 带说明、跳转的列表项 -->
    <div class="weui-cells">
        <a href="#" class="weui-cell weui-cell_access">
            <div class="weui-cell__bd">
                <p>标题文字</p>
            </div>
            <div class="weui-cell__ft">说明文字</div>
        </a>
    </div>
    <!-- 带图标、说明、跳转的列表项 -->
    <div class="weui-cells">
        <a href="#" class="weui-cell weui-cell_access">
            <div class="weui-cell__hd"><img src="" alt="" style="width:20px;margin-right:5px;display:block"></div>
            <div class="weui-cell__bd">
                <p>标题文字</p>
            </div>
            <div class="weui-cell__ft">说明文字</div>
        </a>
    </div>
    <!-- 列表组底部说明文字 -->
    <div class="weui-cells__tips">底部说明文字</div>

    展开全文
  • WeUI基础样式库

    千次阅读 2018-12-28 23:36:49
    WeUI包含button、cell、dialog、toast、article、icon等各式元素。 按钮(Button) 按钮可以使用a或者button标签。wap上要触发按钮的active态,必须触发ontouchstart事件,可以在body上加上ontouchstart="&...
  • weui 开发文档

    万次阅读 多人点赞 2020-03-04 16:50:39
    今天需要用到weui,这里记录一下开发文档地址 开发文档: https://github.com/Tencent/weui.js/blob/master/docs/README.md github: https://github.com/Tencent/weui.js 效果展示: https://weui.io ...
  • 第一次使用weui

    万次阅读 2018-04-22 18:00:55
    今天在做微信公众号开发时,用了一下weui,发现很好用。1、怎么下载weui.css例如,进入了该链接页面:https://weui.io/#input,然后右键查看源码,在源码中有这样一行:&lt;link rel="stylesheet" ...
  • 最近做的一个小demo,在添加Dialog的时候出现了对话框显示的问题,如下左图所示。...一般使用jQuery WeUI时也需要依赖weui.css的,所以在jQuery WeUI解压后的dist/lib还会提供对应的weui.css 我的demo里用的 w...
  • weui-navbar 导航栏页面切换

    万次阅读 2018-08-31 16:04:53
    效果 html &lt;div class="weui-tab"&gt; &...weui-navbar"...weui-navbar__item weui-bar__item_on" href="#tab1"&gt; 标签一 &lt;/a&gt
  • weUI和jquery weUI

    千次阅读 2018-01-16 11:09:36
    *根据项目需求确定要使用的UI库(考虑兼容性),由于是做微信开发,所以选择weUI插件 *但是如何判断weUI和jquery weUI哪个更适合呢? 答: 根据 需求 选择插件, 1.我们可以考虑交互的复杂程度,以及使用jquery ...
  • test &amp;amp;amp;amp;amp;lt;div id=&amp;amp;amp;amp;quot;tab1&amp;amp;amp;...weui-tab__bd-item weui-tab__bd-item--active&amp;amp;amp;amp;quot;&amp;amp;amp
  • 微信小程序里使用weui的正确打开方式

    万次阅读 多人点赞 2018-09-29 12:24:51
    自己写微信小程序,发现有weui这样的东西。第一次使用,网上搜到到用法是这样的: 到https://weui.io/#input查看例子,右键查看源码,然后再对照界面和源码使用。 但是这样看到的源码是网页版的,不是小程序风格的...
  • WeUI 是一套同微信原生视觉体验一致的基础样式库,WeUI由微信官方设计团队为微信内网页和微信小程序量身设计,令用户的使用感知更加统一。 在微信网页或小程序中使用 WeUI的优势 1.同微信客户端一致的视觉效果,令...
  • weui 搜索 weui-search-bar

    千次阅读 2018-11-30 18:16:46
    效果图 1、首先引入css跟js ...lib/weui.min.css"&gt; &lt;script src='js/jquery.min.js'&gt;&lt;/script&gt; &lt;script src='lib/jquery-weui.min.js'&gt;&lt;/
  • 浅谈jQuery WeUI框架

    千次阅读 2018-09-30 17:40:51
    WeUI 是一套同微信原生视觉体验一致的基础样式库,由微信官方设计团队为微信内网页和微信小程序量身设计。而jQuery WeUI是在其基础上的加强版本,专为微信公众账号开发而设计的一个简洁而强大的UI库,包含全部WeUI...
  • 小程序WeUI使用教程(简单易懂)

    千次阅读 2020-09-22 16:19:26
    1、WeUI WeUI 是一套同微信原生视觉体验一致的基础样式库。由微信官方设计团队为微信内网页和微信小程序量身设计,令用户的使用感知更加统一。它最初是为了给在微信端页面提供一致的视觉体验而开发开源的一个样式库...
  • link rel="stylesheet" href="https://cdn.bootcss.com/weui/1.1.2/style/weui.min.css"> <link rel="stylesheet" href="https://cdn.bootcss.com/jquery-weui/1.2.0/css/jquery-weui.min.css"> <!-- ...
  • WeUI 在小程序中使用

    千次阅读 2018-03-10 20:10:21
    下载地址:点击打开链接将weui-wxss-master\dist\style\weui.wxss文件导入到小程序项目的根目录下引入weui.wxss方式一:在app.wxss内或者需要的页面引入style/weui.wxss。方式二:在app.wxss内或者需要的页面引入...
1 2 3 4 5 ... 20
收藏数 10,189
精华内容 4,075
关键字:

weui