mirror of
https://github.com/TangSengDaoDao/TangSengDaoDaoWeb
synced 2025-06-06 01:04:26 +00:00
feat: 更新好友申请
This commit is contained in:
parent
65afe3e269
commit
48bae77b27
@ -1,60 +1,100 @@
|
|||||||
import { ChatPage, EndpointCategory, WKApp, Menus } from '@tsdaodao/base';
|
import { ChatPage, EndpointCategory, WKApp, Menus } from "@tsdaodao/base";
|
||||||
import { ContactsList } from '@tsdaodao/contacts';
|
import { ContactsList } from "@tsdaodao/contacts";
|
||||||
import React from 'react';
|
import React from "react";
|
||||||
import './index.css';
|
import "./index.css";
|
||||||
import AppLayout from '../Layout';
|
import AppLayout from "../Layout";
|
||||||
import { WKSDK } from 'wukongimjssdk';
|
import { WKSDK } from "wukongimjssdk";
|
||||||
function App() {
|
function App() {
|
||||||
registerMenus()
|
registerMenus();
|
||||||
return (
|
return <AppLayout />;
|
||||||
<AppLayout />
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function registerMenus() {
|
function registerMenus() {
|
||||||
|
|
||||||
WKSDK.shared().conversationManager.addConversationListener(() => {
|
WKSDK.shared().conversationManager.addConversationListener(() => {
|
||||||
WKApp.menus.refresh()
|
WKApp.menus.refresh();
|
||||||
})
|
});
|
||||||
|
|
||||||
WKApp.endpointManager.setMethod("menus.friendapply.change", () => {
|
WKApp.endpointManager.setMethod(
|
||||||
WKApp.menus.refresh()
|
"menus.friendapply.change",
|
||||||
}, {
|
() => {
|
||||||
|
WKApp.menus.refresh();
|
||||||
|
},
|
||||||
|
{
|
||||||
category: EndpointCategory.friendApplyDataChange,
|
category: EndpointCategory.friendApplyDataChange,
|
||||||
})
|
}
|
||||||
|
);
|
||||||
|
|
||||||
WKApp.menus.register("chat", (context) => {
|
WKApp.menus.register(
|
||||||
const m = new Menus("chat", "/", "会话",
|
"chat",
|
||||||
<img alt='会话' src={require("./assets/HomeTab.svg").default}></img>,
|
(context) => {
|
||||||
<img alt='会话' src={require("./assets/HomeTabSelected.svg").default}></img>)
|
const m = new Menus(
|
||||||
let badge = 0
|
"chat",
|
||||||
for (const conversation of WKSDK.shared().conversationManager.conversations) {
|
"/",
|
||||||
|
"会话",
|
||||||
|
<img alt="会话" src={require("./assets/HomeTab.svg").default}></img>,
|
||||||
|
(
|
||||||
|
<img
|
||||||
|
alt="会话"
|
||||||
|
src={require("./assets/HomeTabSelected.svg").default}
|
||||||
|
></img>
|
||||||
|
)
|
||||||
|
);
|
||||||
|
let badge = 0;
|
||||||
|
for (const conversation of WKSDK.shared().conversationManager
|
||||||
|
.conversations) {
|
||||||
if (!conversation.channelInfo?.mute) {
|
if (!conversation.channelInfo?.mute) {
|
||||||
badge += conversation.unread
|
badge += conversation.unread;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m.badge = badge
|
m.badge = badge;
|
||||||
return m
|
return m;
|
||||||
},1000)
|
},
|
||||||
|
1000
|
||||||
|
);
|
||||||
|
|
||||||
WKApp.menus.register("contacts", (param) => {
|
// 获取好友未申请添加数量
|
||||||
const m = new Menus("contacts", "/contacts", "通讯录",
|
let unreadCount = 0;
|
||||||
<img alt='通讯录' src={require("./assets/ContactsTab.svg").default}></img>,
|
if (WKApp.loginInfo.isLogined()) {
|
||||||
<img alt='通讯录' src={require("./assets/ContactsTabSelected.svg").default}></img>)
|
WKApp.apiClient.get(`/user/reddot/friendApply`).then((res) => {
|
||||||
|
unreadCount = res.count;
|
||||||
|
WKApp.menus.refresh();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
m.badge = WKApp.shared.getFriendApplysUnreadCount()
|
WKApp.menus.register(
|
||||||
return m
|
"contacts",
|
||||||
},2000)
|
(param) => {
|
||||||
|
const m = new Menus(
|
||||||
|
"contacts",
|
||||||
|
"/contacts",
|
||||||
|
"通讯录",
|
||||||
|
(
|
||||||
|
<img
|
||||||
|
alt="通讯录"
|
||||||
|
src={require("./assets/ContactsTab.svg").default}
|
||||||
|
></img>
|
||||||
|
),
|
||||||
|
(
|
||||||
|
<img
|
||||||
|
alt="通讯录"
|
||||||
|
src={require("./assets/ContactsTabSelected.svg").default}
|
||||||
|
></img>
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
m.badge = unreadCount;
|
||||||
|
return m;
|
||||||
|
},
|
||||||
|
2000
|
||||||
|
);
|
||||||
|
|
||||||
WKApp.route.register("/", () => {
|
WKApp.route.register("/", () => {
|
||||||
return <ChatPage></ChatPage>
|
return <ChatPage></ChatPage>;
|
||||||
})
|
});
|
||||||
|
|
||||||
WKApp.route.register("/contacts", () => {
|
WKApp.route.register("/contacts", () => {
|
||||||
return <ContactsList></ContactsList>
|
return <ContactsList></ContactsList>;
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export default App;
|
export default App;
|
||||||
|
|
||||||
|
@ -457,9 +457,9 @@ export default class WKApp extends ProviderListener {
|
|||||||
for (const friendApplyObj of friendApplyObjs) {
|
for (const friendApplyObj of friendApplyObjs) {
|
||||||
const f = new FriendApply()
|
const f = new FriendApply()
|
||||||
f.uid = friendApplyObj.uid
|
f.uid = friendApplyObj.uid
|
||||||
f.name = friendApplyObj.name
|
f.to_name = friendApplyObj.to_name
|
||||||
f.remark = friendApplyObj.remark
|
f.remark = friendApplyObj.remark
|
||||||
f.state = friendApplyObj.state
|
f.status = friendApplyObj.status
|
||||||
f.token = friendApplyObj.token
|
f.token = friendApplyObj.token
|
||||||
f.unread = friendApplyObj.unread
|
f.unread = friendApplyObj.unread
|
||||||
f.createdAt = friendApplyObj.createdAt
|
f.createdAt = friendApplyObj.createdAt
|
||||||
@ -472,35 +472,41 @@ export default class WKApp extends ProviderListener {
|
|||||||
return friendApplys
|
return friendApplys
|
||||||
}
|
}
|
||||||
|
|
||||||
public getFriendApplysUnreadCount() {
|
public async getFriendApplysUnreadCount() {
|
||||||
const friendApplys = this.getFriendApplys()
|
// const friendApplys = this.getFriendApplys()
|
||||||
let unreadCount = 0
|
let unreadCount = 0
|
||||||
if (friendApplys && friendApplys.length > 0) {
|
// if (friendApplys && friendApplys.length > 0) {
|
||||||
for (const friendApply of friendApplys) {
|
// for (const friendApply of friendApplys) {
|
||||||
if (friendApply.unread) {
|
// if (friendApply.unread) {
|
||||||
unreadCount++
|
// unreadCount++
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
|
if (!WKApp.loginInfo.isLogined()) {
|
||||||
|
return unreadCount;
|
||||||
}
|
}
|
||||||
|
const res = await WKApp.apiClient.get(`/user/reddot/friendApply`);
|
||||||
|
unreadCount = res.count;
|
||||||
return unreadCount
|
return unreadCount
|
||||||
}
|
}
|
||||||
|
|
||||||
public friendApplyMarkAllReaded() {
|
public async friendApplyMarkAllReaded(): Promise<void> {
|
||||||
let friendApplys = this.getFriendApplys()
|
// let friendApplys = this.getFriendApplys()
|
||||||
if (!friendApplys) {
|
// if (!friendApplys) {
|
||||||
friendApplys = new Array<FriendApply>()
|
// friendApplys = new Array<FriendApply>()
|
||||||
}
|
// }
|
||||||
var change = false
|
// var change = false
|
||||||
for (const friendApply of friendApplys) {
|
// for (const friendApply of friendApplys) {
|
||||||
if (friendApply.unread) {
|
// if (friendApply.unread) {
|
||||||
friendApply.unread = false
|
// friendApply.unread = false
|
||||||
change = true
|
// change = true
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
if (change) {
|
// if (change) {
|
||||||
WKApp.loginInfo.setStorageItem(this.getFriendApplysKey(), JSON.stringify(friendApplys))
|
// WKApp.loginInfo.setStorageItem(this.getFriendApplysKey(), JSON.stringify(friendApplys))
|
||||||
WKApp.endpointManager.invokes(EndpointCategory.friendApplyDataChange)
|
// WKApp.endpointManager.invokes(EndpointCategory.friendApplyDataChange)
|
||||||
}
|
// }
|
||||||
|
await WKApp.apiClient.delete(`/user/reddot/friendApply`);
|
||||||
}
|
}
|
||||||
|
|
||||||
public addFriendApply(friendApply: FriendApply) {
|
public addFriendApply(friendApply: FriendApply) {
|
||||||
@ -572,13 +578,14 @@ export enum FriendApplyState {
|
|||||||
}
|
}
|
||||||
// 好友申请
|
// 好友申请
|
||||||
export class FriendApply {
|
export class FriendApply {
|
||||||
uid!: string
|
uid!: string;
|
||||||
name!: string
|
to_uid!: string;
|
||||||
remark?: string
|
to_name!: string;
|
||||||
token?: string
|
remark?: string;
|
||||||
state!: FriendApplyState
|
token?: string;
|
||||||
unread: boolean = false // 是否未读
|
status!: FriendApplyState;
|
||||||
createdAt!: number // 创建时间
|
unread: boolean = false; // 是否未读
|
||||||
|
createdAt!: number; // 创建时间
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,58 +1,92 @@
|
|||||||
import { FriendApplyState, WKApp, WKViewQueueHeader, Provider } from "@tsdaodao/base";
|
import {
|
||||||
|
FriendApplyState,
|
||||||
|
WKApp,
|
||||||
|
WKViewQueueHeader,
|
||||||
|
Provider,
|
||||||
|
} from "@tsdaodao/base";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { Component, ReactNode } from "react";
|
import { Component, ReactNode } from "react";
|
||||||
import { Button } from '@douyinfe/semi-ui';
|
import { Button } from "@douyinfe/semi-ui";
|
||||||
import "./index.css"
|
import "./index.css";
|
||||||
import { NewFriendVM } from "./vm";
|
import { NewFriendVM } from "./vm";
|
||||||
import "./index.css"
|
import "./index.css";
|
||||||
import { FriendAdd } from "../FriendAdd";
|
import { FriendAdd } from "../FriendAdd";
|
||||||
|
|
||||||
export class NewFriend extends Component {
|
export class NewFriend extends Component {
|
||||||
|
|
||||||
render(): ReactNode {
|
render(): ReactNode {
|
||||||
return <Provider create={() => {
|
return (
|
||||||
return new NewFriendVM()
|
<Provider
|
||||||
}} render={(vm: NewFriendVM) => {
|
create={() => {
|
||||||
|
return new NewFriendVM();
|
||||||
return <div className="wk-newfriend">
|
}}
|
||||||
<WKViewQueueHeader title="新朋友" onBack={() => {
|
render={(vm: NewFriendVM) => {
|
||||||
WKApp.routeLeft.pop()
|
return (
|
||||||
}} action={<div className="wk-viewqueueheader-content-action">
|
<div className="wk-newfriend">
|
||||||
<Button size="small" onClick={()=>{
|
<WKViewQueueHeader
|
||||||
WKApp.routeLeft.push(<FriendAdd onBack={()=>{
|
title="新朋友"
|
||||||
WKApp.routeLeft.pop()
|
onBack={() => {
|
||||||
}}></FriendAdd>)
|
WKApp.routeLeft.pop();
|
||||||
}} >添加好友</Button>
|
}}
|
||||||
</div>}></WKViewQueueHeader>
|
action={
|
||||||
|
<div className="wk-viewqueueheader-content-action">
|
||||||
|
<Button
|
||||||
|
size="small"
|
||||||
|
onClick={() => {
|
||||||
|
WKApp.routeLeft.push(
|
||||||
|
<FriendAdd
|
||||||
|
onBack={() => {
|
||||||
|
WKApp.routeLeft.pop();
|
||||||
|
}}
|
||||||
|
></FriendAdd>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
添加好友
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
></WKViewQueueHeader>
|
||||||
<div className="wk-newfriend-content">
|
<div className="wk-newfriend-content">
|
||||||
<ul>
|
<ul>
|
||||||
{
|
{vm.friendApplys.map((f) => {
|
||||||
vm.friendApplys.map((f) => {
|
return (
|
||||||
return <li key={f.uid} >
|
<li key={f.to_uid}>
|
||||||
<div className="wk-newfriend-content-avatar">
|
<div className="wk-newfriend-content-avatar">
|
||||||
<img src={WKApp.shared.avatarUser(f.uid)}></img>
|
<img src={WKApp.shared.avatarUser(f.to_uid)}></img>
|
||||||
</div>
|
</div>
|
||||||
<div className="wk-newfriend-content-title">
|
<div className="wk-newfriend-content-title">
|
||||||
<div className="wk-newfriend-content-title-name">
|
<div className="wk-newfriend-content-title-name">
|
||||||
{f.name}
|
{f.to_name}
|
||||||
</div>
|
</div>
|
||||||
<div className="wk-newfriend-content-title-remark">
|
<div className="wk-newfriend-content-title-remark">
|
||||||
{f.remark}
|
{f.remark}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="wk-newfriend-content-action">
|
<div className="wk-newfriend-content-action">
|
||||||
<Button loading={vm.currentFriendApply?.uid === f.uid && vm.sureLoading } disabled={f.state==FriendApplyState.accepted} onClick={()=>{
|
<Button
|
||||||
vm.friendSure(f)
|
loading={
|
||||||
}}>{f.state==FriendApplyState.accepted?"已添加":"确认"}</Button>
|
vm.currentFriendApply?.to_uid === f.to_uid &&
|
||||||
|
vm.sureLoading
|
||||||
|
}
|
||||||
|
disabled={f.status == FriendApplyState.accepted}
|
||||||
|
onClick={() => {
|
||||||
|
vm.friendSure(f);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{f.status == FriendApplyState.accepted
|
||||||
|
? "已添加"
|
||||||
|
: "确认"}
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
})
|
);
|
||||||
}
|
})}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}}>
|
);
|
||||||
|
}}
|
||||||
</Provider>
|
></Provider>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,33 +1,83 @@
|
|||||||
|
import { WKSDK, Message, CMDContent } from "wukongimjssdk";
|
||||||
import { FriendApplyState, WKApp, ProviderListener } from "@tsdaodao/base";
|
import { FriendApplyState, WKApp, ProviderListener } from "@tsdaodao/base";
|
||||||
import { FriendApply } from "@tsdaodao/base";
|
import { FriendApply } from "@tsdaodao/base";
|
||||||
|
|
||||||
|
|
||||||
export class NewFriendVM extends ProviderListener {
|
export class NewFriendVM extends ProviderListener {
|
||||||
friendApplys: FriendApply[] = []
|
friendApplys: FriendApply[] = [];
|
||||||
sureLoading:boolean = false
|
sureLoading: boolean = false;
|
||||||
currentFriendApply?:FriendApply
|
currentFriendApply?: FriendApply;
|
||||||
|
|
||||||
didMount(): void {
|
async didMount(): Promise<void> {
|
||||||
|
WKApp.shared.friendApplyMarkAllReaded();
|
||||||
|
|
||||||
WKApp.shared.friendApplyMarkAllReaded()
|
this.friendApplys = await this.getFriendApply();
|
||||||
|
if (this.friendApplys.length === 0) {
|
||||||
|
this.clearFriendApply();
|
||||||
|
}
|
||||||
|
this.notifyListener();
|
||||||
|
// 监听好友申请
|
||||||
|
WKSDK.shared().chatManager.addCMDListener(this.friendRequestCMDListener);
|
||||||
|
}
|
||||||
|
|
||||||
this.friendApplys = WKApp.shared.getFriendApplys()
|
didUnMount(): void {
|
||||||
this.notifyListener()
|
// 监听好友申请
|
||||||
|
WKSDK.shared().chatManager.removeCMDListener(this.friendRequestCMDListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
friendSure(apply: FriendApply) {
|
friendSure(apply: FriendApply) {
|
||||||
this.sureLoading = true
|
this.sureLoading = true;
|
||||||
this.currentFriendApply = apply
|
this.currentFriendApply = apply;
|
||||||
this.notifyListener()
|
this.notifyListener();
|
||||||
|
|
||||||
WKApp.dataSource.commonDataSource.friendSure(apply.token || "").then(() => {
|
WKApp.dataSource.commonDataSource
|
||||||
apply.state = FriendApplyState.accepted
|
.friendSure(apply.token || "")
|
||||||
WKApp.shared.updateFriendApply(apply)
|
.then(() => {
|
||||||
this.sureLoading = false
|
apply.status = FriendApplyState.accepted;
|
||||||
this.notifyListener()
|
WKApp.shared.updateFriendApply(apply);
|
||||||
}).catch(() => {
|
this.sureLoading = false;
|
||||||
this.sureLoading = false
|
this.notifyListener();
|
||||||
this.notifyListener()
|
|
||||||
})
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.sureLoading = false;
|
||||||
|
this.notifyListener();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async getFriendApply(): Promise<FriendApply[]> {
|
||||||
|
const fromData = {
|
||||||
|
page_index: 1,
|
||||||
|
page_size: 999,
|
||||||
|
};
|
||||||
|
const res = await WKApp.apiClient.get("/friend/apply", {
|
||||||
|
param: fromData,
|
||||||
|
});
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
async delFriendApply(apply: FriendApply): Promise<void> {
|
||||||
|
WKApp.apiClient
|
||||||
|
.delete(`/friend/apply/${apply.to_uid}`)
|
||||||
|
.then(async () => {
|
||||||
|
this.friendApplys = await this.getFriendApply();
|
||||||
|
this.sureLoading = false;
|
||||||
|
this.notifyListener();
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.sureLoading = false;
|
||||||
|
this.notifyListener();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async clearFriendApply(): Promise<void> {
|
||||||
|
await WKApp.apiClient.delete(`/user/reddot/friendApply`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async friendRequestCMDListener(message: Message) {
|
||||||
|
console.log("收到CMD->", message);
|
||||||
|
const cmdContent = message.content as CMDContent;
|
||||||
|
if (cmdContent.cmd === "friendRequest") {
|
||||||
|
this.friendApplys = await this.getFriendApply();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,57 +1,105 @@
|
|||||||
import { EndpointCategory, IconListItem, IModule, WKApp, ThemeMode } from "@tsdaodao/base"
|
import {
|
||||||
import React from "react"
|
EndpointCategory,
|
||||||
import Blacklist from "./Blacklist"
|
IconListItem,
|
||||||
import { FriendAdd } from "./FriendAdd"
|
IModule,
|
||||||
import GroupSave from "./GroupSave"
|
WKApp,
|
||||||
import { NewFriend } from "./NewFriend"
|
ThemeMode,
|
||||||
import { ContactsListManager } from "./Service/ContactsListManager"
|
} from "@tsdaodao/base";
|
||||||
|
import React from "react";
|
||||||
|
import Blacklist from "./Blacklist";
|
||||||
|
import { FriendAdd } from "./FriendAdd";
|
||||||
|
import GroupSave from "./GroupSave";
|
||||||
|
import { NewFriend } from "./NewFriend";
|
||||||
|
import { ContactsListManager } from "./Service/ContactsListManager";
|
||||||
|
|
||||||
export default class ContactsModule implements IModule {
|
export default class ContactsModule implements IModule {
|
||||||
|
|
||||||
id(): string {
|
id(): string {
|
||||||
return "ContactsModule"
|
return "ContactsModule";
|
||||||
}
|
}
|
||||||
init(): void {
|
init(): void {
|
||||||
console.log("【ContactsModule】初始化")
|
console.log("【ContactsModule】初始化");
|
||||||
|
|
||||||
|
WKApp.endpointManager.setMethod(
|
||||||
WKApp.endpointManager.setMethod("contacts.friendapply.change", () => {
|
"contacts.friendapply.change",
|
||||||
ContactsListManager.shared.refreshList()
|
() => {
|
||||||
}, {
|
ContactsListManager.shared.refreshList();
|
||||||
|
},
|
||||||
|
{
|
||||||
category: EndpointCategory.friendApplyDataChange,
|
category: EndpointCategory.friendApplyDataChange,
|
||||||
})
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// 获取好友未申请添加数量
|
||||||
|
let unreadCount = 0;
|
||||||
|
if (WKApp.loginInfo.isLogined()) {
|
||||||
|
WKApp.apiClient.get(`/user/reddot/friendApply`).then((res) => {
|
||||||
|
unreadCount = res.count;
|
||||||
|
WKApp.menus.refresh();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
WKApp.endpoints.registerContactsHeader("friends.new", (param: any) => {
|
WKApp.endpoints.registerContactsHeader("friends.new", (param: any) => {
|
||||||
return <IconListItem badge={WKApp.shared.getFriendApplysUnreadCount()} title="新朋友" icon={require("./assets/friend_new.png")} backgroudColor={"var(--wk-color-secondary)"} onClick={() => {
|
return (
|
||||||
WKApp.routeLeft.push(<NewFriend></NewFriend>)
|
<IconListItem
|
||||||
}} ></IconListItem>
|
badge={unreadCount}
|
||||||
})
|
title="新朋友"
|
||||||
|
icon={require("./assets/friend_new.png")}
|
||||||
|
backgroudColor={"var(--wk-color-secondary)"}
|
||||||
|
onClick={() => {
|
||||||
|
WKApp.routeLeft.push(<NewFriend></NewFriend>);
|
||||||
|
}}
|
||||||
|
></IconListItem>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
WKApp.endpoints.registerContactsHeader("groups.save", (param: any) => {
|
WKApp.endpoints.registerContactsHeader("groups.save", (param: any) => {
|
||||||
return <IconListItem title="保存的群" icon={require("./assets/icon_group_save.png")} backgroudColor={"var(--wk-color-secondary)"} onClick={() => {
|
return (
|
||||||
WKApp.routeLeft.push(<GroupSave></GroupSave>)
|
<IconListItem
|
||||||
}}></IconListItem>
|
title="保存的群"
|
||||||
})
|
icon={require("./assets/icon_group_save.png")}
|
||||||
|
backgroudColor={"var(--wk-color-secondary)"}
|
||||||
|
onClick={() => {
|
||||||
|
WKApp.routeLeft.push(<GroupSave></GroupSave>);
|
||||||
|
}}
|
||||||
|
></IconListItem>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
WKApp.endpoints.registerContactsHeader("contacts.blacklist", (param: any) => {
|
WKApp.endpoints.registerContactsHeader(
|
||||||
return <IconListItem title="黑名单" icon={require("./assets/blacklist.png")} backgroudColor={"var(--wk-color-secondary)"} onClick={() => {
|
"contacts.blacklist",
|
||||||
WKApp.routeLeft.push(<Blacklist></Blacklist>)
|
(param: any) => {
|
||||||
}}></IconListItem>
|
return (
|
||||||
})
|
<IconListItem
|
||||||
|
title="黑名单"
|
||||||
|
icon={require("./assets/blacklist.png")}
|
||||||
|
backgroudColor={"var(--wk-color-secondary)"}
|
||||||
|
onClick={() => {
|
||||||
|
WKApp.routeLeft.push(<Blacklist></Blacklist>);
|
||||||
|
}}
|
||||||
|
></IconListItem>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
WKApp.shared.chatMenusRegister("chatmenus.addfriend",(param)=>{
|
WKApp.shared.chatMenusRegister("chatmenus.addfriend", (param) => {
|
||||||
const isDark = WKApp.config.themeMode === ThemeMode.dark
|
const isDark = WKApp.config.themeMode === ThemeMode.dark;
|
||||||
return {
|
return {
|
||||||
title: "添加朋友",
|
title: "添加朋友",
|
||||||
icon: require(`${isDark?"./assets/popmenus_friendadd_dark.png":"./assets/popmenus_friendadd.png"}`),
|
icon: require(`${
|
||||||
onClick:()=>{
|
isDark
|
||||||
WKApp.routeLeft.push(<FriendAdd onBack={()=>{
|
? "./assets/popmenus_friendadd_dark.png"
|
||||||
WKApp.routeLeft.pop()
|
: "./assets/popmenus_friendadd.png"
|
||||||
}}></FriendAdd>)
|
}`),
|
||||||
}
|
onClick: () => {
|
||||||
}
|
WKApp.routeLeft.push(
|
||||||
})
|
<FriendAdd
|
||||||
|
onBack={() => {
|
||||||
|
WKApp.routeLeft.pop();
|
||||||
|
}}
|
||||||
|
></FriendAdd>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user