Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gaohuaxue-mobile-app
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chen
gaohuaxue-mobile-app
Commits
e47473b1
Commit
e47473b1
authored
Nov 24, 2022
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加协议页面
parent
66f9e491
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
1 deletion
+56
-1
routers.ts
src/routers/routers.ts
+6
-0
types.ts
src/routers/types.ts
+2
-1
index.tsx
src/views/Login/Agreement/index.tsx
+48
-0
No files found.
src/routers/routers.ts
View file @
e47473b1
import
BottomTabs
from
'./BottomTabs'
;
import
TestDetailsScreen
from
'../views/Test/TestDetailsScreen'
;
import
Login
from
'../views/Login'
;
import
LoginAgreement
from
'../views/Login/Agreement'
;
import
AccountInfo
from
'../views/AccountInfo'
;
export
const
ROUTERS
=
{
...
...
@@ -19,6 +20,11 @@ export const ROUTERS = {
component
:
Login
,
headerShown
:
true
,
},
LoginAgreement
:
{
title
:
''
,
// 协议
component
:
LoginAgreement
,
headerShown
:
true
,
},
AccountInfo
:
{
title
:
'账号信息'
,
component
:
AccountInfo
,
...
...
src/routers/types.ts
View file @
e47473b1
...
...
@@ -24,6 +24,7 @@ export type RootStackParamList = {
BottomTabs
:
NavigatorScreenParams
<
RootTabParamList
>
;
TestDetailsScreen
:
undefined
;
Login
:
undefined
;
LoginAgreement
:
{
id
:
number
};
AccountInfo
:
undefined
;
};
...
...
@@ -32,7 +33,7 @@ export type RootStackScreenProps<Screen extends keyof RootStackParamList> =
export
type
RootTabParamList
=
{
// Home: NavigatorScreenParams<RootStackParamList>;
Home
:
{
post
:
string
};
Home
:
{
post
:
string
}
|
undefined
;
Customer
:
undefined
;
PWAS
:
undefined
;
PersonalCenter
:
undefined
;
...
...
src/views/Login/Agreement/index.tsx
0 → 100644
View file @
e47473b1
/* eslint-disable react-hooks/exhaustive-deps */
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
View
}
from
'react-native'
;
import
{
WebView
}
from
'react-native-webview'
;
import
{
useSafeAreaInsets
}
from
'react-native-safe-area-context'
;
import
{
RootStackScreenProps
}
from
'../../../routers/types'
;
import
{
getManageContentNoticeGet
}
from
'../../../services/ManageV2Api'
;
import
type
{
GetManageContentNoticeGetResponse
}
from
'../../../services/ManageV2Api'
;
type
LoginAgreementScreenNavigationProp
=
RootStackScreenProps
<
'LoginAgreement'
>
;
/**
* 协议
* @returns null
*/
const
LoginAgreement
:
React
.
FC
<
LoginAgreementScreenNavigationProp
>
=
({
route
,
navigation
,
})
=>
{
const
{
params
:
{
id
},
}
=
route
;
const
[
columnTypeList
,
setcolumnTypeList
]
=
useState
<
GetManageContentNoticeGetResponse
|
null
>
(
null
);
const
safeInset
=
useSafeAreaInsets
();
const
findAllByColumnType
=
async
()
=>
{
const
res
=
await
getManageContentNoticeGet
({
id
:
`
${
id
}
`
});
if
(
res
.
code
===
1000
)
{
setcolumnTypeList
(
res
.
data
);
navigation
.
setOptions
({
title
:
res
.
data
.
title
});
}
};
useEffect
(()
=>
{
findAllByColumnType
();
},
[]);
return
(
<
View
style=
{
{
flex
:
1
,
paddingBottom
:
safeInset
.
bottom
}
}
>
<
WebView
source=
{
{
html
:
columnTypeList
?.
content
||
''
}
}
/>
</
View
>
);
};
export
default
LoginAgreement
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment