parent
d7f9f7068e
commit
e6fd3f33e5
@ -1,2 +1,3 @@
|
||||
/// <reference types="next" />
|
||||
/// <reference types="next/types/global" />
|
||||
/// <reference types="next/image-types/global" />
|
||||
|
@ -1,3 +1,8 @@
|
||||
module.exports = {
|
||||
reactStrictMode: true,
|
||||
i18n: {
|
||||
locales: ['zh_TW', 'zh_CN', 'en'],
|
||||
defaultLocale: 'zh_TW',
|
||||
localeDetection: true,
|
||||
},
|
||||
}
|
||||
|
@ -1,7 +1,34 @@
|
||||
import '../styles/globals.css'
|
||||
import type { AppProps } from 'next/app'
|
||||
import App, { AppContext, AppProps } from "next/app";
|
||||
import { NextIntlProvider } from "next-intl";
|
||||
import { useRouter } from "next/router";
|
||||
import cookies from "next-cookies";
|
||||
|
||||
function MyApp({ Component, pageProps }: AppProps) {
|
||||
return <Component {...pageProps} />
|
||||
}
|
||||
export default MyApp
|
||||
const twMessages = require(`../public/h5_assets/messages/zh_TW/common.json`);
|
||||
const cnMessages = require(`../public/h5_assets/messages/zh_CN/common.json`);
|
||||
|
||||
const MyApp = ({ Component, pageProps }: AppProps) => {
|
||||
|
||||
let router = useRouter();
|
||||
|
||||
return (
|
||||
<NextIntlProvider
|
||||
messages={(pageProps.lang ?? router.locale) === "zh_CN" ? { ...cnMessages } : { ...twMessages }}
|
||||
>
|
||||
<Component {...pageProps} />
|
||||
</NextIntlProvider>
|
||||
);
|
||||
};
|
||||
|
||||
MyApp.getInitialProps = async (props: AppContext) => {
|
||||
const NEXT_LOCALE = cookies(props.ctx)["NEXT_LOCALE"];
|
||||
const appProps = await App.getInitialProps(props);
|
||||
|
||||
appProps.pageProps = {
|
||||
...appProps.pageProps,
|
||||
lang: NEXT_LOCALE,
|
||||
};
|
||||
|
||||
return { ...appProps };
|
||||
};
|
||||
|
||||
export default MyApp;
|
@ -1,13 +0,0 @@
|
||||
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
||||
import type { NextApiRequest, NextApiResponse } from 'next'
|
||||
|
||||
type Data = {
|
||||
name: string
|
||||
}
|
||||
|
||||
export default function handler(
|
||||
req: NextApiRequest,
|
||||
res: NextApiResponse<Data>
|
||||
) {
|
||||
res.status(200).json({ name: 'John Doe' })
|
||||
}
|
@ -1,69 +1,18 @@
|
||||
import Head from 'next/head'
|
||||
import Image from 'next/image'
|
||||
import styles from '../styles/Home.module.css'
|
||||
import React from "react";
|
||||
import { useTranslations } from "next-intl";
|
||||
import { KEYS } from "../lib/keys";
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
<Head>
|
||||
<title>Create Next App</title>
|
||||
<meta name="description" content="Generated by create next app" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
</Head>
|
||||
|
||||
<main className={styles.main}>
|
||||
<h1 className={styles.title}>
|
||||
Welcome to <a href="https://nextjs.org">Next.js!</a>
|
||||
</h1>
|
||||
|
||||
<p className={styles.description}>
|
||||
Get started by editing{' '}
|
||||
<code className={styles.code}>pages/index.js</code>
|
||||
</p>
|
||||
|
||||
<div className={styles.grid}>
|
||||
<a href="https://nextjs.org/docs" className={styles.card}>
|
||||
<h2>Documentation →</h2>
|
||||
<p>Find in-depth information about Next.js features and API.</p>
|
||||
</a>
|
||||
const IndexPage: React.FC = () => {
|
||||
let t = useTranslations();
|
||||
|
||||
<a href="https://nextjs.org/learn" className={styles.card}>
|
||||
<h2>Learn →</h2>
|
||||
<p>Learn about Next.js in an interactive course with quizzes!</p>
|
||||
</a>
|
||||
|
||||
<a
|
||||
href="https://github.com/vercel/next.js/tree/master/examples"
|
||||
className={styles.card}
|
||||
>
|
||||
<h2>Examples →</h2>
|
||||
<p>Discover and deploy boilerplate example Next.js projects.</p>
|
||||
</a>
|
||||
return (
|
||||
<div>
|
||||
{
|
||||
t(KEYS.UI$bloodGlucose$about)
|
||||
}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
<a
|
||||
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
|
||||
className={styles.card}
|
||||
>
|
||||
<h2>Deploy →</h2>
|
||||
<p>
|
||||
Instantly deploy your Next.js site to a public URL with Vercel.
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer className={styles.footer}>
|
||||
<a
|
||||
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
Powered by{' '}
|
||||
<span className={styles.logo}>
|
||||
<Image src="/vercel.svg" alt="Vercel Logo" width={72} height={16} />
|
||||
</span>
|
||||
</a>
|
||||
</footer>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default IndexPage;
|
@ -0,0 +1,18 @@
|
||||
import React from "react";
|
||||
import { useTranslations } from "next-intl";
|
||||
import { KEYS } from "../../lib/keys";
|
||||
|
||||
const IndexPage: React.FC = () => {
|
||||
let t = useTranslations();
|
||||
|
||||
return (
|
||||
<div>
|
||||
{
|
||||
t(KEYS.UI$tabs$quota, { p: 9 })
|
||||
}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
export default IndexPage;
|
Before Width: | Height: | Size: 25 KiB |
@ -0,0 +1,272 @@
|
||||
{
|
||||
"test_polar": "Test polar chart",
|
||||
"test_egc": "Test egc chart",
|
||||
"test_heart_health": "Test heart health",
|
||||
"UI": {
|
||||
"button_next": "Next",
|
||||
"button_pre": "Previous",
|
||||
"button_send": "Sent",
|
||||
"questionnaire": {
|
||||
"header": "According to the feeling at the moment, please observe whether you have the following symptoms or conditions? Please check at least one before the next step. After confirmation, you cannot modify it!",
|
||||
"option_none": "None of the above symptoms"
|
||||
},
|
||||
"login": {
|
||||
"uid_hint": "Please input your user ID",
|
||||
"passwd_hint": "Please input your password",
|
||||
"btn_login": "Get Started"
|
||||
},
|
||||
"health_params": {
|
||||
"input_hint": {
|
||||
"sdnn": "Please input SDNN",
|
||||
"hf": "Please input HF",
|
||||
"lf": "Please input LF",
|
||||
"vlf": "Please input VLF",
|
||||
"lf_o": "Please input Origin LF",
|
||||
"hf_o": "Please input Origin HF",
|
||||
"tp": "Please input TP",
|
||||
"age": "Please input age",
|
||||
"ecg_id": "Please enter the ECG report ID:",
|
||||
"ecg_id_error": "Enter is incorrect, please check"
|
||||
},
|
||||
"submit": "Submit",
|
||||
"input_id": "Input ID"
|
||||
},
|
||||
"tabs": {
|
||||
"params": "Params",
|
||||
"health_strength": "Health Strength",
|
||||
"problem_analysis": "Problem Analysis",
|
||||
"physique_analysis": "Physique Analysis",
|
||||
"quota": "The quota remain this week: {{p}}"
|
||||
},
|
||||
"physique_analysis": {
|
||||
"suggestion": "Suggestion:",
|
||||
"title": "Scientific physical analysis"
|
||||
},
|
||||
"health_strength": {
|
||||
"health": "Health Strength {{p}}",
|
||||
"hint": "The ability of today's body to function comprehensively",
|
||||
"repair": "Repair power {{p}}",
|
||||
"antistress": "Anti-stress power {{p}}",
|
||||
"endurance": "Endurance power {{p}}",
|
||||
"resistance": "Resistance power {{p}}",
|
||||
"label": {
|
||||
"antistress": "Pressure index",
|
||||
"endurance": "Life Index",
|
||||
"health": "Health intensity",
|
||||
"repair": "Repair Index",
|
||||
"resistance": "Resistance index",
|
||||
"physique": "Physique"
|
||||
},
|
||||
"priority": "Priority conditioning",
|
||||
"physique": "{{t}} Physique"
|
||||
},
|
||||
"problem_analysis": {
|
||||
"title": "Real-time physiological status analysis",
|
||||
"subtitle": "The real-time physiological status analysis shows that the body function load or abnormality at the time of detection may be caused by a short-term phenomenon or a long-term accumulation. It is recommended that multiple tests and timely intervention and improvement are recommended to ensure maintenance of health and avoid injury from the lesion.",
|
||||
"emergency": "Emergency Problems",
|
||||
"system": "System Functions",
|
||||
"health": "Health Risks",
|
||||
"life": "Life Risks",
|
||||
"emergency_desc": "Indicates possible recent problems\nwhich need to be actively dealt with to avoid cumulative damage",
|
||||
"health_desc": "Indicates that the physiological abnormality has been caused\nIt is recommended to observe carefully or go to a specialist for examination",
|
||||
"life_desc": "Indicates recent bad behavior\nif it is not immediately improved, it will cause health risks",
|
||||
"system_desc": "Indicates the current status of the autonomic nerve\nwhich is used to coordinate the operation of various organs in the body"
|
||||
},
|
||||
"what_happened": {
|
||||
"title_questionnaire": "Please click on the instructions according to the body's feelings.",
|
||||
"title_problems": "According to the analysis, you may have problems",
|
||||
"title_looks_fine": "No big problem!",
|
||||
"looks_fine_dialog_content": "There is no big problem now!\nIt is recommended to drink a glass of water, let the body take a while\nIf there is something uncomfortable, it may be just a short phenomenon.\nAfter 30 minutes, measure it again, see\nHow is the body feel!",
|
||||
"what_happened_msg": "What's wrong with me?",
|
||||
"title_measure_time": "measure time",
|
||||
"title_recently_ten_result": "Recently 10 analysis results",
|
||||
"title_improve_ways": "I can improve {{type}} through the following ways"
|
||||
},
|
||||
"button_close": "shut down",
|
||||
"warning_info": {
|
||||
"happened_time": "Abnormal time",
|
||||
"echarts_table": {
|
||||
"echarts_1_title": "Sinus rhythm",
|
||||
"echarts_2_title": "autonomic frequency map",
|
||||
"echarts_1_subtitle": "RRI Scatter",
|
||||
"echarts_2_subtitle": "AR-Power Spectral \n[Non-detrend]"
|
||||
},
|
||||
"form_table": {
|
||||
"table_1_header": "time domain analysis",
|
||||
"table_2_header": "sectrum analysis"
|
||||
},
|
||||
"heart_rate_title": "Instant ECG",
|
||||
"average_bpm": "Average heartbeat:",
|
||||
"max_bpm": "Maximum heartbeat:",
|
||||
"min_bpm": "Minority heartbeat:"
|
||||
},
|
||||
"button_last_10_record": "Nearly 10",
|
||||
"button_last_30_record": "Nearly 30",
|
||||
"button_last_90_record": "Nearly 90",
|
||||
"button_custom": "customize",
|
||||
"hrv_report": {
|
||||
"title": "Heart rate variability change trend",
|
||||
"hrv_chart": {
|
||||
"title": "Heart rate variant ms",
|
||||
"comment_start": "Note:",
|
||||
"comment_green": "green",
|
||||
"comment_yellow": "yellow",
|
||||
"comment_red": "red",
|
||||
"comment_red_content": "more attention is needed within the scope.",
|
||||
"comment_yellow_content": "need to pay attention within the scope,",
|
||||
"comment_green_content": "The range is relatively safe (0.75 ~ 2.5)"
|
||||
},
|
||||
"action": {
|
||||
"measure_time": "Measurement time:",
|
||||
"detail_title": "Heart rate variant:",
|
||||
"detail_show": "When the data details",
|
||||
"detail_delete": "delete data"
|
||||
},
|
||||
"empty_content": "You haven't discharged it yet."
|
||||
},
|
||||
"ans_report": {
|
||||
"title": "Self-discipline nerve trend",
|
||||
"chart_2_title": "Self-discipline",
|
||||
"chart_1_title": "Sype sense nerve LF",
|
||||
"chart_1_subtitle": "Deputy-seniary nerve HF",
|
||||
"chart_2_label": "Self-discipline neurodus:"
|
||||
},
|
||||
"health_risk_rank": {
|
||||
"title": "Health risk ranking analysis",
|
||||
"selector": {
|
||||
"month": {
|
||||
"month": "month",
|
||||
"January": "January",
|
||||
"February": "February",
|
||||
"March": "March",
|
||||
"April": "April",
|
||||
"May": "May",
|
||||
"June": "June",
|
||||
"July": "July",
|
||||
"August": "August",
|
||||
"September": "September",
|
||||
"October": "October",
|
||||
"November": "November",
|
||||
"December": "December"
|
||||
},
|
||||
"year": "year",
|
||||
"season": {
|
||||
"season_1": "first season",
|
||||
"season_2": "second season",
|
||||
"season_3": "third season",
|
||||
"season_4": "fourth season",
|
||||
"season": "season"
|
||||
}
|
||||
}
|
||||
},
|
||||
"health_friends": {
|
||||
"menu": {
|
||||
"add": "add friend",
|
||||
"message": "Invitation notice",
|
||||
"manage": "Manage healthy friends"
|
||||
},
|
||||
"add": {
|
||||
"title": "Add health friend",
|
||||
"hint": "Please enter the account you want to add",
|
||||
"button": "Sent an invitation",
|
||||
"msg": "Send invitation ~"
|
||||
},
|
||||
"invitation_msg": {
|
||||
"title": "Invitation notice",
|
||||
"your_friend": "Your friend",
|
||||
"want_watch": "Want to view your health data",
|
||||
"agreed": "approved",
|
||||
"denied": "rejected"
|
||||
},
|
||||
"manage": {
|
||||
"follower": "Care about me\nHealthy friend",
|
||||
"following": "I care about it.\nHealthy friend"
|
||||
},
|
||||
"list": {
|
||||
"title": "Friends List"
|
||||
},
|
||||
"report": {
|
||||
"health_warning_title": "Health alert"
|
||||
},
|
||||
"hint": "prompt:",
|
||||
"no_friends_hint": "You haven't added healthy friends yet!\nGo and click on the avatar."
|
||||
},
|
||||
"button_last_10_day": "Nearly 10 days",
|
||||
"button_last_30_day": "Nearly 30 days",
|
||||
"button_last_90_day": "Near 90 days",
|
||||
"button_agree": "Agree",
|
||||
"button_deny": "Deny",
|
||||
"blood_glucose": {
|
||||
"basic": {
|
||||
"type": {
|
||||
"empty_stomach_10_hour": "Empty stomach 10 hours",
|
||||
"30min_before_sleep": "30 minutes before going to bed",
|
||||
"random_measure": "Random measurement",
|
||||
"30min_before_sleep_remark": "What have you eaten within an hour before going to bed? Is there a fasting?",
|
||||
"empty_stomach_10_hour_remark": "Last night, is it? Have you taking medicine?",
|
||||
"random_measure_remark": "Why is this information?"
|
||||
},
|
||||
"single_day_report": {
|
||||
"title": "Single-day change",
|
||||
"empty_content": "There is no measurement data on the same day."
|
||||
}
|
||||
},
|
||||
"query_date": "Query date",
|
||||
"normal": "normal",
|
||||
"abnormal": "abnormal",
|
||||
"value": "Blood sugar level:",
|
||||
"unit": "mmol/L",
|
||||
"normal_percent": "Measure number\nProportion",
|
||||
"record_count": "Total measurement {{count}}",
|
||||
"count_is": "The number of times is {{count}}",
|
||||
"about": "About blood sugar",
|
||||
"advanced": {
|
||||
"type": {
|
||||
"2hour_after_eating": "2 hours after dining",
|
||||
"2hour_after_eating_remark": "I have a measure of this data before I eat.",
|
||||
"30min_after_use_medicine": "30 minutes after medication",
|
||||
"30min_after_use_medicine_remark": "Before the data was measured, I was eating.",
|
||||
"30min_after_use_tonic": "30 minutes after health products",
|
||||
"30min_after_use_tonic_remark": "Before you measure this data, the health food I eat is",
|
||||
"30min_after_exercise": "30 minutes after exercise",
|
||||
"30min_after_exercise_remark": "I measure this data before I do."
|
||||
},
|
||||
"delete": "Delete this comparison data",
|
||||
"pre": "Previous group",
|
||||
"next": "Next group"
|
||||
}
|
||||
},
|
||||
"dialog": {
|
||||
"confirm_delete": "Do you have to delete this information?"
|
||||
},
|
||||
"button_cancel": "Accidentally",
|
||||
"button_confirm_delete": "confirm delete",
|
||||
"temperature": {
|
||||
"data_title": "Body temperature data",
|
||||
"unit": "℃",
|
||||
"label": "body temperature",
|
||||
"measurement_position": "Measurement position",
|
||||
"measurement_positions": {
|
||||
"forehead": "forehead",
|
||||
"armpit": "armpit",
|
||||
"ear": "ear",
|
||||
"mouth": "mouth",
|
||||
"anus": "anus"
|
||||
}
|
||||
}
|
||||
},
|
||||
"ShiXin": {
|
||||
"yin": "Yin",
|
||||
"yang": "Yang",
|
||||
"xu": "Xu",
|
||||
"shi": "Shi",
|
||||
"han": "Han",
|
||||
"re": "Re",
|
||||
"h": "Han",
|
||||
"i": "Yin",
|
||||
"r": "Re",
|
||||
"s": "Shi",
|
||||
"x": "Xu",
|
||||
"a": "Yang"
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 1.1 KiB |
@ -1,121 +0,0 @@
|
||||
.container {
|
||||
min-height: 100vh;
|
||||
padding: 0 0.5rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.main {
|
||||
padding: 5rem 0;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.footer {
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
border-top: 1px solid #eaeaea;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.footer a {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.title a {
|
||||
color: #0070f3;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.title a:hover,
|
||||
.title a:focus,
|
||||
.title a:active {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.title {
|
||||
margin: 0;
|
||||
line-height: 1.15;
|
||||
font-size: 4rem;
|
||||
}
|
||||
|
||||
.title,
|
||||
.description {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.description {
|
||||
line-height: 1.5;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.code {
|
||||
background: #fafafa;
|
||||
border-radius: 5px;
|
||||
padding: 0.75rem;
|
||||
font-size: 1.1rem;
|
||||
font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
|
||||
Bitstream Vera Sans Mono, Courier New, monospace;
|
||||
}
|
||||
|
||||
.grid {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
max-width: 800px;
|
||||
margin-top: 3rem;
|
||||
}
|
||||
|
||||
.card {
|
||||
margin: 1rem;
|
||||
padding: 1.5rem;
|
||||
text-align: left;
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
border: 1px solid #eaeaea;
|
||||
border-radius: 10px;
|
||||
transition: color 0.15s ease, border-color 0.15s ease;
|
||||
width: 45%;
|
||||
}
|
||||
|
||||
.card:hover,
|
||||
.card:focus,
|
||||
.card:active {
|
||||
color: #0070f3;
|
||||
border-color: #0070f3;
|
||||
}
|
||||
|
||||
.card h2 {
|
||||
margin: 0 0 1rem 0;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.card p {
|
||||
margin: 0;
|
||||
font-size: 1.25rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.logo {
|
||||
height: 1em;
|
||||
margin-left: 0.5rem;
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.grid {
|
||||
width: 100%;
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
html,
|
||||
body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
|
||||
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
|
||||
}
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
const message = require("../public/h5_assets/messages/zh_CN/common.json");
|
||||
const fs = require('fs')
|
||||
let keys = [];
|
||||
|
||||
function toHump(name) {
|
||||
return name.replace(/_(\w)/g, function (all, letter) {
|
||||
return letter.toUpperCase();
|
||||
});
|
||||
}
|
||||
|
||||
function parse(obj, preFix = "", preKey = "") {
|
||||
Object.keys(obj).forEach(key => {
|
||||
if (typeof obj[key] == 'string') {
|
||||
keys.push(` ${ preFix }${ preFix === "" ? "" : '$' }${ toHump(key) } = "${ preKey }${ preKey === "" ? "" : '.' }${ key }",`);
|
||||
} else {
|
||||
parse(obj[key], `${ preFix }${ preFix === "" ? "" : '$' }${ toHump(key) }`, `${ preKey }${ preKey === "" ? "" : '.' }${ key }`)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
keys.push("export enum KEYS {");
|
||||
|
||||
parse(message);
|
||||
|
||||
keys.push("}");
|
||||
|
||||
fs.writeFile('./lib/keys.ts', keys.join('\n'), (e) => {
|
||||
console.info(e);
|
||||
});
|
Loading…
Reference in new issue