diff --git a/src/pages/team/index.tsx b/src/pages/team/index.tsx
index 5e942ae..82b5213 100644
--- a/src/pages/team/index.tsx
+++ b/src/pages/team/index.tsx
@@ -62,7 +62,7 @@ const Team = () => {
const getData = async () => {
const res: any = await team_info()
if (res && res.code === 0) {
- cardState[0][0].value = res.data.inviti_address || '000000000000000'
+ cardState[0][0].value = res.data.inviti_address || ''
cardState[1][0].value = res.data.award ? res.data.award + "U" : "0U"
cardState[1][1].value = res.data.direct_count ? res.data.direct_count + '人' : '0人'
cardState[1][2].value = res.data.indirect_count ? res.data.indirect_count + '人' : '0人'
@@ -99,9 +99,9 @@ const Team = () => {
{item.title}
- {item.id === 1 ? splitAddress(item.value) : item.value}
+ {item.id === 1 ? item.value && splitAddress(item.value) || '-' : item.value}
{
- item.id === 1 && (
+ item.id === 1 && item.value && (
copyVal(item.value)}>
)
}
diff --git a/src/router/layout/Navbar.tsx b/src/router/layout/Navbar.tsx
index db5c16d..1366c9f 100644
--- a/src/router/layout/Navbar.tsx
+++ b/src/router/layout/Navbar.tsx
@@ -45,7 +45,10 @@ const Navbar = (props: NavbarProps) => {
pathname === '/noShare' ? (
push(-1)}>
) : (
-
9527
+
+
+
{require('../../../package.json').name}
+
)
}
diff --git a/src/router/layout/index.tsx b/src/router/layout/index.tsx
index 255afad..4e7c8fb 100644
--- a/src/router/layout/index.tsx
+++ b/src/router/layout/index.tsx
@@ -13,6 +13,7 @@ import { ethers } from 'ethers';
import { bind_rmd } from '~/api';
import { AlreadyBind, BindRmd, BindSuccess, DefaultBind, UnLogin, VaildLink } from './ui';
import Modal from '~/components/Modal';
+import { Toast } from 'react-vant';
const LayoutRouter = () => {
@@ -61,12 +62,19 @@ const LayoutRouter = () => {
}, [token])
useEffect(() => {
+ // 0x2ADDed672bacEfe857a408B577CB7DF1f6687c07
const isModal = async () => {
let user = userInfo
- let isRouter = routes.find(v => v.path === location.pathname)
- const address = location.pathname.substring(1, location.pathname.length)
- if (isRouter) return
+ if (location.pathname !== '/') return
+
+ const address = location.search.split('=')[1]
+ if (!address) return
+
+ if (!token) {
+ store.setVisibleUnLogin(true)
+ return
+ }
if (Object.keys(user).length <= 0) {
const res: any = await store.getUserInfo()
@@ -74,15 +82,23 @@ const LayoutRouter = () => {
user = res
}
}
+
if (!ethers.utils.isAddress(address)) {
// 无效的分享链接
setVisibleVaildLink(true)
return
}
// 地址相同
- if (address.toLocaleLowerCase() === walletAddress.toLocaleLowerCase()) return
- setShareAddress(address)
+ if (address.toLocaleLowerCase() === walletAddress.toLocaleLowerCase()) {
+ push('/', null, true)
+ Toast.fail({
+ message: '不能綁定自己!',
+ duration: 2500
+ })
+ return
+ }
// 绑定推荐人
+ setShareAddress(address)
if (!user.is_bound && ethers.utils.isAddress(address)) {
setVisibleBindRmd(true)
@@ -94,7 +110,7 @@ const LayoutRouter = () => {
}
}
- token && isModal()
+ isModal()
!token && setVisibleBindRmd(false)
}, [token, walletAddress])
diff --git a/src/router/layout/ui.tsx b/src/router/layout/ui.tsx
index 3230fac..b21d39f 100644
--- a/src/router/layout/ui.tsx
+++ b/src/router/layout/ui.tsx
@@ -10,35 +10,49 @@ interface UIProps {
address?: string
}
-export const UnLogin = ({ visible, setVisible }: UIProps) => (
-
-
-
訪問失敗
-
未檢測到錢包,請登錄錢包後重新點擊
-
-
-)
+export const UnLogin = ({ visible, setVisible }: UIProps) => {
+ return (
+
{
+ setVisible(false)
+ }}
+ setVisible={() => {
+ setVisible(false)
+ }}
+ visible={visible}
+ buttonText="關閉"
+ hiddenCloseIcon
+ >
+
+
訪問失敗
+
未檢測到錢包,請登錄錢包後重新點擊
+
+
+ )
+}
-export const VaildLink = ({ visible, setVisible }: UIProps) => (
-
setVisible(false)}
- setVisible={() => setVisible(false)}
- visible={visible}
- buttonText="關閉"
- >
-
-
-)
+export const VaildLink = ({ visible, setVisible }: UIProps) => {
+ return (
+
{
+ setVisible(false)
+ }}
+ setVisible={() => {
+ setVisible(false)
+ }}
+ visible={visible}
+ hiddenCloseIcon
+ buttonText="關閉"
+ >
+
+
+ )
+}
export const DefaultBind = ({ visible, setVisible, onClick }: UIProps) => {
@@ -97,7 +111,6 @@ export const BindSuccess = ({ visible, setVisible, address }: UIProps) => {
setVisible={setVisible}
title="綁定推薦人"
buttonClick={() => {
- push('/', null, true)
setVisible()
push('/team')
}}
@@ -105,7 +118,9 @@ export const BindSuccess = ({ visible, setVisible, address }: UIProps) => {
hiddenCloseIcon
showCancelButton
showCancelButtonText="關閉"
- showCancelButtonClick={setVisible}
+ showCancelButtonClick={() => {
+ setVisible()
+ }}
>
綁定成功
@@ -116,19 +131,24 @@ export const BindSuccess = ({ visible, setVisible, address }: UIProps) => {
}
-export const AlreadyBind = ({ visible, setVisible, onClick }: UIProps) => (
-
onClick && onClick()}
- setVisible={() => setVisible(false)}
- visible={visible}
- buttonText='查看綁定人'
- showCancelButton
- showCancelButtonClick={() => setVisible(false)}
- >
-
-
綁定失敗
-
該錢包已有推薦人,不可重複綁定推薦人
-
-
-)
\ No newline at end of file
+export const AlreadyBind = ({ visible, setVisible, onClick }: UIProps) => {
+ return (
+
onClick && onClick()}
+ setVisible={() => setVisible()}
+ visible={visible}
+ buttonText='查看綁定人'
+ hiddenCloseIcon
+ showCancelButton
+ showCancelButtonClick={() => {
+ setVisible()
+ }}
+ >
+
+
綁定失敗
+
該錢包已有推薦人,不可重複綁定推薦人
+
+
+ )
+}
\ No newline at end of file
diff --git a/src/router/routes.tsx b/src/router/routes.tsx
index 1ef866c..a4c59cc 100644
--- a/src/router/routes.tsx
+++ b/src/router/routes.tsx
@@ -17,10 +17,6 @@ const routes = [
path: "/",
element:
},
- {
- path: '/:id',
- component:
- },
{
path: "/product",
element:
,
diff --git a/src/styles/components.scss b/src/styles/components.scss
index f2df7ba..fea5cce 100644
--- a/src/styles/components.scss
+++ b/src/styles/components.scss
@@ -56,7 +56,8 @@
align-items: center;
.user-img{
- @include img-size(12px,12px)
+ @include img-size(12px,12px);
+ border-radius:12px
}
}
}
diff --git a/src/styles/home.scss b/src/styles/home.scss
index af09baa..fbdc51b 100644
--- a/src/styles/home.scss
+++ b/src/styles/home.scss
@@ -22,7 +22,6 @@
height: 130px;
.tag{
- background: $usdt-bg;
color: $white;
padding: 3px 15px;
border-radius: 20px;
@@ -85,7 +84,7 @@
display: flex;
justify-content: space-between;
flex-direction: column;
-
+
.user-tag{
width: 90%;
height: 16px;
diff --git a/src/styles/layout.scss b/src/styles/layout.scss
index d073cf8..04706de 100644
--- a/src/styles/layout.scss
+++ b/src/styles/layout.scss
@@ -17,6 +17,13 @@
border-radius: 3px;
background-color: $red;
}
+
+ .logo{
+ width: 20px;
+ height: 20px;
+ object-fit: cover;
+ }
+
}
.header-block{