Merge branch 'develop' into feature/pc端

This commit is contained in:
john 2024-07-01 17:02:08 +08:00
commit 6a819b6412
22 changed files with 445 additions and 416 deletions

View File

@ -1,11 +1,11 @@
### ###
# @LastEditors: John # @LastEditors: John
# @Date: 2024-06-26 15:04:10 # @Date: 2024-06-26 15:04:10
# @LastEditTime: 2024-06-27 20:18:39 # @LastEditTime: 2024-07-01 15:13:11
# @Author: John # @Author: John
### ###
VITE_BASE_URL=https://node.yotta-network.com VITE_BASE_URL=https://www.nodeai.world
VITE_BASE_API_URL=https://node.yotta-network.com/api VITE_BASE_API_URL=https://www.nodeai.world/api
VITE_PARTICIPATE_CHAIN_ID=56 VITE_PARTICIPATE_CHAIN_ID=56
VITE_PURCHASED_CONTRACT_ADDRESS=0x17c38AaF564716A3D9dD4EBE7Fb5db2D43c6A834 VITE_PURCHASED_CONTRACT_ADDRESS=0x17c38AaF564716A3D9dD4EBE7Fb5db2D43c6A834
VITE_NETWORK_USDT_ADDRESS=0x55d398326f99059fF775485246999027B3197955 VITE_NETWORK_USDT_ADDRESS=0x55d398326f99059fF775485246999027B3197955

Binary file not shown.

View File

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="46" height="46" viewBox="0 0 46 46"><g><g><g><rect x="0" y="0" width="46" height="46" rx="23" fill="#2DFCFC" fill-opacity="1"/></g><g><ellipse cx="15.29602861404419" cy="18.62433671951294" rx="5.9895710945129395" ry="5.9895710945129395" fill="#000000" fill-opacity="1"/></g><g><path d="M28.716520703125,12.63720703125L14.313720703125,33.363107031249996L22.288390703125,33.363107031249996L36.693520703125,12.63720703125L28.716520703125,12.63720703125Z" fill="#000000" fill-opacity="1"/></g></g></g></svg> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="46" height="46" viewBox="0 0 46 46"><g><g><g><rect x="0" y="0" width="46" height="46" rx="23" fill="#EA6D28" fill-opacity="1"/></g><g><ellipse cx="15.29602861404419" cy="18.62433671951294" rx="5.9895710945129395" ry="5.9895710945129395" fill="#000000" fill-opacity="1"/></g><g><path d="M28.716520703125,12.63720703125L14.313720703125,33.363107031249996L22.288390703125,33.363107031249996L36.693520703125,12.63720703125L28.716520703125,12.63720703125Z" fill="#000000" fill-opacity="1"/></g></g></g></svg>

Before

Width:  |  Height:  |  Size: 619 B

After

Width:  |  Height:  |  Size: 619 B

View File

