新增金属微章
이 커밋은 다음에 포함됨:
@@ -4699,156 +4699,9 @@ public class ProductService {
|
||||
priceList.add(pro);
|
||||
return priceList;
|
||||
case "奖牌":
|
||||
String kindValue = dto.getKindValue();
|
||||
String name = dto.getKind1Value();
|
||||
price = 0.0;
|
||||
Double zhongliang = 0.0;
|
||||
|
||||
if ("水晶".equals(kindValue)) {
|
||||
if ("酸洗五角星".equals(name)) {
|
||||
price = Math.ceil(98 * dto.getCount());
|
||||
zhongliang = 2.9;
|
||||
}
|
||||
if ("炫彩刀片".equals(name)) {
|
||||
price = Math.ceil(98 * dto.getCount());
|
||||
zhongliang = 2.9;
|
||||
}
|
||||
if ("金色刀片".equals(name)) {
|
||||
price = Math.ceil(120 * dto.getCount());
|
||||
zhongliang = 2.9;
|
||||
}
|
||||
if ("尖角".equals(name)) {
|
||||
price = Math.ceil(160 * dto.getCount());
|
||||
zhongliang = 2.3;
|
||||
}
|
||||
if ("斜面6角星".equals(name)) {
|
||||
price = Math.ceil(90 * dto.getCount());
|
||||
zhongliang = 2.6;
|
||||
}
|
||||
if ("八角".equals(name)) {
|
||||
price = Math.ceil(108 * dto.getCount());
|
||||
zhongliang = 3.1;
|
||||
}
|
||||
if ("蓝色梦想".equals(name)) {
|
||||
price = Math.ceil(120 * dto.getCount());
|
||||
zhongliang = 2.9;
|
||||
}
|
||||
if ("蓝色三条线".equals(name)) {
|
||||
price = Math.ceil(98 * dto.getCount());
|
||||
zhongliang = 2.9;
|
||||
}
|
||||
if ("蓝色弯弯".equals(name)) {
|
||||
price = Math.ceil(98 * dto.getCount());
|
||||
zhongliang = 2.2;
|
||||
}
|
||||
if ("斜面5角星".equals(name)) {
|
||||
price = Math.ceil(88 * dto.getCount());
|
||||
zhongliang = 2.5;
|
||||
}
|
||||
if ("麦穗圆型".equals(name)) {
|
||||
price = Math.ceil(108 * dto.getCount());
|
||||
zhongliang = 2.9;
|
||||
}
|
||||
if ("酸洗凹面".equals(name)) {
|
||||
price = Math.ceil(118 * dto.getCount());
|
||||
zhongliang = 2.9;
|
||||
}
|
||||
if ("月牙".equals(name)) {
|
||||
price = Math.ceil(108 * dto.getCount());
|
||||
zhongliang = 2.9;
|
||||
}
|
||||
if ("大拇指".equals(name)) {
|
||||
price = Math.ceil(60 * dto.getCount());
|
||||
zhongliang = 2.9;
|
||||
}
|
||||
if ("宝剑".equals(name)) {
|
||||
price = Math.ceil(108 * dto.getCount());
|
||||
zhongliang = 2.9;
|
||||
}
|
||||
if ("蓝色五角星".equals(name)) {
|
||||
price = Math.ceil(128 * dto.getCount());
|
||||
zhongliang = 2.9;
|
||||
}
|
||||
} else {
|
||||
List<String> carfts = dto.getCraft() != null ? Arrays.asList(dto.getCraft()) : new ArrayList<>();
|
||||
if ("20*25".equals(dto.getSize())) {
|
||||
if (carfts.contains("直边")) {
|
||||
price = Math.ceil(33 * dto.getCount());
|
||||
} else {
|
||||
price = Math.ceil(39 * dto.getCount());
|
||||
}
|
||||
zhongliang = 1.3;
|
||||
}
|
||||
if ("24*31".equals(dto.getSize())) {
|
||||
if (carfts.contains("直边")) {
|
||||
price = Math.ceil(36 * dto.getCount());
|
||||
} else {
|
||||
price = Math.ceil(45 * dto.getCount());
|
||||
}
|
||||
zhongliang = 1.6;
|
||||
}
|
||||
if ("25*35".equals(dto.getSize())) {
|
||||
if (carfts.contains("直边")) {
|
||||
price = Math.ceil(39 * dto.getCount());
|
||||
} else {
|
||||
price = Math.ceil(54 * dto.getCount());
|
||||
}
|
||||
zhongliang = 1.7;
|
||||
}
|
||||
if ("30*40".equals(dto.getSize())) {
|
||||
if (carfts.contains("直边")) {
|
||||
price = Math.ceil(42 * dto.getCount());
|
||||
} else {
|
||||
price = Math.ceil(66 * dto.getCount());
|
||||
}
|
||||
zhongliang = 2.7;
|
||||
}
|
||||
if ("35*50".equals(dto.getSize())) {
|
||||
if (carfts.contains("直边")) {
|
||||
price = Math.ceil(57 * dto.getCount());
|
||||
} else {
|
||||
price = Math.ceil(75 * dto.getCount());
|
||||
}
|
||||
zhongliang = 3.6;
|
||||
}
|
||||
if ("40*60".equals(dto.getSize())) {
|
||||
if (carfts.contains("直边")) {
|
||||
price = Math.ceil(75 * dto.getCount());
|
||||
} else {
|
||||
price = Math.ceil(108 * dto.getCount());
|
||||
}
|
||||
zhongliang = 4.8;
|
||||
}
|
||||
}
|
||||
pro = new Product();
|
||||
pro.setCount(count);
|
||||
pro.setPrice(price * number);
|
||||
pro.setWeight(df.format(Math.ceil(zhongliang * dto.getCount() * number)));
|
||||
priceList.add(pro);
|
||||
return priceList;
|
||||
return getMedalPrice(dto, width, length);
|
||||
case "防伪标":
|
||||
carft_list = dto.getCraft() != null ? Arrays.asList(dto.getCraft()) : new ArrayList<>();
|
||||
int[][] prices = {
|
||||
{176, 176, 176, 176, 176, 176, 176, 176, 180, 184, 192, 192, 202, 228, 228},
|
||||
{180, 180, 182, 184, 186, 188, 196, 206, 240, 260, 274, 286, 306, 344, 360},
|
||||
{184, 184, 184, 194, 214, 228, 264, 290, 358, 408, 434, 466, 506, 572, 650},
|
||||
{190, 202, 210, 224, 256, 282, 332, 374, 478, 554, 590, 660, 716, 814, 942},
|
||||
{200, 232, 254, 290, 338, 392, 468, 544, 728, 864, 920, 1046, 1138, 1298, 1520},
|
||||
{226, 312, 368, 452, 550, 672, 814, 980, 1358, 1636, 1746, 2008, 2190, 2502, 2970},
|
||||
{274, 470, 594, 784, 988, 1250, 1518, 1854, 2614, 3184, 3398, 3936, 4298, 4916, 5872},
|
||||
};
|
||||
int[] count_list = {500, 1000, 2000, 3000, 5000, 10000, 20000};
|
||||
double[] areas = {1, 4, 6, 9, 12, 16, 20, 25, 36, 45, 48.6, 54, 60, 72, 81};
|
||||
|
||||
area = length * width;
|
||||
priceList = getAreaCenterPrice(count_list, count, area, prices, areas, number);
|
||||
for (Product product : priceList) {
|
||||
product.setPrice(Math.ceil(product.getPrice() * 1.3));
|
||||
}
|
||||
if (carft_list.contains("印白墨")) {
|
||||
priceList = PriceUtils.getYinBaiPrice(priceList, width, length);
|
||||
}
|
||||
return priceList;
|
||||
return getantiLabelPrice(dto, width, length);
|
||||
case "透卡":
|
||||
return getPETPrice(dto, width, length);
|
||||
case "澜达海报":
|
||||
@@ -4867,12 +4720,88 @@ public class ProductService {
|
||||
return getLingmoPrice(dto, width, length);
|
||||
case "香薰卡":
|
||||
return getaromatherapyPrice(dto, width, length);
|
||||
case "金属微章":
|
||||
return getbadgePrice(dto, width, length);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private List<Product> getbadgePrice(Product dto, Double width, Double length) {
|
||||
List<String> carft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
|
||||
List<Product> priceList = new ArrayList<>();
|
||||
int count = dto.getCount();
|
||||
int number = dto.getNumber();
|
||||
double[][] prices_list = {
|
||||
{450, 880, 1700, 3250, 5380, 10000, 14728, 23685, 43103},
|
||||
};
|
||||
int[] count_list = {
|
||||
50, 100, 200, 500, 1000, 2000, 3000, 5000, 10000
|
||||
};
|
||||
int pre_count = 0;
|
||||
for (int i = 0; i < count_list.length; i++) {
|
||||
double price = prices_list[0][i];
|
||||
|
||||
int item_count = count_list[i];
|
||||
if (item_count < count) {
|
||||
pre_count = item_count;
|
||||
continue;
|
||||
}
|
||||
if (priceList.size() > 2) {
|
||||
break;
|
||||
}
|
||||
//数量小于50
|
||||
Product pro = new Product();
|
||||
if (pre_count > 0 && count > pre_count) {
|
||||
double base_price = prices_list[0][i - 1] / pre_count;
|
||||
pro = new Product();
|
||||
pro.setCount(count);
|
||||
pro.setWeight(df.format(0.005 * count * dto.getNumber()));
|
||||
pro.setPrice(Math.ceil(base_price * count * dto.getNumber()));
|
||||
priceList.add(pro);
|
||||
}
|
||||
pro = new Product();
|
||||
pro.setCount(item_count);
|
||||
pro.setWeight(df.format(0.005 * item_count * dto.getNumber()));
|
||||
pro.setPrice(Math.ceil(price * dto.getNumber()));
|
||||
priceList.add(pro);
|
||||
pre_count = item_count;
|
||||
|
||||
}
|
||||
|
||||
return priceList;
|
||||
}
|
||||
|
||||
|
||||
private List<Product> getantiLabelPrice(Product dto, Double width, Double length) {
|
||||
List<String> carft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
|
||||
List<Product> priceList = new ArrayList<>();
|
||||
int count = dto.getCount();
|
||||
int number = dto.getNumber();
|
||||
int[][] prices = {
|
||||
{176, 176, 176, 176, 176, 176, 176, 176, 180, 184, 192, 192, 202, 228, 228},
|
||||
{180, 180, 182, 184, 186, 188, 196, 206, 240, 260, 274, 286, 306, 344, 360},
|
||||
{184, 184, 184, 194, 214, 228, 264, 290, 358, 408, 434, 466, 506, 572, 650},
|
||||
{190, 202, 210, 224, 256, 282, 332, 374, 478, 554, 590, 660, 716, 814, 942},
|
||||
{200, 232, 254, 290, 338, 392, 468, 544, 728, 864, 920, 1046, 1138, 1298, 1520},
|
||||
{226, 312, 368, 452, 550, 672, 814, 980, 1358, 1636, 1746, 2008, 2190, 2502, 2970},
|
||||
{274, 470, 594, 784, 988, 1250, 1518, 1854, 2614, 3184, 3398, 3936, 4298, 4916, 5872},
|
||||
};
|
||||
int[] count_list = {500, 1000, 2000, 3000, 5000, 10000, 20000};
|
||||
double[] areas = {1, 4, 6, 9, 12, 16, 20, 25, 36, 45, 48.6, 54, 60, 72, 81};
|
||||
|
||||
double area = length * width;
|
||||
priceList = getAreaCenterPrice(count_list, count, area, prices, areas, number);
|
||||
for (Product product : priceList) {
|
||||
product.setPrice(Math.ceil(product.getPrice() * 1.3));
|
||||
}
|
||||
if (carft_list.contains("印白墨")) {
|
||||
priceList = PriceUtils.getYinBaiPrice(priceList, width, length);
|
||||
}
|
||||
return priceList;
|
||||
}
|
||||
|
||||
private List<Product> getaromatherapyPrice(Product dto, Double width, Double length) {
|
||||
List<String> carftList = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
|
||||
List<Product> priceList = new ArrayList<>();
|
||||
@@ -5232,6 +5161,138 @@ public class ProductService {
|
||||
return priceList;
|
||||
}
|
||||
|
||||
private List<Product> getMedalPrice(Product dto, Double width, Double length) {
|
||||
String kindValue = dto.getKindValue();
|
||||
String name = dto.getKind1Value();
|
||||
double price = 0.0;
|
||||
Double zhongliang = 0.0;
|
||||
List<Product> priceList = new ArrayList<>();
|
||||
int count = dto.getCount();
|
||||
int number = dto.getNumber();
|
||||
if ("水晶".equals(kindValue)) {
|
||||
if ("酸洗五角星".equals(name)) {
|
||||
price = Math.ceil(98 * dto.getCount());
|
||||
zhongliang = 2.9;
|
||||
}
|
||||
if ("炫彩刀片".equals(name)) {
|
||||
price = Math.ceil(98 * dto.getCount());
|
||||
zhongliang = 2.9;
|
||||
}
|
||||
if ("金色刀片".equals(name)) {
|
||||
price = Math.ceil(120 * dto.getCount());
|
||||
zhongliang = 2.9;
|
||||
}
|
||||
if ("尖角".equals(name)) {
|
||||
price = Math.ceil(160 * dto.getCount());
|
||||
zhongliang = 2.3;
|
||||
}
|
||||
if ("斜面6角星".equals(name)) {
|
||||
price = Math.ceil(90 * dto.getCount());
|
||||
zhongliang = 2.6;
|
||||
}
|
||||
if ("八角".equals(name)) {
|
||||
price = Math.ceil(108 * dto.getCount());
|
||||
zhongliang = 3.1;
|
||||
}
|
||||
if ("蓝色梦想".equals(name)) {
|
||||
price = Math.ceil(120 * dto.getCount());
|
||||
zhongliang = 2.9;
|
||||
}
|
||||
if ("蓝色三条线".equals(name)) {
|
||||
price = Math.ceil(98 * dto.getCount());
|
||||
zhongliang = 2.9;
|
||||
}
|
||||
if ("蓝色弯弯".equals(name)) {
|
||||
price = Math.ceil(98 * dto.getCount());
|
||||
zhongliang = 2.2;
|
||||
}
|
||||
if ("斜面5角星".equals(name)) {
|
||||
price = Math.ceil(88 * dto.getCount());
|
||||
zhongliang = 2.5;
|
||||
}
|
||||
if ("麦穗圆型".equals(name)) {
|
||||
price = Math.ceil(108 * dto.getCount());
|
||||
zhongliang = 2.9;
|
||||
}
|
||||
if ("酸洗凹面".equals(name)) {
|
||||
price = Math.ceil(118 * dto.getCount());
|
||||
zhongliang = 2.9;
|
||||
}
|
||||
if ("月牙".equals(name)) {
|
||||
price = Math.ceil(108 * dto.getCount());
|
||||
zhongliang = 2.9;
|
||||
}
|
||||
if ("大拇指".equals(name)) {
|
||||
price = Math.ceil(60 * dto.getCount());
|
||||
zhongliang = 2.9;
|
||||
}
|
||||
if ("宝剑".equals(name)) {
|
||||
price = Math.ceil(108 * dto.getCount());
|
||||
zhongliang = 2.9;
|
||||
}
|
||||
if ("蓝色五角星".equals(name)) {
|
||||
price = Math.ceil(128 * dto.getCount());
|
||||
zhongliang = 2.9;
|
||||
}
|
||||
} else {
|
||||
List<String> carfts = dto.getCraft() != null ? Arrays.asList(dto.getCraft()) : new ArrayList<>();
|
||||
if ("20*25".equals(dto.getSize())) {
|
||||
if (carfts.contains("直边")) {
|
||||
price = Math.ceil(33 * dto.getCount());
|
||||
} else {
|
||||
price = Math.ceil(39 * dto.getCount());
|
||||
}
|
||||
zhongliang = 1.3;
|
||||
}
|
||||
if ("24*31".equals(dto.getSize())) {
|
||||
if (carfts.contains("直边")) {
|
||||
price = Math.ceil(36 * dto.getCount());
|
||||
} else {
|
||||
price = Math.ceil(45 * dto.getCount());
|
||||
}
|
||||
zhongliang = 1.6;
|
||||
}
|
||||
if ("25*35".equals(dto.getSize())) {
|
||||
if (carfts.contains("直边")) {
|
||||
price = Math.ceil(39 * dto.getCount());
|
||||
} else {
|
||||
price = Math.ceil(54 * dto.getCount());
|
||||
}
|
||||
zhongliang = 1.7;
|
||||
}
|
||||
if ("30*40".equals(dto.getSize())) {
|
||||
if (carfts.contains("直边")) {
|
||||
price = Math.ceil(42 * dto.getCount());
|
||||
} else {
|
||||
price = Math.ceil(66 * dto.getCount());
|
||||
}
|
||||
zhongliang = 2.7;
|
||||
}
|
||||
if ("35*50".equals(dto.getSize())) {
|
||||
if (carfts.contains("直边")) {
|
||||
price = Math.ceil(57 * dto.getCount());
|
||||
} else {
|
||||
price = Math.ceil(75 * dto.getCount());
|
||||
}
|
||||
zhongliang = 3.6;
|
||||
}
|
||||
if ("40*60".equals(dto.getSize())) {
|
||||
if (carfts.contains("直边")) {
|
||||
price = Math.ceil(75 * dto.getCount());
|
||||
} else {
|
||||
price = Math.ceil(108 * dto.getCount());
|
||||
}
|
||||
zhongliang = 4.8;
|
||||
}
|
||||
}
|
||||
Product pro = new Product();
|
||||
pro.setCount(count);
|
||||
pro.setPrice(price * number);
|
||||
pro.setWeight(df.format(Math.ceil(zhongliang * dto.getCount() * number)));
|
||||
priceList.add(pro);
|
||||
return priceList;
|
||||
}
|
||||
|
||||
private List<Product> getLeiseDiaoPrice(Product dto, double length, double width) {
|
||||
double[] prices = new double[]{170, 233, 370, 537, 643, 843, 1613, 3117, 4847};
|
||||
int[] count_list = new int[]{500, 1000, 2000, 3000, 4000, 5000, 10000, 20000, 30000};
|
||||
|
||||
@@ -19,29 +19,49 @@
|
||||
<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="香薰卡"/>
|
||||
<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>
|
||||
<option value="1">300克</option>
|
||||
<option value="2">600克</option>
|
||||
<option value="3">1000克</option>
|
||||
<option value="1">金属微章</option>
|
||||
</select>
|
||||
</div>
|
||||
<p>
|
||||
尺寸(CM/厘米) <span style="font-size: 14px; color: red">输入格式: 长 * 宽</span>
|
||||
</p>
|
||||
<div class="layui-form-item" id="ui_size">
|
||||
<input type="text" name="size" id="size" placeholder="格式:长*宽" class="layui-input" autocomplete="off">
|
||||
<input type="text" name="size" id="size" value="3*3" class="layui-input" autocomplete="off" readonly>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-form-item layui-input-inline">
|
||||
<p>
|
||||
数量(个)
|
||||
</p>
|
||||
<div class="layui-form-item">
|
||||
<input type="text" name="count" id="count" placeholder="请输入整数" class="layui-input" autocomplete="off">
|
||||
<div class="layui-form-item" style="width: 200px">
|
||||
<select id="count_select" lay-filter="count_select" class="select">
|
||||
<option value="50">50</option>
|
||||
<option value="100">100</option>
|
||||
<option value="200">200</option>
|
||||
<option value="500">500</option>
|
||||
<option value="1000">1000</option>
|
||||
<option value="2000">2000</option>
|
||||
<option value="3000">3000</option>
|
||||
<option value="5000">5000</option>
|
||||
<option value="10000">10000</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class=" layui-input-inline">
|
||||
<p>
|
||||
自定义数量
|
||||
</p>
|
||||
<div class="layui-form-item" style="width: 500px">
|
||||
<input type="text" name="count" id="count" value="50" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p>
|
||||
款数
|
||||
@@ -50,36 +70,6 @@
|
||||
<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" id="xiangwei">
|
||||
<select name="craft" class="select">
|
||||
<option value="桂花">桂花</option>
|
||||
<option value="爱马仕大地">爱马仕大地</option>
|
||||
<option value="白茶">白茶</option>
|
||||
<option value="东方风韵">东方风韵</option>
|
||||
<option value="咖啡">咖啡</option>
|
||||
<option value="柑橘">柑橘</option>
|
||||
<option value="栀子花">栀子花</option>
|
||||
<option value="玫瑰">玫瑰</option>
|
||||
<option value="水蜜桃">水蜜桃</option>
|
||||
<option value="奥迪真我">奥迪真我</option>
|
||||
<option value="古龙">古龙</option>
|
||||
<option value="海洋">海洋</option>
|
||||
<option value="驱蚊香">驱蚊香</option>
|
||||
<option value="苹果">苹果</option>
|
||||
<option value="薰衣草">薰衣草</option>
|
||||
<option value="凤梨">凤梨</option>
|
||||
<option value="蔚蓝">蔚蓝</option>
|
||||
<option value="乌木沉香">乌木沉香</option>
|
||||
<option value="蓝风铃">蓝风铃</option>
|
||||
<option value="小苍兰">小苍兰</option>
|
||||
<option value="柠檬香">柠檬香</option>
|
||||
<option value="茉莉">茉莉</option>
|
||||
<option value="邂逅">邂逅</option>
|
||||
</select>
|
||||
</div>
|
||||
<p>
|
||||
客户旺旺
|
||||
</p>
|
||||
@@ -92,59 +82,22 @@
|
||||
</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="双面">
|
||||
画面工艺:
|
||||
<input type="checkbox" lay-filter="ui_craft" value="PET印刷" title="PET印刷" checked>
|
||||
</div>
|
||||
<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="异形模切">
|
||||
底托颜色:
|
||||
<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="打孔">
|
||||
</div>
|
||||
<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="真空包装">
|
||||
<input type="checkbox" name="craft" lay-filter="ui_craft" value="无需包装" title="无需包装">
|
||||
</div>
|
||||
|
||||
<div class="layui-input-block">
|
||||
配件:
|
||||
<input type="checkbox" class="peijian" name="craft" lay-filter="peijian" value="配涤纶丝带"
|
||||
title="配涤纶丝带">
|
||||
<input type="checkbox" class="peijian" name="craft" lay-filter="peijian" value="配吊牌绳"
|
||||
title="配吊牌绳">
|
||||
<input type="checkbox" class="peijian" name="craft" lay-filter="peijian" value="配弹力绳"
|
||||
title="配弹力绳">
|
||||
</div>
|
||||
<div class="layui-input-block">
|
||||
穿配件:
|
||||
<input type="checkbox" class="peijian" name="craft" lay-filter="peijian" value="穿涤纶丝带"
|
||||
title="穿涤纶丝带">
|
||||
<input type="checkbox" class="peijian" name="craft" lay-filter="peijian" value="穿吊牌绳"
|
||||
title="穿吊牌绳">
|
||||
<input type="checkbox" class="peijian" name="craft" lay-filter="peijian" value="穿弹力绳"
|
||||
title="穿弹力绳">
|
||||
<div class="layui-inline shengz scolor" style="width: 110px;display: none">
|
||||
<select class="select" name="shen_color">
|
||||
<option value="白色绳子">白色绳子</option>
|
||||
<option value="黑色绳子">黑色绳子</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-input-block" id="peijian_ui" style="display: none">
|
||||
配件颜色:
|
||||
<div class="layui-inline shengz scolor" style="width: 110px;">
|
||||
<select class="select" name="shen_color">
|
||||
<option value="白色绳子">白色绳子</option>
|
||||
<option value="黑色绳子">黑色绳子</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="checkbox" class="peijian" name="craft" lay-filter="peijian" value="别针"
|
||||
title="别针" checked>
|
||||
<input type="checkbox" class="peijian" name="craft" lay-filter="peijian" value="蝴蝶扣"
|
||||
title="蝴蝶扣">
|
||||
<input type="checkbox" class="peijian" name="craft" lay-filter="peijian" value="磁铁"
|
||||
title="磁铁">
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
@@ -187,14 +140,9 @@
|
||||
ins = carousel.render({});
|
||||
var html = " ";
|
||||
var remark = " ";
|
||||
const carft_list1 = ["单面", "双面"];
|
||||
const carft_list1 = ["金色", "银色"];
|
||||
|
||||
const carft_list2 = ["直角裁切", "异形模切"];
|
||||
|
||||
const carft_list3 = ["单独包装", "真空包装", "无需包装"];
|
||||
|
||||
const carft_list4 = ["穿涤纶丝带", "穿吊牌绳", "穿弹力绳"];
|
||||
const carft_list5 = ["配涤纶丝带", "配吊牌绳", "配弹力绳"];
|
||||
const carft_list2 = ["别针", "蝴蝶扣", "磁铁"];
|
||||
|
||||
// 清空轮播图
|
||||
$("#carousel").empty();
|
||||
@@ -233,6 +181,9 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
form.on("select(count_select)", function (val) {
|
||||
$("#count").val(val.value);
|
||||
})
|
||||
form.on('checkbox(ui_craft)', function (data) {
|
||||
let craft_list = [];
|
||||
craft_list.push($("select[name='craft'] option:selected").val());
|
||||
@@ -242,27 +193,18 @@
|
||||
}
|
||||
}
|
||||
);
|
||||
if (data.value == "PET印刷") {
|
||||
$(data.elem).prop("checked", true);
|
||||
layer.msg("画面工艺不能取消", {offset: ['300px', '300px']}, function () {
|
||||
});
|
||||
form.render();
|
||||
return false;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
const carft2 = carft_list2.filter(craft => craft_list.includes(craft));
|
||||
if (carft2.length > 1) {
|
||||
$(data.elem).prop("checked", false);
|
||||
layer.msg("裁切工艺不能同时选择", {offset: ['300px', '300px']}, function () {
|
||||
});
|
||||
form.render();
|
||||
return false;
|
||||
}
|
||||
const carft3 = carft_list3.filter(craft => craft_list.includes(craft));
|
||||
if (carft3.length > 1) {
|
||||
$(data.elem).prop("checked", false);
|
||||
layer.msg("包装工艺不能同时选择", {offset: ['300px', '300px']}, function () {
|
||||
layer.msg("底托颜色不能同时选择", {offset: ['300px', '300px']}, function () {
|
||||
});
|
||||
form.render();
|
||||
return false;
|
||||
@@ -276,28 +218,15 @@
|
||||
}
|
||||
}
|
||||
);
|
||||
const carft4 = carft_list4.filter(craft => craft_list.includes(craft));
|
||||
const carft5 = carft_list5.filter(craft => craft_list.includes(craft));
|
||||
if (carft4.length > 0 && carft5.length > 0) {
|
||||
const carft2 = carft_list2.filter(craft => craft_list.includes(craft));
|
||||
if (carft2.length > 1) {
|
||||
$(data.elem).next().attr("class", "layui-unselect layui-form-checkbox");
|
||||
$(data.elem).prop("checked", false);
|
||||
layer.msg('配 - 穿只能选择一种!', {offset: ['300px', '300px']}, {icon: 5});
|
||||
return false;
|
||||
}
|
||||
if (carft4.length > 1) {
|
||||
$(data.elem).next().attr("class", "layui-unselect layui-form-checkbox");
|
||||
$(data.elem).prop("checked", false);
|
||||
layer.msg('穿只能选择一种!', {offset: ['300px', '300px']}, {icon: 5});
|
||||
return false;
|
||||
}
|
||||
if ($(data.elem).is(":checked")) {
|
||||
$("#peijian_ui").show();
|
||||
$("#peijian_ui .scolor select").prop("disabled", false);
|
||||
} else {
|
||||
$("#peijian_ui").hide();
|
||||
$("#peijian_ui .scolor select").prop("disabled", true);
|
||||
}
|
||||
layer.msg('配件只能选择一种!', {offset: ['300px', '300px']}, {icon: 5});
|
||||
form.render();
|
||||
return false;
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
// 点击计算,计算价格
|
||||
@@ -307,48 +236,23 @@
|
||||
var count = $("#count").val();
|
||||
var kind = $("select[name='kind'] option:selected").text();
|
||||
var craft = [];
|
||||
if (size == "") {
|
||||
layer.msg('请填写尺寸!', {offset: ['300px', '300px']}, function () {
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if ((size.split("*")[0] > 42 || size.split("*")[1] > 28.5) && (size.split("*")[1] > 42 || size.split("*")[0] > 28.5)) {
|
||||
layer.msg('最大尺寸42*28.5cm!', {offset: ['300px', '300px']}, function () {
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if ((size.split("*")[0] < 1 || size.split("*")[1] < 1)) {
|
||||
layer.msg('最小尺寸1*1cm!', {offset: ['300px', '300px']}, function () {
|
||||
});
|
||||
return false;
|
||||
}
|
||||
craft.push($("#xiangwei select[name='craft'] option:selected").val());
|
||||
|
||||
$("input:checkbox[name='craft']:checked").each(function (i) {
|
||||
// 没有被禁用的工艺加到arr中
|
||||
if (!$(this).is(':disabled')) {
|
||||
if (carft_list4.indexOf($(this).val()) > -1) {
|
||||
craft.push($(this).val() + $("#peijian_ui select[name='shen_color'] option:selected").val());
|
||||
} else {
|
||||
craft.push($(this).val());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const carft1 = carft_list1.filter(item => craft.includes(item));
|
||||
if (carft1.length == 0) {
|
||||
layer.msg("请选择印面工艺", {offset: ['300px', '300px']}, function () {
|
||||
layer.msg("请选择底托颜色", {offset: ['300px', '300px']}, function () {
|
||||
});
|
||||
return false;
|
||||
}
|
||||
const carft2 = carft_list2.filter(item => craft.includes(item));
|
||||
if (carft2.length == 0) {
|
||||
layer.msg("请选择裁切工艺", {offset: ['300px', '300px']}, function () {
|
||||
});
|
||||
return false;
|
||||
}
|
||||
const carft3 = carft_list3.filter(item => craft.includes(item));
|
||||
if (carft3.length == 0) {
|
||||
layer.msg("请选择包装工艺", {offset: ['300px', '300px']}, function () {
|
||||
layer.msg("请选择配件", {offset: ['300px', '300px']}, function () {
|
||||
});
|
||||
return false;
|
||||
}
|
||||
@@ -364,18 +268,18 @@
|
||||
}
|
||||
var data = result.data.proList;
|
||||
|
||||
var span_result = '香薰卡 - ' + kind + ' - ' + size + ' CM (同款内容)\n';
|
||||
var span_result = '金属徽章 - ' + kind + ' - ' + 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'
|
||||
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'
|
||||
span_result += number + '款 ' + data[i].count + "个,共" + data[i].price + "元" + '\n'
|
||||
data[i].number = number;
|
||||
}
|
||||
}
|
||||
|
||||
새 이슈에서 참조
사용자 차단