Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
banma_credit
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hik_rn
project
banma_credit
Commits
4e8851a4
Commit
4e8851a4
authored
Sep 29, 2020
by
肖亮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:更新tabbar及操作退出
parent
a7f591d8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
10 deletions
+23
-10
src/pages/ChangeNickname/index.js
+2
-3
src/pages/Equipment/index.js
+1
-2
src/router/index.js
+20
-5
No files found.
src/pages/ChangeNickname/index.js
View file @
4e8851a4
...
...
@@ -5,7 +5,7 @@
import
React
,
{
useEffect
,
useState
}
from
'react'
import
{
TextInput
,
Text
,
TouchableHighlight
,
View
,
NativeModules
,
StatusBar
,
Platform
}
from
'react-native'
;
import
Tabbar
from
'../../components/Tabbar'
;
//
import Tabbar from '../../components/Tabbar';
import
{
user
as
userServices
}
from
'../../services'
;
import
styles
from
'./style'
;
...
...
@@ -24,7 +24,7 @@ const Equipment = () => {
const
handleSave
=
async
()
=>
{
if
(
/^
[\w\d
_-
]{4,20}
$/
.
test
(
nick
N
ame
))
{
if
(
/^
[\w\d
_-
]{4,20}
$/
.
test
(
nick
n
ame
))
{
const
data
=
await
userServices
.
setNickName
({
nickname
});
BMCUI
.
show
(
'修改昵称成功!'
);
exit
();
...
...
@@ -35,7 +35,6 @@ const Equipment = () => {
return
(
<
View
style
=
{
styles
.
container
}
>
<
Tabbar
title
=
"修改昵称"
/>
<
View
>
<
TextInput
style
=
{
styles
.
input
}
...
...
src/pages/Equipment/index.js
View file @
4e8851a4
...
...
@@ -5,7 +5,7 @@
import
React
,
{
useEffect
,
useState
}
from
'react'
import
{
ScrollView
,
View
,
Text
,
SafeAreaView
,
NativeModules
,
FlatList
}
from
'react-native'
;
import
Tabbar
from
'../../components/Tabbar'
;
//
import Tabbar from '../../components/Tabbar';
import
{
equiment
as
equimentServices
}
from
'../../services'
;
import
styles
from
'./style'
;
...
...
@@ -29,7 +29,6 @@ const Equipment = () => {
return
(
<
SafeAreaView
>
<
View
style
=
{
styles
.
container
}
>
<
Tabbar
title
=
"常用设备"
/>
<
Text
style
=
{
styles
.
tip
}
>
标题文字点击无反馈,文字超长则隐藏,文字超长则隐藏
<
/Text
>
...
...
src/router/index.js
View file @
4e8851a4
import
React
from
'react'
import
{
NavigationContainer
}
from
'@react-navigation/native'
;
import
{
createStackNavigator
}
from
'@react-navigation/stack'
;
import
{
NativeModules
}
from
'react-native'
;
import
{
createStackNavigator
,
HeaderBackButton
}
from
'@react-navigation/stack'
;
import
Equipment
from
'../pages/Equipment'
import
ChangeNickname
from
'../pages/ChangeNickname'
const
Stack
=
createStackNavigator
();
const
{
BMCAction
:
{
exit
}
}
=
NativeModules
;
const
pathMap
=
{
'/equiment'
:
'equiment'
,
...
...
@@ -13,18 +15,31 @@ const pathMap = {
function
AllStack
(
props
)
{
const
{
path
}
=
props
;
console
.
log
(
'pathMap[path]'
,
pathMap
[
path
]);
const
headerLeft
=
(
props
)
=>
(
<
HeaderBackButton
{...
props
}
onPress
=
{()
=>
{
exit
()
}}
/
>
);
return
(
<
Stack
.
Navigator
initialRouteName
=
{
pathMap
[
path
]
||
'changeNickname'
}
>
<
Stack
.
Screen
options
=
{{
title
:
'常用设备'
}}
name
=
"equiment"
component
=
{
Equipment
}
/
>
<
Stack
.
Screen
options
=
{{
title
:
'修改昵称'
}}
name
=
"changeNickname"
component
=
{
ChangeNickname
}
/
>
<
Stack
.
Screen
options
=
{{
title
:
'常用设备'
,
headerLeft
:
headerLeft
,
}}
name
=
"equiment"
component
=
{
Equipment
}
/
>
<
Stack
.
Screen
options
=
{{
title
:
'修改昵称'
,
headerLeft
:
headerLeft
,
}}
name
=
"changeNickname"
component
=
{
ChangeNickname
}
/
>
<
/Stack.Navigator
>
);
}
export
default
function
App
(
props
)
{
const
{
path
}
=
props
;
console
.
log
(
'path'
,
path
);
return
(
<
NavigationContainer
>
<
AllStack
path
=
{
path
}
/
>
...
...
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