diff --git a/src/http/api.ts b/src/http/api.ts
index 344a2d6..c595049 100644
--- a/src/http/api.ts
+++ b/src/http/api.ts
@@ -47,3 +47,5 @@ export const http_transferDeposit = (data: HttpRequestPs.TransferDeposit) => req
export const http_submit = (data: HttpRequestPs.Submit) => request({ url: '/v1/submitData', data })
+export const http_notify = () => request({ url: '/v1/message' })
+
diff --git a/src/pages/record/bonus/index.tsx b/src/pages/record/bonus/index.tsx
index 065ef85..9e23613 100644
--- a/src/pages/record/bonus/index.tsx
+++ b/src/pages/record/bonus/index.tsx
@@ -28,7 +28,7 @@ const BonusRecords = () => {
{ label: '盈利分红', value: 2 },
{ label: '超级奖励', value: 3 },
{ label: '交易佣金', value: 4 },
- { label: '星际奖励', value: 5 },
+ { label: '星级奖励', value: 5 },
]
const searchConfigList = [
diff --git a/src/pages/transfer/index.tsx b/src/pages/transfer/index.tsx
index e8f72ca..9def1c2 100644
--- a/src/pages/transfer/index.tsx
+++ b/src/pages/transfer/index.tsx
@@ -27,6 +27,7 @@ const Transfer = () => {
type
})
if (res.code === 0) {
+ store.getUserInfo()
form.resetFields()
notification.success({
message: '提交成功'
@@ -56,10 +57,19 @@ const Transfer = () => {
>
资金操作}>
-
- 钱包金额:
- ${userInfo.account_balance}
-
+ {
+ type < 3 ? (
+
+ 钱包金额:
+ ${userInfo.balance}
+
+ ) : (
+
+ 资产账户金额:
+ ${userInfo.account_balance}
+
+ )
+ }
{
diff --git a/src/router/index.tsx b/src/router/index.tsx
index ca19445..d00d15a 100644
--- a/src/router/index.tsx
+++ b/src/router/index.tsx
@@ -5,14 +5,18 @@ import '../styles/app.scss'
import { useRouter } from "../hooks/useRouter";
import Slider from "../components/layout/Slider";
import Header from "../components/layout/Header";
-import { useEffect, useRef } from "react";
+import { useEffect, useRef, useState } from "react";
import { unLoginPath } from "./routes";
+import { Divider, Modal } from "antd";
+import { NotifyStatus_Type } from "../types";
+import { http_notify } from "../http/api";
const LayoutRouter = () => {
const { push, location } = useRouter()
-
+ const [visible, setVisible] = useState(false)
const { token, screenWidth } = store.state
+ const [notifys, setNotifys] = useState([] as any)
//
useEffect(() => {
@@ -36,45 +40,78 @@ const LayoutRouter = () => {
}
}, [location.pathname, token])
+ const isShowNotifyModal = async () => {
+
+ try {
+ const res: any = await http_notify()
+ if (res.code === 0) {
+ console.log(res);
+
+ setNotifys(res.data)
+ const type = window.localStorage.getItem('NotifyStatus') || NotifyStatus_Type.show
+ if (type === NotifyStatus_Type.show && res.data && res.data.length > 0) {
+ setVisible(true)
+ window.localStorage.setItem('NotifyStatus', NotifyStatus_Type.hidden)
+ }
+ }
+ } catch (error) {
+ }
+
+
+ }
+
useEffect(() => {
token && store.getUserInfo()
token && store.getReceiveAccount()
!token && store.resetUserInfo()
!token && store.resetReceiveAccount()
- }, [token])
- useEffect(() => {
- window.addEventListener('message', (res) => {
- if (res.origin === process.env.REACT_APP_ORIGIN) {
- if (res && res.data && res.data.token) {
- store.setToken(res.data.token)
- if (!window.sessionStorage.getItem('first_render')) {
- window.location.reload()
- }
- window.sessionStorage.setItem('first_render', 'true')
- }
- }
- })
- }, [])
+ if (token) {
+ isShowNotifyModal()
+ }
+ }, [token])
return (
- !token ? (
-
- ) : (
-
-
-
+ <>
+ {
+ !token ? (
+
+ ) : (
+
+
+
+ {
+ screenWidth > 1000 &&
+ }
+
1000 ? 40 : 0, flex: 1 }}>
+
+
+
+
+
+
+ )
+ }
+
setVisible(false)}
+ footer={() => null}
+ width={screenWidth > 1000 ? '60%' : '90%'}
+ title="平台公告"
+ >
+
{
- screenWidth > 1000 &&
+ notifys.map((item: any) => (
+
+ ))
}
-
1000 ? 40 : 0, flex: 1 }}>
-
-
-
-
-
- )
+
+ >
)
}
diff --git a/src/store/index.ts b/src/store/index.ts
index 6e65254..d548cc4 100644
--- a/src/store/index.ts
+++ b/src/store/index.ts
@@ -1,5 +1,5 @@
import { makeAutoObservable } from "mobx";
-import { Store } from "../types";
+import { NotifyStatus_Type, Store } from "../types";
import { http_account, http_receiveAccount } from "../http/api";
class AppStore {
@@ -29,6 +29,10 @@ class AppStore {
setToken(_token: string) {
this.state.token = _token;
window.localStorage.setItem('Tarder_Token', _token)
+
+ if (!_token) {
+ window.localStorage.setItem('NotifyStatus', NotifyStatus_Type.show)
+ }
}
setScreenWidth(_width: number) {
diff --git a/src/types/index.ts b/src/types/index.ts
index 8b55a10..23fc5ac 100644
--- a/src/types/index.ts
+++ b/src/types/index.ts
@@ -14,6 +14,7 @@ export namespace Store {
name: string;
total_assets: string;
total_income: string;
+ level: string
}
export interface ReceiveAccount {
@@ -25,3 +26,7 @@ export namespace Store {
}
}
+export enum NotifyStatus_Type {
+ hidden = 'hidden',
+ show = 'show'
+}
\ No newline at end of file