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; }