Commit 09542fc4 authored by yuxingming's avatar yuxingming

feat: 添加yapi消息token

parent 1586974b
......@@ -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) => ({
......
......@@ -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/',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment