<script>
layui.use(['form', 'layedit', 'laydate'], function () {
var form = layui.form
, layer = layui.layer
, layedit = layui.layedit
, laydate = layui.laydate;
$ = layui.$;
layer.open({
id: 1,
type: 1,
title: '请输入兑换码',
style: 'width:80%;height:auto;',
skin: 'layui-layer-rim',
area: ['450px', 'auto'],
move: false,//是否可以拖动,默认可以拖动
content: ' <div class="layui-form-item">'
+ ' <div class= "layui-inline" >'
+' <label class="layui-form-label">兑换码</label>'
+' <div class="layui-input-inline">'
+' <input type="tel" name="code" id="code" class="layui-input">'
+'</div>'
+' </div>'
+' </div>'
,
btn: ['提交'],
yes: function (index, layero) {
//获取输入框里面的值
var closeContent = top.$("#code").val() || $("#code").val();
if (closeContent) {
$.get("/Home/selectCode?code=" + closeContent, function (data) {
var json = eval('(' + data + ')');
if (json.data == "success") {
location.href = "http://maitianquankeji.com/m-wap/vshop/CouponInfo/73";
} else {
var r = confirm(json.data + ',是否重新输入');
if (r == true) {
location = location;
}else {
location.href = "http://maitianquankeji.com/m-wap";
}
}
})
} else {
alert("兑换码不能为空");
location = location;
}
layer.close(index);
// 在这里提交数据
}
});
$('.layui-layer-setwin').hide();
})
</script>
没加 $(’.layui-layer-setwin’).hide();之前:
效果如下:
我们检查看到:
所以我们只需要把它隐藏就行了。
结果: