后台开发老是遇到涉及地区的地方,于是乎就找了一个插件,基于layui的,因为存数据库还是地区id为好,所改了改,结合数据库使用,感觉挺好的,分享出来,有谁要用的,也方便直接用啦!
说明:插件基于layui的,也就是刷新dom用了layui,自己改改就可以不依赖layui了。
数据库文件也在压缩包里了,直接导入就好了。
下载地址:
http://pan.baidu.com/s/1nuLFaJZ ;
提取码:h2qa
使用demo:
{extend name="base" /} {block name="body"} <div class="layui-body"> <!--tab标签--> <div class="layui-tab layui-tab-brief"> <ul class="layui-tab-title"> <li><a href="{:url(‘admin/company/index‘)}">公司管理</a></li> <li class="layui-this">添加公司</li> </ul> <div class="layui-tab-content"> <div class="layui-tab-item layui-show"> <form class="layui-form form-container" action="{:url(‘admin/company/save‘)}" method="post"> <div class="layui-form-item"> <label class="layui-form-label">选择地区</label> <div class="layui-input-inline"> <select name="province" lay-filter="province"> <option></option> </select> </div> <div class="layui-input-inline"> <select name="city" lay-filter="city"> <option></option> </select> </div> <div class="layui-input-inline"> <select name="area" lay-filter="area"> <option></option> </select> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">信誉级别</label> <div class="layui-input-block"> <select name="reputation" lay-verify="required"> {foreach name="company_reputation_result" item="vo"} <option value="{$vo.id}">{$vo.name}</option> {/foreach} </select> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">承接户型</label> <div class="layui-input-block"> {volist name="company_huxing_result" id="v"} <input type="checkbox" name="company_huxing[{$v.ename}]" title="{$v.name}"> {/volist} </div> </div> <div class="layui-form-item"> <label class="layui-form-label">承接价位</label> <div class="layui-input-block"> {volist name="company_preice_result" id="v"} <input type="checkbox" name="company_price[{$v.ename}]" title="{$v.name}"> {/volist} </div> </div> <div class="layui-form-item"> <label class="layui-form-label">承接风格</label> <div class="layui-input-block"> {volist name="company_style_result" id="v"} <input type="checkbox" name="company_style[{$v.ename}]" title="{$v.name}"> {/volist} </div> </div> <div class="layui-form-item"> <label class="layui-form-label">公司名称</label> <div class="layui-input-block"> <input type="text" name="name" value="" required lay-verify="required" placeholder="请输入公司名称" class="layui-input"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">别名</label> <div class="layui-input-block"> <input type="text" name="ename" value="" required lay-verify="required" placeholder="请输入公司别名" class="layui-input"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">LOGO</label> <div class="layui-input-block"> <input type="text" name="logo" value="" class="layui-input layui-input-inline" id="thumb"> <input type="file" name="file" class="layui-upload-file"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">公司地址</label> <div class="layui-input-block"> <input type="text" name="address" value="" required lay-verify="required" placeholder="请输入公司地址" class="layui-input"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">公司电话</label> <div class="layui-input-block"> <input type="text" name="tel" value="" required lay-verify="required" placeholder="请输入公司电话" class="layui-input"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">公司QQ</label> <div class="layui-input-block"> <input type="text" name="qq" value="" required lay-verify="required" placeholder="请输入公司QQ" class="layui-input"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">状态</label> <div class="layui-input-block"> <input type="radio" name="status" value="1" title="已审核" checked="checked"> <input type="radio" name="status" value="0" title="未审核"> </div> </div> <div class="layui-form-item"> <div class="layui-input-block"> <button class="layui-btn" lay-submit lay-filter="*">保存</button> <button type="reset" class="layui-btn layui-btn-primary">重置</button> </div> </div> </form> </div> </div> </div> </div> {/block} {block name="js"} <script src="__JS__/citys.js"></script> {/block} {block name="script"} <script> pca.init(‘select[name=province]‘, ‘select[name=city]‘, ‘select[name=area]‘, ‘14‘, ‘1127‘, ‘3438‘); </script> {/block}
最近再看flutter,搞了个flutter中文社区,欢迎您也来!http://www.fluttercn.com