diff --git a/.yarn/install-state.gz b/.yarn/install-state.gz index cf8ba4e..57f5b88 100644 Binary files a/.yarn/install-state.gz and b/.yarn/install-state.gz differ diff --git a/index.html b/index.html index 0fe0008..8195f18 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - NEER-APP-H5 + Pineer
diff --git a/package.json b/package.json index 2dc9ae3..162e153 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "react-i18next": "^14.0.1", "react-router-dom": "^6.21.3", "sass": "^1.70.0", + "ts-md5": "^1.3.1", "zustand": "^4.5.0" }, "devDependencies": { diff --git a/src/App.css b/src/App.css index c15efd4..b73928a 100644 --- a/src/App.css +++ b/src/App.css @@ -1,8 +1,6 @@ #root { - max-width: 1280px; - margin: 0 auto; + /* max-width: 1280px; */ + /* margin: 0 auto; */ padding: 2rem; text-align: center; -} - - +} \ No newline at end of file diff --git a/src/api/index.ts b/src/api/index.ts index 004384d..0be8c5d 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -2,13 +2,27 @@ import { request } from "./request"; import { AxiosRequestConfig } from 'axios'; //发送验证码 -export const sendCode = (params: any,config:AxiosRequestConfig) => +export const sendCode = (params: { + areaCode?: string; // 区号,只有手机号才有 + account: string; // 账号(邮箱或手机号) + status: 1 | 2; // 1=登录 2=注册 + signature: string; + timestamp: string; +},config:AxiosRequestConfig) => request.get("/api/account/sendVerificationCode", params, { timeout: 15000, ...config }); //注册 -export const signUp = (params: any,config:AxiosRequestConfig) => +export const signUp = (params: { + account: string; // account + area?: string; // 顶级区域:朝鲜/平壤、中国/广东 + areaCode?: string; // 区号,只有手机号才有 + authCode: string; // 验证码 + district?: string; // 二级区域:具体的区域 + shareCode: string; // invitation code + userName: string; // 用户名称 +},config:AxiosRequestConfig) => request.post("/api/account/signUp", params, { timeout: 15000, ...config diff --git a/src/assets/iconfont/email_Select.svg b/src/assets/iconfont/email_Select.svg index 470e283..93542bd 100644 --- a/src/assets/iconfont/email_Select.svg +++ b/src/assets/iconfont/email_Select.svg @@ -9,7 +9,7 @@ + fill="#FCB44B" fill-opacity="1" /> \ No newline at end of file diff --git a/src/assets/iconfont/phone_Select.svg b/src/assets/iconfont/phone_Select.svg index 840764c..cdda0d7 100644 --- a/src/assets/iconfont/phone_Select.svg +++ b/src/assets/iconfont/phone_Select.svg @@ -9,7 +9,7 @@ + fill="#FCB44B" fill-opacity="1" /> \ No newline at end of file diff --git a/src/assets/img/logo.png b/src/assets/img/logo.png index 27c8d05..44e2e1c 100644 Binary files a/src/assets/img/logo.png and b/src/assets/img/logo.png differ diff --git a/src/components/EmailForm.tsx b/src/components/EmailForm.tsx index 171be4d..5e22602 100644 --- a/src/components/EmailForm.tsx +++ b/src/components/EmailForm.tsx @@ -8,6 +8,7 @@ import { sendCode, signUp } from "../api"; import { sendCodeTypes, signUpTypes, ErrorType } from "../type/SignIn"; import { Toast } from "antd-mobile"; import { useLocation, useNavigate } from "react-router-dom"; +import { Md5 } from "ts-md5"; function EmailForm() { const formRef: any = useRef() @@ -30,11 +31,16 @@ function EmailForm() { if (email === "") { return; } + const timestamp = `${new Date().getTime()}`; const res = await sendCode( { account: email, areaCode: "", status: 2, + signature: Md5.hashStr( + `Neer${email},${2},${timestamp}GetCode` + ), + timestamp }, config ); @@ -50,7 +56,7 @@ function EmailForm() { Toast.show({ content: t('Send failure'), afterClose: () => { - start(60 * 1000); + // start(60 * 1000); }, }); } @@ -103,6 +109,7 @@ function EmailForm() { areaCode: "", authCode: authCode, shareCode: shareCode || formRef.current?.getFieldValue('shareCode'), + userName: "" }, config ); diff --git a/src/components/PhoneForm.tsx b/src/components/PhoneForm.tsx index a7b664a..05dd8cd 100644 --- a/src/components/PhoneForm.tsx +++ b/src/components/PhoneForm.tsx @@ -8,7 +8,7 @@ import { useCountdown } from "../hooks/useCountdown"; import { sendCode, signUp } from "../api"; import { sendCodeTypes, signUpTypes, ErrorType } from "../type/SignIn"; import { Toast } from "antd-mobile"; - +import { Md5 } from "ts-md5"; function PhoneForm() { const formRef: any = useRef() const location = useLocation() @@ -59,10 +59,15 @@ function PhoneForm() { if (CurrentPhoneNumber === "") { return; } + const timestamp = `${new Date().getTime()}`; const res = await sendCode({ account: CurrentPhoneNumber, areaCode: SelectCountry?.code || defaultAreaCode, status: 2, + signature: Md5.hashStr( + `Neer${CurrentPhoneNumber},${2},${timestamp}GetCode` + ), + timestamp }, config); console.log("res", res); if (res.status === 200 && res.data.data.sms) { @@ -77,7 +82,7 @@ function PhoneForm() { Toast.show({ content: t('Send failure'), afterClose: () => { - start(60 * 1000); + // start(60 * 1000); }, }); } @@ -113,6 +118,7 @@ function PhoneForm() { areaCode: SelectCountry?.code, authCode: authCode, shareCode: shareCode || formRef.current?.getFieldValue('shareCode'), + userName: "" }, config) console.log('res', res) if (res.status === 200 && res.data.data.token) { diff --git a/src/i18n/en/translation.json b/src/i18n/en/translation.json index 37d26be..3e24ed8 100644 --- a/src/i18n/en/translation.json +++ b/src/i18n/en/translation.json @@ -7,7 +7,7 @@ "Please enter SMS verification code":"Please enter SMS verification code", "Send verification code":"Send verification code", "Please enter the invitation code (optional)":"Please enter the invitation code (optional)", - "register":"register", + "register":"Register", "If you already have an account":"If you already have an account", "download the APP directly":"download the APP directly", "Continuing to represent you in agreeing to our":"Continuing to represent you in agreeing to our", diff --git a/src/index.css b/src/index.css index ff4ca39..0ec6936 100644 --- a/src/index.css +++ b/src/index.css @@ -1,5 +1,5 @@ -: - { +body, +html { font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; line-height: 1.5; font-weight: 400; @@ -13,16 +13,19 @@ -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } + #root { padding: 0; background: #fafafb; - + } + a { font-weight: 500; color: #646cff; text-decoration: inherit; } + a:hover { color: #535bf2; } @@ -51,9 +54,11 @@ button { cursor: pointer; transition: border-color 0.25s; } + button:hover { border-color: #646cff; } + button:focus, button:focus-visible { outline: 4px auto -webkit-focus-ring-color; @@ -68,10 +73,12 @@ button:focus-visible { color: #213547; background-color: #ffffff; } + a:hover { color: #747bff; } + button { background-color: #f9f9f9; } -} +} \ No newline at end of file diff --git a/src/pages/Download.scss b/src/pages/Download.scss index 48684d7..5f7d649 100644 --- a/src/pages/Download.scss +++ b/src/pages/Download.scss @@ -27,7 +27,7 @@ height: 2.75rem; border-radius: .3125rem; box-sizing: border-box; - border: .0625rem solid #f5d90a; + border: .0625rem solid #FCB44B; margin-bottom: 1.25rem; display: flex; align-items: center; diff --git a/src/pages/Download.tsx b/src/pages/Download.tsx index 84f0f1f..0f7729a 100644 --- a/src/pages/Download.tsx +++ b/src/pages/Download.tsx @@ -1,5 +1,5 @@ -import googleIcon from '../assets/img/google.png' -import appStoreIcon from '../assets/img/app_store.png' +// import googleIcon from '../assets/img/google.png' +// import appStoreIcon from '../assets/img/app_store.png' import { useTranslation } from "react-i18next"; import Logo from "../assets/img/logo.png" @@ -14,14 +14,14 @@ function Download() {
- */} diff --git a/src/pages/SelectCountry.scss b/src/pages/SelectCountry.scss index a9e7aad..3a5e051 100644 --- a/src/pages/SelectCountry.scss +++ b/src/pages/SelectCountry.scss @@ -55,7 +55,7 @@ } } .area-box { - overflow: scroll; + overflow-y: scroll; height: calc(100vh - 7.5rem); padding: 0 1.5rem; box-sizing: border-box; @@ -69,8 +69,8 @@ line-height: 3.25rem; border-bottom: .0625rem solid #D8D8D8; &.selected { - border-bottom: .0625rem solid #f5d90a; - color: #f5d90a; + border-bottom: .0625rem solid #FCB44B; + color: #FCB44B; } } } diff --git a/src/pages/SignIn.scss b/src/pages/SignIn.scss index 9dd706c..b44c18f 100644 --- a/src/pages/SignIn.scss +++ b/src/pages/SignIn.scss @@ -49,8 +49,8 @@ margin-right: 2.0625rem; &.selected { - border-bottom: .0625rem solid #f5d90a; - color: #f5d90a; + border-bottom: .0625rem solid #FCB44B; + color: #FCB44B; } img { @@ -120,7 +120,7 @@ width: 6.1875rem; height: 2.75rem; border-radius: .3125rem; - background: #f5d90a; + background: #FCB44B; font-family: PingFang SC; font-size: .75rem; color: #333; diff --git a/src/pages/SignIn.tsx b/src/pages/SignIn.tsx index 8f19215..7c9c6b1 100644 --- a/src/pages/SignIn.tsx +++ b/src/pages/SignIn.tsx @@ -92,7 +92,7 @@ function SignIn() { {selectIndex === 1 && }

{t("If you already have an account")}

-

navigate("/Download")}>{t("download the APP directly")}

+

navigate("/Download")}>{t("Download the APP directly")}

{t("Continuing to represent you in agreeing to our")}

diff --git a/yarn.lock b/yarn.lock index 75fe11c..33bc4de 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2366,6 +2366,7 @@ __metadata: react-i18next: "npm:^14.0.1" react-router-dom: "npm:^6.21.3" sass: "npm:^1.70.0" + ts-md5: "npm:^1.3.1" typescript: "npm:^5.3.3" vite: "npm:^5.0.8" zustand: "npm:^4.5.0" @@ -3054,6 +3055,13 @@ __metadata: languageName: node linkType: hard +"ts-md5@npm:^1.3.1": + version: 1.3.1 + resolution: "ts-md5@npm:1.3.1" + checksum: 10c0/1a3963172184ab260eadb0c34c597f97e64ecd5151c9cee3fe24c275945c659096adcb2a70f7ee434d7d163309f52e6df968a3ebaeee0cd422695c3650bdd6b8 + languageName: node + linkType: hard + "tslib@npm:^2.4.1, tslib@npm:^2.5.0": version: 2.6.2 resolution: "tslib@npm:2.6.2"