@ -3,7 +3,7 @@ html,
#root { #root {
width: 100%; width: 100%;
height: 100%; height: 100%;
background: url("./assets/home_bg.png"); background: #fafafb;
} }
@font-face { @font-face {

View File

@ -1,7 +1,7 @@
/* /*
* @LastEditors: John * @LastEditors: John
* @Date: 2024-06-17 17:20:03 * @Date: 2024-06-17 17:20:03
* @LastEditTime: 2024-06-28 17:44:02 * @LastEditTime: 2024-07-01 16:41:42
* @Author: John * @Author: John
*/ */
import { Route, Routes } from "react-router-dom"; import { Route, Routes } from "react-router-dom";
@ -16,7 +16,7 @@ import InvitationList from "./pages/InvitationList";
import { useEffect } from "react"; import { useEffect } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import useUserStore from "./store/User"; import useUserStore from "./store/User";
import { getUrlQueryParam, isMobile } from "./utils"; import { getUrlParameterByName, isMobile } from "./utils";
import { UrlQueryParamsKey } from "./constants"; import { UrlQueryParamsKey } from "./constants";
import { signAndLogin } from "./utils/wallet"; import { signAndLogin } from "./utils/wallet";
import { useAccount } from "wagmi"; import { useAccount } from "wagmi";
@ -26,7 +26,9 @@ function App() {
const { address } = useAccount(); const { address } = useAccount();
useEffect(() => { useEffect(() => {
i18n.changeLanguage(currantLang); i18n.changeLanguage(currantLang);
UpdateInviteCode(getUrlQueryParam(UrlQueryParamsKey.INVITE_CODE) || ""); UpdateInviteCode(
getUrlParameterByName(UrlQueryParamsKey.INVITE_CODE) || ""
);
return () => {}; return () => {};
}, []); }, []);

View File

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="46" height="46" viewBox="0 0 46 46"><g><g><g><rect x="0" y="0" width="46" height="46" rx="23" fill="#2DFCFC" fill-opacity="1"/></g><g><ellipse cx="15.29602861404419" cy="18.62433671951294" rx="5.9895710945129395" ry="5.9895710945129395" fill="#000000" fill-opacity="1"/></g><g><path d="M28.716520703125,12.63720703125L14.313720703125,33.363107031249996L22.288390703125,33.363107031249996L36.693520703125,12.63720703125L28.716520703125,12.63720703125Z" fill="#000000" fill-opacity="1"/></g></g></g></svg> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="46" height="46" viewBox="0 0 46 46"><g><g><g><rect x="0" y="0" width="46" height="46" rx="23" fill="#EA6D28" fill-opacity="1"/></g><g><ellipse cx="15.29602861404419" cy="18.62433671951294" rx="5.9895710945129395" ry="5.9895710945129395" fill="#000000" fill-opacity="1"/></g><g><path d="M28.716520703125,12.63720703125L14.313720703125,33.363107031249996L22.288390703125,33.363107031249996L36.693520703125,12.63720703125L28.716520703125,12.63720703125Z" fill="#000000" fill-opacity="1"/></g></g></g></svg>

Before

Width:  |  Height:  |  Size: 619 B

After

Width:  |  Height:  |  Size: 619 B

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 325 KiB

After

Width:  |  Height:  |  Size: 322 KiB

View File

@ -1,17 +1,17 @@
/* /*
* @LastEditors: John * @LastEditors: John
* @Date: 2024-06-18 15:19:21 * @Date: 2024-06-18 15:19:21
* @LastEditTime: 2024-06-18 18:49:40 * @LastEditTime: 2024-07-01 14:10:45
* @Author: John * @Author: John
*/ */
.header { .header {
background-color: #101010; background-color: #fafafb;
padding: 0 15px; padding: 0 15px;
.header_top { .header_top {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 8px; gap: 8px;
border-bottom: 0.25px solid #333333; border-bottom: 1px solid #d8d8d8;
padding: 10px 0; padding: 10px 0;
.header_logo { .header_logo {
@ -30,7 +30,7 @@
font-variation-settings: "opsz" auto; font-variation-settings: "opsz" auto;
font-feature-settings: "kern" on; font-feature-settings: "kern" on;
color: #ffffff; color: #000000;
z-index: 1; z-index: 1;
} }
@ -57,7 +57,7 @@
font-variation-settings: "opsz" auto; font-variation-settings: "opsz" auto;
font-feature-settings: "kern" on; font-feature-settings: "kern" on;
color: #ffffff; color: #000000;
z-index: 1; z-index: 1;
} }

View File

@ -1,7 +1,7 @@
/* /*
* @LastEditors: John * @LastEditors: John
* @Date: 2024-06-18 15:16:31 * @Date: 2024-06-18 15:16:31
* @LastEditTime: 2024-06-28 14:05:29 * @LastEditTime: 2024-07-01 15:19:02
* @Author: John * @Author: John
*/ */
import Picker, { import Picker, {
@ -70,7 +70,7 @@ function Mobile() {
<IconFont <IconFont
className={classes.header_nav_icon} className={classes.header_nav_icon}
name="icon_arrow_left" name="icon_arrow_left"
color={"#fff"} color={"#000000"}
/> />
<span>{navTitle}</span> <span>{navTitle}</span>
</div> </div>

View File

@ -61,7 +61,7 @@ createWeb3Modal({
wagmiConfig: config, wagmiConfig: config,
projectId, projectId,
themeVariables: { themeVariables: {
"--w3m-accent": "#2dfcfc", "--w3m-accent": "#EA6D28",
}, },
featuredWalletIds: [ featuredWalletIds: [
...(window.ethereum ...(window.ethereum

View File

@ -22,7 +22,7 @@
"总收益= 已领取 + 待领取": "Total Revenue = Claimed + Pending", "总收益= 已领取 + 待领取": "Total Revenue = Claimed + Pending",
"邀请": "Invite", "邀请": "Invite",
"邀请链接": "Invite Link", "邀请链接": "Invite Link",
"Invite your friends to become YOTTA nodes and you will get a 20% rebate.": "Invite your friends to become YOTTA nodes and you will get a 20% rebate.", "Invite your friends to become YOTTA nodes and you will get a 10% rebate.": "Invite your friends to become YOTTA nodes and you will get a 10% rebate.",
"数据披露": "Data Disclosure", "数据披露": "Data Disclosure",
"资金池": "Fund Pool", "资金池": "Fund Pool",
"社长席位": "Leader Seats", "社长席位": "Leader Seats",

View File

@ -1,7 +1,7 @@
/* /*
* @LastEditors: John * @LastEditors: John
* @Date: 2024-06-17 17:20:03 * @Date: 2024-06-17 17:20:03
* @LastEditTime: 2024-06-20 11:43:14 * @LastEditTime: 2024-07-01 16:46:07
* @Author: John * @Author: John
*/ */
import "@/i18n/init.ts"; import "@/i18n/init.ts";
@ -15,9 +15,9 @@ import EventBusProvider from "./context/EventBusContext.tsx";
import { WalletProvider } from "./components/WalletProvider.tsx"; import { WalletProvider } from "./components/WalletProvider.tsx";
import flexible from "./utils/flexible.ts"; import flexible from "./utils/flexible.ts";
import VConsole from "vconsole"; import VConsole from "vconsole";
import { getUrlQueryParam } from "./utils/index.ts"; import { getUrlParameterByName } from "./utils/index.ts";
if (getUrlQueryParam("vconsole") === "1") { if (getUrlParameterByName("vconsole") === "1") {
new VConsole(); new VConsole();
} }
flexible(window, document); flexible(window, document);

View File

@ -99,5 +99,6 @@ export default function () {
setTabIndex, setTabIndex,
navigate, navigate,
userInviteLink, userInviteLink,
open,
}; };
} }

View File

@ -14,10 +14,8 @@
border-radius: 16px; border-radius: 16px;
opacity: 1; opacity: 1;
background: #171719; background: #ffffff;
box-shadow: 0px 2px 8px 0px rgba(99, 99, 99, 0.2);
box-shadow: 0px 4px 10px 0px rgba(45, 252, 252, 0.3),
inset 0px 0px 8px 0px #2dfcfc;
padding: 14px 15px; padding: 14px 15px;
box-sizing: border-box; box-sizing: border-box;
@ -57,7 +55,7 @@
font-variation-settings: "opsz" auto; font-variation-settings: "opsz" auto;
font-feature-settings: "kern" on; font-feature-settings: "kern" on;
color: #ffffff; color: #000000;
z-index: 0; z-index: 0;
} }
@ -117,10 +115,9 @@
border-radius: 10px; border-radius: 10px;
opacity: 1; opacity: 1;
background: #2dfcfc; background: #ea6d28;
box-sizing: border-box; box-sizing: border-box;
border: 1px solid;
padding: 0 20px; padding: 0 20px;
@ -153,7 +150,7 @@
border-radius: 16px; border-radius: 16px;
opacity: 1; opacity: 1;
background: #212123; background: #eeeeef;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -173,7 +170,7 @@
font-variation-settings: "opsz" auto; font-variation-settings: "opsz" auto;
font-feature-settings: "kern" on; font-feature-settings: "kern" on;
color: #ffffff; color: #000000;
z-index: 0; z-index: 0;
@ -193,7 +190,7 @@
font-variation-settings: "opsz" auto; font-variation-settings: "opsz" auto;
font-feature-settings: "kern" on; font-feature-settings: "kern" on;
color: #ffffff; color: #000000;
z-index: 1; z-index: 1;
} }
@ -210,7 +207,7 @@
font-variation-settings: "opsz" auto; font-variation-settings: "opsz" auto;
font-feature-settings: "kern" on; font-feature-settings: "kern" on;
color: #ffffff; color: #000000;
z-index: 1; z-index: 1;
} }
@ -245,7 +242,7 @@
border-radius: 10px; border-radius: 10px;
opacity: 1; opacity: 1;
background: #2dfcfc; background: #ea6d28;
color: #101010; color: #101010;
} }
@ -260,7 +257,8 @@
border-radius: 16px; border-radius: 16px;
opacity: 1; opacity: 1;
background: #171719; background: #ffffff;
box-shadow: 0px 2px 8px 0px rgba(99, 99, 99, 0.2);
z-index: 1; z-index: 1;
.nftToken_content_nft { .nftToken_content_nft {
/* 自动布局 */ /* 自动布局 */
@ -286,7 +284,7 @@
font-variation-settings: "opsz" auto; font-variation-settings: "opsz" auto;
font-feature-settings: "kern" on; font-feature-settings: "kern" on;
color: #ffffff; color: #000000;
z-index: 0; z-index: 0;
} }
@ -303,7 +301,7 @@
font-variation-settings: "opsz" auto; font-variation-settings: "opsz" auto;
font-feature-settings: "kern" on; font-feature-settings: "kern" on;
color: #2dfcfc; color: #ea6d28;
z-index: 0; z-index: 0;
@ -335,7 +333,7 @@
font-variation-settings: "opsz" auto; font-variation-settings: "opsz" auto;
font-feature-settings: "kern" on; font-feature-settings: "kern" on;
color: #ffffff; color: #000000;
z-index: 2; z-index: 2;
} }
@ -536,7 +534,7 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
padding: 10px 0; padding: 10px 0;
background: #2dfcfc; background: #ea6d28;
z-index: 0; z-index: 0;
gap: 10px; gap: 10px;
box-sizing: border-box; box-sizing: border-box;
@ -574,7 +572,7 @@
font-variation-settings: "opsz" auto; font-variation-settings: "opsz" auto;
font-feature-settings: "kern" on; font-feature-settings: "kern" on;
color: #ffffff; color: #000000;
z-index: 1; z-index: 1;
} }
@ -600,7 +598,7 @@
font-variation-settings: "opsz" auto; font-variation-settings: "opsz" auto;
font-feature-settings: "kern" on; font-feature-settings: "kern" on;
color: #ffffff; color: #000000;
} }
} }
} }
@ -625,7 +623,7 @@
font-variation-settings: "opsz" auto; font-variation-settings: "opsz" auto;
font-feature-settings: "kern" on; font-feature-settings: "kern" on;
color: #ffffff; color: #000000;
z-index: 0; z-index: 0;
} }
@ -641,7 +639,7 @@
font-variation-settings: "opsz" auto; font-variation-settings: "opsz" auto;
font-feature-settings: "kern" on; font-feature-settings: "kern" on;
color: #2dfcfc; color: #ea6d28;
z-index: 0; z-index: 0;
@ -657,7 +655,8 @@
border-radius: 16px; border-radius: 16px;
opacity: 1; opacity: 1;
background: #171719; background: #ffffff;
box-shadow: 0px 2px 8px 0px rgba(99, 99, 99, 0.2);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -680,7 +679,7 @@
font-variation-settings: "opsz" auto; font-variation-settings: "opsz" auto;
font-feature-settings: "kern" on; font-feature-settings: "kern" on;
color: #ffffff; color: #333333;
z-index: 0; z-index: 0;
} }
@ -697,7 +696,7 @@
font-variation-settings: "opsz" auto; font-variation-settings: "opsz" auto;
font-feature-settings: "kern" on; font-feature-settings: "kern" on;
color: #eaeaea; color: #666666;
z-index: 1; z-index: 1;
} }
@ -720,7 +719,7 @@
font-variation-settings: "opsz" auto; font-variation-settings: "opsz" auto;
font-feature-settings: "kern" on; font-feature-settings: "kern" on;
color: #ffffff; color: #000000;
z-index: 0; z-index: 0;

