新增沙滩旗
This commit is contained in:
@@ -4428,12 +4428,56 @@ public class ProductService {
|
|||||||
case "夹板":
|
case "夹板":
|
||||||
priceList = getSplintPrice(dto, width, length);
|
priceList = getSplintPrice(dto, width, length);
|
||||||
return chucklePrice(role, priceList, dto);
|
return chucklePrice(role, priceList, dto);
|
||||||
|
case "沙滩旗":
|
||||||
|
priceList = getBeachFlagPrice(dto, width, length);
|
||||||
|
return chucklePrice(role, priceList, dto);
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<Product> getBeachFlagPrice(Product dto, Double width, Double length) {
|
||||||
|
List<String> craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
|
||||||
|
List<Product> priceList = new ArrayList<>();
|
||||||
|
|
||||||
|
int count = dto.getCount();
|
||||||
|
int number = dto.getNumber();
|
||||||
|
|
||||||
|
double base_price = 0;
|
||||||
|
int sizeIndex = 0;
|
||||||
|
if (Math.max(length, width) == 200 && Math.min(length, width) == 50) {
|
||||||
|
sizeIndex = 0;
|
||||||
|
}
|
||||||
|
if (Math.max(length, width) == 240 && Math.min(length, width) == 60) {
|
||||||
|
sizeIndex = 1;
|
||||||
|
}
|
||||||
|
if (Math.max(length, width) == 340 && Math.min(length, width) == 70) {
|
||||||
|
sizeIndex = 2;
|
||||||
|
}
|
||||||
|
if (Math.max(length, width) == 410 && Math.min(length, width) == 80) {
|
||||||
|
sizeIndex = 3;
|
||||||
|
}
|
||||||
|
double[][] prices = {
|
||||||
|
{115.50, 129.50, 168.50, 209.50},
|
||||||
|
{115.50, 129.50, 168.50, 209.50},
|
||||||
|
{129.00, 149.00, 200.67, 253.67},
|
||||||
|
};
|
||||||
|
if (craft_list.contains("水滴型")) {
|
||||||
|
prices = new double[][]{
|
||||||
|
{115.50, 129.50, 168.50, 209.50},
|
||||||
|
{115.50, 129.50, 168.50, 209.50},
|
||||||
|
{129.00, 149.00, 200.67, 253.67},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
Product pro = new Product();
|
||||||
|
pro.setCount(count);
|
||||||
|
pro.setNumber(number);
|
||||||
|
pro.setPrice(Math.ceil((Math.max(prices[Integer.parseInt(dto.getKind())][sizeIndex] * count * number, 30))));
|
||||||
|
priceList.add(pro);
|
||||||
|
return priceList;
|
||||||
|
}
|
||||||
|
|
||||||
private List<Product> getSplintPrice(Product dto, Double width, Double length) {
|
private List<Product> getSplintPrice(Product dto, Double width, Double length) {
|
||||||
List<String> craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
|
List<String> craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
|
||||||
List<Product> priceList = new ArrayList<>();
|
List<Product> priceList = new ArrayList<>();
|
||||||
@@ -4668,12 +4712,13 @@ public class ProductService {
|
|||||||
|
|
||||||
return priceList;
|
return priceList;
|
||||||
} else if ("5".equals(dto.getK())) {
|
} else if ("5".equals(dto.getK())) {
|
||||||
int[] counts = {100, 200, 500, 1000, 2000, 5000, 10000, 50000, 100000};
|
int[] counts = {100, 200, 300, 500, 1000, 2000, 5000, 10000, 50000, 100000};
|
||||||
double[][] prices = {
|
double[][] prices = {
|
||||||
{140, 190, 380, 690, 1330, 3110, 5980, 27540, 51430},
|
{140, 190, 253, 380, 690, 1330, 3110, 5980, 27540, 51430},
|
||||||
{150, 230, 460, 850, 1640, 3790, 7320, 34060, 64290},
|
{150, 230, 307, 460, 850, 1640, 3790, 7320, 34060, 64290},
|
||||||
{160, 240, 500, 930, 1790, 4170, 8060, 36960, 70000},
|
{160, 240, 327, 500, 930, 1790, 4170, 8060, 36960, 70000},
|
||||||
{170, 270, 560, 1040, 2000, 4700, 8960, 41310, 78580},
|
{170, 270, 367, 560, 1040, 2000, 4700, 8960, 41310, 78580},
|
||||||
|
{200, 320, 440, 680, 1290, 2490, 4960, 11200, 51600, 98160},
|
||||||
};
|
};
|
||||||
if (craft_list.contains("单色") && craft_list.contains("双面")) {
|
if (craft_list.contains("单色") && craft_list.contains("双面")) {
|
||||||
prices = new double[][]{
|
prices = new double[][]{
|
||||||
@@ -4686,19 +4731,20 @@ public class ProductService {
|
|||||||
}
|
}
|
||||||
if (craft_list.contains("彩色") && craft_list.contains("单面")) {
|
if (craft_list.contains("彩色") && craft_list.contains("单面")) {
|
||||||
prices = new double[][]{
|
prices = new double[][]{
|
||||||
{150, 198, 363, 691, 1329, 3215, 6286, 30001, 57143},
|
{150, 198, 253, 363, 691, 1329, 3215, 6286, 30001, 57143},
|
||||||
{166, 214, 439, 838, 1615, 3858, 7572, 36429, 70000},
|
{166, 214, 289, 439, 838, 1615, 3858, 7572, 36429, 70000},
|
||||||
{175, 253, 477, 911, 1758, 4215, 8286, 39286, 75715},
|
{175, 253, 328, 477, 911, 1758, 4215, 8286, 39286, 75715},
|
||||||
{183, 276, 537, 1014, 1958, 4715, 9286, 44286, 85715},
|
{183, 276, 363, 537, 1014, 1958, 4715, 9286, 44286, 85715},
|
||||||
|
{215, 343, 445, 650, 1215, 2415, 5800, 11430, 54570, 105715},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (craft_list.contains("彩色") && craft_list.contains("双面")) {
|
if (craft_list.contains("彩色") && craft_list.contains("双面")) {
|
||||||
prices = new double[][]{
|
prices = new double[][]{
|
||||||
{233, 277, 454, 838, 1472, 3543, 6929, 33115, 63272},
|
{233, 277, 336, 454, 838, 1472, 3543, 6929, 33115, 63272},
|
||||||
{316, 293, 530, 985, 1758, 4229, 8272, 39543, 75558},
|
{316, 293, 372, 530, 985, 1758, 4229, 8272, 39543, 75558},
|
||||||
{325, 333, 568, 1058, 1901, 4572, 8943, 42758, 81700},
|
{325, 333, 411, 568, 1058, 1901, 4572, 8943, 42758, 81700},
|
||||||
{333, 355, 628, 1161, 2100, 5043, 9872, 47258, 90300},
|
{333, 355, 446, 628, 1161, 2100, 5043, 9872, 47258, 90300},
|
||||||
{366, 406, 740, 1397, 2558, 6143, 12029, 57543, 109958},
|
{366, 406, 517, 740, 1397, 2558, 6143, 12029, 57543, 109958},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
double baseRate = 0;
|
double baseRate = 0;
|
||||||
|
|||||||
@@ -0,0 +1,334 @@
|
|||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||||
|
pageEncoding="UTF-8" %>
|
||||||
|
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Insert title here</title>
|
||||||
|
<%@include file="/views/common.jsp" %>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<style>
|
||||||
|
#z4_craft .layui-form-select .layui-edge {
|
||||||
|
right: 20px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div class="big_box">
|
||||||
|
<div class="left_div">
|
||||||
|
<h1 class="h1">沙滩旗</h1> <span style="color:red;font-weight:700;"></span>
|
||||||
|
<hr>
|
||||||
|
<form class="layui-form">
|
||||||
|
<input type="hidden" name="proTypeValue" id="proTypeValue" class="layui-input" value="沙滩旗"/>
|
||||||
|
<p>
|
||||||
|
材质
|
||||||
|
</p>
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<select name="kind" class="select" lay-search lay-filter="kind">
|
||||||
|
<option value="0">110克经编布</option>
|
||||||
|
<option value="1">75克双透彩旗</option>
|
||||||
|
<option value="2">240克旗帜双面喷夹黑布</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
尺寸(CM/厘米) <span style="color:red;font-weight:700;">旗杆尺寸:<span id="qigan">2.8m</span></span>
|
||||||
|
</p>
|
||||||
|
<div class="layui-form-item" id="ui_size">
|
||||||
|
<select class="layui-form-select" name="size" lay-filter="size">
|
||||||
|
<option value="50*200">50*200cm</option>
|
||||||
|
<option value="60*240">60*240cm</option>
|
||||||
|
<option value="70*340">70*340cm</option>
|
||||||
|
<option value="80*410">80*410cm</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<p>
|
||||||
|
数量(个)
|
||||||
|
</p>
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<input type="text" name="count" id="diyCount" placeholder="请输入整数" class="layui-input" autocomplete="off">
|
||||||
|
</div>
|
||||||
|
<p>
|
||||||
|
款数
|
||||||
|
</p>
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<input type="text" placeholder="请输入整数" autocomplete="off" name="number" id="number" 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>
|
||||||
|
<p>
|
||||||
|
工艺 <span style="color:red;font-weight:700;">整套配件:旗杆,底座,水袋,旗面</span>
|
||||||
|
</p>
|
||||||
|
<div class="layui-form-item" id='z4_craft'>
|
||||||
|
<div class="layui-input-block ">
|
||||||
|
形状:
|
||||||
|
<input type="checkbox" name="craft" lay-filter="ui_craft" value="刀型" title="刀型" checked>
|
||||||
|
<input type="checkbox" name="craft" lay-filter="ui_craft" value="水滴型" title="水滴型">
|
||||||
|
</div>
|
||||||
|
<div class="layui-input-block ">
|
||||||
|
裁切工艺:
|
||||||
|
<input type="checkbox" name="craft" lay-filter="ui_craft" value="模切" title="模切" checked>
|
||||||
|
</div>
|
||||||
|
<div class="layui-input-block ">
|
||||||
|
常见工艺:
|
||||||
|
<input type="checkbox" name="craft" lay-filter="ui_craft" value="缝筒" title="缝筒" checked>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="layui-input-block">
|
||||||
|
<input type="checkbox" name="craft" lay-filter="ui_craft" value="抠图" title="抠图">
|
||||||
|
<div class="layui-inline crop" style="display:none;width: 80px">
|
||||||
|
<input class="layui-input" type="text" name="cropNumber">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<button class="layui-btn" lay-submit="" lay-filter="acount_btn">计算</button>
|
||||||
|
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||||
|
</div>
|
||||||
|
<h2>计算结果-
|
||||||
|
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm copyResult"
|
||||||
|
onclick="copyResult()">点击复制
|
||||||
|
</button>
|
||||||
|
</h2>
|
||||||
|
<div>
|
||||||
|
<textarea rows="11" cols="75" id="span_result" readonly="readonly"></textarea>
|
||||||
|
<%@include file="../acountExpressFee.jsp" %>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<table class="layui-hide" id="priceTable" lay-filter="priceTable"></table>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="right_div" style="margin-left:50px;">
|
||||||
|
<div class="layui-carousel" id="test1">
|
||||||
|
<div carousel-item id="carousel"></div>
|
||||||
|
<br>
|
||||||
|
<div id="remark" style="font-size:20px;color:red"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
<%@include file="/views/copyResult.jsp" %>
|
||||||
|
<script>
|
||||||
|
layui.use(['table', 'form', 'carousel'], function () {
|
||||||
|
var form = layui.form; //只有执行了这一步,部分表单元素才会自动修饰成功
|
||||||
|
var carousel = layui.carousel;
|
||||||
|
var table = layui.table;
|
||||||
|
|
||||||
|
//建造实例
|
||||||
|
ins = carousel.render({});
|
||||||
|
var html = " ";
|
||||||
|
var remark = " ";
|
||||||
|
|
||||||
|
// 清空轮播图
|
||||||
|
$("#carousel").empty();
|
||||||
|
$("#remark").empty();
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "${pageContext.request.contextPath}/getImgs",
|
||||||
|
type: "GET",
|
||||||
|
data: {
|
||||||
|
proTypeValue: $("#proTypeValue").val(),
|
||||||
|
kindValue: $('input[name="kindValue"]').val()
|
||||||
|
},
|
||||||
|
success: function (result) {
|
||||||
|
for (let i = 0; i < result.length; i++) {
|
||||||
|
// 只留一个remark
|
||||||
|
remark = "";
|
||||||
|
html += '<div><img style="width:100%;height: 100%;object-fit: contain" src="' + result[i].imgUrl + '"></div>';
|
||||||
|
remark += '<div><span>' + result[i].remark + '<span/></div>';
|
||||||
|
}
|
||||||
|
$("#carousel").append(html);
|
||||||
|
// 如果没有说明,就不显示null
|
||||||
|
if (remark.indexOf("null") < 0) {
|
||||||
|
$("#remark").append(remark);
|
||||||
|
}
|
||||||
|
// 如果没有轮播图就隐藏
|
||||||
|
if (result.length == 0) {
|
||||||
|
document.getElementById("test1").style.display = "none"; //隐藏
|
||||||
|
} else {
|
||||||
|
document.getElementById("test1").style.display = "block"; //显示
|
||||||
|
ins.reload({
|
||||||
|
elem: '#test1',
|
||||||
|
width: result[0].imgWidth, //设置容器宽度
|
||||||
|
height: result[0].imgHeight
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
form.on("select(size)", function (data) {
|
||||||
|
let html = "2.8米"
|
||||||
|
if (data.value == "50*200") {
|
||||||
|
html = "2.8米"
|
||||||
|
}
|
||||||
|
if (data.value == "60*240") {
|
||||||
|
html = "3.4米"
|
||||||
|
}
|
||||||
|
if (data.value == "70*340") {
|
||||||
|
html = "4.5米"
|
||||||
|
}
|
||||||
|
if (data.value == "80*410") {
|
||||||
|
html = "5.5米"
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#qigan").text(html);
|
||||||
|
})
|
||||||
|
form.on('checkbox(ui_craft)', function (data) {
|
||||||
|
let craft_list = [];
|
||||||
|
$("input[name='craft']:checked").each(function () {
|
||||||
|
if (!$(this).is(':disabled')) {
|
||||||
|
craft_list.push($(this).val());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!craft_list.includes("模切")) {
|
||||||
|
$(data.elem).prop("checked", true);
|
||||||
|
layer.msg("裁切工艺不能取消选择", {offset: ['300px', '300px']}, function () {
|
||||||
|
});
|
||||||
|
form.render();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!craft_list.includes("缝筒")) {
|
||||||
|
$(data.elem).prop("checked", true);
|
||||||
|
layer.msg("常见工艺不能取消选择", {offset: ['300px', '300px']}, function () {
|
||||||
|
});
|
||||||
|
form.render();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const carft_list1 = ["刀型", "水滴型"];
|
||||||
|
|
||||||
|
const carft1 = carft_list1.filter(craft => craft_list.includes(craft));
|
||||||
|
if (carft1.length > 1) {
|
||||||
|
$(data.elem).prop("checked", false);
|
||||||
|
layer.msg("形状工艺不能同时选择", {offset: ['300px', '300px']}, function () {
|
||||||
|
});
|
||||||
|
form.render();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
form.render();
|
||||||
|
})
|
||||||
|
|
||||||
|
// 点击计算,计算价格
|
||||||
|
form.on('submit(acount_btn)', function (data) {
|
||||||
|
var number = $("#number").val();
|
||||||
|
var size = $("select[name='size'] option:selected").val();
|
||||||
|
var count = $("#diyCount").val();
|
||||||
|
var kind = $("select[name='kind'] option:selected").text();
|
||||||
|
var kindValue = $("select[name='kindValue'] option:selected").text();
|
||||||
|
var craft = [];
|
||||||
|
|
||||||
|
if (size == "") {
|
||||||
|
layer.msg('请填写尺寸!', {offset: ['300px', '300px']}, function () {
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$("input:checkbox[name='craft']:checked").each(function (i) {
|
||||||
|
// 没有被禁用的工艺加到arr中
|
||||||
|
if (!$(this).is(':disabled')) {
|
||||||
|
if ($(this).val() == "抠图") {
|
||||||
|
craft.push($(this).val() + $("input[name='cropNumber']").val());
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
craft.push($(this).val());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "${path}/getThanSum",
|
||||||
|
type: "GET",
|
||||||
|
data: $(".big_box form").serialize(),
|
||||||
|
success: function (result) {
|
||||||
|
if (result.code == 100) {
|
||||||
|
layer.msg(result.msg, {offset: ['300px', '300px']}, function () {
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
var data = result.data.proList;
|
||||||
|
let material = $("select[name='kind'] option:selected").text();
|
||||||
|
|
||||||
|
var span_result = '沙滩旗 - ' + material + ' - ' + size + ' cm (同款内容)\n';
|
||||||
|
|
||||||
|
span_result += `工艺:` + craft.join(",") + '\n';
|
||||||
|
|
||||||
|
if (number > 1) {
|
||||||
|
for (let i = 0; i < data.length; i++) {
|
||||||
|
span_result += number + '款 各' + data[i].count + "个,共" + data[i].price + "元" + '\n'
|
||||||
|
data[i].number = number;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (let i = 0; i < data.length; i++) {
|
||||||
|
span_result += number + '款 ' + data[i].count + "个,共" + data[i].price + "元" + '\n'
|
||||||
|
data[i].number = number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
span_result += '包邮,免费设计呢~(偏远地区需补邮费)'
|
||||||
|
if (window.parent.system_isGai) {
|
||||||
|
span_result += "\n\n亲 现在下单可以参加淘宝活动8.5折折扣哦!"
|
||||||
|
}
|
||||||
|
addLog(span_result);
|
||||||
|
$("#span_result").val(span_result);
|
||||||
|
|
||||||
|
//计算完自动复制文本
|
||||||
|
var e = document.getElementById("span_result");//对象是content
|
||||||
|
if (e.value != "") {
|
||||||
|
e.select();//选择对象
|
||||||
|
document.execCommand("Copy");//执行浏览器复制命令
|
||||||
|
}
|
||||||
|
|
||||||
|
//生成表格
|
||||||
|
table.render({
|
||||||
|
elem: '#priceTable',
|
||||||
|
even: true, //隔行变色
|
||||||
|
data: data, // 赋值已知数据
|
||||||
|
width: 500,
|
||||||
|
cols: [[
|
||||||
|
{
|
||||||
|
field: 'number',
|
||||||
|
width: '12%',
|
||||||
|
align: "center",
|
||||||
|
title: '款数'
|
||||||
|
}, {
|
||||||
|
field: 'count',
|
||||||
|
width: '16%',
|
||||||
|
align: "center",
|
||||||
|
title: '数量'
|
||||||
|
}, {
|
||||||
|
field: 'price',
|
||||||
|
width: '16%',
|
||||||
|
align: "center",
|
||||||
|
title: '报价'
|
||||||
|
}, {
|
||||||
|
field: 'wangwang',
|
||||||
|
align: "center",
|
||||||
|
width: '16%',
|
||||||
|
title: '折扣价'
|
||||||
|
}, {
|
||||||
|
field: 'wangwang',
|
||||||
|
align: "center",
|
||||||
|
width: '19%',
|
||||||
|
title: '跳楼价'
|
||||||
|
}, {
|
||||||
|
field: 'weight',
|
||||||
|
width: '21%',
|
||||||
|
align: "center",
|
||||||
|
title: '重量(kg)'
|
||||||
|
}
|
||||||
|
]],
|
||||||
|
done: function () {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</html>
|
||||||
@@ -124,6 +124,7 @@
|
|||||||
<option value="1">21*27*11CM</option>
|
<option value="1">21*27*11CM</option>
|
||||||
<option value="2">24*24*15CM</option>
|
<option value="2">24*24*15CM</option>
|
||||||
<option value="3">26*26*17CM</option>
|
<option value="3">26*26*17CM</option>
|
||||||
|
<option value="4">30*30*20CM</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
@@ -562,7 +563,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$(".lbstd select[name='count']").empty().append(html)
|
$(".lbstd select[name='count']").empty().append(html)
|
||||||
$(".lbstd select[name='kind2Value']").empty().append(sizeHtml)
|
//$(".lbstd select[name='kind2Value']").empty().append(sizeHtml)
|
||||||
form.render();
|
form.render();
|
||||||
})
|
})
|
||||||
// 自定义数量
|
// 自定义数量
|
||||||
|
|||||||
Reference in New Issue
Block a user