update(修改页面)

This commit is contained in:
john 2024-05-22 18:34:41 +08:00
parent d6ebf4aef5
commit 7d465ca568
18 changed files with 73 additions and 32 deletions

Binary file not shown.

View File

@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/src/assets/img/logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>NEER-APP-H5</title>
<title>Pineer</title>
</head>
<body>
<div id="root"></div>

View File

@ -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": {

View File

@ -1,8 +1,6 @@
#root {
max-width: 1280px;
margin: 0 auto;
/* max-width: 1280px; */
/* margin: 0 auto; */
padding: 2rem;
text-align: center;
}
}

View File

@ -2,13 +2,27 @@ import { request } from "./request";
import { AxiosRequestConfig } from 'axios';
//发送验证码
export const sendCode = <T>(params: any,config:AxiosRequestConfig) =>
export const sendCode = <T>(params: {
areaCode?: string; // 区号,只有手机号才有
account: string; // 账号(邮箱或手机号)
status: 1 | 2; // 1=登录 2=注册
signature: string;
timestamp: string;
},config:AxiosRequestConfig) =>
request.get<T>("/api/account/sendVerificationCode", params, {
timeout: 15000,
...config
});
//注册
export const signUp = <T>(params: any,config:AxiosRequestConfig) =>
export const signUp = <T>(params: {
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, {
timeout: 15000,
...config

View File

@ -9,7 +9,7 @@
<g>
<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"
fill="#f5d90a" fill-opacity="1" />
fill="#FCB44B" fill-opacity="1" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -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<sendCodeTypes>(
{
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
);

View File

@ -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<sendCodeTypes>({
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) {

View File

@ -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",

View File

@ -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;
}
}
}

View File

@ -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;

View File

@ -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() {
<img src={Logo} alt="" />
</div>
<div className="btn-box">
<div className="btn-item">
{/* <div className="btn-item">
<img src={googleIcon}alt="" />
<a href="">Google Play</a>
<a>Google Play</a>
</div>
<div className="btn-item">
<img src={appStoreIcon} alt="" />
<a href="">App Store</a>
</div>
<a>App Store</a>
</div> */}
<div className="btn-item">
<a href="https://d.pineer.cc/app-release.apk">{t('Download')} APK</a>
</div>

View File

@ -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;
}
}
}

View File

@ -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;

View File

@ -92,7 +92,7 @@ function SignIn() {
{selectIndex === 1 && <PhoneForm></PhoneForm>}
<div className="to-download">
<p style={{ color: '#999999' }}>{t("If you already have an account")}</p>
<p onClick={() => navigate("/Download")}>{t("download the APP directly")}</p>
<p onClick={() => navigate("/Download")}>{t("Download the APP directly")}</p>
</div>
<div className="terms-service">
<p>{t("Continuing to represent you in agreeing to our")}</p>

View File

@ -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"