{"id":603,"date":"2025-11-06T08:03:00","date_gmt":"2025-11-06T00:03:00","guid":{"rendered":"https:\/\/www.explore2022.com\/?page_id=603"},"modified":"2025-11-10T08:20:10","modified_gmt":"2025-11-10T00:20:10","slug":"%e4%bf%a1%e6%81%af%e6%80%bb%e8%a7%88","status":"publish","type":"page","link":"https:\/\/www.explore2022.com\/?page_id=603","title":{"rendered":"\u4fe1\u606f\u603b\u89c8"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u52a0\u5bc6\u8d27\u5e01<\/h2>\n\n\n\n<div style=\"margin-bottom:10px;\">\n    <label for=\"symbolInput\">\u641c\u7d22\u5e01\u79cd\uff1a<\/label>\n    <input type=\"text\" id=\"symbolInput\" placeholder=\"\u8f93\u5165\u5e01\u79cd\uff0c\u5982 BTC\" style=\"padding:4px 6px; width:80px;\">\n    <button id=\"searchBtn\" style=\"padding:4px 6px;\">\u641c\u7d22<\/button>\n    <button id=\"resetBtn\" style=\"padding:4px 6px;\">\u6062\u590d\u9ed8\u8ba4<\/button>\n<\/div>\n\n<div id=\"okxTicker\" style=\"font-size:16px; font-weight:bold;\"><\/div>\n\n<div id=\"chartContainer\" style=\"margin-top:20px; display:none;\">\n    <div style=\"margin-bottom:10px;\">\n        <label for=\"intervalSelect\">\u65f6\u95f4\u5468\u671f\uff1a<\/label>\n        <select id=\"intervalSelect\" style=\"padding:4px 6px;\">\n            <option value=\"1m\">1\u5206\u949f<\/option>\n            <option value=\"5m\">5\u5206\u949f<\/option>\n            <option value=\"15m\" selected>15\u5206\u949f<\/option>\n            <option value=\"1H\">1\u5c0f\u65f6<\/option>\n            <option value=\"1D\">1\u5929<\/option>\n        <\/select>\n        <button id=\"reloadKline\" style=\"padding:4px 6px;\">\u5237\u65b0\u56fe\u8868<\/button>\n    <\/div>\n    <div id=\"klineStatus\" style=\"margin-bottom:5px; color:gray; font-size:14px;\">\u672a\u52a0\u8f7d<\/div>\n    <div id=\"klineChart\" style=\"width:100%;height:400px;\"><\/div>\n<\/div>\n\n<script src=\"https:\/\/cdn.jsdelivr.net\/npm\/echarts@5\/dist\/echarts.min.js\"><\/script>\n<script>\nconst proxyBase = 'https:\/\/x.202620260.xyz'; \/\/ \u66ff\u6362\u4e3a\u4f60\u7684\u57df\u540d\nlet defaultSymbols = ['BTC','SOL','DOGE','PYTH','ASTER'];\nlet lastPrice = {};\nlet currentSymbols = [...defaultSymbols];\nlet isSearchMode = false;\nlet currentSymbol = null;\n\n\/\/ \u683c\u5f0f\u5316\u4ef7\u683c\nfunction formatPrice(price){\n    if(!price) return '-';\n    return Number(price).toLocaleString('en-US', { maximumFractionDigits: 10 });\n}\n\n\/\/ \u6e32\u67d3\u884c\u60c5\u8868\u683c\uff08\u4ef7\u683c\u7eff\u6da8\u7ea2\u8dcc + 24\u5c0f\u65f6\u6da8\u5e45\uff09\nfunction displayTicker(data, symbols){\n    let html = `<table style=\"width:100%; border-collapse:collapse; text-align:left;\">\n        <thead>\n            <tr style=\"background:#f5f5f5;\">\n                <th style=\"padding:6px; border-bottom:1px solid #ccc;\">\u5e01\u79cd<\/th>\n                <th style=\"padding:6px; border-bottom:1px solid #ccc;\">\u4ef7\u683c<\/th>\n                <th style=\"padding:6px; border-bottom:1px solid #ccc;\">24\u5c0f\u65f6\u6da8\u5e45<\/th>\n            <\/tr>\n        <\/thead>\n        <tbody>`;\n\n    symbols.forEach(symbol => {\n        if(data[symbol] && data[symbol].price !== null){\n            const price = parseFloat(data[symbol].price);\n            const change24h = parseFloat(data[symbol].change24h) || 0;\n\n            let colorPrice = 'black';\n            if(lastPrice[symbol] !== undefined){\n                colorPrice = price > lastPrice[symbol] ? 'green' : (price < lastPrice[symbol] ? 'red' : 'black');\n            }\n            let colorChange = change24h > 0 ? 'green' : (change24h < 0 ? 'red' : 'black');\n\n            html += `<tr>\n                <td style=\"padding:6px; border-bottom:1px solid #eee;\">${symbol}<\/td>\n                <td style=\"padding:6px; border-bottom:1px solid #eee; color:${colorPrice}\">${formatPrice(price)}<\/td>\n                <td style=\"padding:6px; border-bottom:1px solid #eee; color:${colorChange}\">${change24h.toFixed(2)}%<\/td>\n            <\/tr>`;\n\n            lastPrice[symbol] = price;\n        } else {\n            html += `<tr>\n                <td style=\"padding:6px; border-bottom:1px solid #eee;\">${symbol}<\/td>\n                <td style=\"padding:6px; border-bottom:1px solid #eee;\" colspan=\"2\">\u672a\u83b7\u53d6\u5230\u884c\u60c5<\/td>\n            <\/tr>`;\n        }\n    });\n\n    html += `<\/tbody><\/table>`;\n    document.getElementById('okxTicker').innerHTML = html;\n}\n\n\/\/ \u83b7\u53d6\u9ed8\u8ba4\u884c\u60c5\nasync function loadDefaultPrices(){\n    try {\n        const res = await fetch(proxyBase);\n        const data = await res.json();\n        displayTicker(data, defaultSymbols);\n    } catch(e){\n        console.error(e);\n    }\n}\n\n\/\/ \u641c\u7d22\u5e01\u79cd\u884c\u60c5 + \u6536\u76d8\u4ef7\u6298\u7ebf\u56fe\uff0c\u9f20\u6807\u60ac\u505c\u663e\u793a OCHL\nasync function loadSearchPrice(symbol){\n    symbol = symbol.trim().toUpperCase();\n    if(!symbol) return;\n\n    try {\n        document.getElementById('chartContainer').style.display = 'block';\n        document.getElementById('klineStatus').innerText = '\u52a0\u8f7d\u4e2d...';\n\n        const interval = document.getElementById('intervalSelect').value;\n        const res = await fetch(`${proxyBase}\/kline\/${symbol}?interval=${interval}`);\n        const data = await res.json();\n\n        if(data.candles && data.candles.length > 0){\n            const dates = data.candles.map(item => item[0]);\n            const opens = data.candles.map(item => item[1]);\n            const highs = data.candles.map(item => item[2]);\n            const lows = data.candles.map(item => item[3]);\n            const closes = data.candles.map(item => item[4]);\n\n            \/\/ \u663e\u793a\u6700\u540e\u6536\u76d8\u4ef7 + 24\u5c0f\u65f6\u6da8\u5e45\n            const lastClose = closes[closes.length-1];\n            const change24h = ((lastClose - opens[0]) \/ opens[0]) * 100;\n            displayTicker({[symbol]: {price:lastClose, change24h}}, [symbol]);\n\n            const chartDom = document.getElementById('klineChart');\n            const chart = echarts.init(chartDom);\n\n            const option = {\n                backgroundColor: '#fff',\n                title: { text: `${symbol}\u8d70\u52bf`, left: 'center' },\n                tooltip: {\n                    trigger: 'axis',\n                    formatter: function(params) {\n                        const i = params[0].dataIndex;\n                        return `\n                            \u65f6\u95f4: ${dates[i]}<br\/>\n                            \u5f00\u76d8: ${opens[i]}<br\/>\n                            \u6536\u76d8: ${closes[i]}<br\/>\n                            \u6700\u9ad8: ${highs[i]}<br\/>\n                            \u6700\u4f4e: ${lows[i]}\n                        `;\n                    }\n                },\n                xAxis: { type: 'category', data: dates, boundaryGap: false },\n                yAxis: { scale: true },\n                series: [\n                    {\n                        name: '\u6536\u76d8\u4ef7',\n                        type: 'line',\n                        data: closes,\n                        smooth: true,\n                        lineStyle: { color: '#26a69a' }\n                    }\n                ]\n            };\n\n            chart.setOption(option);\n            document.getElementById('klineStatus').innerText = '\u52a0\u8f7d\u5b8c\u6210';\n        } else {\n            displayTicker({[symbol]: {price:null, change24h:0}}, [symbol]);\n            document.getElementById('klineStatus').innerText = '\u672a\u83b7\u53d6\u5230K\u7ebf\u6570\u636e';\n        }\n\n    } catch(e){\n        console.error(e);\n        displayTicker({[symbol]: {price:null, change24h:0}}, [symbol]);\n        document.getElementById('klineStatus').innerText = '\u52a0\u8f7d\u5931\u8d25';\n    }\n}\n\n\/\/ \u641c\u7d22\u6309\u94ae\ndocument.getElementById('searchBtn').addEventListener('click', () => {\n    const symbol = document.getElementById('symbolInput').value;\n    if(symbol){\n        isSearchMode = true;\n        currentSymbol = symbol.trim().toUpperCase();\n        currentSymbols = [currentSymbol];\n        loadSearchPrice(currentSymbol);\n    }\n});\n\n\/\/ \u56de\u8f66\u641c\u7d22\ndocument.getElementById('symbolInput').addEventListener('keypress', e => {\n    if(e.key === 'Enter'){\n        const symbol = e.target.value;\n        if(symbol){\n            isSearchMode = true;\n            currentSymbol = symbol.trim().toUpperCase();\n            currentSymbols = [currentSymbol];\n            loadSearchPrice(currentSymbol);\n        }\n    }\n});\n\n\/\/ \u6062\u590d\u9ed8\u8ba4\ndocument.getElementById('resetBtn').addEventListener('click', () => {\n    isSearchMode = false;\n    currentSymbols = [...defaultSymbols];\n    currentSymbol = null;\n    document.getElementById('chartContainer').style.display = 'none';\n    loadDefaultPrices();\n});\n\n\/\/ K\u7ebf\u5468\u671f\u5207\u6362\ndocument.getElementById('reloadKline').addEventListener('click', () => {\n    if(currentSymbol){\n        loadSearchPrice(currentSymbol);\n    }\n});\n\n\/\/ \u81ea\u52a8\u5237\u65b0\u884c\u60c5\nasync function refreshPrices(){\n    if(isSearchMode && currentSymbol){\n        await loadSearchPrice(currentSymbol);\n    } else {\n        await loadDefaultPrices();\n    }\n    setTimeout(refreshPrices, 3000);\n}\n\n\/\/ \u521d\u59cb\u5316\nrefreshPrices();\n<\/script>\n\n\n\n<h2 class=\"wp-block-heading\"><\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">\u770b\u677f\u6570\u636e<\/h2>\n\n\n\n<div id=\"quotesWidgetTicker\"><\/div>\n<div class=\"qw-copyright\"><a href=\"https:\/\/www.mql5.com\/?utm_source=quotes.widget&utm_medium=link&utm_term=quotes.ticker&utm_content=visit.mql5.quotes&utm_campaign=quotes.ticker.widget\" rel=\"noopener nofollow\" target=\"_blank\" rel=\"nofollow\" ><\/a><\/div>\n<script async type=\"text\/javascript\" data-type=\"quotes-widget\" src=\"https:\/\/c.mql5.com\/js\/widgets\/quotes\/widget.js?v=3\">\n   {\"type\":\"ticker\",\"filter\":[\"BTCUSD\",\"SOLUSD\",\"DOGUSD\",\"XAUUSD\",\"USDCNH\"],\"width\":\"100%\",\"height\":50,\"id\":\"quotesWidgetTicker\",\"fw\":\"html\"}\n<\/script>\n\n\n\n<div id=\"quotesWidgetOverview\"><\/div>\n<div class=\"qw-copyright\"><a href=\"https:\/\/www.mql5.com\/?utm_source=quotes.widget&utm_medium=link&utm_term=quotes.overview&utm_content=visit.mql5.quotes&utm_campaign=quotes.overview.widget\" rel=\"noopener nofollow\" target=\"_blank\" rel=\"nofollow\" ><\/a><\/div>\n<script async type=\"text\/javascript\" data-type=\"quotes-widget\" src=\"https:\/\/c.mql5.com\/js\/widgets\/quotes\/widget.js?v=3\">\n   {\"type\":\"overview\",\"style\":\"table\",\"filter\":[\"BTCUSD\",\"SOLUSD\",\"DOGUSD\",\"XAUUSD\",\"USDCNH\"],\"width\":700,\"height\":420,\"period\":\"M15\",\"id\":\"quotesWidgetOverview\",\"fw\":\"html\"}\n<\/script>\n\n\n","protected":false},"excerpt":{"rendered":"<p>\u52a0\u5bc6\u8d27\u5e01 \u641c\u7d22\u5e01\u79cd\uff1a \u641c\u7d22 \u6062\u590d\u9ed8\u8ba4 \u65f6\u95f4\u5468\u671f\uff1a 1\u5206\u949f5\u5206\u949f15\u5206\u949f1\u5c0f\u65f61\u5929 \u5237\u65b0\u56fe\u8868 \u672a\u52a0\u8f7d \u770b\u677f\u6570\u636e<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"_links":{"self":[{"href":"https:\/\/www.explore2022.com\/index.php?rest_route=\/wp\/v2\/pages\/603"}],"collection":[{"href":"https:\/\/www.explore2022.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.explore2022.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.explore2022.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.explore2022.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=603"}],"version-history":[{"count":24,"href":"https:\/\/www.explore2022.com\/index.php?rest_route=\/wp\/v2\/pages\/603\/revisions"}],"predecessor-version":[{"id":864,"href":"https:\/\/www.explore2022.com\/index.php?rest_route=\/wp\/v2\/pages\/603\/revisions\/864"}],"wp:attachment":[{"href":"https:\/\/www.explore2022.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=603"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}