diff --git a/src/main/java/lingtao/net/service/ProductService.java b/src/main/java/lingtao/net/service/ProductService.java index 23bc45a..ad402b7 100644 --- a/src/main/java/lingtao/net/service/ProductService.java +++ b/src/main/java/lingtao/net/service/ProductService.java @@ -1983,6 +1983,7 @@ public class ProductService { // 牛皮纸手提袋 case "11": List hanbagList = new ArrayList(); + craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft()); // 没有尺寸,就是常规,查询数据库 if (StringUtils.isEmpty(size) && !dto.getK().equals("4")) { // 各常规尺寸展开的长宽--用于计算重量 @@ -2097,9 +2098,11 @@ public class ProductService { return priceList; } + double sizeLength = 0.0; + double sizeWidth = 0.0; // 厘米转成毫米 - length = length * 10; - width = width * 10; + sizeLength = length = length * 10; + sizeWidth = width = width * 10; height = height * 10; length = (length + width) * 2 + 20; height = (height + (width / 2 + 20)) + 40; @@ -2163,6 +2166,14 @@ public class ProductService { } } else { for (Product product : priceList) { + double craft_price = 0.0; + if (craft_list.contains("烫金")) { + craft_price = Math.max(Math.ceil((sizeWidth + 2) * (sizeLength + 2) * 0.00015 * (product.getCount() + 50) * number), 200); + } + if (craft_list.contains("双面")) { + craft_price = Math.max(Math.ceil((sizeWidth + 2) * (sizeLength + 2) * 0.00015 * (product.getCount() + 50) * number * 2), 200); + } + product.setPrice(Math.ceil(product.getPrice() + craft_price)); product.setWeight(df.format(number * length / 1000 * height / 1000 * product.getCount() * 0.25 * 1.25)); } } diff --git a/src/main/webapp/views/product/handBag.jsp b/src/main/webapp/views/product/handBag.jsp index f5a1bd3..d13d100 100644 --- a/src/main/webapp/views/product/handBag.jsp +++ b/src/main/webapp/views/product/handBag.jsp @@ -26,7 +26,7 @@
- + @@ -74,7 +74,7 @@
+
@@ -240,6 +250,15 @@ $("#price").val(expressPrice) } }); + form.on("checkbox(craft)", function (data) { + $("#tang_type").hide(); + $("#tang_type select").prop("disabled", true); + if (data.value == "烫金" && data.elem.checked) { + $("#tang_type").show(); + $("#tang_type select").prop("disabled", false); + } + form.render(); + }) form.on("select(expressFee)", function (selectedData) { // 获取选中下拉框的价格(格式:首重,续重) price = selectedData.value @@ -352,7 +371,7 @@ let spec = $("#spec").val(); let kindValue = $(".npzd select[name='kindValue']").val(); let count_html = ``; - if (spec <= 10 && kindValue == 0) { + if (spec <= 10 && kindValue == 0) { // count_html += // ``; } @@ -439,9 +458,12 @@ } } }); - + $("#tang_type").hide(); + $("#tang_type select").prop("disabled", true); $("#bagForm")[0].reset(); var level = data.value;//被点击的radio的value值 + $("#craft_layout").hide(); + $("#craft_layout").find(":input").attr("disabled", true); if (level == 0) { $(".cg").show(); $(".zdy").hide(); @@ -462,6 +484,8 @@ $(".tj").find(":input").attr("disabled", true); $(".dz").find(":input").attr("disabled", true); $(".npzd").find(":input").attr("disabled", true); + $("#craft_layout").show(); + $("#craft_layout").find(":input").attr("disabled", false); } else if (level == 2) { $(".cg").hide(); $(".tj").hide(); @@ -568,6 +592,14 @@ layer.msg(result.msg, {offset: ['300px', '300px']}, {icon: 5, time: 1000}); return false; } + let arr = []; + $("input:checkbox[name='craft']:checked").each(function (i) { + if (!$(this).is(':disabled')) { + if ($(this).val() == "烫金") { + arr.push($("#tang_type select option:selected").val() + $(this).val()); + } + } + }); var data = result.data.proList; var number = $("#number").val(); if (level == 0) { @@ -586,6 +618,7 @@ // textarea var span_result = "手提袋- " + kind + ' - ' + kind2 + '\n'; + span_result += "工艺:" + arr.join(",") + '\n'; if (number > 1) { for (let i = 0; i < data.length; i++) { span_result += number + '款 各' + data[i].count + "个,共" + data[i].price + "元" + '\n' @@ -636,6 +669,7 @@ var count = $(".countZDY").val(); // textarea var span_result = "手提袋--" + kind + '--' + size + 'CM\n'; + span_result += "工艺:" + arr.join(",") + '\n'; if (number > 1) { for (let i = 0; i < data.length; i++) { span_result += number + '款 各' + data[i].count + "个,共" + data[i].price + "元" + '\n' diff --git a/src/main/webapp/views/product/specialCard2.jsp b/src/main/webapp/views/product/specialCard2.jsp index 9632959..94b3344 100644 --- a/src/main/webapp/views/product/specialCard2.jsp +++ b/src/main/webapp/views/product/specialCard2.jsp @@ -216,7 +216,6 @@