{"id":127,"date":"2026-03-09T17:28:55","date_gmt":"2026-03-09T09:28:55","guid":{"rendered":"https:\/\/blog.ichenfu.cn\/?p=127"},"modified":"2026-03-09T18:07:33","modified_gmt":"2026-03-09T10:07:33","slug":"epic","status":"publish","type":"post","link":"https:\/\/blog.ichenfu.cn\/index.php\/2026\/03\/09\/epic\/","title":{"rendered":"Epic\u6e38\u620f\u5927\u653e\u9001:Epic\u6bcf\u5468\u9650\u514d\u6e38\u620f\u53ca\u6253\u6298\u6e38\u620f"},"content":{"rendered":"\n<!DOCTYPE html>\n<html lang=\"zh-CN\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>Epic\u6e38\u620f\u5927\u653e\u9001<\/title>\n    <style>\n        .game-list {\n            display: grid;\n            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));\n            gap: 25px;\n            padding: 20px 40px;\n            max-width: 1400px;\n            margin: 0 auto;\n        }\n        .game-card {\n            background: rgba(255,255,255,0.1);\n            border-radius: 12px;\n            padding: 15px;\n            text-align: center;\n            transition: transform 0.3s, box-shadow 0.3s;\n            backdrop-filter: blur(10px);\n        }\n        .game-card:hover {\n            transform: translateY(-5px);\n            box-shadow: 0 10px 30px rgba(0,0,0,0.3);\n        }\n        .game-card img {\n            width: 100%;\n            height: 350px;\n            object-fit: cover;\n            border-radius: 8px;\n        }\n        .game-title {\n            font-size: 1.2rem;\n            margin: 15px 0 10px;\n            font-weight: bold;\n        }\n        .game-seller {\n            color: #aaa;\n            font-size: 0.9rem;\n            margin-bottom: 10px;\n        }\n        .original-price {\n            color: #999;\n            text-decoration: line-through;\n            margin: 8px 0;\n        }\n        .current-price {\n            color: #f39c12;\n            font-weight: bold;\n            font-size: 1.1rem;\n            margin: 8px 0;\n        }\n        .free-tag {\n            background: #27ae60;\n            color: #fff;\n            padding: 5px 15px;\n            border-radius: 20px;\n            display: inline-block;\n            margin: 8px 0;\n            font-weight: bold;\n        }\n        .sale-tag {\n            background: #e74c3c;\n            color: #fff;\n            padding: 5px 15px;\n            border-radius: 20px;\n            display: inline-block;\n            margin: 8px 0;\n            font-weight: bold;\n        }\n        .countdown {\n            color: #e74c3c;\n            font-weight: bold;\n            margin: 10px 0;\n            font-size: 0.95rem;\n        }\n        .countdown.expired {\n            color: #999;\n        }\n        .game-description {\n            color: #ccc;\n            font-size: 0.85rem;\n            margin: 10px 0;\n            line-height: 1.6;\n            text-align: left;\n            word-break: break-all;\n        }\n        .get-game-btn {\n            display: inline-block;\n            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n            color: #fff;\n            padding: 10px 25px;\n            border-radius: 25px;\n            text-decoration: none;\n            margin-top: 10px;\n            transition: opacity 0.3s;\n        }\n        .get-game-btn:hover {\n            opacity: 0.9;\n        }\n        .get-game-btn.disabled {\n            background: #666;\n            pointer-events: none;\n        }\n        .loading {\n            text-align: center;\n            padding: 50px;\n            font-size: 1.2rem;\n        }\n        .error {\n            text-align: center;\n            padding: 50px;\n            color: #e74c3c;\n        }\n        .price-section {\n            margin: 10px 0;\n        }\n    <\/style>\n<\/head>\n<body>\n    <div id=\"game-list\" class=\"game-list\">\n        <div class=\"loading\">\u6b63\u5728\u52a0\u8f7d\u6e38\u620f...<\/div>\n    <\/div>\n    \n    <script>\n        \/\/ API \u5730\u5740\n        const API_URL = 'https:\/\/uapis.cn\/api\/v1\/game\/epic-free';\n        \n        \/\/ \u5b58\u50a8\u6e38\u620f\u6570\u636e\u4f9b\u5012\u8ba1\u65f6\u66f4\u65b0\u4f7f\u7528\n        let gamesData = [];\n        \n        \/\/ \u83b7\u53d6 Epic \u514d\u8d39\u6e38\u620f\u5217\u8868\n        async function getEpicFreeGames() {\n            try {\n                const response = await fetch(API_URL, {\n                    method: 'GET',\n                    headers: {\n                        'Content-Type': 'application\/json'\n                    }\n                });\n                \n                if (!response.ok) {\n                    throw new Error(`HTTP \u9519\u8bef\uff1a${response.status}`);\n                }\n                \n                const data = await response.json();\n                return data.data || [];\n            } catch (error) {\n                console.error('\u83b7\u53d6\u514d\u8d39\u6e38\u620f\u5931\u8d25:', error);\n                throw error;\n            }\n        }\n        \n        \/\/ \u8ba1\u7b97\u5269\u4f59\u65f6\u95f4\n        function calculateCountdown(endTimestamp) {\n            const now = Date.now();\n            const end = endTimestamp;\n            const diff = end - now;\n            \n            if (diff <= 0) {\n                return { text: '\u5df2\u7ed3\u675f', expired: true };\n            }\n            \n            const days = Math.floor(diff \/ (1000 * 60 * 60 * 24));\n            const hours = Math.floor((diff % (1000 * 60 * 60 * 24)) \/ (1000 * 60 * 60));\n            const minutes = Math.floor((diff % (1000 * 60 * 60)) \/ (1000 * 60));\n            const seconds = Math.floor((diff % (1000 * 60)) \/ 1000);\n            \n            return { \n                text: `${days}\u5929 ${hours}\u65f6 ${minutes}\u5206 ${seconds}\u79d2`, \n                expired: false \n            };\n        }\n        \n        \/\/ \u6e32\u67d3\u6e38\u620f\u5217\u8868\u5230\u9875\u9762\n        function renderGames(games) {\n            const container = document.getElementById('game-list');\n            gamesData = games;\n            \n            if (!games || games.length === 0) {\n                container.innerHTML = '<div class=\"error\">\u6682\u65e0\u514d\u8d39\u6e38\u620f<\/div>';\n                return;\n            }\n            \n            container.innerHTML = '';\n            \n            games.forEach((game, index) => {\n                const countdownResult = calculateCountdown(game.free_end_at);\n                const isFree = game.is_free_now;\n                \n                const gameCard = document.createElement('div');\n                gameCard.className = 'game-card';\n                gameCard.dataset.index = index;\n                gameCard.innerHTML = `\n                    <img decoding=\"async\" src=\"${game.cover}\" alt=\"${game.title}\" onerror=\"this.src='https:\/\/via.placeholder.com\/280x350?text=No+Image'\">\n                    <h3 class=\"game-title\">${game.title}<\/h3>\n                    <p class=\"game-seller\">${game.seller}<\/p>\n                    <div class=\"price-section\">\n                        <p class=\"original-price\">\u539f\u4ef7\uff1a${game.original_price_desc}<\/p>\n                        ${!isFree ? `<p class=\"current-price\">\ud83d\udcb0 \u73b0\u4ef7\uff1a${game.original_price_desc}<\/p>` : ''}\n                    <\/div>\n                    ${isFree \n                        ? '<span class=\"free-tag\">\ud83c\udd93 \u514d\u8d39\u9886\u53d6<\/span>'\n                        : '<span class=\"sale-tag\">\ud83d\uded2 \u6b63\u5e38\u9500\u552e<\/span>'\n                    }\n                    <p class=\"countdown ${countdownResult.expired ? 'expired' : ''}\" data-end=\"${game.free_end_at}\">\n                        \u23f0 \u5269\u4f59\uff1a${countdownResult.text}\n                    <\/p>\n                    <p class=\"game-description\">${game.description}<\/p>\n                    <a href=\"${game.link}\" target=\"_blank\" \n                       class=\"get-game-btn ${countdownResult.expired ? 'disabled' : ''}\" rel=\"nofollow\" >\n                        ${isFree \n                            ? (countdownResult.expired ? '\u5df2\u8fc7\u671f' : '\u7acb\u5373\u9886\u53d6') \n                            : '\u7acb\u5373\u8d2d\u4e70'\n                        }\n                    <\/a>\n                `;\n                container.appendChild(gameCard);\n            });\n        }\n        \n        \/\/ \u5b9e\u65f6\u66f4\u65b0\u6240\u6709\u5012\u8ba1\u65f6\uff08\u6bcf\u79d2\u6267\u884c\uff09\n        function updateCountdowns() {\n            const countdownElements = document.querySelectorAll('.countdown');\n            const btnElements = document.querySelectorAll('.get-game-btn');\n            \n            countdownElements.forEach((el, index) => {\n                const endTimestamp = parseInt(el.dataset.end);\n                const game = gamesData[index];\n                const result = calculateCountdown(endTimestamp);\n                const isFree = game?.is_free_now;\n                \n                el.textContent = `\u23f0 \u5269\u4f59\uff1a${result.text}`;\n                \n                if (result.expired) {\n                    el.classList.add('expired');\n                    if (btnElements[index]) {\n                        btnElements[index].classList.add('disabled');\n                        btnElements[index].textContent = isFree ? '\u5df2\u8fc7\u671f' : '\u5df2\u4e0b\u67b6';\n                    }\n                }\n            });\n        }\n        \n        \/\/ \u9875\u9762\u52a0\u8f7d\u65f6\u83b7\u53d6\u6e38\u620f\u6570\u636e\n        document.addEventListener('DOMContentLoaded', async () => {\n            try {\n                const games = await getEpicFreeGames();\n                renderGames(games);\n                \n                \/\/ \u6bcf\u79d2\u66f4\u65b0\u4e00\u6b21\u5012\u8ba1\u65f6\uff0c\u5b9e\u73b0\u5b9e\u65f6\u52a8\u6001\u6548\u679c\n                setInterval(updateCountdowns, 1000);\n            } catch (error) {\n                document.getElementById('game-list').innerHTML = \n                    '<div class=\"error\">\u52a0\u8f7d\u5931\u8d25\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5<br>' + error.message + '<\/div>';\n            }\n        });\n    <\/script>\n<\/body>\n<\/html>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u8fd9\u91cc\u53ef\u4ee5\u770b\u5230Epic\u6e38\u620f\u5927\u653e\u9001:Epic\u6bcf\u5468\u9650\u514d\u6e38\u620f\u53ca\u6253\u6298\u6e38\u620f<\/p>\n<\/blockquote>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"Epic\u6e38\u620f\u5927\u653e\u9001\uff01\u6bcf\u5468\u9650\u514d\u4e0e\u8d85\u503c\u6298\u6263\uff0c\u6d77\u91cf\u6e38\u620f\u7b49\u4f60\u6765\u9886\u3002\u522b\u518d\u72b9\u8c6b\uff0c\u7acb\u5373\u67e5\u770b\u6700\u65b0\u514d\u8d39\u6e38\u620f\u53ca\u7279\u60e0\u4fe1\u606f\uff0c\u5f00\u542f\u4f60\u7684\u6e38\u620f\u72c2\u6b22\uff01","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[11],"tags":[],"class_list":["post-127","post","type-post","status-publish","format-standard","hentry","category-11"],"_links":{"self":[{"href":"https:\/\/blog.ichenfu.cn\/index.php\/wp-json\/wp\/v2\/posts\/127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ichenfu.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ichenfu.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ichenfu.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ichenfu.cn\/index.php\/wp-json\/wp\/v2\/comments?post=127"}],"version-history":[{"count":10,"href":"https:\/\/blog.ichenfu.cn\/index.php\/wp-json\/wp\/v2\/posts\/127\/revisions"}],"predecessor-version":[{"id":139,"href":"https:\/\/blog.ichenfu.cn\/index.php\/wp-json\/wp\/v2\/posts\/127\/revisions\/139"}],"wp:attachment":[{"href":"https:\/\/blog.ichenfu.cn\/index.php\/wp-json\/wp\/v2\/media?parent=127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ichenfu.cn\/index.php\/wp-json\/wp\/v2\/categories?post=127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ichenfu.cn\/index.php\/wp-json\/wp\/v2\/tags?post=127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}