123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <?php
- use backend\assets\AppAsset;
- ?>
- <style>
- .layui_box {
- width: 80%;
- margin: 0 auto;
- margin-top: 25px;
- }
- .layui-code, .layui-upload-list {
- margin-top: 0;
- }
- hr {
- width: 100%;
- margin: 0 auto;
- }
- .mt {
- text-align: center;
- margin-top: 15px;
- }
- .The_house {
- background: #FBFBFB;
- color: #333;
- }
- .The_house:hover {
- border: 1px solid #a9a9a9;
- color: #333;
- }
- .xm_xcxqTc_button {
- margin-top: -20px;
- }
- </style>
- <form class="layui-form layui-form-pane">
- <div class="layui_box">
- <div class="layui-form-item">
- <label class="layui-form-label "><span style="color:red">*</span>选择楼盘:</label>
- <div class="layui-input-inline" style="width:43%">
- <input type="text" id="house_name" name="house_name" required lay-verify="required" disabled
- placeholder="请输入楼盘名称" autocomplete="off" class="layui-input">
- </div>
- <div class="layui-inline"><a class="layui-btn layui-btn-primary The_house" href="javascript:;">选择所属楼盘</a>
- </div>
- </div>
- <input type="hidden" name="type" value="<?php echo $type ?>">
- <div class="layui-form-item mt">
- <button class="layui-btn" lay-submit="" lay-filter="add">提交</button>
- </div>
- </div>
- </form>
- <script>
- layui.use(['laypage', 'layer', 'table', 'element', 'form', 'upload'], function () {
- var laypage = layui.laypage //分页
- , $ = layui.jquery
- , layer = layui.layer //弹层
- , table = layui.table //表格
- , element = layui.element //元素操作
- , form = layui.form
- , upload = layui.upload;
- var tableIds = 'videolist'; //表格ID
- var type_id = $('input[name="typeid"]').val();
- $('.The_house').focus(function () {
- // $('form').append('<input type="hidden" name="aa" value="aaa">');
- indexOpen = parent.layui.layer.open({
- type: 2,
- title: '选择需要添加的楼盘',
- area: ['', '100%'],
- content: '/publicuse/housenamecn',
- success: function (layero, index) {
- },
- end: function () {
- }
- });
- parent.layui.layer.full(indexOpen);
- //改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
- $(window).on("resize", function () {
- parent.layui.layer.full(indexOpen);
- })
- })
- //添加页面提交数据
- form.on('submit(add)', function (data) {
- var index = layer.msg('数据提交中,请稍候', {icon: 16, time: false, shade: 0.8}); //数据提交提示
- var formData = new FormData($('form')[0]);
- $.ajax({
- cache: false,
- type: "post",
- url: "/china/push/hothouseaddform",
- data: formData, // 你的formid
- contentType: false, //jax 中 contentType 设置为 false 是为了避免 JQuery 对其操作,从而失去分界符,而使服务器不能正常解析文件
- processData: false, //当设置为true的时候,jquery ajax 提交的时候不会序列化 data,而是直接使用data
- error: function (request) {
- layer.close(index);
- layer.msg("请联系管理员");
- },
- success: function (data) {
- if (data.data != null) {
- layer.msg(ReturnInfo(data.data), {icon: 5});
- return;
- }
- layer.msg(data.msg);
- parent.layer.close(oindex); //再执行关闭
- }
- });
- return false;
- });
- })
- </script>
|