{"id":898,"date":"2025-11-10T21:54:59","date_gmt":"2025-11-10T13:54:59","guid":{"rendered":"https:\/\/explore2022.com\/?page_id=898"},"modified":"2026-02-05T14:04:18","modified_gmt":"2026-02-05T06:04:18","slug":"%e5%8a%a0%e5%af%86%e8%a1%8c%e6%83%85","status":"publish","type":"page","link":"https:\/\/www.explore2022.com\/?page_id=898","title":{"rendered":"\u52a0\u5bc6\u884c\u60c5"},"content":{"rendered":"\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','OKB','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<!-- TradingView Widget BEGIN -->\n<div class=\"tradingview-widget-container\">\n  <div class=\"tradingview-widget-container__widget\"><\/div>\n  <div class=\"tradingview-widget-copyright\"><a href=\"https:\/\/www.tradingview.com\/symbols\/BTCUSDT\/?exchange=BINANCE\" rel=\"noopener nofollow\" target=\"_blank\" rel=\"nofollow\" ><span class=\"blue-text\">BTCUSDT<\/span><\/a><span class=\"comma\">,<\/span>&nbsp;<a href=\"https:\/\/www.tradingview.com\/symbols\/SOLUSDT\/?exchange=OKX\" rel=\"noopener nofollow\" target=\"_blank\" rel=\"nofollow\" ><span class=\"blue-text\">SOLUSDT<\/span><\/a><span class=\"comma\">,<\/span><span class=\"and\">&nbsp;and&nbsp;<\/span><a href=\"https:\/\/www.tradingview.com\/symbols\/DOGEUSDT\/?exchange=OKX\" rel=\"noopener nofollow\" target=\"_blank\" rel=\"nofollow\" ><span class=\"blue-text\">DOGEUSDT rate<\/span><\/a><span class=\"trademark\">&nbsp;by TradingView<\/span><\/div>\n  <script type=\"text\/javascript\" src=\"https:\/\/s3.tradingview.com\/external-embedding\/embed-widget-symbol-overview.js\" async>\n  {\n  \"lineWidth\": 2,\n  \"lineType\": 0,\n  \"chartType\": \"area\",\n  \"fontColor\": \"rgb(106, 109, 120)\",\n  \"gridLineColor\": \"rgba(242, 242, 242, 0.06)\",\n  \"volumeUpColor\": \"rgba(34, 171, 148, 0.5)\",\n  \"volumeDownColor\": \"rgba(247, 82, 95, 0.5)\",\n  \"backgroundColor\": \"#0F0F0F\",\n  \"widgetFontColor\": \"#DBDBDB\",\n  \"upColor\": \"#22ab94\",\n  \"downColor\": \"#f7525f\",\n  \"borderUpColor\": \"#22ab94\",\n  \"borderDownColor\": \"#f7525f\",\n  \"wickUpColor\": \"#22ab94\",\n  \"wickDownColor\": \"#f7525f\",\n  \"colorTheme\": \"dark\",\n  \"isTransparent\": true,\n  \"locale\": \"en\",\n  \"chartOnly\": false,\n  \"scalePosition\": \"right\",\n  \"scaleMode\": \"Normal\",\n  \"fontFamily\": \"-apple-system, BlinkMacSystemFont, Trebuchet MS, Roboto, Ubuntu, sans-serif\",\n  \"valuesTracking\": \"1\",\n  \"changeMode\": \"price-only\",\n  \"symbols\": [\n    [\n      \"BINANCE:BTCUSDT|1D\"\n    ],\n    [\n      \"OKX:SOLUSDT|1D\"\n    ],\n    [\n      \"OKX:DOGEUSDT|1D\"\n    ]\n  ],\n  \"dateRanges\": [\n    \"1d|1\",\n    \"1m|30\",\n    \"3m|60\",\n    \"12m|1D\",\n    \"60m|1W\",\n    \"all|1M\"\n  ],\n  \"fontSize\": \"10\",\n  \"headerFontSize\": \"medium\",\n  \"autosize\": true,\n  \"width\": \"100%\",\n  \"height\": \"100%\",\n  \"noTimeScale\": false,\n  \"hideDateRanges\": false,\n  \"hideMarketStatus\": false,\n  \"hideSymbolLogo\": false\n}\n  <\/script>\n<\/div>\n<!-- TradingView Widget END -->\n","protected":false},"excerpt":{"rendered":"<p>\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 BTCUSDT,&nbsp;SOLUSD &#8230;<\/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\/898"}],"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=898"}],"version-history":[{"count":6,"href":"https:\/\/www.explore2022.com\/index.php?rest_route=\/wp\/v2\/pages\/898\/revisions"}],"predecessor-version":[{"id":974,"href":"https:\/\/www.explore2022.com\/index.php?rest_route=\/wp\/v2\/pages\/898\/revisions\/974"}],"wp:attachment":[{"href":"https:\/\/www.explore2022.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=898"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}