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
赵振东
gaohuaxue-mobile-app
Commits
09542fc4
Commit
09542fc4
authored
Feb 28, 2023
by
yuxingming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加yapi消息token
parent
1586974b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
29 deletions
+38
-29
index.tsx
src/views/messageCenter/index.tsx
+30
-27
ytt.config.ts
ytt.config.ts
+8
-2
No files found.
src/views/messageCenter/index.tsx
View file @
09542fc4
...
...
@@ -6,7 +6,7 @@ import Toast from 'react-native-root-toast';
import
JPush
from
'jpush-react-native'
;
import
myStyle
from
'./style'
import
useAppStyle
from
'../../hooks/useAppStyle'
;
import
{
GetMessageMobileMessageMemberUnreadCountResponse
,
postMessageMobileMessageMemberReadAll
}
from
'../../services/MessageV2Api'
;
import
{
GetMessageMobileMessageMemberUnreadCountResponse
,
postMessageMobileMessageMemberReadAll
,
getMessageMobileMessageMemberClearMessageWarn
}
from
'../../services/MessageV2Api'
;
import
{
big
}
from
'./common/image'
;
import
{
DataIndexType
}
from
'./PlatformMsg'
;
import
{
useNavigation
}
from
'@react-navigation/native'
;
...
...
@@ -51,34 +51,37 @@ const MessageCenter = ()=>{
},
0
),
[
msgList
],
);
const
handleReadAll
=
async
()
=>
{
// getMessageMobileMessageMemberClearMessageWarn()
if
(
total
===
0
)
{
Toast
.
show
(
'暂无可清除消息'
,{
position
:
300
,
opacity
:
0.6
,
containerStyle
:{
width
:
140
,
height
:
48
,
alignItems
:
'center'
,
justifyContent
:
'center'
}});
return
;
const
{
code
,
data
}
=
await
getMessageMobileMessageMemberClearMessageWarn
()
if
(
code
!==
1000
){
return
}
Confirm
.
info
({
title
:
''
,
content
:
'是否清除所有未读消息'
,
onOk
:
()
=>
new
Promise
<
void
>
((
resolve
)
=>
{
postMessageMobileMessageMemberReadAll
()
.
then
((
res
)
=>
{
if
(
res
.
code
!==
1000
)
{
Toast
.
show
(
res
.
message
);
return
;
}
JPush
.
clearAllNotifications
();
const
newData
:
any
=
{};
list
.
forEach
((
_item
)
=>
{
newData
[
_item
]
=
0
console
.
log
(
data
)
if
(
data
){
Confirm
.
info
({
title
:
''
,
content
:
'是否清除所有未读消息'
,
onOk
:
()
=>
new
Promise
<
void
>
((
resolve
)
=>
{
postMessageMobileMessageMemberReadAll
()
.
then
((
res
)
=>
{
if
(
res
.
code
!==
1000
)
{
Toast
.
show
(
res
.
message
);
return
;
}
JPush
.
clearAllNotifications
();
const
newData
:
any
=
{};
list
.
forEach
((
_item
)
=>
{
newData
[
_item
]
=
0
})
setMsgList
((
prev
)
=>
({
...
prev
,
...
newData
,
}))
resolve
();
})
setMsgList
((
prev
)
=>
({
...
prev
,
...
newData
,
}))
resolve
();
})
}),
})
}),
})
}
}
const
handleReadMsg
=
(
msgType
:
DataIndexType
)
=>
{
setMsgList
((
prev
)
=>
({
...
...
ytt.config.ts
View file @
09542fc4
...
...
@@ -41,18 +41,24 @@ const tokenList = [
token
:
'6fa31c5852fc77bd51f832d38395f808ba7c128ab6bef1e464a6a921ee7b6d00'
,
categoryIds
:
[
0
],
},
{
{
// 平台后台服务
name
:
'ManageV2'
,
token
:
'c54d059471f01df8dbe4d30852934b613a8529b1b2f93b0fb00248c44105794f'
,
categoryIds
:
[
0
]
},
},
{
// 结算服务
name
:
'SettleV2'
,
token
:
'604877091b5873528ca2132dce4bd8cf898ec4cb3b191d10ee7c946242381ba8'
,
categoryIds
:
[
0
],
},
{
// 消息服务
name
:
'MessageV2'
,
token
:
'e65bf996a4a283958e16ff355f51c905f61da1505f9b2bc675fb6e8987d6040e'
,
categoryIds
:
[
0
],
},
];
const
getConfigMap
=
(
tokens
:
any
)
=>
tokens
.
map
((
v
:
any
)
=>
({
serverUrl
:
'http://10.0.1.181:7070/'
,
...
...
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