111 lines
4.0 KiB
Plaintext
111 lines
4.0 KiB
Plaintext
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
|
pageEncoding="UTF-8"%>
|
|
|
|
<style>
|
|
.fixedSizeLotteryCard,.fixedCountLotteryCard{
|
|
width:400px;
|
|
display:inline-block;
|
|
}
|
|
#diySizeLotteryCard,#diyCountLotteryCard{
|
|
width:400px;
|
|
display:inline-block;
|
|
}
|
|
.fixedSizeLotteryCard .layui-input,.fixedCountLotteryCard .layui-input{
|
|
width:100%
|
|
}
|
|
.fixedSizeLotteryCard .layui-edge,.fixedCountLotteryCard .layui-edge{
|
|
right:0px
|
|
}
|
|
</style>
|
|
<input type="hidden" name="proTypeValue" class="layui-input" value="抽奖券">
|
|
<p>材质</p>
|
|
<div class="layui-form-item">
|
|
<input type="radio" name="kindValue" lay-filter="kindValue" value="2" title="300克铜版纸" checked="checked">
|
|
</div>
|
|
<p>
|
|
规格
|
|
</p>
|
|
<div class="layui-form-item fixedSizeLotteryCard">
|
|
<select name="size" id="fixedSizeLotteryCard" class="select">
|
|
<option value="18*5.4">18*5.4 cm</option>
|
|
</select>
|
|
</div>
|
|
<span class="diySizeLotteryCard" style="display:none">
|
|
<input type="text" name="size" id="diySizeLotteryCard" placeholder="格式:长*宽" class="layui-input" autocomplete="off">
|
|
</span>
|
|
<input type="checkbox" name="switchSize" class="switchSizeLotteryCard" lay-filter="switchSizeLotteryCard" title="自定义尺寸" lay-skin="primary">
|
|
<span style="font-size:14px;color:red">输入格式: 长 * 宽</span>
|
|
<p>
|
|
数量(张)
|
|
</p>
|
|
<div class="layui-form-item fixedCountLotteryCard">
|
|
<select name="count" class="select">
|
|
<option value="200">200</option>
|
|
<option value="500">500</option>
|
|
<option value="1000">1000</option>
|
|
<option value="2000">2000</option>
|
|
<option value="5000">5000</option>
|
|
<option value="10000">10000</option>
|
|
</select>
|
|
</div>
|
|
<span class="diyCountLotteryCard" style="display:none">
|
|
<input type="text" name="count" id="diyCountLotteryCard" placeholder="请输入整数" autocomplete="off"
|
|
class="layui-input" lay-verify="number">
|
|
</span>
|
|
<input type="checkbox" name="switchCount" lay-filter="switchCountLotteryCard" title="自定义数量" lay-skin="primary">
|
|
<p>款数</p>
|
|
<div class="layui-form-item">
|
|
<input type="text" placeholder="请输入整数" autocomplete="off" name="number"
|
|
id="numberLotteryCard" value="1" class="layui-input" lay-verify="number">
|
|
</div>
|
|
<p>
|
|
客户旺旺
|
|
</p>
|
|
<div class="layui-form-item">
|
|
<input type="text" placeholder="请输入客户旺旺号" autocomplete="off" name="wangwang" id="wangwang" class="layui-input">
|
|
</div>
|
|
|
|
<script>
|
|
layui.use(['table','form'], function(){
|
|
var form = layui.form; //只有执行了这一步,部分表单元素才会自动修饰成功
|
|
var table = layui.table;
|
|
|
|
// 默认没有选中复选框
|
|
$('.switchSizeLotteryCard').val("off")
|
|
// 自定义尺寸
|
|
form.on('checkbox(switchSizeLotteryCard)', function(data) {
|
|
if(data.elem.checked){
|
|
$('.switchSizeLotteryCard').val("on")
|
|
$(".diySizeLotteryCard").show();
|
|
$(".fixedSizeLotteryCard").hide();
|
|
$(".diySizeLotteryCard").find(":input").attr("disabled", false);
|
|
$(".fixedSizeLotteryCard").find(":input").attr("disabled", true);
|
|
} else {
|
|
$('.switchSizeLotteryCard').val("off")
|
|
$(".fixedSizeLotteryCard").show();
|
|
$(".diySizeLotteryCard").hide();
|
|
$(".fixedSizeLotteryCard").find(":input").attr("disabled", false);
|
|
$(".diySizeLotteryCard").find(":input").attr("disabled", true);
|
|
// 恢复标准数量的时候会被禁用,加这个解决
|
|
form.render();
|
|
}
|
|
})
|
|
|
|
// 自定义數量
|
|
form.on('checkbox(switchCountLotteryCard)', function(data) {
|
|
if(data.elem.checked){
|
|
$(".diyCountLotteryCard").show();
|
|
$(".fixedCountLotteryCard").hide();
|
|
$(".diyCountLotteryCard").find(":input").attr("disabled", false);
|
|
$(".fixedCountLotteryCard").find(":input").attr("disabled", true);
|
|
} else {
|
|
$(".fixedCountLotteryCard").show();
|
|
$(".diyCountLotteryCard").hide();
|
|
$(".fixedCountLotteryCard").find(":input").attr("disabled", false);
|
|
$(".diyCountLotteryCard").find(":input").attr("disabled", true);
|
|
}
|
|
// 恢复标准数量的时候会被禁用,加这个解决
|
|
form.render();
|
|
})
|
|
})
|
|
</script> |