View File

@ -1,7 +1,7 @@
/* /*
* @LastEditors: John * @LastEditors: John
* @Date: 2024-06-26 15:04:10 * @Date: 2024-06-26 15:04:10
* @LastEditTime: 2024-06-28 14:36:37 * @LastEditTime: 2024-07-01 16:47:34
* @Author: John * @Author: John
*/ */
import classes from "./Home-m.module.css"; import classes from "./Home-m.module.css";
@ -27,6 +27,7 @@ function Mobile() {
setTabIndex, setTabIndex,
navigate, navigate,
userInviteLink, userInviteLink,
open,
} = useHome(); } = useHome();
return ( return (
@ -55,7 +56,7 @@ function Mobile() {
}} }}
name="tuichu" name="tuichu"
className={classes.userinfo_top_right_wallet_disconnect} className={classes.userinfo_top_right_wallet_disconnect}
color={"#fff"} color={"#000000"}
/> />
</div> </div>
<div className={classes.userinfo_top_right_btns}> <div className={classes.userinfo_top_right_btns}>
@ -137,7 +138,7 @@ function Mobile() {
{t("Buy Node")} {t("Buy Node")}
<IconFont <IconFont
name="chevronsrightshuangyoujiantou" name="chevronsrightshuangyoujiantou"
color={"#2DFCFC"} color={"#EA6D28"}
/> />
</span> </span>
</div> </div>
@ -199,7 +200,7 @@ function Mobile() {
{t("邀请列表")}{" "} {t("邀请列表")}{" "}
<IconFont <IconFont
name="chevronsrightshuangyoujiantou" name="chevronsrightshuangyoujiantou"
color={"#2DFCFC"} color={"#EA6D28"}
/> />
</span> </span>
)} )}
@ -239,7 +240,7 @@ function Mobile() {
<span> <span>
{t( {t(
"Invite your friends to become YOTTA nodes and you will get a 20% rebate." "Invite your friends to become YOTTA nodes and you will get a 10% rebate."
)} )}
</span> </span>
</div> </div>

View File

@ -11,7 +11,7 @@
height: 190px; height: 190px;
border-radius: 10px; border-radius: 10px;
opacity: 1; opacity: 1;
background: #171719; background: #ffffff;
box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.16), box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.16),
0px 3px 6px 0px rgba(0, 0, 0, 0.23); 0px 3px 6px 0px rgba(0, 0, 0, 0.23);
padding: 8px; padding: 8px;
@ -95,7 +95,7 @@
font-variation-settings: "opsz" auto; font-variation-settings: "opsz" auto;
font-feature-settings: "kern" on; font-feature-settings: "kern" on;
color: #9e9e9e; color: #333333;
z-index: 0; z-index: 0;
} }
@ -137,7 +137,7 @@
font-variation-settings: "opsz" auto; font-variation-settings: "opsz" auto;
font-feature-settings: "kern" on; font-feature-settings: "kern" on;
color: #ffffff; color: #000000;
z-index: 0; z-index: 0;
} }
@ -154,7 +154,7 @@
font-variation-settings: "opsz" auto; font-variation-settings: "opsz" auto;
font-feature-settings: "kern" on; font-feature-settings: "kern" on;
color: #ffffff; color: #000000;
z-index: 1; z-index: 1;
} }
@ -178,7 +178,7 @@
font-variation-settings: "opsz" auto; font-variation-settings: "opsz" auto;
font-feature-settings: "kern" on; font-feature-settings: "kern" on;
color: #ffffff; color: #000000;
z-index: 0; z-index: 0;
} }
@ -194,7 +194,7 @@
font-variation-settings: "opsz" auto; font-variation-settings: "opsz" auto;
font-feature-settings: "kern" on; font-feature-settings: "kern" on;
color: #ffffff; color: #000000;
z-index: 1; z-index: 1;
} }
@ -215,7 +215,7 @@
padding: 11px 40px; padding: 11px 40px;
gap: 10px; gap: 10px;
background: #2dfcfc; background: #ea6d28;
z-index: 3; z-index: 3;

