{"id":146,"date":"2026-08-25T06:43:01","date_gmt":"2026-08-25T06:43:01","guid":{"rendered":"https:\/\/ledscreencard.szlogic.cn\/index.php\/cart\/"},"modified":"2026-10-12T09:36:46","modified_gmt":"2026-10-12T09:36:46","slug":"cart","status":"publish","type":"page","link":"https:\/\/ledscreencard.szlogic.cn\/ar\/cart\/","title":{"rendered":"Cart"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"146\" class=\"elementor elementor-146\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"elementor-element elementor-element-55b2d820 e-con-full e-flex e-con e-parent\" data-id=\"55b2d820\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t<div class=\"elementor-element elementor-element-d0b3c79 e-con-full e-flex e-con e-child\" data-id=\"d0b3c79\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-28b9e76 elementor-widget elementor-widget-shortcode\" data-id=\"28b9e76\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"shortcode.default\">\n\t\t\t\t\t\t\t<div class=\"elementor-shortcode\"><p>\u8d2d\u7269\u8f66\u5bf9\u8c61\u4e0d\u5b58\u5728<\/p><\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d23441d elementor-widget elementor-widget-html\" data-id=\"d23441d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t\t<script>\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n\n    const shippingBox = document.querySelector(\n        \".led-shipping-calculator\"\n    );\n\n    if (!shippingBox) return;\n\n    const button = shippingBox.querySelector(\n        \".shipping-calculator-button\"\n    );\n\n    const form = shippingBox.querySelector(\n        \".shipping-calculator-form\"\n    );\n\n    if (!button || !form) return;\n\n    \/\/ \u70b9\u51fb Change address\n    button.addEventListener(\"click\", function (e) {\n\n        e.preventDefault();\n        e.stopPropagation();\n\n        \/\/ \u9690\u85cf\u6309\u94ae\n        button.style.setProperty(\n            \"display\",\n            \"none\",\n            \"important\"\n        );\n\n        \/\/ \u663e\u793a\u8868\u5355\n        form.style.setProperty(\n            \"display\",\n            \"flex\",\n            \"important\"\n        );\n\n    });\n\n    \/\/ \u70b9\u51fb\u8868\u5355\u5185\u90e8\u65f6\uff0c\u4e0d\u5173\u95ed\n    form.addEventListener(\"click\", function (e) {\n        e.stopPropagation();\n    });\n\n});\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-1d982af elementor-widget elementor-widget-html\" data-id=\"1d982af\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t\t<script>\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n\n    let isUpdating = false;\n\n    \/\/ \u52a0\u51cf\u6309\u94ae\n    document.addEventListener(\"click\", function (event) {\n\n        const button = event.target.closest(\n            \".cart-quantity-minus, .cart-quantity-plus\"\n        );\n\n        if (!button) return;\n\n        event.preventDefault();\n\n        const quantityBox = button.closest(\".cart-quantity-box\");\n        if (!quantityBox) return;\n\n        const input = quantityBox.querySelector(\".cart-quantity-input\");\n        if (!input) return;\n\n        let quantity = parseInt(input.value, 10) || 1;\n\n        const min = parseInt(input.min, 10) || 1;\n        const max = input.max ? parseInt(input.max, 10) : null;\n\n        if (button.classList.contains(\"cart-quantity-minus\")) {\n            quantity--;\n        }\n\n        if (button.classList.contains(\"cart-quantity-plus\")) {\n            quantity++;\n        }\n\n        quantity = Math.max(quantity, min);\n\n        if (max !== null && max > 0) {\n            quantity = Math.min(quantity, max);\n        }\n\n        input.value = quantity;\n\n        \/\/ \u540c\u6b65\u540c\u4e00\u4e2a\u5546\u54c1\u7684\u53e6\u4e00\u5957\u6570\u91cf\u8f93\u5165\u6846\n        const name = input.getAttribute(\"name\");\n\n        if (name) {\n            document.querySelectorAll(\n                '.cart-quantity-input[name=\"' +\n                CSS.escape(name) +\n                '\"]'\n            ).forEach(function (otherInput) {\n                otherInput.value = quantity;\n            });\n        }\n\n        \/\/ \u89e6\u53d1 change \u4e8b\u4ef6\n        input.dispatchEvent(new Event(\"change\", {\n            bubbles: true\n        }));\n\n        \/\/ \u83b7\u53d6\u5f53\u524d\u5546\u54c1\u6240\u5728\u7684\u8868\u5355\n        const form = input.closest(\"form\");\n\n        if (!form) {\n            console.error(\"\u6ca1\u6709\u627e\u5230\u8d2d\u7269\u8f66\u8868\u5355 form\");\n            return;\n        }\n\n        const updateButton = form.querySelector(\n            'button[name=\"update_cart\"]'\n        );\n\n        if (!updateButton) {\n            console.error(\"\u6ca1\u6709\u627e\u5230 update_cart \u6309\u94ae\");\n            return;\n        }\n\n        \/\/ \u9632\u6b62\u8fde\u7eed\u91cd\u590d\u63d0\u4ea4\n        if (isUpdating) return;\n\n        isUpdating = true;\n\n        \/\/ \u5ef6\u8fdf\u63d0\u4ea4\uff0c\u907f\u514d\u8fde\u7eed\u70b9\u51fb\u65f6\u9891\u7e41\u8bf7\u6c42\n        clearTimeout(window.cartUpdateTimer);\n\n        window.cartUpdateTimer = setTimeout(function () {\n\n            \/\/ \u5173\u952e\uff1a\u4f7f\u7528 requestSubmit\uff0c\u800c\u4e0d\u662f click\n            if (typeof form.requestSubmit === \"function\") {\n                form.requestSubmit(updateButton);\n            } else {\n                updateButton.removeAttribute(\"hidden\");\n                updateButton.click();\n            }\n\n        }, 300);\n\n    });\n\n    \/\/ \u624b\u52a8\u4fee\u6539\u6570\u91cf\u8f93\u5165\u6846\u540e\u81ea\u52a8\u63d0\u4ea4\n    document.addEventListener(\"change\", function (event) {\n\n        const input = event.target.closest(\".cart-quantity-input\");\n\n        if (!input) return;\n\n        const form = input.closest(\"form\");\n        if (!form) return;\n\n        const updateButton = form.querySelector(\n            'button[name=\"update_cart\"]'\n        );\n\n        if (!updateButton || isUpdating) return;\n\n        let quantity = parseInt(input.value, 10) || 1;\n\n        const min = parseInt(input.min, 10) || 1;\n        const max = input.max ? parseInt(input.max, 10) : null;\n\n        quantity = Math.max(quantity, min);\n\n        if (max !== null && max > 0) {\n            quantity = Math.min(quantity, max);\n        }\n\n        input.value = quantity;\n\n        isUpdating = true;\n\n        setTimeout(function () {\n\n            if (typeof form.requestSubmit === \"function\") {\n                form.requestSubmit(updateButton);\n            } else {\n                updateButton.removeAttribute(\"hidden\");\n                updateButton.click();\n            }\n\n        }, 300);\n\n    });\n\n});\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3d624cd elementor-widget elementor-widget-html\" data-id=\"3d624cd\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t\t<script>\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n    const shippingBox = document.querySelector(\n        \".led-shipping-calculator\"\n    );\n\n    if (!shippingBox) return;\n\n    const placeholders = {\n        \"#calc_shipping_state\": \"State \/ Province\",\n        \"#calc_shipping_city\": \"Enter your city\",\n        \"#calc_shipping_postcode\": \"Enter your postcode\"\n    };\n\n    Object.entries(placeholders).forEach(function ([selector, text]) {\n        const input = shippingBox.querySelector(selector);\n\n        if (input) {\n            input.setAttribute(\"placeholder\", text);\n        }\n    });\n});\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c257ca6 elementor-widget elementor-widget-html\" data-id=\"c257ca6\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t\t<script>\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n\n    const cards = document.querySelectorAll(\n        \".cart-product-info\"\n    );\n\n    const MAX_WIDTH = 68;\n    const TRIGGER_DISTANCE = 34;\n\n    let activeCard = null;\n\n    cards.forEach(function (card) {\n\n        const deleteBox = card.querySelector(\".delete-box\");\n\n        if (!deleteBox) return;\n\n        let startX = 0;\n        let startY = 0;\n        let startWidth = 0;\n\n        let currentWidth = 0;\n        let isDragging = false;\n        let isHorizontal = null;\n        let animationFrame = null;\n\n        function updateWidth(width) {\n\n            currentWidth = Math.max(\n                0,\n                Math.min(MAX_WIDTH, width)\n            );\n\n            if (animationFrame) {\n                cancelAnimationFrame(animationFrame);\n            }\n\n            animationFrame = requestAnimationFrame(() => {\n                deleteBox.style.width =\n                    currentWidth + \"px\";\n            });\n        }\n\n        function closeCard(targetCard) {\n\n            const targetBox =\n                targetCard.querySelector(\".delete-box\");\n\n            if (!targetBox) return;\n\n            targetCard.classList.remove(\n                \"delete-visible\"\n            );\n\n            targetBox.style.transition =\n                \"width 0.22s cubic-bezier(0.22, 1, 0.36, 1)\";\n\n            targetBox.style.width = \"0px\";\n\n        }\n\n        function closeOthers(currentCard) {\n\n            cards.forEach(function (otherCard) {\n\n                if (otherCard !== currentCard) {\n                    closeCard(otherCard);\n                }\n\n            });\n\n        }\n\n        function setOpen(open) {\n\n            if (open) {\n\n                closeOthers(card);\n\n                card.classList.add(\n                    \"delete-visible\"\n                );\n\n                deleteBox.style.width =\n                    MAX_WIDTH + \"px\";\n\n                currentWidth = MAX_WIDTH;\n\n                activeCard = card;\n\n            } else {\n\n                closeCard(card);\n\n                currentWidth = 0;\n\n                if (activeCard === card) {\n                    activeCard = null;\n                }\n\n            }\n\n        }\n\n        card.addEventListener(\"touchstart\", function (e) {\n\n            if (\n                e.target.closest(\"input\") ||\n                e.target.closest(\"button\") ||\n                e.target.closest(\"a\") ||\n                e.target.closest(\"select\") ||\n                e.target.closest(\".select2-container\")\n            ) {\n                isDragging = false;\n                return;\n            }\n\n            const touch = e.touches[0];\n\n            startX = touch.clientX;\n            startY = touch.clientY;\n\n            startWidth =\n                card.classList.contains(\"delete-visible\")\n                    ? MAX_WIDTH\n                    : 0;\n\n            currentWidth = startWidth;\n\n            isDragging = true;\n            isHorizontal = null;\n\n            \/\/ \u6ed1\u52a8\u5f53\u524d\u5361\u7247\u65f6\uff0c\u81ea\u52a8\u5173\u95ed\u5176\u4ed6\u5361\u7247\n            closeOthers(card);\n\n            deleteBox.style.transition = \"none\";\n\n        }, { passive: true });\n\n\n        card.addEventListener(\"touchmove\", function (e) {\n\n            if (!isDragging) return;\n\n            const touch = e.touches[0];\n\n            const deltaX = touch.clientX - startX;\n            const deltaY = touch.clientY - startY;\n\n            if (isHorizontal === null) {\n\n                if (\n                    Math.abs(deltaX) < 5 &&\n                    Math.abs(deltaY) < 5\n                ) {\n                    return;\n                }\n\n                isHorizontal =\n                    Math.abs(deltaX) > Math.abs(deltaY);\n\n            }\n\n            if (!isHorizontal) return;\n\n            e.preventDefault();\n\n            \/\/ \u4ee5\u89e6\u6478\u8d77\u70b9\u7684\u539f\u59cb\u5bbd\u5ea6\u4e3a\u57fa\u51c6\n            const newWidth = startWidth + deltaX;\n\n            updateWidth(newWidth);\n\n        }, { passive: false });\n\n\n        card.addEventListener(\"touchend\", function () {\n\n            if (!isDragging) return;\n\n            isDragging = false;\n\n            deleteBox.style.transition =\n                \"width 0.22s cubic-bezier(0.22, 1, 0.36, 1)\";\n\n            setOpen(\n                currentWidth >= TRIGGER_DISTANCE\n            );\n\n        });\n\n\n        card.addEventListener(\"touchcancel\", function () {\n\n            if (!isDragging) return;\n\n            isDragging = false;\n\n            deleteBox.style.transition =\n                \"width 0.22s cubic-bezier(0.22, 1, 0.36, 1)\";\n\n            setOpen(\n                currentWidth >= TRIGGER_DISTANCE\n            );\n\n        });\n\n    });\n\n});\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2ef3787 elementor-widget elementor-widget-html\" data-id=\"2ef3787\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t\t<script>\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n\n    const deleteModal = document.querySelector(\"#cartDeleteModal\");\n    const successModal = document.querySelector(\"#cartRemoveSuccessModal\");\n\n    const SUCCESS_KEY = \"cart_remove_success\";\n\n    let removeUrl = \"\";\n    let undoUrl = \"\";\n    let successTimer = null;\n\n    \/*\n     * ================================\n     * \u6210\u529f\u5f39\u7a97\n     * ================================\n     *\/\n\n    function showSuccessModal() {\n\n        if (!successModal) return;\n\n        if (successTimer) {\n            clearTimeout(successTimer);\n        }\n\n        successModal.classList.add(\"is-visible\");\n        document.body.style.overflow = \"hidden\";\n\n        successTimer = setTimeout(function () {\n            closeSuccessModal();\n        }, 5000);\n    }\n\n    function closeSuccessModal() {\n\n        if (!successModal) return;\n\n        successModal.classList.remove(\"is-visible\");\n        document.body.style.overflow = \"\";\n\n        if (successTimer) {\n            clearTimeout(successTimer);\n            successTimer = null;\n        }\n    }\n\n    \/*\n     * \u9875\u9762\u52a0\u8f7d\u540e\u8bfb\u53d6\u5220\u9664\u6210\u529f\u72b6\u6001\n     *\/\n\n    const savedData = sessionStorage.getItem(SUCCESS_KEY);\n\n    if (savedData && successModal) {\n\n        sessionStorage.removeItem(SUCCESS_KEY);\n\n        try {\n\n            const data = JSON.parse(savedData);\n\n            undoUrl = data.undoUrl || \"\";\n\n            showSuccessModal();\n\n        } catch (error) {\n\n            console.error(\"\u89e3\u6790\u5220\u9664\u6210\u529f\u6570\u636e\u5931\u8d25\uff1a\", error);\n\n        }\n    }\n\n    \/*\n     * ================================\n     * \u5220\u9664\u786e\u8ba4\u5f39\u7a97\n     * ================================\n     *\/\n\n    if (!deleteModal) return;\n\n    const cancelButton = deleteModal.querySelector(\n        \".cart-delete-cancel\"\n    );\n\n    const confirmButton = deleteModal.querySelector(\n        \".cart-delete-confirm\"\n    );\n\n    if (!cancelButton || !confirmButton) return;\n\n    \/*\n     * \u6253\u5f00\u5220\u9664\u786e\u8ba4\u5f39\u7a97\n     *\/\n\n    document.addEventListener(\"click\", function (e) {\n\n        const removeLink = e.target.closest(\n            \".cart-remove-product\"\n        );\n\n        if (!removeLink) return;\n\n        e.preventDefault();\n        e.stopPropagation();\n\n        removeUrl = removeLink.href;\n        undoUrl = removeLink.dataset.undoUrl || \"\";\n\n        deleteModal.classList.add(\"is-visible\");\n        document.body.style.overflow = \"hidden\";\n\n    });\n\n    \/*\n     * \u5173\u95ed\u5220\u9664\u786e\u8ba4\u5f39\u7a97\n     *\/\n\n    function closeDeleteModal() {\n\n        deleteModal.classList.remove(\"is-visible\");\n        document.body.style.overflow = \"\";\n\n        removeUrl = \"\";\n        undoUrl = \"\";\n    }\n\n    cancelButton.addEventListener(\"click\", function () {\n        closeDeleteModal();\n    });\n\n    \/*\n     * \u786e\u8ba4\u5220\u9664\n     *\/\n\n    confirmButton.addEventListener(\"click\", function () {\n\n        if (!removeUrl) return;\n\n        confirmButton.disabled = true;\n        confirmButton.textContent = \"Removing...\";\n\n        sessionStorage.setItem(\n            SUCCESS_KEY,\n            JSON.stringify({\n                undoUrl: undoUrl\n            })\n        );\n\n        window.location.href = removeUrl;\n\n    });\n\n    \/*\n     * \u70b9\u51fb\u5916\u90e8\u5173\u95ed\u5220\u9664\u5f39\u7a97\n     *\/\n\n    deleteModal.addEventListener(\"click\", function (e) {\n\n        if (e.target === deleteModal) {\n            closeDeleteModal();\n        }\n\n    });\n\n    \/*\n     * \u70b9\u51fb\u5916\u90e8\u5173\u95ed\u6210\u529f\u5f39\u7a97\n     *\/\n\n    if (successModal) {\n\n        successModal.addEventListener(\"click\", function (e) {\n\n            if (e.target === successModal) {\n                closeSuccessModal();\n            }\n\n        });\n\n        \/*\n         * Undo\n         *\/\n\n        const undoButton = successModal.querySelector(\n            \".cart-remove-undo\"\n        );\n\n        if (undoButton) {\n\n            undoButton.addEventListener(\"click\", function (e) {\n\n                e.preventDefault();\n\n                if (!undoUrl) return;\n\n                closeSuccessModal();\n\n                window.location.href = undoUrl;\n\n            });\n\n        }\n    }\n\n    \/*\n     * ESC \u5173\u95ed\u5f39\u7a97\n     *\/\n\n    document.addEventListener(\"keydown\", function (e) {\n\n        if (e.key !== \"Escape\") return;\n\n        if (\n            deleteModal &&\n            deleteModal.classList.contains(\"is-visible\")\n        ) {\n            closeDeleteModal();\n        }\n\n        if (\n            successModal &&\n            successModal.classList.contains(\"is-visible\")\n        ) {\n            closeSuccessModal();\n        }\n\n    });\n\n});\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-146","page","type-page","status-publish","hentry"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":7},"has_hero_section":"disabled"},"acf":[],"browser_title":"","page_description":"","_links":{"self":[{"href":"https:\/\/ledscreencard.szlogic.cn\/ar\/wp-json\/wp\/v2\/pages\/146","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ledscreencard.szlogic.cn\/ar\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ledscreencard.szlogic.cn\/ar\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ledscreencard.szlogic.cn\/ar\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ledscreencard.szlogic.cn\/ar\/wp-json\/wp\/v2\/comments?post=146"}],"version-history":[{"count":200,"href":"https:\/\/ledscreencard.szlogic.cn\/ar\/wp-json\/wp\/v2\/pages\/146\/revisions"}],"predecessor-version":[{"id":8722,"href":"https:\/\/ledscreencard.szlogic.cn\/ar\/wp-json\/wp\/v2\/pages\/146\/revisions\/8722"}],"wp:attachment":[{"href":"https:\/\/ledscreencard.szlogic.cn\/ar\/wp-json\/wp\/v2\/media?parent=146"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}