From fe7ddf826eb2052d7a501594278bcb16f2fe18ce Mon Sep 17 00:00:00 2001 From: Tieptk Date: Tue, 7 May 2024 15:42:55 +0700 Subject: [PATCH] loading --- assets/script/main.js | 50 ++++++- assets/script/pc_style.css | 42 +++--- assets/script/pc_style.scss | 40 ++--- template/javascript/global.html | 66 +++++++-- template/order/detail.html | 253 +++++++++++++++++++------------- template/order/home.html | 6 +- template/product/home.html | 18 ++- template/theme.html | 17 ++- 8 files changed, 327 insertions(+), 165 deletions(-) diff --git a/assets/script/main.js b/assets/script/main.js index b425752..51a8afb 100644 --- a/assets/script/main.js +++ b/assets/script/main.js @@ -1,6 +1,23 @@ "use strict"; var AdminFunction = (function () { + + + function capNhatTrangThaiMenu(hideMenuBig) { + + if (hideMenuBig === false) { + $('#js-admin-content-container').addClass('show-large-menu') + } else { + $('#js-admin-content-container').removeClass('show-large-menu') + } + + $('#js-menu-big').toggleClass('hidden', hideMenuBig); + $('#js-menu-small').toggleClass('hidden', !hideMenuBig); + $('#js-form-search').toggleClass('menu-hide', hideMenuBig); + localStorage.setItem(hideMenuBig ? 'menu_big' : 'menu_small', 'hidden'); + localStorage.removeItem(hideMenuBig ? 'menu_small' : 'menu_big'); + } + function add_product_to_category(id) { $('#status_' + id).html('Đang xử lý..'); setTimeout(function () { @@ -8,8 +25,39 @@ var AdminFunction = (function () { }, 1000) } + function run_search(holder) { + + $(holder).keyup(debounce(function () { + var inputString = $(this).val(); + $('#js-show-search').show() + }, 300)); + + $('body').click(function () { + $("#js-show-search").hide(); + }); + + + } + + + function update_product_hot(id) { + $('#js-status-hottype-' + id).html('Đang xử lý..'); + setTimeout(function () { + $('#js-status-hottype-' + id).html(''); + }, 1000) + } + + + function searchSelect(holder) { + $(holder).select2(); + } + return { - add_product_to_category: add_product_to_category + capNhatTrangThaiMenu: capNhatTrangThaiMenu, + add_product_to_category: add_product_to_category, + run_search: run_search, + searchSelect: searchSelect, + update_product_hot: update_product_hot } })(); diff --git a/assets/script/pc_style.css b/assets/script/pc_style.css index 92d020c..f18c3a7 100644 --- a/assets/script/pc_style.css +++ b/assets/script/pc_style.css @@ -911,28 +911,27 @@ input[type=radio]:focus:before { vertical-align: inherit; } +#js-form-search [type=search]:focus::before { + position: absolute; + content: "\f00d"; + font-family: "Font Awesome 6 Free"; + font-weight: 900; + left: 0; + top: 0; +} + +.autocomplete-suggestions { + height: 334px; + overflow-y: auto; + z-index: 999; +} .autocomplete-suggestions .item { - padding: 12px 0; + padding: 10px 15px; border-bottom: 1px solid #ededed; } -.autocomplete-suggestions .item .info { - width: calc(100% - 108px); - margin-right: 48px; -} -.autocomplete-suggestions .item img { - width: 60px; - display: block; -} -.autocomplete-suggestions .item .name { - font-weight: 600; - line-height: 20px; -} -.autocomplete-suggestions .item .price { - font-weight: 600; - color: #fb4e4e; - line-height: 20px; - display: block; - margin-top: 5px; +.autocomplete-suggestions .item:hover { + font-weight: 700; + background: #f6f6f6; } .table-list-customer th { @@ -1268,4 +1267,9 @@ input[type=radio]:focus:before { } .list-category .style-checkbox { color: #919699; +} + +.order-detail-page .select2-container { + width: 100% !important; + margin-top: 10px; }/*# sourceMappingURL=pc_style.css.map */ \ No newline at end of file diff --git a/assets/script/pc_style.scss b/assets/script/pc_style.scss index ebd747c..5741c6a 100644 --- a/assets/script/pc_style.scss +++ b/assets/script/pc_style.scss @@ -941,28 +941,25 @@ input[type="radio"] { } } +#js-form-search [type="search"]:focus::before { + position: absolute; + content: "\f00d"; + font-family: "Font Awesome 6 Free"; + font-weight: 900; + left: 0; + top: 0; +} + .autocomplete-suggestions { + height: 334px; + overflow-y: auto; + z-index: 999; .item { - padding: 12px 0; + padding: 10px 15px; border-bottom: 1px solid #ededed; - .info { - width: calc(100% - 108px); - margin-right: 48px; - } - img { - width: 60px; - display: block; - } - .name { - font-weight: 600; - line-height: 20px; - } - .price { - font-weight: 600; - color: #fb4e4e; - line-height: 20px; - display: block; - margin-top: 5px; + &:hover { + font-weight: 700; + background: #f6f6f6; } } } @@ -1314,3 +1311,8 @@ input[type="radio"] { color: #919699; } } + +.order-detail-page .select2-container { + width: 100% !important; + margin-top: 10px; +} diff --git a/template/javascript/global.html b/template/javascript/global.html index 848f824..cd0d22e 100644 --- a/template/javascript/global.html +++ b/template/javascript/global.html @@ -5,35 +5,71 @@ // Sự kiện click để hiển thị menu $('#js-show-menu').click(function () { - capNhatTrangThaiMenu(false); + AdminFunction.capNhatTrangThaiMenu(false); }); // Sự kiện click để ẩn menu $('#js-hide-menu').click(function () { - capNhatTrangThaiMenu(true); + AdminFunction.capNhatTrangThaiMenu(true); }); // Kiểm tra localStorage và thiết lập trạng thái ban đầu của menu const hideMenuBig = localStorage.getItem('menu_big') === 'hidden'; - capNhatTrangThaiMenu(hideMenuBig); + AdminFunction.capNhatTrangThaiMenu(hideMenuBig); + + AdminFunction.run_search('#js-input-search') + + AdminFunction.searchSelect('#js-assign-admin'); + + AdminFunction.searchSelect('#js-order-status-select'); + }) - // Hàm để cập nhật trạng thái hiển thị menu và localStorage - function capNhatTrangThaiMenu(hideMenuBig) { - if (hideMenuBig === false) { - $('#js-admin-content-container').addClass('show-large-menu') - } else { - $('#js-admin-content-container').removeClass('show-large-menu') - } + function debounce(func, wait, immediate) { + var timeout; + return function () { + var context = this, args = arguments; + var later = function () { + timeout = null; + if (!immediate) func.apply(context, args); + }; + var callNow = immediate && !timeout; + clearTimeout(timeout); + timeout = setTimeout(later, wait); + if (callNow) func.apply(context, args); + }; + }; - $('#js-menu-big').toggleClass('hidden', hideMenuBig); - $('#js-menu-small').toggleClass('hidden', !hideMenuBig); - $('#js-form-search').toggleClass('menu-hide', hideMenuBig); - localStorage.setItem(hideMenuBig ? 'menu_big' : 'menu_small', 'hidden'); - localStorage.removeItem(hideMenuBig ? 'menu_small' : 'menu_big'); + function getTextAreaSelection(textarea) { + var start = textarea.selectionStart, end = textarea.selectionEnd; + return { + start: start, + end: end, + length: end - start, + text: textarea.value.slice(start, end) + }; } + function detectPaste(textarea, callback) { + textarea.onpaste = function () { + var sel = getTextAreaSelection(textarea); + var initialLength = textarea.value.length; + window.setTimeout(function () { + var val = textarea.value; + var pastedTextLength = val.length - (initialLength - sel.length); + var end = sel.start + pastedTextLength; + callback({ + start: sel.start, + end: end, + length: pastedTextLength, + text: val.slice(sel.start, end) + }); + }, 1); + }; + } + // end search + function formatCurrency(a) { var b = parseFloat(a).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1.").toString(); diff --git a/template/order/detail.html b/template/order/detail.html index fcc38b0..db062ed 100644 --- a/template/order/detail.html +++ b/template/order/detail.html @@ -4,14 +4,25 @@
-
- - -
-
-

Đơn hàng #000-368

-

Thời gian: 16-11-2023, 9:59 am

+
+ +
+ Đơn hàng #000-368 + +
+

Thời gian: 16-11-2023, 9:59 am

@@ -40,7 +51,8 @@ Địa chỉ nhận hàng Kiến Hưng, Quận Hà Đông, Hà Nội - + @@ -48,7 +60,8 @@ Địa chỉ thanh toán Kiến Hưng, Quận Hà Đông, Hà Nội - + @@ -77,8 +90,9 @@ 1 HH0003 - - HHWS - CORE i9 9900X | 32G | NVIDIA RTX 2060 6GB + + HHWS - CORE i9 9900X | 32G | + NVIDIA RTX 2060 6GB 34.800.000 VND (chiếc) 2 @@ -105,17 +119,21 @@ Phí vận chuyển & giao hàng - + 0 VND - + Phí thu hộ - + 0 VND - + @@ -151,7 +169,7 @@ test Đức lúc 22-05-2023, 4:49 pm - + Hiện tại chưa có trạng thái nào được cập nhật @@ -163,15 +181,21 @@
-
+

Nhân sự xử lý đơn hàng

Uyên Hura - +

-

- Trạng thái đơn hàng - +

+ Trạng thái đơn hàng +

- +

Ghi chú

- - + +
+ class="bg-[#0041E8] cursor-pointer font-[500] h-[32px] p-[0_15px] rounded-[4px] text-[#fff]">
@@ -301,57 +336,65 @@ Họ tên - + - - + + Mobile - + - + Tỉnh/thành - + - + Quận huyện - + - + Phường/xã - + - + Địa chỉ - + - + Ghi chú - + - + - - + + @@ -361,74 +404,83 @@ @@ -441,23 +493,26 @@ Phí ship - + VND - + Chi chú - + v.d. Gửi xe khách, Máy bay, EMS - + - + diff --git a/template/order/home.html b/template/order/home.html index c9498b3..ba7ef61 100644 --- a/template/order/home.html +++ b/template/order/home.html @@ -83,11 +83,11 @@ STT - Mã số - Thời gian + Mã số + Thời gian Khách hàng Tỉnh/TP - Giá trị + Giá trị + + +
diff --git a/template/theme.html b/template/theme.html index e3582e0..34f8380 100644 --- a/template/theme.html +++ b/template/theme.html @@ -235,9 +235,18 @@ placeholder="Tìm kiếm">
- @@ -290,12 +299,14 @@
- {% include javascript/index %} + + {% include javascript/index %} + \ No newline at end of file