🐞 fix:

修改部分文案
This commit is contained in:
john 2024-06-27 18:29:40 +08:00
parent 007af1f625
commit f6cd16f1c6
15 changed files with 90 additions and 50 deletions

View File

@ -1,10 +1,10 @@
###
# @LastEditors: John
# @Date: 2024-06-18 10:12:21
# @LastEditTime: 2024-06-25 14:04:33
# @LastEditTime: 2024-06-27 15:35:23
# @Author: John
###
VITE_BASE_URL=http://192.168.10.167:5173/
VITE_BASE_URL=
VITE_BASE_API_URL=/dev
VITE_PARTICIPATE_CHAIN_ID=97
VITE_PURCHASED_CONTRACT_ADDRESS=0x7aAe4f2CA23482B58D6f9e8d1fBb5e413e7013c8

View File

@ -57,7 +57,7 @@ export default function () {
<div className={classes.header}>
<div className={classes.header_top}>
<img className={classes.header_logo} src={logo} alt="" />
<span className={classes.header_title}>{t("红魔NFT")}</span>
<span className={classes.header_title}>{t("红魔股权NFT")}</span>
<Popover.Menu
mode="dark"
actions={langColums}

View File

@ -1,7 +1,7 @@
/*
* @LastEditors: John
* @Date: 2024-06-19 15:48:57
* @LastEditTime: 2024-06-25 15:28:36
* @LastEditTime: 2024-06-27 18:00:07
* @Author: John
*/
import { config } from "@/components/WalletProvider";
@ -200,7 +200,8 @@ export async function payByContract(
});
} catch (err) {
console.log("pay By Contract catch err", err);
reject(new BaseError(`${err}`));
if (typeof err == "string") return reject(new BaseError(`${err}`));
return reject(err);
}
});
}

View File

@ -1,6 +1,6 @@
{
"AppName": "红魔",
"红魔NFT": "红魔NFT",
"红魔股权NFT": "红魔股权NFT",
"铸造 NFT": "铸造 NFT",
"级别提升": "级别提升",
"收益记录": "收益记录",
@ -103,5 +103,6 @@
"无级别提升": "无级别提升",
"没有更多数据了": "没有更多数据了",
"升级中": "升级中",
"无等级": "无等级"
"无等级": "无等级",
"无效的邀请链接": "无效的邀请链接"
}

View File

@ -1,6 +1,6 @@
{
"AppName": "Der Rote Teufel",
"红魔NFT": "Der Rote Teufel NFT",
"红魔股权NFT": "Red Devils Equity NFT",
"铸造 NFT": "NFT Prägen",
"级别提升": "Stufenaufstieg",
"收益记录": "Ergebnisrekord",
@ -103,5 +103,6 @@
"无级别提升": "Beförderung ohne Rang",
"没有更多数据了": "Keine weiteren Daten",
"升级中": "Wird aktualisiert",
"无等级": "Keine Bewertung"
"无等级": "Keine Bewertung",
"无效的邀请链接": "Ungültiger Einladungslink"
}

View File

@ -1,6 +1,6 @@
{
"AppName": "Red Devils",
"红魔NFT": "Red Devils NFT",
"红魔股权NFT": "Red Devil Equity NFT",
"铸造 NFT": "Mint NFT",
"级别提升": "Level Up",
"收益记录": "Revenue Record",
@ -103,5 +103,6 @@
"无级别提升": "Promotion without rank",
"没有更多数据了": "No more data",
"升级中": "Upgrading",
"无等级": "No Grade"
"无等级": "No Grade",
"无效的邀请链接": "Invalid invitation link"
}

View File

@ -1,6 +1,6 @@
{
"AppName": "紅魔",
"红魔NFT": "紅魔NFT",
"红魔股权NFT": "レッドデビルズ株式NFT",
"铸造 NFT": "NFT 鋳造",
"级别提升": "レベルアップ",
"收益记录": "収益実績",
@ -103,5 +103,6 @@
"无级别提升": "階級なしの昇進",
"没有更多数据了": "これ以上のデータはありません",
"升级中": "アップグレード中",
"无等级": "グレードなし"
"无等级": "グレードなし",
"无效的邀请链接": "無効な招待リンクです"
}

View File

@ -1,6 +1,6 @@
{
"AppName": "紅魔",
"红魔NFT": "紅魔NFT",
"红魔股权NFT": "紅魔鬼股權NFT",
"铸造 NFT": "鑄造 NFT",
"级别提升": "級別提升",
"收益记录": "收益記錄",
@ -103,5 +103,6 @@
"无级别提升": "無級別提升",
"没有更多数据了": "沒有更多數據了",
"升级中": "升級中",
"无等级": "無等級"
"无等级": "無等級",
"无效的邀请链接": "無效的邀請連結"
}

View File

