Compare commits

..

6 Commits

Author SHA1 Message Date
john 20c5eaf47d 🐞 fix: 2024-07-01 19:01:47 +08:00
john 6a819b6412 Merge branch 'develop' into feature/pc端 2024-07-01 17:02:08 +08:00
john daf5634a10 feat:
更新主题色
2024-07-01 15:18:09 +08:00
john 5e4d6e6521 feat: 2024-06-28 20:13:46 +08:00
john a58b225544 feat: 2024-06-28 18:00:45 +08:00
john c1a8cfd6d6 🐎 ci:
生产环境变量
2024-06-28 13:56:17 +08:00
33 changed files with 1239 additions and 830 deletions

View File

@ -1,6 +1,12 @@
VITE_BASE_URL=/ ###
VITE_BASE_API_URL=/dev # @LastEditors: John
# @Date: 2024-06-26 15:04:10
# @LastEditTime: 2024-07-01 15:13:11
# @Author: John
###
VITE_BASE_URL=https://www.nodeai.world
VITE_BASE_API_URL=https://www.nodeai.world/api
VITE_PARTICIPATE_CHAIN_ID=56 VITE_PARTICIPATE_CHAIN_ID=56
VITE_PURCHASED_CONTRACT_ADDRESS= VITE_PURCHASED_CONTRACT_ADDRESS=0x17c38AaF564716A3D9dD4EBE7Fb5db2D43c6A834
VITE_NETWORK_USDT_ADDRESS= VITE_NETWORK_USDT_ADDRESS=0x55d398326f99059fF775485246999027B3197955
VITE_CHECK_TRANSACTION_DETAILS_URL=https://bscscan.com/ VITE_CHECK_TRANSACTION_DETAILS_URL=https://bscscan.com/

Binary file not shown.

100
nodeai.worid.crt Normal file
View File

@ -0,0 +1,100 @@
-----BEGIN CERTIFICATE-----
MIIFuTCCBKGgAwIBAgIRAM0x4XaWUXTydUUUUxaKx6swDQYJKoZIhvcNAQELBQAw
gY8xCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO
BgNVBAcTB1NhbGZvcmQxGDAWBgNVBAoTD1NlY3RpZ28gTGltaXRlZDE3MDUGA1UE
AxMuU2VjdGlnbyBSU0EgRG9tYWluIFZhbGlkYXRpb24gU2VjdXJlIFNlcnZlciBD
QTAeFw0yNDA2M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QUFBwMCBggrBgEFBQcD
ATAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBQVW93wA7aT2uzpVH9qaHLNcgM1mDAf
BgNVHSMEGDAWgBQk6FNXXXw0QIep65TbuuEWePwppDBABggrBgEFBQcBAQQ0MDIw
MAYIKwYBBQUHMAGGJGh0dHA6Ly9vY3NwLmNsb3VkZmxhcmUuY29tL29yaWdpbl9j
YTAnBgNVHREEIDAegg4qLm5vZGVhaS53b3JsZIIMbm9kZWFpLndvcmxkMDgGA1Ud
HwQxMC8wLaAroCmGJ2h0dHA6Ly9jcmwuY2xvdWRmbGFyZS5jb20vb3JpZ2luX2Nh
LmNybDANBgkqhkiG9w0BAQsFAAOCAQEAGISJxOYxuAAXapVJxU5vP2rt61xH1vC8
UEUSD7u3WUoULJIZt3pHyfUI6twxHlXttlFWEq3aogrpuGlv76OCXILNy5B4Xkx8
OR47xvO5EClDdVJb9a5hET6iJn9UXR9UrSiuzZAE0HEOK1t3KEJOFh0/39sDqwTn
pJ49DjiVA7TvvJgUljjnumf40I1F6apuZbdnW03VHr3WsBkPE/wv+ZEBxwRTZaLB
1BakIMguI8tnSSReAf4O+oOwIAgz0OwT18d/xc4O8hhkitdfUnON03KZLEK26J1r
KQ+8PPhMBKVjsPTM9li8vAWSq8Cc3GxoNnvOeV/u1NXnxfD+X6vBwA==
-----END CERTIFICATE-----

59
nodeai.world.conf Normal file
View File

