From bdb29764beebb2f4646a731ddf1ac00d648d14d7 Mon Sep 17 00:00:00 2001 From: Phoenix <64720302+Concur-max@users.noreply.github.com> Date: Fri, 23 May 2025 20:21:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E8=82=A1=E7=A5=A8=E6=8A=A5=E4=BB=B7?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E4=B8=AD=E6=B7=BB=E5=8A=A0=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96=E6=97=A5=E6=9C=9F=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E5=9C=A8=E7=9B=B8=E5=85=B3=E8=A7=86=E5=9B=BE=E4=B8=AD=E5=BC=95?= =?UTF-8?q?=E5=85=A5=E4=BB=A5=E6=98=BE=E7=A4=BA=E5=BD=93=E5=89=8D=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E5=92=8C=E6=97=B6=E9=97=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/stock-quote/index.js | 14 ++++++++++++++ src/views/stock-quote/size1920/index.vue | 14 +------------- src/views/stock-quote/size375/index.vue | 7 ++++--- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/store/stock-quote/index.js b/src/store/stock-quote/index.js index 64b07f1..df54172 100644 --- a/src/store/stock-quote/index.js +++ b/src/store/stock-quote/index.js @@ -14,11 +14,25 @@ export const useStockQuote = createGlobalState(() => { "" ] }) + const date = new Date(); +const options = { + year: 'numeric', + month: 'short', + day: 'numeric', + hour: 'numeric', + minute: '2-digit', + hour12: true, + timeZone: 'America/New_York', + timeZoneName: 'short' +}; + +const formatted = ref(date.toLocaleString('en-US', options)) const getStockQuate= async()=>{ const res = await axios.get('https://saas-test.szjixun.cn/api/chart/forward/test') stockQuote.value=res.data } return { + formatted, getStockQuate, stockQuote } diff --git a/src/views/stock-quote/size1920/index.vue b/src/views/stock-quote/size1920/index.vue index 3c6288f..edcfd0f 100644 --- a/src/views/stock-quote/size1920/index.vue +++ b/src/views/stock-quote/size1920/index.vue @@ -1,19 +1,7 @@ diff --git a/src/views/stock-quote/size375/index.vue b/src/views/stock-quote/size375/index.vue index 3ca6e28..68efba0 100644 --- a/src/views/stock-quote/size375/index.vue +++ b/src/views/stock-quote/size375/index.vue @@ -1,6 +1,6 @@ @@ -8,8 +8,9 @@ getStockQuate();
-
$1.98
-
NASDAQ: UK
+
${{ stockQuote.change?.[0].slice(0,4) }}
+
NASDAQ: MINM
+
{{ formatted }}