Compare commits
No commits in common. "d6ebf4a" and "main" have entirely different histories.
|
@ -1,4 +1,2 @@
|
||||||
VITE_APP_DEV = 'dev-api'
|
VITE_APP_DEV = 'dev-api'
|
||||||
# VITE_API_URL = 'http://192.168.10.166:8096'
|
VITE_API_URL = 'http://192.168.10.166:8096'
|
||||||
# VITE_API_URL = 'https://8.217.122.133:10020'
|
|
||||||
VITE_API_URL = 'https://api.pineer.cc'
|
|
|
@ -1,4 +1,2 @@
|
||||||
VITE_APP_DEV = 'prod-api'
|
VITE_APP_DEV = 'prod-api'
|
||||||
# VITE_API_URL = 'http://192.168.10.166:8096'
|
VITE_API_URL = 'http://192.168.10.166:8096'
|
||||||
# VITE_API_URL = 'https://8.217.122.133:10020'
|
|
||||||
VITE_API_URL = 'https://api.pineer.cc'
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
env: { browser: true, es2020: true },
|
||||||
|
extends: [
|
||||||
|
'eslint:recommended',
|
||||||
|
'plugin:@typescript-eslint/recommended',
|
||||||
|
'plugin:react-hooks/recommended',
|
||||||
|
],
|
||||||
|
ignorePatterns: ['dist', '.eslintrc.cjs'],
|
||||||
|
parser: '@typescript-eslint/parser',
|
||||||
|
plugins: ['react-refresh'],
|
||||||
|
rules: {
|
||||||
|
'react-refresh/only-export-components': [
|
||||||
|
'warn',
|
||||||
|
{ allowConstantExport: true },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
}
|
|
@ -1 +0,0 @@
|
||||||
nodeLinker: node-modules
|
|
43
README.md
|
@ -1,27 +1,30 @@
|
||||||
<!--
|
# React + TypeScript + Vite
|
||||||
* @LastEditors: John
|
|
||||||
* @Date: 2024-04-12 19:24:25
|
|
||||||
* @LastEditTime: 2024-06-03 14:37:23
|
|
||||||
* @Author: John
|
|
||||||
-->
|
|
||||||
|
|
||||||
## Git Flow
|
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
||||||
|
|
||||||
- 初始化Git Flow
|
Currently, two official plugins are available:
|
||||||
git flow init
|
|
||||||
|
|
||||||
- 创建一个新功能分支
|
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
|
||||||
git flow feature start new-feature
|
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
||||||
|
|
||||||
- 完成功能开发
|
## Expanding the ESLint configuration
|
||||||
git flow feature finish new-feature
|
|
||||||
|
|
||||||
- 创建一个release分支
|
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
|
||||||
git flow release start 1.0.0
|
|
||||||
|
|
||||||
- 完成release分支
|
- Configure the top-level `parserOptions` property like this:
|
||||||
git flow release finish 1.0.0
|
|
||||||
|
|
||||||
- 紧急修复
|
```js
|
||||||
git flow hotfix start hotfix-issue
|
export default {
|
||||||
git flow hotfix finish hotfix-issue
|
// other rules...
|
||||||
|
parserOptions: {
|
||||||
|
ecmaVersion: 'latest',
|
||||||
|
sourceType: 'module',
|
||||||
|
project: ['./tsconfig.json', './tsconfig.node.json'],
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
|
||||||
|
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
|
||||||
|
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
import ReactDOM from "react-dom/client";
|
import React from 'react'
|
||||||
import App from "./App.tsx";
|
import ReactDOM from 'react-dom/client'
|
||||||
import "./index.css";
|
import App from './App.tsx'
|
||||||
|
import './index.css'
|
||||||
|
|
||||||
ReactDOM.createRoot(document.getElementById("root")!).render(<App />);
|
ReactDOM.createRoot(document.getElementById('root')!).render(
|
||||||
|
<React.StrictMode>
|
||||||
|
<App />
|
||||||
|
</React.StrictMode>,
|
||||||
|
)
|
||||||
|
|
10
index.html
|
@ -1,16 +1,10 @@
|
||||||
<!--
|
<!doctype html>
|
||||||
* @LastEditors: John
|
|
||||||
* @Date: 2024-05-22 18:06:14
|
|
||||||
* @LastEditTime: 2024-05-22 18:43:14
|
|
||||||
* @Author: John
|
|
||||||
-->
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/src/assets/img/logo.png" />
|
<link rel="icon" type="image/svg+xml" href="/src/assets/img/logo.png" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Pioneer</title>
|
<title>NEER-APP-H5</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "tsc && vite build",
|
"build": "tsc && vite build",
|
||||||
|
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -17,14 +18,18 @@
|
||||||
"react-i18next": "^14.0.1",
|
"react-i18next": "^14.0.1",
|
||||||
"react-router-dom": "^6.21.3",
|
"react-router-dom": "^6.21.3",
|
||||||
"sass": "^1.70.0",
|
"sass": "^1.70.0",
|
||||||
"ts-md5": "^1.3.1",
|
|
||||||
"zustand": "^4.5.0"
|
"zustand": "^4.5.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^20.11.7",
|
"@types/node": "^20.11.7",
|
||||||
"@types/react": "^18.2.43",
|
"@types/react": "^18.2.43",
|
||||||
"@types/react-dom": "^18.2.17",
|
"@types/react-dom": "^18.2.17",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^6.14.0",
|
||||||
|
"@typescript-eslint/parser": "^6.14.0",
|
||||||
"@vitejs/plugin-react-swc": "^3.5.0",
|
"@vitejs/plugin-react-swc": "^3.5.0",
|
||||||
|
"eslint": "^8.55.0",
|
||||||
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
|
"eslint-plugin-react-refresh": "^0.4.5",
|
||||||
"typescript": "^5.3.3",
|
"typescript": "^5.3.3",
|
||||||
"vite": "^5.0.8"
|
"vite": "^5.0.8"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#root {
|
#root {
|
||||||
/* max-width: 1280px; */
|
max-width: 1280px;
|
||||||
/* margin: 0 auto; */
|
margin: 0 auto;
|
||||||
padding: 2rem;
|
padding: 2rem;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
16
src/App.tsx
|
@ -1,23 +1,17 @@
|
||||||
/*
|
|
||||||
* @LastEditors: John
|
|
||||||
* @Date: 2024-05-22 18:06:14
|
|
||||||
* @LastEditTime: 2024-05-22 18:45:10
|
|
||||||
* @Author: John
|
|
||||||
*/
|
|
||||||
import "./App.css";
|
import "./App.css";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { HashRouter as Router, Route, Routes } from "react-router-dom";
|
import { BrowserRouter as Router, Route, Routes } from "react-router-dom";
|
||||||
import SignIn from "./pages/SignIn";
|
import SignIn from "./pages/SignIn";
|
||||||
import Download from "./pages/Download";
|
import Download from "./pages/Download";
|
||||||
import SelectCountry from "./pages/SelectCountry";
|
import SelectCountry from "./pages/SelectCountry";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
const { i18n } = useTranslation();
|
const {i18n} = useTranslation()
|
||||||
const lang: string = navigator.language.split("-")[1].toLocaleLowerCase();
|
const lang:string = navigator.language.split('-')[1].toLocaleLowerCase()
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
i18n.changeLanguage("en");
|
i18n.changeLanguage(lang)
|
||||||
}, [i18n, lang]);
|
},[ i18n,lang])
|
||||||
return (
|
return (
|
||||||
<Router>
|
<Router>
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -2,27 +2,13 @@ import { request } from "./request";
|
||||||
import { AxiosRequestConfig } from 'axios';
|
import { AxiosRequestConfig } from 'axios';
|
||||||
|
|
||||||
//发送验证码
|
//发送验证码
|
||||||
export const sendCode = <T>(params: {
|
export const sendCode = <T>(params: any,config:AxiosRequestConfig) =>
|
||||||
areaCode?: string; // 区号,只有手机号才有
|
|
||||||
account: string; // 账号(邮箱或手机号)
|
|
||||||
status: 1 | 2; // 1=登录 2=注册
|
|
||||||
signature: string;
|
|
||||||
timestamp: string;
|
|
||||||
},config:AxiosRequestConfig) =>
|
|
||||||
request.get<T>("/api/account/sendVerificationCode", params, {
|
request.get<T>("/api/account/sendVerificationCode", params, {
|
||||||
timeout: 15000,
|
timeout: 15000,
|
||||||
...config
|
...config
|
||||||
});
|
});
|
||||||
//注册
|
//注册
|
||||||
export const signUp = <T>(params: {
|
export const signUp = <T>(params: any,config:AxiosRequestConfig) =>
|
||||||
account: string; // account
|
|
||||||
area?: string; // 顶级区域:朝鲜/平壤、中国/广东
|
|
||||||
areaCode?: string; // 区号,只有手机号才有
|
|
||||||
authCode: string; // 验证码
|
|
||||||
district?: string; // 二级区域:具体的区域
|
|
||||||
shareCode: string; // invitation code
|
|
||||||
userName: string; // 用户名称
|
|
||||||
},config:AxiosRequestConfig) =>
|
|
||||||
request.post<T>("/api/account/signUp", params, {
|
request.post<T>("/api/account/signUp", params, {
|
||||||
timeout: 15000,
|
timeout: 15000,
|
||||||
...config
|
...config
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<g>
|
<g>
|
||||||
<path
|
<path
|
||||||
d="M15.38570390625,3.583333L2.33317390625,3.583333C2.2623339062500003,3.583333,2.19317390625,3.592083,2.12692390625,3.6091670000000002L8.449003906249999,9.93083C8.61171390625,10.09349,8.87546390625,10.09349,9.03817390625,9.93083L15.38570390625,3.583333ZM16.28690390625,3.86042L11.19520390625,8.952079999999999L16.33070390625,14.0871C16.436903906250002,13.9471,16.49980390625,13.7725,16.49980390625,13.5833L16.49980390625,4.41667C16.49980390625,4.20292,16.41940390625,4.00833,16.28730390625,3.86042L16.28690390625,3.86042ZM15.48150390625,14.4167L10.60650390625,9.54125L9.62733390625,10.52042C9.13916390625,11.00867,8.347593906250001,11.00867,7.85942390625,10.52042L6.88067390625,9.54125L2.05400390625,14.3688C2.14150390625,14.3996,2.23525390625,14.4167,2.33358390625,14.4167L15.48190390625,14.4167L15.48150390625,14.4167ZM1.51275390625,13.7308L6.29150390625,8.95167L1.5306709062500001,4.19167C1.51018390625,4.26491,1.4998099062499999,4.34061,1.49983690625,4.41667L1.49983690625,13.5833C1.49983690625,13.6333,1.50400390625,13.6829,1.51275390625,13.7308ZM2.33317390625,2.75L15.66650390625,2.75C16.58700390625,2.75,17.33320390625,3.4961919999999997,17.33320390625,4.41667L17.33320390625,13.5833C17.33320390625,14.5038,16.58700390625,15.25,15.66650390625,15.25L2.33317390625,15.25C1.41269590625,15.25,0.66650390625,14.5038,0.66650390625,13.5833L0.66650390625,4.41667C0.666503757238,3.4961919999999997,1.41269590625,2.75,2.33317390625,2.75Z"
|
d="M15.38570390625,3.583333L2.33317390625,3.583333C2.2623339062500003,3.583333,2.19317390625,3.592083,2.12692390625,3.6091670000000002L8.449003906249999,9.93083C8.61171390625,10.09349,8.87546390625,10.09349,9.03817390625,9.93083L15.38570390625,3.583333ZM16.28690390625,3.86042L11.19520390625,8.952079999999999L16.33070390625,14.0871C16.436903906250002,13.9471,16.49980390625,13.7725,16.49980390625,13.5833L16.49980390625,4.41667C16.49980390625,4.20292,16.41940390625,4.00833,16.28730390625,3.86042L16.28690390625,3.86042ZM15.48150390625,14.4167L10.60650390625,9.54125L9.62733390625,10.52042C9.13916390625,11.00867,8.347593906250001,11.00867,7.85942390625,10.52042L6.88067390625,9.54125L2.05400390625,14.3688C2.14150390625,14.3996,2.23525390625,14.4167,2.33358390625,14.4167L15.48190390625,14.4167L15.48150390625,14.4167ZM1.51275390625,13.7308L6.29150390625,8.95167L1.5306709062500001,4.19167C1.51018390625,4.26491,1.4998099062499999,4.34061,1.49983690625,4.41667L1.49983690625,13.5833C1.49983690625,13.6333,1.50400390625,13.6829,1.51275390625,13.7308ZM2.33317390625,2.75L15.66650390625,2.75C16.58700390625,2.75,17.33320390625,3.4961919999999997,17.33320390625,4.41667L17.33320390625,13.5833C17.33320390625,14.5038,16.58700390625,15.25,15.66650390625,15.25L2.33317390625,15.25C1.41269590625,15.25,0.66650390625,14.5038,0.66650390625,13.5833L0.66650390625,4.41667C0.666503757238,3.4961919999999997,1.41269590625,2.75,2.33317390625,2.75Z"
|
||||||
fill="#999999" fill-opacity="1" />
|
fill="#333333" fill-opacity="1" />
|
||||||
</g>
|
</g>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
@ -9,7 +9,7 @@
|
||||||
<g>
|
<g>
|
||||||
<path
|
<path
|
||||||
d="M15.38570390625,3.583333L2.33317390625,3.583333C2.2623339062500003,3.583333,2.19317390625,3.592083,2.12692390625,3.6091670000000002L8.449003906249999,9.93083C8.61171390625,10.09349,8.87546390625,10.09349,9.03817390625,9.93083L15.38570390625,3.583333ZM16.28690390625,3.86042L11.19520390625,8.952079999999999L16.33070390625,14.0871C16.436903906250002,13.9471,16.49980390625,13.7725,16.49980390625,13.5833L16.49980390625,4.41667C16.49980390625,4.20292,16.41940390625,4.00833,16.28730390625,3.86042L16.28690390625,3.86042ZM15.48150390625,14.4167L10.60650390625,9.54125L9.62733390625,10.52042C9.13916390625,11.00867,8.347593906250001,11.00867,7.85942390625,10.52042L6.88067390625,9.54125L2.05400390625,14.3688C2.14150390625,14.3996,2.23525390625,14.4167,2.33358390625,14.4167L15.48190390625,14.4167L15.48150390625,14.4167ZM1.51275390625,13.7308L6.29150390625,8.95167L1.5306709062500001,4.19167C1.51018390625,4.26491,1.4998099062499999,4.34061,1.49983690625,4.41667L1.49983690625,13.5833C1.49983690625,13.6333,1.50400390625,13.6829,1.51275390625,13.7308ZM2.33317390625,2.75L15.66650390625,2.75C16.58700390625,2.75,17.33320390625,3.4961919999999997,17.33320390625,4.41667L17.33320390625,13.5833C17.33320390625,14.5038,16.58700390625,15.25,15.66650390625,15.25L2.33317390625,15.25C1.41269590625,15.25,0.66650390625,14.5038,0.66650390625,13.5833L0.66650390625,4.41667C0.666503757238,3.4961919999999997,1.41269590625,2.75,2.33317390625,2.75Z"
|
d="M15.38570390625,3.583333L2.33317390625,3.583333C2.2623339062500003,3.583333,2.19317390625,3.592083,2.12692390625,3.6091670000000002L8.449003906249999,9.93083C8.61171390625,10.09349,8.87546390625,10.09349,9.03817390625,9.93083L15.38570390625,3.583333ZM16.28690390625,3.86042L11.19520390625,8.952079999999999L16.33070390625,14.0871C16.436903906250002,13.9471,16.49980390625,13.7725,16.49980390625,13.5833L16.49980390625,4.41667C16.49980390625,4.20292,16.41940390625,4.00833,16.28730390625,3.86042L16.28690390625,3.86042ZM15.48150390625,14.4167L10.60650390625,9.54125L9.62733390625,10.52042C9.13916390625,11.00867,8.347593906250001,11.00867,7.85942390625,10.52042L6.88067390625,9.54125L2.05400390625,14.3688C2.14150390625,14.3996,2.23525390625,14.4167,2.33358390625,14.4167L15.48190390625,14.4167L15.48150390625,14.4167ZM1.51275390625,13.7308L6.29150390625,8.95167L1.5306709062500001,4.19167C1.51018390625,4.26491,1.4998099062499999,4.34061,1.49983690625,4.41667L1.49983690625,13.5833C1.49983690625,13.6333,1.50400390625,13.6829,1.51275390625,13.7308ZM2.33317390625,2.75L15.66650390625,2.75C16.58700390625,2.75,17.33320390625,3.4961919999999997,17.33320390625,4.41667L17.33320390625,13.5833C17.33320390625,14.5038,16.58700390625,15.25,15.66650390625,15.25L2.33317390625,15.25C1.41269590625,15.25,0.66650390625,14.5038,0.66650390625,13.5833L0.66650390625,4.41667C0.666503757238,3.4961919999999997,1.41269590625,2.75,2.33317390625,2.75Z"
|
||||||
fill="#FCB44B" fill-opacity="1" />
|
fill="#BF62FF" fill-opacity="1" />
|
||||||
</g>
|
</g>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 684 B |
|
@ -1,5 +1,5 @@
|
||||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||||
import { useState, useEffect, useRef } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Form, Input, Button } from "antd-mobile";
|
import { Form, Input, Button } from "antd-mobile";
|
||||||
import "../pages/SignIn.scss";
|
import "../pages/SignIn.scss";
|
||||||
|
@ -7,20 +7,14 @@ import { useCountdown } from "../hooks/useCountdown";
|
||||||
import { sendCode, signUp } from "../api";
|
import { sendCode, signUp } from "../api";
|
||||||
import { sendCodeTypes, signUpTypes,ErrorType } from "../type/SignIn";
|
import { sendCodeTypes, signUpTypes,ErrorType } from "../type/SignIn";
|
||||||
import { Toast } from "antd-mobile";
|
import { Toast } from "antd-mobile";
|
||||||
import { useNavigate } from "react-router-dom";
|
|
||||||
import { Md5 } from "ts-md5";
|
|
||||||
import { FormInstance } from "antd-mobile/es/components/form";
|
|
||||||
|
|
||||||
function EmailForm() {
|
function EmailForm() {
|
||||||
const formRef = useRef<FormInstance>(null);
|
|
||||||
const navigate = useNavigate();
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { start, time } = useCountdown();
|
const { start, time } = useCountdown();
|
||||||
const [email, setEmail] = useState("");
|
const [email, setEmail] = useState("");
|
||||||
const [authCode, setAuthCode] = useState("");
|
const [authCode, setAuthCode] = useState("");
|
||||||
const [shareCode, setShareCode] = useState("");
|
const [shareCode, setShareCode] = useState("");
|
||||||
const [remainingTime, setRemainingTime] = useState(0);
|
const [remainingTime, setRemainingTime] = useState(0);
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
headers: {
|
headers: {
|
||||||
"Accept-Language": navigator.language,
|
"Accept-Language": navigator.language,
|
||||||
|
@ -31,55 +25,50 @@ function EmailForm() {
|
||||||
if (email === "") {
|
if (email === "") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const timestamp = `${new Date().getTime()}`;
|
|
||||||
const res = await sendCode<sendCodeTypes>(
|
const res = await sendCode<sendCodeTypes>(
|
||||||
{
|
{
|
||||||
account: email,
|
account: email,
|
||||||
areaCode: "",
|
areaCode: "",
|
||||||
status: 2,
|
status: 2,
|
||||||
signature: Md5.hashStr(`Neer${email},${2},${timestamp}GetCode`),
|
|
||||||
timestamp,
|
|
||||||
},
|
},
|
||||||
config
|
config
|
||||||
);
|
);
|
||||||
console.log("res", res);
|
console.log("res", res);
|
||||||
if (res.status === 200 && res.data.data.sms) {
|
if (res.status === 200 && res.data.data.sms) {
|
||||||
Toast.show({
|
Toast.show({
|
||||||
content: t("send successfully"),
|
content: t('send successfully'),
|
||||||
afterClose: () => {
|
afterClose: () => {
|
||||||
start(60 * 1000);
|
start(60 * 1000);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
Toast.show({
|
Toast.show({
|
||||||
content: t("Send failure"),
|
content: t('Send failure'),
|
||||||
afterClose: () => {
|
afterClose: () => {
|
||||||
// start(60 * 1000);
|
start(60 * 1000);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (error:unknown) {
|
} catch (error:unknown) {
|
||||||
// 检查 error 是否是 ErrorType 类型
|
// 检查 error 是否是 ErrorType 类型
|
||||||
if (typeof error === "object" && error !== null && "msg" in error) {
|
if (typeof error === 'object' && error !== null && 'msg' in error) {
|
||||||
const typedError = error as ErrorType; // 使用类型断言
|
const typedError = error as ErrorType; // 使用类型断言
|
||||||
Toast.show({
|
Toast.show({
|
||||||
content: typedError.msg,
|
content: typedError.msg,
|
||||||
afterClose: () => {
|
afterClose: () => {
|
||||||
// start(60 * 1000);
|
start(60 * 1000);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// 处理不是 ErrorType 类型的错误
|
// 处理不是 ErrorType 类型的错误
|
||||||
console.log("An unexpected error occurred");
|
console.log('An unexpected error occurred');
|
||||||
}
|
}
|
||||||
console.warn(error);
|
console.warn(error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setRemainingTime(time / 1000);
|
setRemainingTime(time / 1000);
|
||||||
}, [time]);
|
}, [time]);
|
||||||
|
|
||||||
const handleSignUp = async () => {
|
const handleSignUp = async () => {
|
||||||
if (email === "" || authCode === "") {
|
if (email === "" || authCode === "") {
|
||||||
return;
|
return;
|
||||||
|
@ -91,20 +80,15 @@ function EmailForm() {
|
||||||
area: "",
|
area: "",
|
||||||
areaCode: "",
|
areaCode: "",
|
||||||
authCode: authCode,
|
authCode: authCode,
|
||||||
shareCode: shareCode || formRef.current?.getFieldValue("shareCode"),
|
shareCode: shareCode,
|
||||||
userName: "",
|
|
||||||
},
|
},
|
||||||
config
|
config
|
||||||
);
|
);
|
||||||
console.log("res", res);
|
console.log("res", res);
|
||||||
if (res.status === 200 && res.data.data.token) {
|
if (res.status === 200 && res.data.data.token) {
|
||||||
console.log(111);
|
|
||||||
Toast.show({
|
Toast.show({
|
||||||
content: res.data.msg,
|
content: res.data.msg,
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
|
||||||
navigate("/Download");
|
|
||||||
}, 1000);
|
|
||||||
} else {
|
} else {
|
||||||
Toast.show({
|
Toast.show({
|
||||||
content: res.data.msg,
|
content: res.data.msg,
|
||||||
|
@ -112,26 +96,21 @@ function EmailForm() {
|
||||||
}
|
}
|
||||||
} catch (error:unknown) {
|
} catch (error:unknown) {
|
||||||
// 检查 error 是否是 ErrorType 类型
|
// 检查 error 是否是 ErrorType 类型
|
||||||
if (typeof error === "object" && error !== null && "msg" in error) {
|
if (typeof error === 'object' && error !== null && 'msg' in error) {
|
||||||
const typedError = error as ErrorType; // 使用类型断言
|
const typedError = error as ErrorType; // 使用类型断言
|
||||||
Toast.show({
|
Toast.show({
|
||||||
content: typedError.msg,
|
content: typedError.msg,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// 处理不是 ErrorType 类型的错误
|
// 处理不是 ErrorType 类型的错误
|
||||||
console.log("An unexpected error occurred");
|
console.log('An unexpected error occurred');
|
||||||
}
|
}
|
||||||
console.warn(error);
|
console.warn(error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Form
|
<Form
|
||||||
ref={formRef}
|
|
||||||
name="form"
|
name="form"
|
||||||
initialValues={{
|
|
||||||
shareCode: getShareCode(window.location.search),
|
|
||||||
}}
|
|
||||||
footer={
|
footer={
|
||||||
<Button
|
<Button
|
||||||
block
|
block
|
||||||
|
@ -193,19 +172,4 @@ function EmailForm() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const getShareCode = (url: string) => {
|
|
||||||
const newStr = url.replace("?", "")?.split("&");
|
|
||||||
if (!newStr) return "";
|
|
||||||
const shareStr = newStr.find((item) => item.includes("shareCode"));
|
|
||||||
if (!shareStr) return "";
|
|
||||||
if (shareStr) {
|
|
||||||
const code = shareStr.split("=")[1];
|
|
||||||
if (code) {
|
|
||||||
// setShareCode(code)
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
};
|
|
||||||
|
|
||||||
export default EmailForm;
|
export default EmailForm;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { useState, useEffect, useRef } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Form, Input, Button } from "antd-mobile";
|
import { Form, Input, Button } from "antd-mobile";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
|
@ -8,10 +8,8 @@ import { useCountdown } from "../hooks/useCountdown";
|
||||||
import { sendCode, signUp } from "../api";
|
import { sendCode, signUp } from "../api";
|
||||||
import { sendCodeTypes, signUpTypes,ErrorType} from "../type/SignIn";
|
import { sendCodeTypes, signUpTypes,ErrorType} from "../type/SignIn";
|
||||||
import { Toast } from "antd-mobile";
|
import { Toast } from "antd-mobile";
|
||||||
import { Md5 } from "ts-md5";
|
|
||||||
import { FormInstance } from "antd-mobile/es/components/form/form";
|
|
||||||
function PhoneForm() {
|
function PhoneForm() {
|
||||||
const formRef = useRef<FormInstance>(null);
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { start, time } = useCountdown();
|
const { start, time } = useCountdown();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
@ -21,22 +19,6 @@ function PhoneForm() {
|
||||||
UpdateCurrentPhoneNumber,
|
UpdateCurrentPhoneNumber,
|
||||||
UpdatePreviousPathName,
|
UpdatePreviousPathName,
|
||||||
} = useUserStore();
|
} = useUserStore();
|
||||||
|
|
||||||
const getShareCode = (url: string) => {
|
|
||||||
const newStr = url.replace("?", "")?.split("&");
|
|
||||||
if (!newStr) return "";
|
|
||||||
const shareStr = newStr.find((item) => item.includes("shareCode"));
|
|
||||||
if (!shareStr) return "";
|
|
||||||
if (shareStr) {
|
|
||||||
const code = shareStr.split("=")[1];
|
|
||||||
if (code) {
|
|
||||||
// setShareCode(code)
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
};
|
|
||||||
|
|
||||||
const defaultAreaCode = "+1";
|
const defaultAreaCode = "+1";
|
||||||
const [authCode, setAuthCode] = useState("");
|
const [authCode, setAuthCode] = useState("");
|
||||||
const [shareCode, setShareCode] = useState("");
|
const [shareCode, setShareCode] = useState("");
|
||||||
|
@ -59,107 +41,89 @@ function PhoneForm() {
|
||||||
if (CurrentPhoneNumber === "") {
|
if (CurrentPhoneNumber === "") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const timestamp = `${new Date().getTime()}`;
|
const res = await sendCode<sendCodeTypes>({
|
||||||
const res = await sendCode<sendCodeTypes>(
|
|
||||||
{
|
|
||||||
account: CurrentPhoneNumber,
|
account: CurrentPhoneNumber,
|
||||||
areaCode: SelectCountry?.code || defaultAreaCode,
|
areaCode: SelectCountry?.code,
|
||||||
status: 2,
|
status: 2,
|
||||||
signature: Md5.hashStr(
|
},config);
|
||||||
`Neer${CurrentPhoneNumber},${2},${timestamp}GetCode`
|
|
||||||
),
|
|
||||||
timestamp,
|
|
||||||
},
|
|
||||||
config
|
|
||||||
);
|
|
||||||
console.log("res", res);
|
console.log("res", res);
|
||||||
if (res.status === 200 && res.data.data.sms) {
|
if (res.status === 200 && res.data.data.sms) {
|
||||||
console.log(111);
|
|
||||||
Toast.show({
|
Toast.show({
|
||||||
content: t("send successfully"),
|
content:t('send successfully'),
|
||||||
afterClose: () => {
|
afterClose: () => {
|
||||||
start(60 * 1000);
|
start(60 * 1000);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
Toast.show({
|
Toast.show({
|
||||||
content: t("Send failure"),
|
content: t('Send failure'),
|
||||||
afterClose: () => {
|
afterClose: () => {
|
||||||
// start(60 * 1000);
|
start(60 * 1000);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (error:unknown) {
|
} catch (error:unknown) {
|
||||||
// 检查 error 是否是 ErrorType 类型
|
// 检查 error 是否是 ErrorType 类型
|
||||||
if (typeof error === "object" && error !== null && "msg" in error) {
|
if (typeof error === 'object' && error !== null && 'msg' in error) {
|
||||||
const typedError = error as ErrorType; // 使用类型断言
|
const typedError = error as ErrorType; // 使用类型断言
|
||||||
Toast.show({
|
Toast.show({
|
||||||
content: typedError.msg,
|
content: typedError.msg,
|
||||||
afterClose: () => {
|
afterClose: () => {
|
||||||
// start(60 * 1000);
|
start(60 * 1000);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// 处理不是 ErrorType 类型的错误
|
// 处理不是 ErrorType 类型的错误
|
||||||
console.log("An unexpected error occurred");
|
console.log('An unexpected error occurred');
|
||||||
}
|
}
|
||||||
console.warn(error);
|
console.warn(error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setRemainingTime(time / 1000);
|
setRemainingTime(time / 1000)
|
||||||
}, [time]);
|
}, [time]);
|
||||||
|
|
||||||
const handleSignUp = async () =>{
|
const handleSignUp = async () =>{
|
||||||
if (CurrentPhoneNumber === "" || authCode === "") {
|
if(CurrentPhoneNumber === '' || authCode === '') {
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const res = await signUp<signUpTypes>(
|
const res = await signUp<signUpTypes>({
|
||||||
{
|
|
||||||
account:CurrentPhoneNumber,
|
account:CurrentPhoneNumber,
|
||||||
area:SelectCountry?.cn,
|
area:SelectCountry?.cn,
|
||||||
areaCode:SelectCountry?.code,
|
areaCode:SelectCountry?.code,
|
||||||
authCode:authCode,
|
authCode:authCode,
|
||||||
shareCode: shareCode || formRef.current?.getFieldValue("shareCode"),
|
shareCode:shareCode
|
||||||
userName: "",
|
},config)
|
||||||
},
|
console.log('res',res)
|
||||||
config
|
|
||||||
);
|
|
||||||
console.log("res", res);
|
|
||||||
if(res.status === 200 && res.data.data.token) {
|
if(res.status === 200 && res.data.data.token) {
|
||||||
Toast.show({
|
Toast.show({
|
||||||
content: res.data.msg,
|
content: res.data.msg,
|
||||||
});
|
})
|
||||||
setTimeout(() => {
|
|
||||||
navigate("/Download");
|
|
||||||
}, 1000);
|
|
||||||
}else {
|
}else {
|
||||||
Toast.show({
|
Toast.show({
|
||||||
content: res.data.msg,
|
content: res.data.msg,
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
} catch (error:unknown) {
|
} catch (error:unknown) {
|
||||||
// 检查 error 是否是 ErrorType 类型
|
// 检查 error 是否是 ErrorType 类型
|
||||||
if (typeof error === "object" && error !== null && "msg" in error) {
|
if (typeof error === 'object' && error !== null && 'msg' in error) {
|
||||||
const typedError = error as ErrorType; // 使用类型断言
|
const typedError = error as ErrorType; // 使用类型断言
|
||||||
Toast.show({
|
Toast.show({
|
||||||
content: typedError.msg,
|
content: typedError.msg,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// 处理不是 ErrorType 类型的错误
|
// 处理不是 ErrorType 类型的错误
|
||||||
console.log("An unexpected error occurred");
|
console.log('An unexpected error occurred');
|
||||||
}
|
}
|
||||||
console.warn(error);
|
console.warn(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<Form
|
<Form
|
||||||
name="form"
|
name="form"
|
||||||
ref={formRef}
|
|
||||||
initialValues={{
|
|
||||||
shareCode: getShareCode(window.location.search),
|
|
||||||
}}
|
|
||||||
footer={
|
footer={
|
||||||
<Button
|
<Button
|
||||||
block
|
block
|
||||||
|
|
|
@ -1,23 +1,24 @@
|
||||||
{
|
{
|
||||||
"E-mail": "電子郵件",
|
"E-mail": "电子邮件",
|
||||||
"phone": "電話",
|
"phone":"电话",
|
||||||
"Please enter your email address": "請輸入您的電子郵件地址",
|
"Please enter your email address":"请输入您的电子邮件地址",
|
||||||
"Please enter the email verification code": "請輸入電子郵件驗證碼",
|
"Please enter the email verification code":"请输入电子邮件验证码",
|
||||||
"Please enter your phone number": "請輸入您的電話號碼",
|
"Please enter your phone number":"请输入您的电话号码",
|
||||||
"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":"注册",
|
||||||
"If you already have an account": "已有帳戶",
|
"If you already have an account":"如果你已经有一个帐户",
|
||||||
"download the APP directly": "直接下載APP",
|
"download the APP directly":"直接下载APP",
|
||||||
"Continuing to represent you in agreeing to our": "繼續代表妳方同意我們的",
|
"Continuing to represent you in agreeing to our":"继续代表你方同意我们的",
|
||||||
"Terms of Service": "服務條款",
|
"Terms of Service":"服务条款",
|
||||||
"and":"和",
|
"and":"和",
|
||||||
"Privacy Policy": "隱私政策",
|
"Privacy Policy":"隐私政策",
|
||||||
"Select country/region": "選擇國家/地區",
|
"Select country/region":"选择国家/地区",
|
||||||
"seconds": "秒",
|
"seconds": "秒",
|
||||||
"Official Website": "官方網站",
|
"Official Website":"官方网站",
|
||||||
"Download": "下載",
|
"Download":"下载",
|
||||||
"send successfully": "發送成功",
|
"send successfully":"发送成功",
|
||||||
"Send failure": "發送失敗"
|
"Send failure":"发送失败"
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
"Please enter SMS verification code":"Please enter SMS verification code",
|
"Please enter SMS verification code":"Please enter SMS verification code",
|
||||||
"Send verification code":"Send verification code",
|
"Send verification code":"Send verification code",
|
||||||
"Please enter the invitation code (optional)":"Please enter the invitation code (optional)",
|
"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",
|
"If you already have an account":"If you already have an account",
|
||||||
"download the APP directly":"download the APP directly",
|
"download the APP directly":"download the APP directly",
|
||||||
"Continuing to represent you in agreeing to our":"Continuing to represent you in agreeing to our",
|
"Continuing to represent you in agreeing to our":"Continuing to represent you in agreeing to our",
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
body,
|
:
|
||||||
html {
|
{
|
||||||
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
|
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
@ -13,19 +13,16 @@ html {
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
#root {
|
#root {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
background: #fafafb;
|
background: #fafafb;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #646cff;
|
color: #646cff;
|
||||||
text-decoration: inherit;
|
text-decoration: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
a:hover {
|
a:hover {
|
||||||
color: #535bf2;
|
color: #535bf2;
|
||||||
}
|
}
|
||||||
|
@ -54,30 +51,22 @@ button {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: border-color 0.25s;
|
transition: border-color 0.25s;
|
||||||
}
|
}
|
||||||
|
|
||||||
button:hover {
|
button:hover {
|
||||||
border-color: #646cff;
|
border-color: #646cff;
|
||||||
}
|
}
|
||||||
|
|
||||||
button:focus,
|
button:focus,
|
||||||
button:focus-visible {
|
button:focus-visible {
|
||||||
outline: 4px auto -webkit-focus-ring-color;
|
outline: 4px auto -webkit-focus-ring-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
.adm-form-item-feedback-error {
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (prefers-color-scheme: light) {
|
@media (prefers-color-scheme: light) {
|
||||||
:root {
|
:root {
|
||||||
color: #213547;
|
color: #213547;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
a:hover {
|
a:hover {
|
||||||
color: #747bff;
|
color: #747bff;
|
||||||
}
|
}
|
||||||
|
|
||||||
button {
|
button {
|
||||||
background-color: #f9f9f9;
|
background-color: #f9f9f9;
|
||||||
}
|
}
|
||||||
|
|
15
src/main.tsx
|
@ -1,5 +1,10 @@
|
||||||
import ReactDOM from "react-dom/client";
|
import React from 'react'
|
||||||
import App from "./App.tsx";
|
import ReactDOM from 'react-dom/client'
|
||||||
import "./index.css";
|
import App from './App.tsx'
|
||||||
import "./i18n/config.ts";
|
import './index.css'
|
||||||
ReactDOM.createRoot(document.getElementById("root")!).render(<App />);
|
import './i18n/config.ts'
|
||||||
|
ReactDOM.createRoot(document.getElementById('root')!).render(
|
||||||
|
<React.StrictMode>
|
||||||
|
<App />
|
||||||
|
</React.StrictMode>,
|
||||||
|
)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
.container {
|
.container {
|
||||||
background: #131313;
|
background: #fafafb;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
padding: 4.625rem 2.5rem;
|
padding: 4.625rem 2.5rem;
|
||||||
|
@ -18,16 +18,12 @@
|
||||||
|
|
||||||
.btn-box {
|
.btn-box {
|
||||||
margin-top: 11.4375rem;
|
margin-top: 11.4375rem;
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
.btn-item {
|
.btn-item {
|
||||||
width: 18.4375rem;
|
width: 18.4375rem;
|
||||||
height: 2.75rem;
|
height: 2.75rem;
|
||||||
border-radius: .3125rem;
|
border-radius: .3125rem;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border: .0625rem solid #FCB44B;
|
border: .0625rem solid #BF62FF;
|
||||||
margin-bottom: 1.25rem;
|
margin-bottom: 1.25rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -40,7 +36,7 @@
|
||||||
a {
|
a {
|
||||||
font-family: PingFang SC;
|
font-family: PingFang SC;
|
||||||
font-size: 1.125rem;
|
font-size: 1.125rem;
|
||||||
color: #ffffff;
|
color: #333333;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// import googleIcon from '../assets/img/google.png'
|
import googleIcon from '../assets/img/google.png'
|
||||||
// import appStoreIcon from '../assets/img/app_store.png'
|
import appStoreIcon from '../assets/img/app_store.png'
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import Logo from "../assets/img/logo.png"
|
import Logo from "../assets/img/logo.png"
|
||||||
|
|
||||||
|
@ -14,19 +14,19 @@ function Download() {
|
||||||
<img src={Logo} alt="" />
|
<img src={Logo} alt="" />
|
||||||
</div>
|
</div>
|
||||||
<div className="btn-box">
|
<div className="btn-box">
|
||||||
{/* <div className="btn-item">
|
<div className="btn-item">
|
||||||
<img src={googleIcon}alt="" />
|
<img src={googleIcon}alt="" />
|
||||||
<a>Google Play</a>
|
<a href="">Google Play</a>
|
||||||
</div>
|
</div>
|
||||||
<div className="btn-item">
|
<div className="btn-item">
|
||||||
<img src={appStoreIcon} alt="" />
|
<img src={appStoreIcon} alt="" />
|
||||||
<a>App Store</a>
|
<a href="">App Store</a>
|
||||||
</div> */}
|
|
||||||
<div className="btn-item">
|
|
||||||
<a href="https://d.pineer.cc/app-release.apk">{t('Download')} APK</a>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="btn-item">
|
<div className="btn-item">
|
||||||
<a href="https://www.pineer.cc">{t('Official Website')}</a>
|
<a href="http://8.217.122.133/upload/apk/app-release.apk">{t('Download')} APK</a>
|
||||||
|
</div>
|
||||||
|
<div className="btn-item">
|
||||||
|
<a href="">{t('Official Website')}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.area-box {
|
.area-box {
|
||||||
overflow-y: scroll;
|
overflow: scroll;
|
||||||
height: calc(100vh - 7.5rem);
|
height: calc(100vh - 7.5rem);
|
||||||
padding: 0 1.5rem;
|
padding: 0 1.5rem;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
@ -69,8 +69,8 @@
|
||||||
line-height: 3.25rem;
|
line-height: 3.25rem;
|
||||||
border-bottom: .0625rem solid #D8D8D8;
|
border-bottom: .0625rem solid #D8D8D8;
|
||||||
&.selected {
|
&.selected {
|
||||||
border-bottom: .0625rem solid #FCB44B;
|
border-bottom: .0625rem solid #BF62FF;
|
||||||
color: #FCB44B;
|
color: #BF62FF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,32 +1,15 @@
|
||||||
.popoverContainer {
|
|
||||||
.adm-popover-inner {
|
|
||||||
.adm-popover-inner-content {
|
|
||||||
padding: 0 !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
background: #fafafb;
|
background: #fafafb;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
padding: 4.625rem 2.5rem;
|
padding: 4.625rem 2.5rem;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
position: relative;
|
|
||||||
|
|
||||||
.language {
|
|
||||||
position: absolute;
|
|
||||||
right: 3rem;
|
|
||||||
top: 2rem;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
width: 4.25rem;
|
width: 4.25rem;
|
||||||
height: 4.25rem;
|
height: 4.25rem;
|
||||||
margin-left: 50%;
|
margin-left: 50%;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
|
|
||||||
img {
|
img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
@ -43,16 +26,14 @@
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
color: #999999;
|
color: #333333;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-right: 2.0625rem;
|
margin-right: 2.0625rem;
|
||||||
|
|
||||||
&.selected {
|
&.selected {
|
||||||
border-bottom: .0625rem solid #FCB44B;
|
border-bottom: .0625rem solid #BF62FF;
|
||||||
color: #FCB44B;
|
color:#BF62FF;
|
||||||
}
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
margin-right: .4375rem;
|
margin-right: .4375rem;
|
||||||
}
|
}
|
||||||
|
@ -66,19 +47,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.adm-list-item {
|
.adm-list-item {
|
||||||
background: #333333;
|
background: #FFFFFF;
|
||||||
margin-bottom: 1.7rem;
|
margin-bottom: 1.7rem;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 2.75rem;
|
height: 2.75rem;
|
||||||
border-radius: .3125rem;
|
border-radius: .3125rem;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border: 1px solid #56512c !important;
|
border: 1px solid #999999 !important;
|
||||||
// box-shadow: 0px 2px 5px 0px rgba(153, 153, 153, 50%);
|
box-shadow: 0px 2px 5px 0px rgba(153, 153, 153, 50%);
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
|
|
||||||
.adm-input-element {
|
.adm-input-element {
|
||||||
color: #c6c6c6;
|
|
||||||
|
|
||||||
&::placeholder {
|
&::placeholder {
|
||||||
font-size: .75rem;
|
font-size: .75rem;
|
||||||
color: #999999
|
color: #999999
|
||||||
|
@ -89,70 +67,55 @@
|
||||||
.adm-list-item-content {
|
.adm-list-item-content {
|
||||||
border-style: none;
|
border-style: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.adm-list-item-content-main {
|
.adm-list-item-content-main {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.adm-input {
|
.adm-input {
|
||||||
padding: 0.5rem 0 0.6rem 0;
|
padding: .75rem 0;
|
||||||
padding-left: .625rem;
|
padding-left: .625rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.send-code {
|
.send-code {
|
||||||
font-family: PingFang SC;
|
font-family: PingFang SC;
|
||||||
font-size: .75rem;
|
font-size: .75rem;
|
||||||
color: #0957c0;
|
color: #BF62FF;
|
||||||
margin-bottom: 1.5375rem;
|
margin-bottom:.9375rem;
|
||||||
margin-top: -0.5rem;
|
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.adm-form-footer {
|
.adm-form-footer {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.submit-btn {
|
.submit-btn {
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
width: 6.1875rem;
|
width: 6.1875rem;
|
||||||
height: 2.75rem;
|
height: 2.75rem;
|
||||||
border-radius: .3125rem;
|
border-radius: .3125rem;
|
||||||
background: #FCB44B;
|
background: #BF62FF;
|
||||||
font-family: PingFang SC;
|
font-family: PingFang SC;
|
||||||
font-size: .75rem;
|
font-size: .75rem;
|
||||||
color: #333;
|
color: #FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
.to-download {
|
.to-download {
|
||||||
font-family: PingFang SC;
|
font-family: PingFang SC;
|
||||||
font-size: .875rem;
|
font-size: .875rem;
|
||||||
color: #0957c0;
|
color: #BF62FF;
|
||||||
}
|
}
|
||||||
|
|
||||||
.terms-service {
|
.terms-service {
|
||||||
font-family: PingFang SC;
|
font-family: PingFang SC;
|
||||||
font-size: .75rem;
|
font-size: .75rem;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-top: 5rem;
|
margin-top: 5rem;
|
||||||
|
|
||||||
p {
|
p {
|
||||||
color: #999999;
|
color: #999999;
|
||||||
}
|
}
|
||||||
|
span {
|
||||||
span>a {
|
color:#BF62FF;
|
||||||
color: #0957c0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.phone-box {
|
.phone-box {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
border-radius: .3125rem;
|
border-radius: .3125rem;
|
||||||
|
|
||||||
span {
|
span {
|
||||||
width: 3.75rem;
|
width: 3.75rem;
|
||||||
height: 2.6rem;
|
height: 2.6rem;
|
||||||
|
@ -160,17 +123,18 @@
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-family: PingFang SC;
|
font-family: PingFang SC;
|
||||||
font-size: .75rem;
|
font-size: .75rem;
|
||||||
color: #c6c6c6;
|
color: #666666;
|
||||||
background: #333333;
|
background: #EAEAEA;
|
||||||
border-right: .0625rem solid #5d5d5d;
|
border-right: .0625rem solid #999999;
|
||||||
|
border-left: .0625rem solid #999999;
|
||||||
|
border-bottom: .0625rem solid #999999;
|
||||||
border-top-left-radius: .3125rem;
|
border-top-left-radius: .3125rem;
|
||||||
border-bottom-left-radius: .3125rem;
|
border-bottom-left-radius: .3125rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.adm-input {
|
.adm-input {
|
||||||
padding-top: 0rem;
|
padding-top: 0.55rem;
|
||||||
padding-left: 0.625rem;
|
padding-left: 0.625rem;
|
||||||
padding-bottom: 0.1rem;
|
padding-bottom: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,28 +1,26 @@
|
||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import { useTranslation, getI18n } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import phoneIconSelect from "../assets/iconfont/phone_Select.svg";
|
import phoneIconSelect from "../assets/iconfont/phone_Select.svg";
|
||||||
import phoneIcon from "../assets/iconfont/phone.svg";
|
import phoneIcon from "../assets/iconfont/phone.svg";
|
||||||
import emailIcon from "../assets/iconfont/email.svg";
|
import emailIcon from "../assets/iconfont/email.svg";
|
||||||
import emailIconSelect from "../assets/iconfont/email_Select.svg";
|
import emailIconSelect from "../assets/iconfont/email_Select.svg";
|
||||||
import Logo from "../assets/img/logo.png";
|
import Logo from "../assets/img/logo.png"
|
||||||
import "./SignIn.scss";
|
import "./SignIn.scss";
|
||||||
import EmailForm from "../components/EmailForm";
|
import EmailForm from "../components/EmailForm";
|
||||||
import PhoneForm from "../components/PhoneForm";
|
import PhoneForm from "../components/PhoneForm";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import useUserStore from "../store/user.ts";
|
import useUserStore from "../store/user.ts";
|
||||||
import { Popover } from "antd-mobile";
|
|
||||||
|
|
||||||
|
console.log('language',navigator.language)
|
||||||
function SignIn() {
|
function SignIn() {
|
||||||
const { t, i18n } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const lang: string = getI18n().language;
|
|
||||||
const [visible, setVisible] = useState(false);
|
|
||||||
|
|
||||||
const [selectIndex, setSelectIndex] = useState<number>(0);
|
const [selectIndex, setSelectIndex] = useState<number>(0);
|
||||||
const { previousPathName, UpdatePreviousPathName } = useUserStore();
|
const {previousPathName,UpdatePreviousPathName} = useUserStore()
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const handleTabs = (num: number) => {
|
const handleTabs = (num: number) => {
|
||||||
return () => {
|
return () => {
|
||||||
UpdatePreviousPathName("/");
|
UpdatePreviousPathName('/');
|
||||||
setSelectIndex(num);
|
setSelectIndex(num);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -34,68 +32,8 @@ function SignIn() {
|
||||||
setSelectIndex(1);
|
setSelectIndex(1);
|
||||||
}
|
}
|
||||||
}, [previousPathName]);
|
}, [previousPathName]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="container">
|
<div className="container">
|
||||||
<div className="language">
|
|
||||||
<Popover
|
|
||||||
className="popoverContainer"
|
|
||||||
mode="dark"
|
|
||||||
visible={visible}
|
|
||||||
placement="bottom-end"
|
|
||||||
trigger="click"
|
|
||||||
content={
|
|
||||||
<ul
|
|
||||||
style={{
|
|
||||||
listStyle: "none",
|
|
||||||
display: "flex",
|
|
||||||
flexDirection: "column",
|
|
||||||
justifyContent: "flex-start",
|
|
||||||
alignItems: "center",
|
|
||||||
margin: 0,
|
|
||||||
padding: "5px 10px",
|
|
||||||
fontSize: 14,
|
|
||||||
background: "#333333",
|
|
||||||
borderRadius: 6,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<li
|
|
||||||
style={{
|
|
||||||
borderBottom: "1px solid #2f2f2f",
|
|
||||||
padding: "5px 10px",
|
|
||||||
cursor: "pointer",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
onClick={() => {
|
|
||||||
i18n.changeLanguage("cn");
|
|
||||||
setVisible(false);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
中文(繁体)
|
|
||||||
</span>
|
|
||||||
</li>
|
|
||||||
<li style={{ padding: "5px 10px", cursor: "pointer" }}>
|
|
||||||
<span
|
|
||||||
onClick={() => {
|
|
||||||
i18n.changeLanguage("en");
|
|
||||||
setVisible(false);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
English
|
|
||||||
</span>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
style={{ cursor: "pointer" }}
|
|
||||||
onClick={() => setVisible(!visible)}
|
|
||||||
>
|
|
||||||
{lang === "cn" ? "中文" : "English"}
|
|
||||||
</span>
|
|
||||||
</Popover>
|
|
||||||
</div>
|
|
||||||
<div className="logo">
|
<div className="logo">
|
||||||
<img src={Logo} alt="" />
|
<img src={Logo} alt="" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -117,31 +55,15 @@ function SignIn() {
|
||||||
</div>
|
</div>
|
||||||
{selectIndex === 0 && <EmailForm></EmailForm>}
|
{selectIndex === 0 && <EmailForm></EmailForm>}
|
||||||
{selectIndex === 1 && <PhoneForm></PhoneForm>}
|
{selectIndex === 1 && <PhoneForm></PhoneForm>}
|
||||||
<div className="to-download">
|
<div className="to-download" onClick={()=> navigate("/Download")}>
|
||||||
<p style={{ color: "#999999" }}>
|
<p>{t("If you already have an account")}</p>
|
||||||
{t("If you already have an account")}
|
<p>{t("download the APP directly")}</p>
|
||||||
</p>
|
|
||||||
<p onClick={() => navigate("/Download")}>
|
|
||||||
{t("download the APP directly")}
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="terms-service">
|
<div className="terms-service">
|
||||||
<p>{t("Continuing to represent you in agreeing to our")}</p>
|
<p>{t("Continuing to represent you in agreeing to our")}</p>
|
||||||
<p>
|
<p>
|
||||||
<span>
|
<span>{t("Terms of Service")}</span> {t("and")}{" "}
|
||||||
<a
|
<span>{t("Privacy Policy")}</span>
|
||||||
target="_blank"
|
|
||||||
href="https://lm0-1.gitbook.io/terms-of-service/"
|
|
||||||
>
|
|
||||||
{t("Terms of Service")}
|
|
||||||
</a>
|
|
||||||
</span>{" "}
|
|
||||||
{t("and")}{" "}
|
|
||||||
<span>
|
|
||||||
<a target="_blank" href="https://lm0-1.gitbook.io/privacy-policy/">
|
|
||||||
{t("Privacy Policy")}
|
|
||||||
</a>
|
|
||||||
</span>
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|