@ -0,0 +1,59 @@
server {
server_name nodeai.world www.nodeai.world;
client_max_body_size 50m;
listen *:80;
listen *:443 ssl;
#ssl on;
# 静态文件夹和域名对应
root /data/nginx/nodeai.world;
index index.html index.htm;
# 日志文件名和域名对应
access_log /data/nginx/logs/nodeai.world.access.log;
error_log /data/nginx/logs/nodeai.world.error.log;
ssl_certificate cert/nodeai.worid.pem;
ssl_certificate_key cert/nodeai.worid.key;
location /upload {
root /data/nginx/;
index index.html;
}
location /api {
proxy_pass http://127.17.0.1:8102;
proxy_headers_hash_max_size 51200;
proxy_headers_hash_bucket_size 6400;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_buffering off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /api/api {
proxy_pass http://127.17.0.1:8102/api;
proxy_headers_hash_max_size 51200;
proxy_headers_hash_bucket_size 6400;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_buffering off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /zip {
alias /data/nginx/zip/;#此处定义映射文件位置
allow all;
autoindex on;
}
}

View File

@ -1,7 +1,7 @@
/* /*
* @LastEditors: John * @LastEditors: John
* @Date: 2024-06-17 18:25:10 * @Date: 2024-06-17 18:25:10
* @LastEditTime: 2024-06-19 16:14:06 * @LastEditTime: 2024-06-28 17:46:23
* @Author: John * @Author: John
*/ */
export default { export default {
@ -11,7 +11,7 @@ export default {
rootValue: 37.5, rootValue: 37.5,
propList: ["*"], propList: ["*"],
exclude: (e) => { exclude: (e) => {
if (/.*-m\.css$/.test(e) || /.module\.css$/.test(e)) { if (/.*-m\.css$/.test(e) || /.*-m.module\.css$/.test(e)) {
// console.log(e); // console.log(e);
return false; return false;
} }

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-26 16:00:00 * @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 } 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 () => {};
}, []); }, []);
@ -45,12 +47,30 @@ function App() {
return ( return (
<> <>
<RouterLogProvider> <RouterLogProvider>
<Header /> {isMobile ? (
<>
<Header.Mobile />
<Routes> <Routes>
<Route path="/" element={<Home />} /> <>
<Route path="/" element={<Home.Mobile />} />
<Route path="/mint" element={<Mint />} /> <Route path="/mint" element={<Mint />} />
<Route path="/invitationlist" element={<InvitationList />}></Route> <Route
path="/invitationlist"
element={<InvitationList />}
></Route>
</>
</Routes> </Routes>
</>
) : (
<>
<Header.Desktop />
<Routes>
<>
<Route path="/" element={<Home.Desktop />} />
</>
</Routes>
</>
)}
</RouterLogProvider> </RouterLogProvider>
</> </>
); );

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-27 15:29:00 * @LastEditTime: 2024-07-01 15:19:02
* @Author: John * @Author: John
*/ */
import Picker, { import Picker, {
@ -11,7 +11,7 @@ import Picker, {
import { useContext, useEffect, useMemo, useState } from "react"; import { useContext, useEffect, useMemo, useState } from "react";
import IconFont from "./iconfont"; import IconFont from "./iconfont";
import logo from "@/assets/logo.svg"; import logo from "@/assets/logo.svg";
import classes from "./Header.module.css"; import classes from "./Header-m.module.css";
import { useLocation, useNavigate, useNavigation } from "react-router-dom"; import { useLocation, useNavigate, useNavigation } from "react-router-dom";
import { RouterLogContext } from "@/context/RouterContext"; import { RouterLogContext } from "@/context/RouterContext";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
@ -27,7 +27,7 @@ const langColums: Action[] = [
{ text: "日本語", key: Lang.jp }, { text: "日本語", key: Lang.jp },
{ text: "DEUTSCH", key: Lang.de }, { text: "DEUTSCH", key: Lang.de },
]; ];
export default function () { function Mobile() {
const { UpdateLang } = useUserStore(); const { UpdateLang } = useUserStore();
const route = useContext(RouterLogContext); const route = useContext(RouterLogContext);
@ -70,7 +70,7 @@ export default function () {
<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>
@ -79,3 +79,12 @@ export default function () {
</> </>
); );
} }
function Desktop() {
return <></>;
}
export default {
Mobile,
Desktop,
};

View File

@ -1,10 +1,10 @@
/* /*
* @LastEditors: John * @LastEditors: John
* @Date: 2024-06-19 10:49:42 * @Date: 2024-06-19 10:49:42
* @LastEditTime: 2024-06-19 10:52:32 * @LastEditTime: 2024-06-28 14:05:45
* @Author: John * @Author: John
*/ */
import classes from "./RecordsItem.module.css"; import classes from "./RecordsItem-m.module.css";
export default function RecordsItem({ export default function RecordsItem({
itemList, itemList,
}: { }: {

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

@ -0,0 +1,104 @@
/*
* @LastEditors: John
* @Date: 2024-06-28 14:09:55
* @LastEditTime: 2024-06-28 14:14:29
* @Author: John
*/
import useUserStore from "@/store/User";
import { useWeb3Modal } from "@web3modal/wagmi/react";
import { useEffect, useMemo, useRef, useState } from "react";
import { useTranslation } from "react-i18next";
import { useAccount } from "wagmi";
import { useNavigate } from "react-router-dom";
import { Dialog } from "antd-mobile";
import {
api_get_homepage_user_data,
api_query_user_invitation_code,
} from "@/server/api";
import { UserHomeData } from "@/server/module";
import { UrlQueryParamsKey } from "@/constants";
import usePollingCheckBuyStatus from "@/hook/usePollingCheckBuyStatus";
import { ToastHandler } from "antd-mobile/es/components/toast";
import { PullStatus } from "antd-mobile/es/components/pull-to-refresh";
export default function () {
const { Token, UpdateToken } = useUserStore();
const { open } = useWeb3Modal();
const { t } = useTranslation();
const { address } = useAccount();
const [tabIndex, setTabIndex] = useState(0);
const navigate = useNavigate();
const [userData, setUserData] = useState<UserHomeData>();
const [inviteCode, setInviteCode] = useState("");
const userInviteLink = useMemo(
() =>
`${location.origin}/#/?${UrlQueryParamsKey.INVITE_CODE}=${inviteCode}`,
[inviteCode]
);
const receiveLoadingToast = useRef<ToastHandler>();
const {
transcationStatus,
startPollingCheckBuyStatus,
stopPollingCheckBuyStatus,
} = usePollingCheckBuyStatus("NORMAL");
const statusRecord: Record<PullStatus, string> = {
pulling: "Pull down to refresh",
canRelease: "Release to refresh immediately",
refreshing: "Loading...",
complete: "Refresh complete",
};
useEffect(() => {
if (Token) {
getHomeData();
getInviteCode();
}
return () => {};
}, [Token]);
useEffect(() => {
if (transcationStatus == "success") {
receiveLoadingToast.current?.close();
stopPollingCheckBuyStatus();
Dialog.alert({
content: `${t("领取成功,前往钱包查看")}`,
confirmText: "OK",
});
}
return () => {};
}, [transcationStatus]);
async function getHomeData() {
const { data } = await api_get_homepage_user_data().send({});
setUserData(data?.data);
}
async function getInviteCode() {
const { data } = await api_query_user_invitation_code().send({});
setInviteCode(data?.data.invitationCode || "");
}
useEffect(() => {
console.log("user token:", Token);
return () => {};
}, [Token]);
return {
getHomeData,
statusRecord,
Token,
address,
setUserData,
userData,
tabIndex,
t,
setTabIndex,
navigate,
userInviteLink,
open,
};
}

View File

@ -0,0 +1,41 @@
import usePagination from "@/hook/usePagination";
import { api_recommended_list } from "@/server/api";
import { RecommendedListItem } from "@/server/module";
import { Empty, InfiniteScroll } from "antd-mobile";
import DataTable, { TableColumn } from "react-data-table-component";
import { useTranslation } from "react-i18next";
export default function () {
const { t } = useTranslation();
const columns: TableColumn<RecommendedListItem>[] = [
{
name: t("地址"),
selector: (row) => row.walletAddress,
grow: 9,
},
{
name: "Node",
selector: (row) => row.nodeNumber,
grow: 1,
// @ts-ignore
right: "true",
},
];
const { list, hasMore, loadMore } = usePagination<RecommendedListItem>({
service({ pageNum, pageSize }) {
return new Promise(async (reslove) => {
const { data } = await api_recommended_list().send({
queryParams: { pageNum, pageSize },
});
reslove(data?.data.records || []);
});
},
});
return {
columns,
list,
loadMore,
hasMore,
};
}

View File

@ -0,0 +1,118 @@
import { cn, filterAddressBeforeZero, filterAmountBeforeZero } from "@/utils";
import classes from "./Mint-m.module.css";
import nft_bg from "@/assets/nft_bg.svg";
import Button from "antd-mobile/es/components/button";
import Space from "antd-mobile/es/components/space";
import { useTranslation } from "react-i18next";
import { useEffect, useMemo, useRef, useState } from "react";
import {
api_get_homepage_user_data,
api_get_nft_configuration_data,
api_node_order,
api_users_cancel_orders,
} from "@/server/api";
import {
NftConfigurationData,
NftOrder,
NodeOrder,
UserHomeData,
} from "@/server/module";
import {
authorizedU,
getApproveUsdt,
getBalance,
payByContract,
} from "@/contract/utils";
import { Dialog, Modal, Stepper, Toast } from "antd-mobile";
import useUserStore from "@/store/User";
import usePollingCheckBuyStatus from "@/hook/usePollingCheckBuyStatus";
import { ToastHandler } from "antd-mobile/es/components/toast";
import { BaseError } from "wagmi";
import { useNavigate } from "react-router-dom";
import { toWei } from "web3-utils";
export default function () {
const { t } = useTranslation();
const { Token } = useUserStore();
const [nodeConfig, setNodeConfig] = useState<UserHomeData>();
const [approveUsdt, setApproveUsdt] = useState<bigint>(0n);
const [balance, setBalance] = useState<bigint>(0n);
const orderInfo = useRef<NodeOrder>();
const navigate = useNavigate();
const [num, setNum] = useState(1);
const buyLoadingToast = useRef<ToastHandler>();
const approveLoadingToast = useRef<ToastHandler>();
const {
transcationStatus,
startPollingCheckBuyStatus,
stopPollingCheckBuyStatus,
} = usePollingCheckBuyStatus("NORMAL");
const costNum = useMemo(
() =>
BigInt(
toWei(`${parseFloat(`${nodeConfig?.nodePrice || "0"}`) * num}`, "ether")
),
[nodeConfig?.nodePrice, num]
);
useEffect(() => {
updateNodeConfig();
return () => {};
}, []);
useEffect(() => {
(async () => {
Toast.show({ icon: "loading", content: t("正在获取已授权金额") });
setBalance(await getBalance());
setApproveUsdt(await getApproveUsdt());
Toast.clear();
})();
return () => {};
}, [Token]);
async function updateNodeConfig() {
const { data } = await api_get_homepage_user_data().send({});
setNodeConfig(data?.data);
}
useEffect(() => {
if (transcationStatus == "success") {
buyLoadingToast.current?.close();
stopPollingCheckBuyStatus();
Dialog.alert({
content: `${t(
"Buy successful. Please return to the homepage to view."
)}`,
confirmText: "OK",
onConfirm() {
navigate("/");
},
});
}
return () => {};
}, [transcationStatus]);
useEffect(() => {
return () => {};
}, []);
return {
nodeConfig,
num,
setNum,
approveUsdt,
t,
balance,
approveLoadingToast,
costNum,
setApproveUsdt,
buyLoadingToast,
orderInfo,
updateNodeConfig,
startPollingCheckBuyStatus,
};
}

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,98 +1,36 @@
import classes from "./Home.module.css"; /*
import useUserStore from "@/store/User"; * @LastEditors: John
* @Date: 2024-06-26 15:04:10
* @LastEditTime: 2024-07-01 17:35:37
* @Author: John
*/
import classes from "./Home-m.module.css";
import { cn, copyText, getLevelName, shortenString } from "@/utils"; import { cn, copyText, getLevelName, shortenString } from "@/utils";
import { useWeb3Modal } from "@web3modal/wagmi/react";
import { useEffect, useMemo, useRef, useState } from "react";
import { useTranslation } from "react-i18next";
import logo from "@/assets/logo.svg"; import logo from "@/assets/logo.svg";
import nftBg from "@/assets/nft_bg.svg"; import nftBg from "@/assets/nft_bg.svg";
import usdtBg from "@/assets/usdt_bg.svg";
import IconFont from "@/components/iconfont"; import IconFont from "@/components/iconfont";
import { BaseError, useAccount } from "wagmi"; import { PullToRefresh } from "antd-mobile";
import { config } from "@/components/WalletProvider";
import { createSearchParams, useNavigate } from "react-router-dom";
import { Button, Dialog, Empty, PullToRefresh, Toast } from "antd-mobile";
import { loginOut } from "@/utils/wallet"; import { loginOut } from "@/utils/wallet";
import { import useHome from "./Feature/useHome";
api_claim_income, import useMint from "./Feature/useMint";
api_get_homepage_user_data, import useInvitationList from "./Feature/useInvitationList";
api_query_user_invitation_code, function Mobile() {
} from "@/server/api";
import { UserHomeData } from "@/server/module";
import { UrlQueryParamsKey } from "@/constants";
import usePollingCheckBuyStatus from "@/hook/usePollingCheckBuyStatus";
import { ToastHandler } from "antd-mobile/es/components/toast";
import { disconnect, getAccount } from "@wagmi/core";
import { PullStatus } from "antd-mobile/es/components/pull-to-refresh";
export default function () {
const { Token, UpdateToken } = useUserStore();
const { open } = useWeb3Modal();
const { t } = useTranslation();
const { address } = useAccount();
const [tabIndex, setTabIndex] = useState(0);
const navigate = useNavigate();
const [userData, setUserData] = useState<UserHomeData>();
const [inviteCode, setInviteCode] = useState("");
const userInviteLink = useMemo(
() =>
`${location.origin}/#/?${UrlQueryParamsKey.INVITE_CODE}=${inviteCode}`,
[inviteCode]
);
const receiveLoadingToast = useRef<ToastHandler>();
const { const {
transcationStatus, getHomeData,
startPollingCheckBuyStatus, statusRecord,
stopPollingCheckBuyStatus, Token,
} = usePollingCheckBuyStatus("NORMAL"); address,
setUserData,
const statusRecord: Record<PullStatus, string> = { userData,
pulling: "Pull down to refresh", tabIndex,
canRelease: "Release to refresh immediately", t,
refreshing: "Loading...", setTabIndex,
complete: "Refresh complete", navigate,
}; userInviteLink,
open,
useEffect(() => { } = useHome();
if (Token) {
getHomeData();
getInviteCode();
}
return () => {};
}, [Token]);
useEffect(() => {
if (transcationStatus == "success") {
receiveLoadingToast.current?.close();
stopPollingCheckBuyStatus();
Dialog.alert({
content: `${t("领取成功,前往钱包查看")}`,
confirmText: "OK",
});
}
return () => {};
}, [transcationStatus]);
async function getHomeData() {
const { data } = await api_get_homepage_user_data().send({});
setUserData(data?.data);
}
async function getInviteCode() {
const { data } = await api_query_user_invitation_code().send({});
setInviteCode(data?.data.invitationCode || "");
}
useEffect(() => {
console.log("user token:", Token);
return () => {};
}, [Token]);
return ( return (
<>
<PullToRefresh <PullToRefresh
onRefresh={async () => { onRefresh={async () => {
await getHomeData(); await getHomeData();
@ -118,7 +56,7 @@ export default function () {
}} }}
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}>
@ -200,7 +138,7 @@ export default function () {
{t("Buy Node")} {t("Buy Node")}
<IconFont <IconFont
name="chevronsrightshuangyoujiantou" name="chevronsrightshuangyoujiantou"
color={"#2DFCFC"} color={"#EA6D28"}
/> />
</span> </span>
</div> </div>
@ -262,7 +200,7 @@ export default function () {
{t("邀请列表")}{" "} {t("邀请列表")}{" "}
<IconFont <IconFont
name="chevronsrightshuangyoujiantou" name="chevronsrightshuangyoujiantou"
color={"#2DFCFC"} color={"#EA6D28"}
/> />
</span> </span>
)} )}
@ -282,7 +220,7 @@ export default function () {
}} }}
className={classes.invite_content_icon} className={classes.invite_content_icon}
name="fuzhi" name="fuzhi"
color={"#fff"} color={"#101010"}
/>{" "} />{" "}
</> </>
) : ( ) : (
@ -302,13 +240,49 @@ export default function () {
<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>
</div> </div>
</div> </div>
</PullToRefresh> </PullToRefresh>
</>
); );
} }
function Desktop() {
const {
getHomeData,
statusRecord,
Token,
address,
setUserData,
userData,
tabIndex,
t,
setTabIndex,
navigate,
userInviteLink,
} = useHome();
const {
nodeConfig,
num,
setNum,
approveUsdt,
balance,
approveLoadingToast,
costNum,
setApproveUsdt,
buyLoadingToast,
orderInfo,
updateNodeConfig,
startPollingCheckBuyStatus,
} = useMint();
const { columns, list, loadMore, hasMore } = useInvitationList();
return <></>;
}
export default {
Mobile,
Desktop,
};

View File

@ -4,40 +4,12 @@
* @LastEditTime: 2024-06-27 15:33:01 * @LastEditTime: 2024-06-27 15:33:01
* @Author: John * @Author: John
*/ */
import usePagination from "@/hook/usePagination";
import { api_recommended_list } from "@/server/api";
import { RecommendedListItem } from "@/server/module";
import { Empty, InfiniteScroll } from "antd-mobile"; import { Empty, InfiniteScroll } from "antd-mobile";
import DataTable, { TableColumn } from "react-data-table-component"; import DataTable from "react-data-table-component";
import { useTranslation } from "react-i18next"; import useInvitationList from "./Feature/useInvitationList";
export default function () { export default function () {
const { t } = useTranslation(); const { columns, list, loadMore, hasMore } = useInvitationList();
const columns: TableColumn<RecommendedListItem>[] = [
{
name: t("地址"),
selector: (row) => row.walletAddress,
grow: 9,
},
{
name: "Node",
selector: (row) => row.nodeNumber,
grow: 1,
// @ts-ignore
right: "true",
},
];
const { list, hasMore, loadMore } = usePagination<RecommendedListItem>({
service({ pageNum, pageSize }) {
return new Promise(async (reslove) => {
const { data } = await api_recommended_list().send({
queryParams: { pageNum, pageSize },
});
reslove(data?.data.records || []);
});
},
});
return ( return (
<> <>

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,110 +1,36 @@
/* /*
* @LastEditors: John * @LastEditors: John
* @Date: 2024-06-18 15:28:03 * @Date: 2024-06-18 15:28:03
* @LastEditTime: 2024-06-27 17:17:09 * @LastEditTime: 2024-06-28 14:33:02
* @Author: John * @Author: John
*/ */
import { cn, filterAddressBeforeZero, filterAmountBeforeZero } from "@/utils"; import { cn, filterAddressBeforeZero, filterAmountBeforeZero } from "@/utils";
import classes from "./Mint.module.css"; import classes from "./Mint-m.module.css";
import nft_bg from "@/assets/nft_bg.svg"; import nft_bg from "@/assets/nft_bg.svg";
import Button from "antd-mobile/es/components/button"; import Button from "antd-mobile/es/components/button";
import Space from "antd-mobile/es/components/space"; import Space from "antd-mobile/es/components/space";
import { useTranslation } from "react-i18next"; import { api_node_order } from "@/server/api";
import { useEffect, useMemo, useRef, useState } from "react"; import { authorizedU, getApproveUsdt, payByContract } from "@/contract/utils";
import { import { Stepper, Toast } from "antd-mobile";
api_get_homepage_user_data,
api_get_nft_configuration_data,
api_node_order,
api_users_cancel_orders,
} from "@/server/api";
import {
NftConfigurationData,
NftOrder,
NodeOrder,
UserHomeData,
} from "@/server/module";
import {
authorizedU,
getApproveUsdt,
getBalance,
payByContract,
} from "@/contract/utils";
import { Dialog, Modal, Stepper, Toast } from "antd-mobile";
import useUserStore from "@/store/User";
import usePollingCheckBuyStatus from "@/hook/usePollingCheckBuyStatus";
import { ToastHandler } from "antd-mobile/es/components/toast";
import { BaseError } from "wagmi"; import { BaseError } from "wagmi";
import { useNavigate } from "react-router-dom";
import { toWei } from "web3-utils"; import { toWei } from "web3-utils";
import useMint from "./Feature/useMint";
export default function () { export default function () {
const { t } = useTranslation();
const { Token } = useUserStore();
const [nodeConfig, setNodeConfig] = useState<UserHomeData>();
const [approveUsdt, setApproveUsdt] = useState<bigint>(0n);
const [balance, setBalance] = useState<bigint>(0n);
const orderInfo = useRef<NodeOrder>();
const navigate = useNavigate();
const [num, setNum] = useState(1);
const buyLoadingToast = useRef<ToastHandler>();
const approveLoadingToast = useRef<ToastHandler>();
const { const {
transcationStatus, nodeConfig,
num,
setNum,
approveUsdt,
t,
balance,
approveLoadingToast,
costNum,
setApproveUsdt,
buyLoadingToast,
orderInfo,
updateNodeConfig,
startPollingCheckBuyStatus, startPollingCheckBuyStatus,
stopPollingCheckBuyStatus, } = useMint();
} = usePollingCheckBuyStatus("NORMAL");
const costNum = useMemo(
() =>
BigInt(
toWei(`${parseFloat(`${nodeConfig?.nodePrice || "0"}`) * num}`, "ether")
),
[nodeConfig?.nodePrice, num]
);
useEffect(() => {
updateNodeConfig();
return () => {};
}, []);
useEffect(() => {
(async () => {
Toast.show({ icon: "loading", content: t("正在获取已授权金额") });
setBalance(await getBalance());
setApproveUsdt(await getApproveUsdt());
Toast.clear();
})();
return () => {};
}, [Token]);
async function updateNodeConfig() {
const { data } = await api_get_homepage_user_data().send({});
setNodeConfig(data?.data);
}
useEffect(() => {
if (transcationStatus == "success") {
buyLoadingToast.current?.close();
stopPollingCheckBuyStatus();
Dialog.alert({
content: `${t(
"Buy successful. Please return to the homepage to view."
)}`,
confirmText: "OK",
onConfirm() {
navigate("/");
},
});
}
return () => {};
}, [transcationStatus]);
useEffect(() => {
return () => {};
}, []);
return ( return (
<> <>
<div className={cn(classes.Mint, classes.container)}> <div className={cn(classes.Mint, classes.container)}>

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 @@
.adm-tabs { @media only screen and (max-width: 1024px) {
.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 {
@ -27,9 +28,9 @@
.adm-tabs-content { .adm-tabs-content {
padding: 0; padding: 0;
} }
} }
.adm-capsule-tabs { .adm-capsule-tabs {
.adm-capsule-tabs-header { .adm-capsule-tabs-header {
padding: 0px 15px; padding: 0px 15px;
border-bottom: none; border-bottom: none;
@ -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;
@ -102,10 +103,10 @@
} }
} }
} }
} }
/* picker */ /* picker */
.adm-picker-popup { .adm-picker-popup {
.adm-picker-header { .adm-picker-header {
border-bottom: 1px solid #404040; border-bottom: 1px solid #404040;
.adm-picker-header-title { .adm-picker-header-title {
@ -175,10 +176,10 @@
} }
} }
} }
} }
/* toast */ /* toast */
.adm-toast-main { .adm-toast-main {
min-width: 170px !important; min-width: 170px !important;
min-height: 40px !important; min-height: 40px !important;
max-width: 320px !important; max-width: 320px !important;
@ -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); */
@ -211,9 +212,9 @@
z-index: 0; z-index: 0;
} }
} }
.adm-popover-menu { .adm-popover-menu {
.adm-popover-arrow { .adm-popover-arrow {
color: rgba(42, 42, 42, 0.6) !important; color: rgba(42, 42, 42, 0.6) !important;
} }
@ -255,24 +256,24 @@
} }
} }
} }
} }
/* adm-stepper */ /* adm-stepper */
.adm-stepper { .adm-stepper {
width: calc(100%) !important; width: calc(100%) !important;
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,16 +297,16 @@
font-variation-settings: "opsz" auto; font-variation-settings: "opsz" auto;
font-feature-settings: "kern" on; font-feature-settings: "kern" on;
color: #ffffff; color: #000000;
}
} }
} }
} }
}
.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,20 +329,20 @@
.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;
}
} }
} }
} }
} }
} }
}
/* adm-pull-to-refresh */ /* adm-pull-to-refresh */
.adm-pull-to-refresh { .adm-pull-to-refresh {
.adm-pull-to-refresh-head-content { .adm-pull-to-refresh-head-content {
/* 自动布局子元素 */ /* 自动布局子元素 */
font-family: Space Grotesk; font-family: Space Grotesk;
@ -356,4 +357,5 @@
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-27 11:40:59 * @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();
} }