diff --git a/public/build/beike/shop/default/js/app.js b/public/build/beike/shop/default/js/app.js index b3b32e67..907dfa7b 100644 --- a/public/build/beike/shop/default/js/app.js +++ b/public/build/beike/shop/default/js/app.js @@ -2492,6 +2492,8 @@ $(document).ready(function ($) { var cartId = $(this).data('id'); $http["delete"]("/carts/".concat(cartId)).then(function (res) { $this.parents('.product-list').remove(); + $('.offcanvas-right-cart-count').html(res.data.quantity); + $('.offcanvas-right-cart-amount').html(res.data.amount_format); }); }); $(document).on('click', '.quantity-wrap .right i', function (event) { @@ -2570,7 +2572,7 @@ bk.getCarts = function () { 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); + $('.offcanvas-right-cart-count').html(res.data.quantity); var html = ''; res.data.carts.forEach(function (e) { html += '
'; @@ -2578,7 +2580,7 @@ bk.getCarts = function () { html += '
'; html += "
".concat(e.name, "
"); html += '
'; - html += "
".concat(e.price_format, "
"); + html += "
".concat(e.price_format, " x ").concat(e.quantity, "
"); html += " \u5220\u9664"); html += '
'; html += '
'; diff --git a/resources/beike/admin/views/pages/home.blade.php b/resources/beike/admin/views/pages/home.blade.php index 104b8de4..0df26942 100644 --- a/resources/beike/admin/views/pages/home.blade.php +++ b/resources/beike/admin/views/pages/home.blade.php @@ -111,24 +111,23 @@ labels: ['新注册', '最近访问', '活跃用户', '近期下单'], datasets: [{ label: '# of Votes', - data: [112, 19, 3, 5, 2, 3], + data: [12, 19, 3, 5], // borderRadius: 5, - borderWidth: 2, backgroundColor: [ 'rgba(255, 99, 132, 0.2)', 'rgba(54, 162, 235, 0.2)', 'rgba(255, 206, 86, 0.2)', 'rgba(75, 192, 192, 0.2)', - 'rgba(153, 102, 255, 0.2)', - 'rgba(255, 159, 64, 0.2)' + // 'rgba(153, 102, 255, 0.2)', + // 'rgba(255, 159, 64, 0.2)' ], borderColor: [ 'rgba(255, 99, 132, 1)', 'rgba(54, 162, 235, 1)', 'rgba(255, 206, 86, 1)', 'rgba(75, 192, 192, 1)', - 'rgba(153, 102, 255, 1)', - 'rgba(255, 159, 64, 1)' + // 'rgba(153, 102, 255, 1)', + // 'rgba(255, 159, 64, 1)' ], borderWidth: 1 }] diff --git a/resources/beike/shop/default/js/app.js b/resources/beike/shop/default/js/app.js index 32b234a5..32602bc0 100644 --- a/resources/beike/shop/default/js/app.js +++ b/resources/beike/shop/default/js/app.js @@ -19,6 +19,8 @@ $(document).ready(function ($) { $http.delete(`/carts/${cartId}`).then((res) => { $this.parents('.product-list').remove() + $('.offcanvas-right-cart-count').html(res.data.quantity); + $('.offcanvas-right-cart-amount').html(res.data.amount_format); }) }) @@ -87,7 +89,7 @@ bk.getCarts = function () { 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); + $('.offcanvas-right-cart-count').html(res.data.quantity); let html = ''; res.data.carts.forEach(e => { @@ -96,7 +98,7 @@ bk.getCarts = function () { html += '
'; html += `
${e.name}
`; html += '
'; - html += `
${e.price_format}
`; + html += `
${e.price_format} x ${e.quantity}
`; html += ` 删除`; html += '
'; html += '
';