diff --git a/beike/Shop/Http/Controllers/CartController.php b/beike/Shop/Http/Controllers/CartController.php index 35852b68..19572b86 100644 --- a/beike/Shop/Http/Controllers/CartController.php +++ b/beike/Shop/Http/Controllers/CartController.php @@ -110,6 +110,7 @@ class CartController extends Controller $data['html'] = view('cart/mini', $reloadData)->render(); $data['quantity'] = $reloadData['quantity']; + $data['quantity_all'] = $reloadData['quantity_all']; return json_success(trans('common.success'), $data); } diff --git a/beike/Shop/Services/CartService.php b/beike/Shop/Services/CartService.php index 6389cef6..1807dd50 100644 --- a/beike/Shop/Services/CartService.php +++ b/beike/Shop/Services/CartService.php @@ -137,25 +137,24 @@ class CartService * 获取购物车相关数据 * * @param array $carts - * @param bool $showAll * @return array */ - public static function reloadData(array $carts = [], bool $showAll = false): array + public static function reloadData(array $carts = []): array { if (empty($carts)) { $carts = CartService::list(current_customer()); } - $cartList = collect($carts); - if (!$showAll) { - $cartList = collect($carts)->where('selected', 1); - } + $cartList = collect($carts)->where('selected', 1); + $quantity = $cartList->sum('quantity'); + $quantityAll = collect($carts)->sum('quantity'); $amount = $cartList->sum('subtotal'); $data = [ 'carts' => $carts, 'quantity' => $quantity, + 'quantity_all' => $quantityAll, 'amount' => $amount, 'amount_format' => currency_format($amount), ]; diff --git a/resources/beike/shop/default/css/footer.scss b/resources/beike/shop/default/css/footer.scss index bff4a550..a30a416d 100644 --- a/resources/beike/shop/default/css/footer.scss +++ b/resources/beike/shop/default/css/footer.scss @@ -77,10 +77,21 @@ footer { } .footer-bottom { - height: 60px; display: flex; align-items: center; background: #EFEFF4; color: #666; + + @media (min-width:768px) { + height: 60px; + } + + @media (max-width:768px) { + padding: 10px 0; + } + + .right-img { + max-height: 42px; + } } } \ No newline at end of file diff --git a/resources/beike/shop/default/css/global.scss b/resources/beike/shop/default/css/global.scss index fdcbefc4..ef555d3a 100644 --- a/resources/beike/shop/default/css/global.scss +++ b/resources/beike/shop/default/css/global.scss @@ -106,6 +106,10 @@ body[class^="page-account-"] { padding-bottom: 10px; margin-bottom: 2rem; + @media (max-width: 992px) { + font-size: 1rem; + } + &:after { position: absolute; bottom: 0; @@ -275,4 +279,16 @@ body[class^="page-account-"] { table.table thead th, .fw-bold, h1,h2,h3, h4, h5, h6, b, strong, .card .card-header { font-family: 'Poppins-Medium', sans-serif; +} + +.text-size-min { + font-size: 12px; +} + +.text-truncate-2 { + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; } \ No newline at end of file diff --git a/resources/beike/shop/default/css/header.scss b/resources/beike/shop/default/css/header.scss index 07e314b9..6451eb55 100644 --- a/resources/beike/shop/default/css/header.scss +++ b/resources/beike/shop/default/css/header.scss @@ -274,7 +274,6 @@ header { padding: 1rem 0; border-top: 1px solid #eee; - .left { width: 80px; flex: 0 0 80px; @@ -288,14 +287,6 @@ header { } .right { - .name { - overflow: hidden; - text-overflow:ellipsis; - display: -webkit-box; - -webkit-box-orient: vertical; - -webkit-line-clamp: 2; - } - .price { input { margin-left: 10px; diff --git a/resources/beike/shop/default/js/common.js b/resources/beike/shop/default/js/common.js index 6cc2c9d7..a92e7570 100644 --- a/resources/beike/shop/default/js/common.js +++ b/resources/beike/shop/default/js/common.js @@ -3,7 +3,7 @@ * @link https://beikeshop.com * @Author pu shuo * @Date 2022-09-09 19:16:39 - * @LastEditTime 2022-09-28 17:23:48 + * @LastEditTime 2022-11-07 09:29:34 */ export default { @@ -15,10 +15,10 @@ export default { $(document).ready(() => { $http.get('carts/mini', null, {hload: true}).then((res) => { $('#offcanvas-right-cart').html(res.data.html); - if (!res.data.quantity) { + if (!res.data.quantity_all) { $('.cart-badge-quantity').hide(); } else { - $('.cart-badge-quantity').show().html(res.data.quantity > 99 ? '99+' : res.data.quantity); + $('.cart-badge-quantity').show().html(res.data.quantity_all > 99 ? '99+' : res.data.quantity_all); } }) }) diff --git a/resources/lang/en/shop/steps.php b/resources/lang/en/shop/steps.php index 80413d16..f5829071 100644 --- a/resources/lang/en/shop/steps.php +++ b/resources/lang/en/shop/steps.php @@ -12,7 +12,7 @@ return [ 'index' => 'Steps', 'cart' => 'Cart', - 'checkout' => 'Checkouts', - 'submitted_successfully' => 'Submitted Successfully', + 'checkout' => 'Checkout', + 'submitted_successfully' => 'Placed Order', 'payment' => 'Payment', ]; diff --git a/themes/default/cart/cart.blade.php b/themes/default/cart/cart.blade.php index b7590c65..3c115bf4 100644 --- a/themes/default/cart/cart.blade.php +++ b/themes/default/cart/cart.blade.php @@ -48,8 +48,8 @@ -
-
@{{ product.variant_labels }}
+
+
@{{ product.variant_labels }}
@{{ product.price_format }}
diff --git a/themes/default/cart/mini.blade.php b/themes/default/cart/mini.blade.php index e04a6422..2b97c78a 100644 --- a/themes/default/cart/mini.blade.php +++ b/themes/default/cart/mini.blade.php @@ -2,7 +2,7 @@
{{ __('shop/carts.mini') }}
-
+
@php $check = 0 @endphp @if ($carts) @@ -16,8 +16,8 @@
- {{ $cart['name'] }} -
{{ $cart['variant_labels'] }}
+ {{ $cart['name'] }} +
{{ $cart['variant_labels'] }}
{{ $cart['price_format'] }} x diff --git a/themes/default/checkout.blade.php b/themes/default/checkout.blade.php index 127fe792..0a89ba19 100644 --- a/themes/default/checkout.blade.php +++ b/themes/default/checkout.blade.php @@ -157,9 +157,7 @@
-
- -
+
@{{ cart.price_format }}
diff --git a/themes/default/layout/footer.blade.php b/themes/default/layout/footer.blade.php index 6bafc9a4..3a3d8244 100644 --- a/themes/default/layout/footer.blade.php +++ b/themes/default/layout/footer.blade.php @@ -73,7 +73,7 @@ {!! $footer_content['bottom']['copyright'][$locale] ?? '' !!}
@if (isset($footer_content['bottom']['image'])) -
+
@endif