|
|
@@ -34,16 +34,14 @@
|
|
|
</div>
|
|
|
<div class="layui-form-item" style="display:none;">
|
|
|
<div class="layui-input-block">
|
|
|
- <input type="radio" name="kindValue" lay-filter="k" class="kindValue" value="2"
|
|
|
- title="140克珠光冰白彩色信封">
|
|
|
- <input type="radio" name="kindValue" lay-filter="k" class="kindValue" value="3"
|
|
|
- title="200克珠光冰白彩色信封">
|
|
|
+ <input type="radio" name="kindValue" lay-filter="k" class="kindValue" value="2" title="140克珠光冰白彩色信封">
|
|
|
+ <input type="radio" name="kindValue" lay-filter="k" class="kindValue" value="3" title="200克珠光冰白彩色信封">
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="layui-form-item">
|
|
|
<div class="layui-input-block">
|
|
|
- <input type="radio" name="kindValue" lay-filter="k" class="kindValue" value="4"
|
|
|
- title="250克高端珠光冰白烫金信封">
|
|
|
+ <input type="radio" name="kindValue" lay-filter="k" class="kindValue" value="4" title="250克高端珠光冰白烫金信封">
|
|
|
+ <input type="radio" name="kindValue" lay-filter="k" class="kindValue" value="12" title="300克铜版纸信封">
|
|
|
</div>
|
|
|
</div>
|
|
|
<p>
|
|
|
@@ -150,21 +148,28 @@
|
|
|
</div>
|
|
|
<p>工艺</p>
|
|
|
<div id="craft_layout">
|
|
|
+ 烫金工艺:
|
|
|
<input type="checkbox" name="craft" lay-filter="switch" value="烫金" title="烫金">
|
|
|
<div class="layui-inline" style="width: 100px">
|
|
|
- <select name="craft" class="select">
|
|
|
+ <select name="craft" class="select" id="craftNum">
|
|
|
<option value="1处">1处</option>
|
|
|
<option value="2处">2处</option>
|
|
|
<option value="3处">3处</option>
|
|
|
- </select></div>
|
|
|
- <div class="layui-inline" style="width: 100px">
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ <div class="layui-inline" style="width: 100px" id="craftColor">
|
|
|
<select name="craft" class="select">
|
|
|
<option value="金色">金色</option>
|
|
|
<option value="黑色">黑色</option>
|
|
|
<option value="红色">红色</option>
|
|
|
<option value="蓝色">蓝色</option>
|
|
|
<option value="银色">银色</option>
|
|
|
- </select></div>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="layui-form-item" id="craft_mo">
|
|
|
+ 覆膜工艺:
|
|
|
+ <input type="checkbox" name="craft" lay-filter="switch" value="覆哑膜" title="覆哑膜" checked>
|
|
|
</div>
|
|
|
<hr>
|
|
|
<div class="layui-form-item">
|
|
|
@@ -214,6 +219,26 @@
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ form.on('checkbox(switch)', function (data) {
|
|
|
+
|
|
|
+ let craft_list = [];
|
|
|
+ let kindV = $("input[name='kindValue']:checked").val();
|
|
|
+
|
|
|
+ $("input[name='craft']:checked").each(function () {
|
|
|
+ if (!$(this).is(':disabled')) {
|
|
|
+ craft_list.push($(this).val());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (kindV == 12 && !craft_list.includes("覆哑膜")) {
|
|
|
+ $(data.elem).prop("checked", true);
|
|
|
+ layer.msg("覆膜工艺无法取消", {offset: ['300px', '300px']}, function () {
|
|
|
+ });
|
|
|
+ form.render();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
// 隐藏的默认禁用
|
|
|
$(".color2").hide();
|
|
|
$(".second").find(":input").attr("disabled", true);
|
|
|
@@ -256,29 +281,29 @@
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
-
|
|
|
+ $(".first").hide();
|
|
|
+ $(".first").find(":input").attr("disabled", true);
|
|
|
+ $(".second").hide();
|
|
|
+ $(".second").find(":input").attr("disabled", true);
|
|
|
+ $(".third").hide();
|
|
|
+ $(".third").find(":input").attr("disabled", true);
|
|
|
+ $("#otherCount").hide();
|
|
|
+ $("#otherCount").find(":input").attr("disabled", true);
|
|
|
+ $("#craft_mo").hide();
|
|
|
+ $("#craft_mo").find(":input").attr("disabled", true);
|
|
|
+ $("#thirdCount").hide();
|
|
|
+ $("#thirdCount").find(":input").attr("disabled", true);
|
|
|
+ $(".pageColor").hide();
|
|
|
+ $(".pageColor").find(":input").attr("disabled", true);
|
|
|
if (level == 2 || level == 3) {
|
|
|
- $(".first").hide();
|
|
|
- $(".first").find(":input").attr("disabled", true);
|
|
|
- $(".third").hide();
|
|
|
- $(".third").find(":input").attr("disabled", true);
|
|
|
$(".second").show();
|
|
|
$(".second").find(":input").attr("disabled", false);
|
|
|
$("#otherCount").show();
|
|
|
$("#thirdCount").find(":input").attr("disabled", false);
|
|
|
- } else if (level == 4) {
|
|
|
- $(".first").hide();
|
|
|
- $(".first").find(":input").attr("disabled", true);
|
|
|
- $(".second").hide();
|
|
|
- $(".second").find(":input").attr("disabled", true);
|
|
|
+ } else if (level == 4 || level == 12) {
|
|
|
$(".third").show();
|
|
|
$(".third").find(":input").attr("disabled", false);
|
|
|
} else {
|
|
|
- $(".second").hide();
|
|
|
- $(".second").find(":input").attr("disabled", true);
|
|
|
- $(".third").hide();
|
|
|
- $(".third").find(":input").attr("disabled", true);
|
|
|
$(".first").show();
|
|
|
$(".first").find(":input").attr("disabled", false);
|
|
|
}
|
|
|
@@ -287,8 +312,7 @@
|
|
|
// 数量
|
|
|
$("#thirdCount").show();
|
|
|
$("#thirdCount").find(":input").attr("disabled", false);
|
|
|
- $("#otherCount").hide();
|
|
|
- $("#otherCount").find(":input").attr("disabled", true);
|
|
|
+
|
|
|
$(".pageColor").show();
|
|
|
$(".pageColor").find(":input").attr("disabled", false);
|
|
|
$(".color2").find(":input").attr("disabled", true);
|
|
|
@@ -305,14 +329,16 @@
|
|
|
// $(".color1").find(":input").attr("disabled", true);
|
|
|
}
|
|
|
})
|
|
|
+ } else if (level == 12) {
|
|
|
+ $("#craft_mo").show();
|
|
|
+ $("#craft_mo").find(":input").attr("disabled", false);
|
|
|
+ $("#otherCount").show();
|
|
|
+ $("#otherCount").find(":input").attr("disabled", false);
|
|
|
} else {
|
|
|
// 数量
|
|
|
$("#otherCount").show();
|
|
|
$("#otherCount").find(":input").attr("disabled", false);
|
|
|
- $("#thirdCount").hide();
|
|
|
- $("#thirdCount").find(":input").attr("disabled", true);
|
|
|
- $(".pageColor").hide();
|
|
|
- $(".pageColor").find(":input").attr("disabled", true);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
// 点击计算,计算价格
|
|
|
@@ -335,7 +361,8 @@
|
|
|
11: "100克牛皮纸",
|
|
|
2: "140克珠光冰白彩色信封",
|
|
|
3: "200克珠光冰白彩色信封",
|
|
|
- 4: "250克高端珠光冰白烫金信封"
|
|
|
+ 4: "250克高端珠光冰白烫金信封",
|
|
|
+ 12: "300克铜版纸信封"
|
|
|
};
|
|
|
// 第二排
|
|
|
if (level == 2 || level == 3) {
|
|
|
@@ -352,17 +379,19 @@
|
|
|
var kind2 = kind2Data[$(".secondKind2Value").val()];
|
|
|
}
|
|
|
// 第三排
|
|
|
- else if (level == 4) {
|
|
|
+ else if (level == 4 || level == 12) {
|
|
|
var kind2Data = {
|
|
|
0: "5号西式信封22*11cm",
|
|
|
1: "卡套定制款 9.4*6.4cm"
|
|
|
};
|
|
|
var kind2 = $(".thirdKind2Value").val();
|
|
|
// 判断规格选颜色
|
|
|
- if (kind2 == 0) {
|
|
|
- var color = $(".color11").val()
|
|
|
- } else {
|
|
|
- var color = $(".color22").val()
|
|
|
+ if (level == 4) {
|
|
|
+ if (kind2 == 0) {
|
|
|
+ var color = $(".color11").val()
|
|
|
+ } else {
|
|
|
+ var color = $(".color22").val()
|
|
|
+ }
|
|
|
}
|
|
|
kind2 = $(".thirdKind2Value option:selected").text();
|
|
|
}
|
|
|
@@ -382,22 +411,19 @@
|
|
|
var kind = kindData[$('input[name="kindValue"]:checked').val()];
|
|
|
var number = $("#number").val();
|
|
|
let craft_list = [];
|
|
|
+ if (color == null) color = ""
|
|
|
$("input[name='craft']:checked").each(function () {
|
|
|
if (!$(this).is(':disabled')) {
|
|
|
- craft_list.push($(this).val());
|
|
|
+ if ($(this).val() == "烫金") {
|
|
|
+ craft_list.push($(this).val() + $("#craftNum option:selected").val() + $("#craftColor option:selected").val());
|
|
|
+ } else {
|
|
|
+ craft_list.push($(this).val());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
);
|
|
|
|
|
|
- if (craft_list.findIndex(x => x == "烫金") > -1) {
|
|
|
- $("select[name='craft'] option:selected").each(function () {
|
|
|
- if (!$(this).is(':disabled')) {
|
|
|
- craft_list.push($(this).val());
|
|
|
- }
|
|
|
- }
|
|
|
- );
|
|
|
- }
|
|
|
- if (color == null) color = ""
|
|
|
+
|
|
|
var span_result = kind + '\n' + kind2 + ' - ' + color + ' (同款内容)\n';
|
|
|
if (craft_list.length > 0) {
|
|
|
span_result += "工艺:" + craft_list.join(",") + '\n'
|
|
|
@@ -425,7 +451,6 @@
|
|
|
var size = "";
|
|
|
if (level == 2 || level == 3) {
|
|
|
var secondKind2Value = $(".secondKind2Value option:selected").val();
|
|
|
- console.log(secondKind2Value);
|
|
|
if (secondKind2Value == "0") {
|
|
|
size = "16.5*10";
|
|
|
} else if (secondKind2Value == "1") {
|
|
|
@@ -444,7 +469,7 @@
|
|
|
size = "32.4*22.9";
|
|
|
}
|
|
|
kind += "-" + kind2;
|
|
|
- } else if (level == 4) {
|
|
|
+ } else if (level == 4 || level == 12) {
|
|
|
var thirdKind2Value = $(".thirdKind2Value option:selected").val();
|
|
|
size = $(".thirdKind2Value option:selected").text()
|
|
|
|