View File

@ -1,7 +1,7 @@
/* /*
* @LastEditors: John * @LastEditors: John
* @Date: 2024-06-18 10:28:21 * @Date: 2024-06-18 10:28:21
* @LastEditTime: 2024-06-27 09:52:45 * @LastEditTime: 2024-07-01 11:55:38
* @Author: John * @Author: John
*/ */
import { GET, POST } from "./client"; import { GET, POST } from "./client";
@ -54,7 +54,7 @@ export function api_signUp() {
chainType: 2; chainType: 2;
}, },
any any
>({ url: "/api/account/signUp", requiresToken: false }); >({ url: "/api/account/signUp", requiresToken: false, catchErr: true });
} }
// 获取钱包签名串 // 获取钱包签名串

View File

@ -1,7 +1,7 @@
/* /*
* @LastEditors: John * @LastEditors: John
* @Date: 2024-06-18 10:09:21 * @Date: 2024-06-18 10:09:21
* @LastEditTime: 2024-06-21 14:47:26 * @LastEditTime: 2024-07-01 11:38:43
* @Author: John * @Author: John
*/ */
import { Client } from "@hyper-fetch/core"; import { Client } from "@hyper-fetch/core";
@ -17,9 +17,11 @@ import i18next from "i18next";
function initClient({ function initClient({
requiresToken, requiresToken,
requiresAddress, requiresAddress,
catchErr,
}: { }: {
requiresToken: boolean; requiresToken: boolean;
requiresAddress: boolean; requiresAddress: boolean;
catchErr: boolean;
}) { }) {
return new Client({ url: import.meta.env.VITE_BASE_API_URL }) return new Client({ url: import.meta.env.VITE_BASE_API_URL })
.onAuth(async (req) => { .onAuth(async (req) => {
@ -59,6 +61,7 @@ function initClient({
const resData: BASE_RESPONSE = res.data; const resData: BASE_RESPONSE = res.data;
if (resData.code !== 200 && resData.code !== 0) { if (resData.code !== 200 && resData.code !== 0) {
if (resData.msg) Toast.show({ content: resData.msg, icon: "fail" }); if (resData.msg) Toast.show({ content: resData.msg, icon: "fail" });
if (catchErr) return res;
throw new Error(resData.msg || "client on response error"); throw new Error(resData.msg || "client on response error");
} }
return res; return res;
@ -69,12 +72,14 @@ export const POST = <P = any, R = any, QueryParams = any>({
url, url,
requiresToken = true, requiresToken = true,
requiresAddress = true, requiresAddress = true,
catchErr = false,
}: { }: {
url: string; url: string;
requiresToken?: boolean; requiresToken?: boolean;
requiresAddress?: boolean; requiresAddress?: boolean;
catchErr?: boolean;
}) => { }) => {
return initClient({ requiresToken, requiresAddress }).createRequest< return initClient({ requiresToken, requiresAddress, catchErr }).createRequest<
BASE_RESPONSE<R>, BASE_RESPONSE<R>,
P, P,
any, any,
@ -89,12 +94,14 @@ export const GET = <P = any, R = any>({
url, url,
requiresToken = true, requiresToken = true,
requiresAddress = true, requiresAddress = true,
catchErr = false,
}: { }: {
url: string; url: string;
requiresToken?: boolean; requiresToken?: boolean;
requiresAddress?: boolean; requiresAddress?: boolean;
catchErr?: boolean;
}) => { }) => {
return initClient({ requiresToken, requiresAddress }).createRequest< return initClient({ requiresToken, requiresAddress, catchErr }).createRequest<
BASE_RESPONSE<R>, BASE_RESPONSE<R>,
any, any,
any, any,

View File

@ -1,9 +1,10 @@
@media only screen and (max-width: 1024px) {
.adm-tabs { .adm-tabs {
.adm-tabs-header { .adm-tabs-header {
border-bottom: 0.25px solid #333333; border-bottom: 0.25px solid #333333;
.adm-tabs-tab-line { .adm-tabs-tab-line {
background-color: #2dfcfc; background-color: #ea6d28;
} }
.adm-tabs-tab { .adm-tabs-tab {
@ -51,7 +52,7 @@
opacity: 1; opacity: 1;
box-sizing: border-box; box-sizing: border-box;
border: 1px solid #2dfcfc; border: 1px solid #ea6d28;
z-index: 1; z-index: 1;
background-color: transparent; background-color: transparent;
@ -80,7 +81,7 @@
border-radius: 8px; border-radius: 8px;
opacity: 1; opacity: 1;
background: #2dfcfc; background: #ea6d28;
z-index: 0; z-index: 0;
@ -192,7 +193,7 @@
/* background: rgba(252, 135, 43, 0.5) !important; */ /* background: rgba(252, 135, 43, 0.5) !important; */
box-sizing: border-box !important; box-sizing: border-box !important;
border: 1px solid #2dfcfc !important; border: 1px solid #ea6d28 !important;
/* backdrop-filter: blur(10px); */ /* backdrop-filter: blur(10px); */
@ -263,16 +264,16 @@
height: 42px; height: 42px;
border-radius: 5px !important; border-radius: 5px !important;
opacity: 1; opacity: 1;
background: rgba(37, 33, 39, 0.2); background: rgba(204, 184, 214, 0.2);
box-sizing: border-box !important; box-sizing: border-box !important;
border: 1px solid #2dfcfc !important; border: 1px solid #ea6d28 !important;
.adm-button { .adm-button {
width: 42px; width: 42px;
height: 42px; height: 42px;
border-radius: 5px; border-radius: 5px;
opacity: 1; opacity: 1;
background: #2dfcfc; background: #ea6d28;
svg { svg {
width: 23px; width: 23px;
@ -296,7 +297,7 @@
font-variation-settings: "opsz" auto; font-variation-settings: "opsz" auto;
font-feature-settings: "kern" on; font-feature-settings: "kern" on;
color: #ffffff; color: #000000;
} }
} }
} }
@ -305,7 +306,7 @@
.adm-dialog { .adm-dialog {
.adm-center-popup-body { .adm-center-popup-body {
box-sizing: border-box !important; box-sizing: border-box !important;
border: 1px solid #2dfcfc !important; border: 1px solid #ea6d28 !important;
border-radius: 10px !important; border-radius: 10px !important;
background-color: transparent !important; background-color: transparent !important;
backdrop-filter: blur(10px); backdrop-filter: blur(10px);
@ -328,11 +329,11 @@
.adm-dialog-footer { .adm-dialog-footer {
.adm-dialog-action-row { .adm-dialog-action-row {
border-top: 1px solid #2dfcfc !important; border-top: 1px solid #ea6d28 !important;
.adm-dialog-button { .adm-dialog-button {
span { span {
color: #2dfcfc; color: #ea6d28;
} }
} }
} }
@ -357,3 +358,4 @@
z-index: 0; z-index: 0;
} }
} }
}

View File

@ -11,6 +11,7 @@
height: 16px !important; height: 16px !important;
min-height: 16px !important; min-height: 16px !important;
background-color: transparent !important; background-color: transparent !important;
border-bottom: none;
.rdt_TableCol { .rdt_TableCol {
div { div {
@ -24,7 +25,7 @@
font-variation-settings: "opsz" auto; font-variation-settings: "opsz" auto;
font-feature-settings: "kern" on; font-feature-settings: "kern" on;
color: #eaeaea; color: #333333;
} }
} }
} }
@ -37,6 +38,8 @@
height: 18px !important; height: 18px !important;
min-height: 18px !important; min-height: 18px !important;
background-color: transparent !important; background-color: transparent !important;
border-bottom: none;
.rdt_TableCell { .rdt_TableCell {
div { div {
opacity: 1; opacity: 1;
@ -49,7 +52,7 @@
font-variation-settings: "opsz" auto; font-variation-settings: "opsz" auto;
font-feature-settings: "kern" on; font-feature-settings: "kern" on;
color: #ffffff; color: #000000;
} }
} }
} }

View File

@ -1,7 +1,7 @@
/* /*
* @LastEditors: John * @LastEditors: John
* @Date: 2024-06-17 18:19:27 * @Date: 2024-06-17 18:19:27
* @LastEditTime: 2024-06-28 15:32:57 * @LastEditTime: 2024-07-01 16:49:14
* @Author: John * @Author: John
*/ */
import { type ClassValue, clsx } from "clsx"; import { type ClassValue, clsx } from "clsx";
@ -121,3 +121,14 @@ export function filterAmountBeforeZero(arr: bigint[]) {
} }
return result; return result;
} }
export function getUrlParameterByName(name: string, url?: string) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
let regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return "";
console.log("url params:", results);
return decodeURIComponent(results[2].replace(/\+/g, " "));
}

View File

@ -1,16 +1,14 @@
/* /*
* @LastEditors: John * @LastEditors: John
* @Date: 2024-06-19 15:55:07 * @Date: 2024-06-19 15:55:07
* @LastEditTime: 2024-06-27 15:09:45 * @LastEditTime: 2024-07-01 16:44:04
* @Author: John * @Author: John
*/ */
import { config } from "@/components/WalletProvider"; import { config } from "@/components/WalletProvider";
import { import {
api_binding_invitation_relationship,
api_check_account_registration, api_check_account_registration,
api_get_wallet_signature_string, api_get_wallet_signature_string,
api_login, api_login,
api_query_whether_the_user_is_binding_relationship,
api_signUp, api_signUp,
} from "@/server/api"; } from "@/server/api";
import useUserStore from "@/store/User"; import useUserStore from "@/store/User";
@ -24,7 +22,7 @@ import {
} from "@wagmi/core"; } from "@wagmi/core";
import Toast from "antd-mobile/es/components/toast"; import Toast from "antd-mobile/es/components/toast";
import i18next from "i18next"; import i18next from "i18next";
import { getUrlQueryParam } from "."; import { getUrlParameterByName } from ".";
import { UrlQueryParamsKey } from "@/constants"; import { UrlQueryParamsKey } from "@/constants";
/** /**
@ -130,7 +128,8 @@ export async function signAndLogin(address?: `0x${string}`): Promise<void> {
loadingToast.close(); loadingToast.close();
} }
} else { } else {
const inviteCode = getUrlQueryParam(UrlQueryParamsKey.INVITE_CODE); const inviteCode = getUrlParameterByName(UrlQueryParamsKey.INVITE_CODE);
console.log("inviteCode:", inviteCode);
if (!inviteCode) { if (!inviteCode) {
Toast.show({ Toast.show({
icon: "fail", icon: "fail",
@ -139,7 +138,7 @@ export async function signAndLogin(address?: `0x${string}`): Promise<void> {
return loginOut(); return loginOut();
} }
// 注册 // 注册
await api_signUp().send({ const { data } = await api_signUp().send({
data: { data: {
account: address, account: address,
publicKey, publicKey,
@ -147,7 +146,11 @@ export async function signAndLogin(address?: `0x${string}`): Promise<void> {
chainType: 2, chainType: 2,
}, },
}); });
if (data?.code == 0) {
await signAndLogin(address); await signAndLogin(address);
} else {
return loginOut();
}
reslove(); reslove();
loadingToast.close(); loadingToast.close();
} }