@ -33,7 +33,7 @@ export default function () {
const userInviteLink = useMemo(
() =>
`${import.meta.env.VITE_BASE_URL}#/?${UrlQueryParamsKey.INVITE_CODE}=${
`${location.origin}/#/?${UrlQueryParamsKey.INVITE_CODE}=${
userData?.invitationCode || ""
}`,
[userData]
@ -87,8 +87,6 @@ export default function () {
<span>{shortenString(address, 6, 4)}</span>
<IconFont
onClick={async () => {
const { connector } = getAccount(config);
await disconnect(config, { connector });
loginOut();
}}
name="tuichu"
@ -433,7 +431,7 @@ function ReceiveCom({
{tokenName}
</span>
<span className={classes.nftToken_content_token_item_tokenNum}>
{tokenNum}
{tokenNum + toReceive}
</span>
<span
className={classes.nftToken_content_token_item_AssetRecords}
@ -449,7 +447,7 @@ function ReceiveCom({
<div>
<div className={classes.nftToken_content_token_item_tokenWaiting}>
<span>{t("待领取")}</span>
<span>{tokenNum + toReceive}</span>
<span>{toReceive}</span>
</div>
<Button
className={classes.nftToken_content_token_item_tokenReceive}

View File

@ -1,7 +1,7 @@
/*
* @LastEditors: John
* @Date: 2024-06-19 11:03:01
* @LastEditTime: 2024-06-25 18:17:18
* @LastEditTime: 2024-06-26 15:21:27
* @Author: John
*/
import { api_preprelion_list } from "@/server/api";
@ -25,7 +25,7 @@ export default function () {
name: t("级别"),
grow: 4,
cell(row, rowIndex, column, id) {
return <div>{getLevelName(row.level)}</div>;
return <div>{getLevelName(row.level, row.userType)}</div>;
},
},
{

View File

@ -95,7 +95,12 @@ export default function () {
<div className={classes.content_box}>
<div className={classes.box_item}>
<span>{t("当前级别")}</span>
<span>{getLevelName(userUpgradeInfo?.level || 0)}</span>
<span>
{getLevelName(
userUpgradeInfo?.level || 0,
userUpgradeInfo?.active
)}
</span>
</div>
<IconFont
className={classes.box_arrow}

View File

@ -43,6 +43,7 @@ export interface UserUpgradeInformation {
proportion: string;
status: 1 | 0; //1=可升级 0=不可升级
upgradeFees: string;
active: 0 | 1; // "0=非活跃 1=活跃用户"
}
export interface NftConfigurationData {
@ -110,7 +111,7 @@ export interface PreprelionListItem {
address: string;
level: 0 | 1 | 2 | 3; // 0=无等级 1=会员 2=社长 3=基金会
mintNumber: number;
userType: number;
userType: 0 | 1; // 0=非活跃 1=活跃用户
}
export interface UpgradeOrder {

View File

@ -256,3 +256,41 @@
}
}
}
.adm-dialog {
.adm-center-popup-body {
box-sizing: border-box !important;
border: 1px solid #fc872b !important;
border-radius: 10px !important;
background-color: transparent !important;
backdrop-filter: blur(10px);
.adm-dialog-content {
.adm-auto-center-content {
opacity: 1;
font-family: Space Grotesk;
font-size: 14px;
font-weight: 500;
line-height: normal;
letter-spacing: 0px;
font-variation-settings: "opsz" auto;
color: #ffffff;
z-index: 0;
}
}
.adm-dialog-footer {
.adm-dialog-action-row {
border-top: 1px solid #fc872b !important;
.adm-dialog-button {
span {
color: #fc872b;
}
}
}
}
}
}

View File

@ -8,7 +8,7 @@ import { type ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";
import Toast from "antd-mobile/es/components/toast";
import i18next from "i18next";
import { Level } from "@/server/module";
import { Level, UserHomeData } from "@/server/module";
export const ua = navigator.userAgent;
export const isIOS = /iphone|ipad|ipod|ios/i.test(ua);
@ -84,12 +84,16 @@ export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
export function getLevelName(level: Level) {
export function getLevelName(level: Level, active?: UserHomeData["active"]) {
switch (level) {
case 0:
return i18next.t("普通非活跃");
return i18next.t("无等级");
case 1:
if (active == 1) {
return i18next.t("普通活跃");
} else {
return i18next.t("普通非活跃");
}
case 2:
return i18next.t("社长");
case 3:

View File

@ -1,7 +1,7 @@
/*
* @LastEditors: John
* @Date: 2024-06-19 15:55:07
* @LastEditTime: 2024-06-25 14:47:58
* @LastEditTime: 2024-06-26 15:18:22
* @Author: John
*/
import { config } from "@/components/WalletProvider";
@ -106,8 +106,6 @@ export async function signAndLogin(address?: `0x${string}`): Promise<void> {
});
} catch (error) {
// 用户拒绝签名或者遇到错误,断开链接
const { connector } = getAccount(config);
await disconnect(config, { connector });
loadingToast.close();
loginOut();
throw new Error("用户拒绝签名或者遇到错误,断开链接");
@ -127,33 +125,21 @@ export async function signAndLogin(address?: `0x${string}`): Promise<void> {
useUserStore.setState((state) => {
return { ...state, Token: loginInfoData.data?.token };
});
// TODO 判断用户是否绑定关系✔
const { data } =
await api_query_whether_the_user_is_binding_relationship().send({});
if (
typeof data?.data.result == "boolean" &&
data?.data.result === false
) {
const inviteCode = getUrlQueryParam(UrlQueryParamsKey.INVITE_CODE);
if (inviteCode) {
const { data } = await api_binding_invitation_relationship().send({
data: {
shareCode: inviteCode,
},
});
}
}
reslove();
loadingToast.close();
}
} else {
const inviteCode = getUrlQueryParam(UrlQueryParamsKey.INVITE_CODE);
if (!inviteCode) {
Toast.show({ icon: "fail", content: i18next.t("无效的邀请链接") });
return loginOut();
}
// 注册
await api_signUp().send({
data: {
account: address,
publicKey,
shareCode: "",
shareCode: inviteCode,
chainType: 2,
},
});
@ -164,7 +150,9 @@ export async function signAndLogin(address?: `0x${string}`): Promise<void> {
});
}
export function loginOut() {
export async function loginOut() {
const { connector } = getAccount(config);
await disconnect(config, { connector });
useUserStore.setState((state) => {
return { ...state, Address: "", Token: "" };
});