码迷,mamicode.com
首页 > 数据库 > 详细

thinkphp + layui1 省市区联动+全国地区mysql数据库

时间:2018-03-26 00:51:09      阅读:1139      评论:0      收藏:0      [点我收藏+]

标签:标签   lan   item   layui   方便   list   后台开发   php   分享   

后台开发老是遇到涉及地区的地方,于是乎就找了一个插件,基于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

 

thinkphp + layui1 省市区联动+全国地区mysql数据库

标签:标签   lan   item   layui   方便   list   后台开发   php   分享   

原文地址:https://www.cnblogs.com/mahuateng/p/8647718.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!