From eede9e4e25a9ef2cbdd85df4941c2c39da757a88 Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Sat, 7 Oct 2023 13:45:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=201.=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E7=BC=96=E8=BE=91=E9=A1=B5=E6=95=B0=E9=87=8F=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E6=9B=B4=E6=96=B0=E4=B8=BA=E5=BA=93=E5=AD=98=EF=BC=8C?= =?UTF-8?q?=E5=89=8D=E5=8F=B0=E6=96=87=E6=9C=AC=E6=8A=8AQuantity=EF=BC=9A?= =?UTF-8?q?=E6=94=B9=E4=B8=BAStock=202.=E4=BA=A4=E6=98=93=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=9C=A8=E4=B8=8B=EF=BC=8C=E6=95=B0=E6=8D=AE=EF=BC=88?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=E6=96=87=E6=9C=AC=E4=B8=BA=EF=BC=9A=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E4=BF=A1=E6=81=AF=EF=BC=89=20=E5=9C=A8=E4=B8=8A?= =?UTF-8?q?=EF=BC=8C=E4=BA=A7=E5=93=81=E7=B1=BB=E5=9E=8B=E4=B8=8B=E6=94=BE?= =?UTF-8?q?=E5=88=B0=E4=BA=A4=E6=98=93=E4=BF=A1=E6=81=AF=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E6=8E=92=203.=E4=BA=A7=E5=93=81=E7=B1=BB=E5=9E=8B=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E5=88=B0=E4=BA=A7=E5=93=81=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E8=A1=8C=E5=9B=BA=E5=AE=9A=E6=A0=8F=EF=BC=9A?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E7=B1=BB=E5=9E=8B=EF=BC=9A=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E4=B8=8B=E5=8D=95=E4=BA=A7=E5=93=81/=E9=9D=9E=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E4=B8=8B=E5=8D=95=E4=BA=A7=E5=93=81=20=20=20=E8=8B=B1?= =?UTF-8?q?=E6=96=87=EF=BC=9AProduct=20Type=EF=BC=9A=20Can=20Place=20Order?= =?UTF-8?q?s=20Wholesale/=20Customization=204.=E4=BA=A7=E5=93=81=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E9=A1=B5=E9=9D=A2=E8=B4=B8=E6=98=93=E6=9C=AF=E8=AF=AD?= =?UTF-8?q?=E5=BF=85=E5=A1=AB=EF=BC=88=E5=9B=BE=E7=89=87=E6=94=BE=E5=A4=A7?= =?UTF-8?q?=EF=BC=89=EF=BC=8C=E4=BA=A7=E5=93=81=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=20=E8=B4=B8=E6=98=93=E6=9C=AF=E8=AF=AD=E4=B9=9F=E6=98=AF?= =?UTF-8?q?=E9=97=AE=E5=8F=B7=E5=BC=B9=E5=87=BA=E5=9B=BE=E7=89=87=EF=BC=8C?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E8=AF=A6=E6=83=85=E9=A1=B5=205.=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E8=AF=A6=E6=83=85=E9=A1=B5Sales=20method=EF=BC=9A?= =?UTF-8?q?=E5=92=8CMin=20Order=E5=88=A0=E9=99=A4=E3=80=82=E4=BB=85?= =?UTF-8?q?=E4=BB=85=E5=9C=A8=E6=8C=89=E6=89=B9=E5=94=AE=E5=8D=96=E6=97=B6?= =?UTF-8?q?=E6=89=8D=E6=98=BE=E7=A4=BAMin=20Order;=20=E6=8A=8A=E4=B8=80?= =?UTF-8?q?=E6=89=B9=E5=A4=9A=E5=B0=91=EF=BC=88=E5=8D=95=E4=BD=8D=EF=BC=89?= =?UTF-8?q?=E5=92=8C=E6=9C=80=E5=B0=91=E4=B9=B0=E5=A4=9A=E5=B0=91=EF=BC=88?= =?UTF-8?q?=E5=8D=95=E4=BD=8D=EF=BC=89=E9=9B=86=E5=90=88=E5=88=B0=E6=9C=80?= =?UTF-8?q?=E5=B0=8F=E8=B5=B7=E8=AE=A2=E9=87=8F=20=E5=BC=B9=E5=87=BA?= =?UTF-8?q?=E5=9C=A8=E4=BB=B7=E6=A0=BC=E4=B8=8B=E6=96=B9=E3=80=82=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=A6=82=E4=B8=8B=EF=BC=9A=20Min=20Order=EF=BC=9AX?= =?UTF-8?q?=E6=89=B9=EF=BC=881=20batch=3DAA=E5=8D=95=E4=BD=8D=20|=20CC=20?= =?UTF-8?q?=E5=8D=95=E4=BD=8D=20in=20total=EF=BC=89=206.=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E4=B8=8B=E5=8D=95=E4=BA=A7=E5=93=81=E4=BA=A4=E6=98=93=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=89=80=E6=9C=89=E5=86=85=E5=AE=B9=E9=83=BD=E6=98=AF?= =?UTF-8?q?=E5=BF=85=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- beike/Models/Product.php | 116 +++++- public/build/beike/shop/default/js/app.js | 14 +- .../views/pages/products/form/form.blade.php | 331 +++++++++++------- resources/beike/shop/default/js/product.js | 9 + resources/lang/en/common.php | 6 +- resources/lang/en/product.php | 4 +- resources/lang/zh_cn/common.php | 2 +- themes/default/product/product.blade.php | 93 ++++- 8 files changed, 418 insertions(+), 157 deletions(-) diff --git a/beike/Models/Product.php b/beike/Models/Product.php index 02a33d88..6ca1ab72 100644 --- a/beike/Models/Product.php +++ b/beike/Models/Product.php @@ -130,10 +130,118 @@ class Product extends Base public static function getUnitList(){ return [ - ['title'=>'set/sets'], - ['title'=>'bag/bags'], - ['title'=>'piece/pieces'] - + //A + ['title' => 'Acre/Acres'], + ['title' => 'Ampere/Amperes'], + //B + ['title' => 'Bag/Bags'], + ['title' => 'Barrel/Barrels'], + ['title' => 'Blade/Blades'], + ['title' => 'Box/Boxes'], + ['title' => 'Bushel/Bushels'], + // C + ['title' => 'Carat/Carats'], + ['title' => 'Carton/Cartons'], + ['title' => 'Case/Cases'], + ['title' => 'Centimeter/Centimeters'], + ['title' => 'Chain/Chains'], + ['title' => 'Combo/Combos'], + ['title' => 'Cubic Centimeter/Cubic Centimeters'], + ['title' => 'Cubic Foot/Cubic Feet'], + ['title' => 'Cubic Inch/Cubic Inches'], + ['title' => 'Cubic Meter/Cubic Meters'], + ['title' => 'Cubic Yard/Cubic Yards'], + // D + ['title' => 'Degrees Fahrenheit'], + ['title' => 'Dozen/Dozens'], + ['title' => 'Dram/Drams'], + // F + ['title' => 'Fluid Ounce/Fluid Ounces'], + ['title' => 'Foot/Feet'], + ['title' => 'Forty-FootContainer'], + ['title' => 'Furlong/Furlongs'], + // G + ['title' => 'Gallon/Gallons'], + ['title' => 'Gill/Gills'], + ['title' => 'Grain/Grains'], + ['title' => 'Gram/Grams'], + ['title' => 'Gross'], + // H + ['title' => 'Hectare/Hectares'], + ['title' => 'Hertz'], + // I + ['title' => 'Inch/Inches'], + // K + ['title' => 'Kiloampere/Kiloamperes'], + ['title' => 'Kilogram/Kilograms'], + ['title' => 'Kilohertz'], + ['title' => 'Kilometer/kilometers'], + ['title' => 'Kiloohm/Kiloohms'], + ['title' => 'Kilovolt/Kilovolts'], + ['title' => 'Kilowatt/Kilowatts'], + // L + ['title' => 'Liter/Liters'], + ['title' => 'Long Ton/Long Tons'], + // M + ['title' => 'Megahertz'], + ['title' => 'Meter/Meters'], + ['title' => 'Metric Ton/Metric Tons'], + ['title' => 'Mile/Miles'], + ['title' => 'Milliampere/Milliamperes'], + ['title' => 'Milligram/Milligrams'], + ['title' => 'Millihertz'], + ['title' => 'Milliliter/Milliliters'], + ['title' => 'Milliohm/Milliohms'], + ['title' => 'Millivolt/Millivolts'], + ['title' => 'Milliwatt/Milliwatts'], + // N + ['title' => 'Nautical Mile/Nautical Miles'], + // O + ['title' => 'Ohm/Ohms'], + ['title' => 'Ounce/Ounces'], + // P + ['title' => 'Pack/Packs'], + ['title' => 'Pair/Pairs'], + ['title' => 'Pallet/Pallets'], + ['title' => 'Parcel/Parcels'], + ['title' => 'Perch/Perches'], + ['title' => 'Piece/Pieces'], + ['title' => 'Pint/Pints'], + ['title' => 'Plant/Plants'], + ['title' => 'Pole/Poles'], + ['title' => 'Pound/Pounds'], + // Q + ['title' => 'Quart/Quarts'], + ['title' => 'Quarter/Quarters'], + // R + ['title' => 'Rod/Rods'], + ['title' => 'Roll/Rolls'], + // S + ['title' => 'Set/Sets'], + ['title' => 'Sheet/Sheets'], + ['title' => 'Short Ton/Short Tons'], + ['title' => 'Square Centimeter/Square Centimeters'], + ['title' => 'Square Foot/Square Feet'], + ['title' => 'Square Inch/Square Inches'], + ['title' => 'Square Meter/Square Meters'], + ['title' => 'Square Mile/Square Miles'], + ['title' => 'Square Yard/Square Yards'], + ['title' => 'Stone/Stones'], + ['title' => 'Strand/Strands'], + // T + ['title' => 'Ton/Tons'], + ['title' => 'Tonne/Tonnes'], + ['title' => 'Tray/Trays'], + ['title' => 'Twenty-Foot Container'], + // U + ['title' => 'Unit/Units'], + // V + ['title' => 'Volt/Volts'], + // W + ['title' => 'Watt/Watts'], + ['title' => 'Wp'], + // Y + ['title' => 'Yard/Yards'], ]; } diff --git a/public/build/beike/shop/default/js/app.js b/public/build/beike/shop/default/js/app.js index 5bbb4327..bcbdcc37 100644 --- a/public/build/beike/shop/default/js/app.js +++ b/public/build/beike/shop/default/js/app.js @@ -2396,6 +2396,8 @@ $(function () { hload: true }).then(function (res) { updateMiniCartData(res); + })["catch"](function (err) { + console.log("修改购物车信息header - 错误:", err); }); }); function updateMiniCartData(res) { @@ -2444,20 +2446,28 @@ $(document).on('click', '.quantity-wrap .right i', function (event) { event.stopPropagation(); event.preventDefault(); var input = $(this).parent().siblings('input'); - var minimum_order = input.attr('minimum_order') || 0; // 最小起订量 + var minimum_order = input.attr('minimum') || 0; // 最小起订量 var sales_method = input.attr('sales_method') || 'piece'; // 销售方式:piece=按件卖,batches=按批卖 var piece_to_batch = input.attr('piece_to_batch') || 1; // 按批卖,每批等于多少件 var step = sales_method === 'piece' ? parseInt(1) : parseInt(piece_to_batch); // 点击后加减数量 + var res_num = $(this).hasClass('bi-chevron-up') ? input.val() * 1 + step : input.val() * 1 - step; + if (sales_method === 'batches' && res_num % step !== 0) { + input.val(0); + input.get(0).dispatchEvent(new Event('input')); + return; + } if ($(this).hasClass('bi-chevron-up')) { input.val(input.val() * 1 + step); input.get(0).dispatchEvent(new Event('input')); return; } if (input.val() * 1 <= input.attr('minimum') * 1) { + input.val(0); + input.get(0).dispatchEvent(new Event('input')); return; } - if (input.val() * 1 <= 1) { + if (input.val() * 1 <= 0) { return; } input.val(input.val() * 1 - step); diff --git a/resources/beike/admin/views/pages/products/form/form.blade.php b/resources/beike/admin/views/pages/products/form/form.blade.php index 031b75e3..9f6b86dd 100644 --- a/resources/beike/admin/views/pages/products/form/form.blade.php +++ b/resources/beike/admin/views/pages/products/form/form.blade.php @@ -35,9 +35,15 @@ align-items: center; } #unitAndTradeTerm select { + width: 330px!important; + } + #unitAndTradeTerm .row:nth-child(2) select{ width: 150px!important; } #unitAndTradeTerm .col-auto { + width: 330px!important; + } + #unitAndTradeTerm .row:nth-child(2) .col-auto{ width: 150px!important; } #unitAndTradeTerm .row:nth-child(2) .col-form-label{ @@ -55,10 +61,12 @@ width: 84px!important; } .trade-term-img{ - width: 400px!important; + width: 1200px!important; + max-width: 90vw!important; + max-height: 95vh!important; } .popover{ - --bs-popover-max-width: 550px!important; + --bs-popover-max-width: 100vw!important; }