From 8b072bbb3ccf91a94eccab198475e8c85b48f9f7 Mon Sep 17 00:00:00 2001 From: pushuo <229102104@qq.com> Date: Wed, 6 Jul 2022 21:42:15 +0800 Subject: [PATCH] wip --- public/build/beike/shop/default/css/app.css | 15 +++++++++++++++ public/build/beike/shop/default/js/app.js | 2 ++ resources/beike/shop/default/css/header.scss | 16 ++++++++++++++++ resources/beike/shop/default/js/app.js | 3 +++ themes/default/layout/header.blade.php | 7 ++----- 5 files changed, 38 insertions(+), 5 deletions(-) diff --git a/public/build/beike/shop/default/css/app.css b/public/build/beike/shop/default/css/app.css index 3f2c1876..80f19435 100644 --- a/public/build/beike/shop/default/css/app.css +++ b/public/build/beike/shop/default/css/app.css @@ -203,10 +203,25 @@ header .header-content .right-btn .nav-link { color: #333; padding-right: 0.7rem; padding-left: 0.7rem; + position: relative; } header .header-content .right-btn .nav-link i { font-size: 1.1rem; } +header .navbar-icon-link-badge { + position: absolute; + display: none; + top: 0; + right: 0; + width: 19px; + height: 19px; + text-align: center; + color: #fff; + border-radius: 50%; + background: #fd560f; + font-size: 0.6rem; + line-height: 19px; +} #offcanvas-right-cart .offcanvas-right-products .product-list { padding: 1rem 0; diff --git a/public/build/beike/shop/default/js/app.js b/public/build/beike/shop/default/js/app.js index eb1d7288..b068165b 100644 --- a/public/build/beike/shop/default/js/app.js +++ b/public/build/beike/shop/default/js/app.js @@ -2494,6 +2494,8 @@ $(document).ready(function ($) { $('.offcanvas-right-cart-amount').html(res.data.amount_format); if (res.data.carts.length) { + $('.navbar-icon-link-badge').html(res.data.carts.length > 99 ? '99+' : res.data.carts.length).show(); + $('.offcanvas-right-cart-count').html(res.data.carts.length); var html = ''; res.data.carts.forEach(function (e) { html += '