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