) => {
+ const data = context.routeData();
+ const channelInfo = data.channelInfo;
+ const status = channelInfo?.orgData?.status;
+ if (data.isSelf) {
+ return;
+ }
+ if (status !== UserRelation.blacklist) {
+ return;
+ }
+ return new Section({
+ rows: [
+ new Row({
+ cell: ListItemTip,
+ properties: {
+ tip: (
+
+
+ 已添加至黑名单,你将不再收到对方的消息
+
+ ),
+ },
+ }),
+ ],
+ });
+ },
+ 99999
+ );
+ }
- return new Section({
- rows: [
- new Row({
- cell: ListItem,
- properties: {
- title: "我在本群的昵称",
- subTitle: name,
- onClick: () => {
- this.inputEditPush(context, name || "", (value: string) => {
- return WKApp.dataSource.channelDataSource.subscriberAttrUpdate(data.channel, WKApp.loginInfo.uid || "", { "remark": value })
- }, "在这里可以设置你在这个群里的昵称。这个昵称只会在此群内显示。", 10, true)
- }
- },
- }),
- ],
+ inputEditPush(
+ context: RouteContext,
+ defaultValue: string,
+ onFinish: (value: string) => Promise,
+ placeholder?: string,
+ maxCount?: number,
+ allowEmpty?: boolean,
+ allowWrap?: boolean
+ ) {
+ let value: string;
+ let finishButtonContext: FinishButtonContext;
+ context.push(
+ {
+ value = v;
+ if (!allowEmpty && (!value || value === "")) {
+ finishButtonContext.disable(true);
+ } else {
+ finishButtonContext.disable(false);
+ }
+ if (exceeded) {
+ finishButtonContext.disable(true);
+ }
+ }}
+ maxCount={maxCount}
+ allowWrap={allowWrap}
+ >,
+ new RouteContextConfig({
+ showFinishButton: true,
+ onFinishContext: (finishBtnContext) => {
+ finishButtonContext = finishBtnContext;
+ finishBtnContext.disable(true);
+ },
+ onFinish: async () => {
+ finishButtonContext.loading(true);
+ await onFinish(value);
+ finishButtonContext.loading(false);
+
+ context.pop();
+ },
+ })
+ );
+ }
+
+ registerChannelSettings() {
+ WKApp.shared.channelSettingRegister("channel.subscribers", (context) => {
+ const data = context.routeData() as ChannelSettingRouteData;
+ const channel = data.channel;
+
+ if (channel.channelType == ChannelTypeCustomerService) {
+ return;
+ }
+
+ let addFinishButtonContext: FinishButtonContext;
+ let removeFinishButtonContext: FinishButtonContext;
+ let addSelectItems: IndexTableItem[];
+ let removeSelectItems: IndexTableItem[];
+ const disableSelectList = data.subscribers.map((subscriber) => {
+ return subscriber.uid;
+ });
+ return new Section({
+ rows: [
+ new Row({
+ cell: Subscribers,
+ properties: {
+ context: context,
+ key: channel.getChannelKey(),
+ onAdd: () => {
+ context.push(
+ {
+ addSelectItems = items;
+ addFinishButtonContext.disable(items.length === 0);
+ }}
+ disableSelectList={disableSelectList}
+ >,
+ {
+ title: "联系人选择",
+ showFinishButton: true,
+ onFinish: async () => {
+ addFinishButtonContext.loading(true);
+
+ if (channel.channelType === ChannelTypePerson) {
+ const uids = new Array();
+ uids.push(WKApp.loginInfo.uid || "");
+ uids.push(channel.channelID);
+ for (const item of addSelectItems) {
+ uids.push(item.id);
+ }
+
+ const result = await WKApp.dataSource.channelDataSource
+ .createChannel(uids)
+ .catch((err) => {
+ Toast.error(err.msg);
+ });
+ if (result) {
+ WKApp.endpoints.showConversation(
+ new Channel(result.group_no, ChannelTypeGroup)
+ );
+ }
+ } else {
+ await WKApp.dataSource.channelDataSource.addSubscribers(
+ channel,
+ addSelectItems.map((item) => {
+ return item.id;
+ })
+ );
+ context.pop();
+ }
+ addFinishButtonContext.loading(false);
+ },
+ onFinishContext: (context) => {
+ console.log("onFinishContext------>", context);
+ addFinishButtonContext = context;
+ addFinishButtonContext.disable(true);
+ },
+ }
+ );
+ },
+ onRemove: () => {
+ context.push(
+ {
+ removeSelectItems = items;
+ removeFinishButtonContext.disable(items.length === 0);
+ }}
+ users={data.subscribers
+ .filter(
+ (subscriber) => subscriber.uid !== WKApp.loginInfo.uid
+ )
+ .map((item) => {
+ return new IndexTableItem(
+ item.uid,
+ item.name,
+ item.avatar
+ );
+ })}
+ >,
+ {
+ title: "删除群成员",
+ showFinishButton: true,
+ onFinish: async () => {
+ removeFinishButtonContext.loading(true);
+ await WKApp.dataSource.channelDataSource.removeSubscribers(
+ channel,
+ removeSelectItems.map((item) => {
+ return item.id;
+ })
+ );
+ removeFinishButtonContext.loading(false);
+ context.pop();
+ },
+ onFinishContext: (context) => {
+ removeFinishButtonContext = context;
+ removeFinishButtonContext.disable(true);
+ },
+ }
+ );
+ },
+ },
+ }),
+ ],
+ });
+ });
+
+ WKApp.shared.channelSettingRegister(
+ "channel.base.setting",
+ (context) => {
+ const data = context.routeData() as ChannelSettingRouteData;
+ const channelInfo = data.channelInfo;
+ const channel = data.channel;
+ if (channel.channelType !== ChannelTypeGroup) {
+ return undefined;
+ }
+ const rows = new Array();
+ rows.push(
+ new Row({
+ cell: ListItem,
+ properties: {
+ title: "群聊名称",
+ subTitle: channelInfo?.title,
+ onClick: () => {
+ if (!data.isManagerOrCreatorOfMe) {
+ Toast.warning("只有管理者才能修改群名字");
+ return;
+ }
+ this.inputEditPush(
+ context,
+ channelInfo?.title || "",
+ (value: string) => {
+ return WKApp.dataSource.channelDataSource
+ .updateField(channel, ChannelField.channelName, value)
+ .catch((err) => {
+ Toast.error(err.msg);
+ });
+ },
+ "群名称",
+ 20
+ );
+ },
+ },
+ })
+ );
+
+ rows.push(
+ new Row({
+ cell: ListItemIcon,
+ properties: {
+ title: "群头像",
+ icon: (
+
+ ),
+ onClick: () => {
+ context.push(
+ ,
+ { title: "群头像" }
+ );
+ },
+ },
+ })
+ );
+
+ rows.push(
+ new Row({
+ cell: ListItemIcon,
+ properties: {
+ title: "群二维码",
+ icon: (
+
+ ),
+ onClick: () => {
+ context.push(
+ ,
+ new RouteContextConfig({
+ title: "群二维码名片",
+ })
+ );
+ },
+ },
+ })
+ );
+ rows.push(
+ new Row({
+ cell: ListItemMuliteLine,
+ properties: {
+ title: "群公告",
+ subTitle: channelInfo?.orgData?.notice,
+ onClick: () => {
+ if (!data.isManagerOrCreatorOfMe) {
+ Toast.warning("只有管理者才能修改群公告");
+ return;
+ }
+ this.inputEditPush(
+ context,
+ channelInfo?.orgData?.notice || "",
+ (value: string) => {
+ return WKApp.dataSource.channelDataSource
+ .updateField(channel, ChannelField.notice, value)
+ .catch((err) => {
+ Toast.error(err.msg);
+ });
+ },
+ "群公告",
+ 400,
+ false,
+ true
+ );
+ },
+ },
+ })
+ );
+
+ return new Section({
+ rows: rows,
+ });
+ },
+ 1000
+ );
+
+ WKApp.shared.channelSettingRegister(
+ "channel.base.setting2",
+ (context) => {
+ const data = context.routeData() as ChannelSettingRouteData;
+ const channelInfo = data.channelInfo;
+ const channel = data.channel;
+ const rows = new Array();
+
+ if (channel.channelType == ChannelTypeCustomerService) {
+ return;
+ }
+
+ rows.push(
+ new Row({
+ cell: ListItemSwitch,
+ properties: {
+ title: "消息免打扰",
+ checked: channelInfo?.mute,
+ onCheck: (v: boolean, ctx: ListItemSwitchContext) => {
+ ctx.loading = true;
+ ChannelSettingManager.shared
+ .mute(v, channel)
+ .then(() => {
+ ctx.loading = false;
+ data.refresh();
+ })
+ .catch(() => {
+ ctx.loading = false;
+ });
+ },
+ },
+ })
+ );
+
+ rows.push(
+ new Row({
+ cell: ListItemSwitch,
+ properties: {
+ title: "聊天置顶",
+ checked: channelInfo?.top,
+ onCheck: (v: boolean, ctx: ListItemSwitchContext) => {
+ ctx.loading = true;
+ ChannelSettingManager.shared
+ .top(v, channel)
+ .then(() => {
+ ctx.loading = false;
+ data.refresh();
+ })
+ .catch(() => {
+ ctx.loading = false;
+ });
+ },
+ },
+ })
+ );
+
+ if (channel.channelType == ChannelTypeGroup) {
+ rows.push(
+ new Row({
+ cell: ListItemSwitch,
+ properties: {
+ title: "保存到通讯录",
+ checked: channelInfo?.orgData.save === 1,
+ onCheck: (v: boolean, ctx: ListItemSwitchContext) => {
+ ctx.loading = true;
+ ChannelSettingManager.shared
+ .save(v, channel)
+ .then(() => {
+ ctx.loading = false;
+ data.refresh();
+ })
+ .catch(() => {
+ ctx.loading = false;
+ });
+ },
+ },
})
- }, 4000)
+ );
+ }
+ return new Section({
+ rows: rows,
+ });
+ },
+ 3000
+ );
- // WKApp.shared.channelSettingRegister("channel.notify.setting.screen", (context) => {
- // return new Section({
- // subtitle: "在对话中的截屏,各方均会收到通知",
- // rows: [
- // new Row({
- // cell: ListItemSwitch,
- // properties: {
- // title: "截屏通知",
- // },
- // }),
- // ],
- // })
- // })
- // WKApp.shared.channelSettingRegister("channel.notify.setting.revokemind", (context) => {
- // return new Section({
- // subtitle: "在对话中的消息撤回,各方均会收到通知",
- // rows: [
- // new Row({
- // cell: ListItemSwitch,
- // properties: {
- // title: "撤回通知",
- // },
- // }),
- // ],
- // })
- // })
- // WKApp.shared.channelSettingRegister("channel.base.setting5", (context) => {
- // return new Section({
- // rows: [
- // new Row({
- // cell: ListItem,
- // properties: {
- // title: "投诉",
- // },
- // }),
- // ],
- // })
- // })
+ WKApp.shared.channelSettingRegister(
+ "channel.base.setting3",
+ (context) => {
+ const data = context.routeData() as ChannelSettingRouteData;
+ if (data.channel.channelType !== ChannelTypeGroup) {
+ return undefined;
+ }
- WKApp.shared.channelSettingRegister("channel.base.setting6", (context) => {
- const data = context.routeData() as ChannelSettingRouteData
- if (data.channel.channelType !== ChannelTypeGroup) {
- return undefined
- }
- return new Section({
- rows: [
- new Row({
- cell: ListItemButton,
- properties: {
- title: "清空聊天记录",
- type: ListItemButtonType.warn,
- onClick: () => {
- WKApp.shared.baseContext.showAlert({
- content: "是否清空此会话的所有消息?",
- onOk: async () => {
- const conversation = WKSDK.shared().conversationManager.findConversation(data.channel)
- if (!conversation) {
- return
- }
- await WKApp.conversationProvider.clearConversationMessages(conversation)
- conversation.lastMessage = undefined
- WKApp.endpointManager.invoke(EndpointID.clearChannelMessages, data.channel)
- }
- })
- }
- },
- }),
- new Row({
- cell: ListItemButton,
- properties: {
- title: "删除并退出",
- type: ListItemButtonType.warn,
- onClick: () => {
- WKApp.shared.baseContext.showAlert({
- content: "退出后不会通知群里其他成员,且不会再接收此群聊消息",
- onOk: async () => {
- WKApp.dataSource.channelDataSource.exitChannel(data.channel).catch((err) => {
- Toast.error(err.msg)
- })
- WKApp.conversationProvider.deleteConversation(data.channel)
- }
- })
- }
- },
- }),
- ],
- })
- }, 90000)
- }
+ let name = data.subscriberOfMe?.remark;
+ if (!name || name === "") {
+ name = data.subscriberOfMe?.name;
+ }
- registerChannelManages() {
- WKApp.shared.channelManageRegister("channel.setting.manage.invite", (context) => {
- const data = context.routeData() as ChannelSettingRouteData
- const channel = data.channel
- const channelInfo = data.channelInfo
- return new Section({
- subtitle: "启用后,群成员需要群主或管理员确认才能邀请朋友进群。扫描二维码进群将同时停用。",
- rows: [
- new Row({
- cell: ListItemSwitch,
- properties: {
- title: "群聊邀请确认",
- checked: channelInfo?.orgData?.invite === 1,
- onCheck: (v: boolean, ctx: ListItemSwitchContext) => {
- ctx.loading = true
- ChannelSettingManager.shared.invite(v, channel).then(() => {
- ctx.loading = false
- data.refresh()
- }).catch((err) => {
- ctx.loading = false
- })
- }
- },
- }),
- ],
- });
- })
+ return new Section({
+ rows: [
+ new Row({
+ cell: ListItem,
+ properties: {
+ title: "我在本群的昵称",
+ subTitle: name,
+ onClick: () => {
+ this.inputEditPush(
+ context,
+ name || "",
+ (value: string) => {
+ return WKApp.dataSource.channelDataSource.subscriberAttrUpdate(
+ data.channel,
+ WKApp.loginInfo.uid || "",
+ { remark: value }
+ );
+ },
+ "在这里可以设置你在这个群里的昵称。这个昵称只会在此群内显示。",
+ 10,
+ true
+ );
+ },
+ },
+ }),
+ ],
+ });
+ },
+ 4000
+ );
- WKApp.shared.channelManageRegister("channel.setting.manage.transfer", (context) => {
- const data = context.routeData() as ChannelSettingRouteData
- const channel = data.channel
- const subscriberOfMe = data.subscriberOfMe
- if (!subscriberOfMe || subscriberOfMe.role !== GroupRole.owner) {
- return
- }
- return new Section({
- rows: [
- new Row({
- cell: ListItem,
- properties: {
- title: "群主管理权转让",
- onClick: () => {
- context.push( {
- const item = items[0]
- WKApp.shared.baseContext.showAlert({
- content: "你将自动放弃群主身份",
- onOk: () => {
- WKApp.dataSource.channelDataSource.channelTransferOwner(channel, item.id).then(() => {
- context.popToRoot()
- }).catch((err) => {
- Toast.error(err.msg)
- })
- }
- })
- }} users={data.subscribers.filter((subscriber) => !(subscriber.uid === WKApp.loginInfo.uid || subscriber.uid === WKApp.config.fileHelperUID || subscriber.uid === WKApp.config.systemUID)).map((item) => {
- return new IndexTableItem(item.uid, item.name, item.avatar)
- })}>, {
- title: "选择新的群主",
- showFinishButton: false,
- onFinish: async () => {
+ // WKApp.shared.channelSettingRegister("channel.notify.setting.screen", (context) => {
+ // return new Section({
+ // subtitle: "在对话中的截屏,各方均会收到通知",
+ // rows: [
+ // new Row({
+ // cell: ListItemSwitch,
+ // properties: {
+ // title: "截屏通知",
+ // },
+ // }),
+ // ],
+ // })
+ // })
+ // WKApp.shared.channelSettingRegister("channel.notify.setting.revokemind", (context) => {
+ // return new Section({
+ // subtitle: "在对话中的消息撤回,各方均会收到通知",
+ // rows: [
+ // new Row({
+ // cell: ListItemSwitch,
+ // properties: {
+ // title: "撤回通知",
+ // },
+ // }),
+ // ],
+ // })
+ // })
+ // WKApp.shared.channelSettingRegister("channel.base.setting5", (context) => {
+ // return new Section({
+ // rows: [
+ // new Row({
+ // cell: ListItem,
+ // properties: {
+ // title: "投诉",
+ // },
+ // }),
+ // ],
+ // })
+ // })
- context.pop()
- },
- onFinishContext: (context) => {
- }
- })
- }
- },
- }),
- ],
- });
- })
+ WKApp.shared.channelSettingRegister(
+ "channel.base.setting6",
+ (context) => {
+ const data = context.routeData() as ChannelSettingRouteData;
+ if (data.channel.channelType !== ChannelTypeGroup) {
+ return undefined;
+ }
+ return new Section({
+ rows: [
+ new Row({
+ cell: ListItemButton,
+ properties: {
+ title: "清空聊天记录",
+ type: ListItemButtonType.warn,
+ onClick: () => {
+ WKApp.shared.baseContext.showAlert({
+ content: "是否清空此会话的所有消息?",
+ onOk: async () => {
+ const conversation =
+ WKSDK.shared().conversationManager.findConversation(
+ data.channel
+ );
+ if (!conversation) {
+ return;
+ }
+ await WKApp.conversationProvider.clearConversationMessages(
+ conversation
+ );
+ conversation.lastMessage = undefined;
+ WKApp.endpointManager.invoke(
+ EndpointID.clearChannelMessages,
+ data.channel
+ );
+ },
+ });
+ },
+ },
+ }),
+ new Row({
+ cell: ListItemButton,
+ properties: {
+ title: "删除并退出",
+ type: ListItemButtonType.warn,
+ onClick: () => {
+ WKApp.shared.baseContext.showAlert({
+ content:
+ "退出后不会通知群里其他成员,且不会再接收此群聊消息",
+ onOk: async () => {
+ WKApp.dataSource.channelDataSource
+ .exitChannel(data.channel)
+ .catch((err) => {
+ Toast.error(err.msg);
+ });
+ WKApp.conversationProvider.deleteConversation(
+ data.channel
+ );
+ },
+ });
+ },
+ },
+ }),
+ ],
+ });
+ },
+ 90000
+ );
+ }
- WKApp.shared.channelManageRegister("channel.setting.manage.mute", (context) => {
- const data = context.routeData() as ChannelSettingRouteData
- const channel = data.channel
- const channelInfo = data.channelInfo
- return new Section({
- title: "成员设置",
- subtitle: "全员禁言启用后,只允许群主和管理员发言。",
- rows: [
- new Row({
- cell: ListItemSwitch,
- properties: {
- title: "全员禁言",
- checked: channelInfo?.orgData?.forbidden === 1,
- onCheck: (v: boolean, ctx: ListItemSwitchContext) => {
- ctx.loading = true
- ChannelSettingManager.shared.forbidden(v, channel).then(() => {
- ctx.loading = false
- data.refresh()
- }).catch((err) => {
- ctx.loading = false
- })
- }
- },
- }),
- ],
- });
- })
+ registerChannelManages() {
+ WKApp.shared.channelManageRegister(
+ "channel.setting.manage.invite",
+ (context) => {
+ const data = context.routeData() as ChannelSettingRouteData;
+ const channel = data.channel;
+ const channelInfo = data.channelInfo;
+ return new Section({
+ subtitle:
+ "启用后,群成员需要群主或管理员确认才能邀请朋友进群。扫描二维码进群将同时停用。",
+ rows: [
+ new Row({
+ cell: ListItemSwitch,
+ properties: {
+ title: "群聊邀请确认",
+ checked: channelInfo?.orgData?.invite === 1,
+ onCheck: (v: boolean, ctx: ListItemSwitchContext) => {
+ ctx.loading = true;
+ ChannelSettingManager.shared
+ .invite(v, channel)
+ .then(() => {
+ ctx.loading = false;
+ data.refresh();
+ })
+ .catch((err) => {
+ ctx.loading = false;
+ });
+ },
+ },
+ }),
+ ],
+ });
+ }
+ );
- WKApp.shared.channelManageRegister("channel.setting.manage.prohibitAddFriend", (context) => {
- const data = context.routeData() as ChannelSettingRouteData
- const channel = data.channel
- const channelInfo = data.channelInfo
- return new Section({
- rows: [
- new Row({
- cell: ListItemSwitch,
- properties: {
- title: "禁止群成员互加好友",
- checked: channelInfo?.orgData?.forbidden_add_friend === 1,
- onCheck: (v: boolean, ctx: ListItemSwitchContext) => {
- ctx.loading = true
- ChannelSettingManager.shared.forbiddenAddFriend(v, channel).then(() => {
- ctx.loading = false
- data.refresh()
- }).catch((err) => {
- ctx.loading = false
- })
- }
- },
- }),
- ],
- });
- })
- WKApp.shared.channelManageRegister("channel.setting.manage.blacklist", (context) => {
- return new Section({
- rows: [
- new Row({
- cell: ListItem,
- properties: {
- title: "群黑名单",
- onClick: () => {
- context.push(, {
- title: "群黑名单",
- })
- }
- },
- }),
- ],
- });
- })
- WKApp.shared.channelManageRegister("channel.setting.manage.managerlist", (context) => {
- const data = context.routeData() as ChannelSettingRouteData
- const subscriberOfMe = data.subscriberOfMe
- if (subscriberOfMe?.role !== GroupRole.owner) {
- return
- }
- return new Section({
- title: "群主、管理员",
- rows: [
- new Row({
- cell: ChannelManagerList,
- properties: {
- routeContext: context,
- },
- }),
- ],
- });
- })
- }
+ WKApp.shared.channelManageRegister(
+ "channel.setting.manage.transfer",
+ (context) => {
+ const data = context.routeData() as ChannelSettingRouteData;
+ const channel = data.channel;
+ const subscriberOfMe = data.subscriberOfMe;
+ if (!subscriberOfMe || subscriberOfMe.role !== GroupRole.owner) {
+ return;
+ }
+ return new Section({
+ rows: [
+ new Row({
+ cell: ListItem,
+ properties: {
+ title: "群主管理权转让",
+ onClick: () => {
+ context.push(
+ {
+ const item = items[0];
+ WKApp.shared.baseContext.showAlert({
+ content: "你将自动放弃群主身份",
+ onOk: () => {
+ WKApp.dataSource.channelDataSource
+ .channelTransferOwner(channel, item.id)
+ .then(() => {
+ context.popToRoot();
+ })
+ .catch((err) => {
+ Toast.error(err.msg);
+ });
+ },
+ });
+ }}
+ users={data.subscribers
+ .filter(
+ (subscriber) =>
+ !(
+ subscriber.uid === WKApp.loginInfo.uid ||
+ subscriber.uid === WKApp.config.fileHelperUID ||
+ subscriber.uid === WKApp.config.systemUID
+ )
+ )
+ .map((item) => {
+ return new IndexTableItem(
+ item.uid,
+ item.name,
+ item.avatar
+ );
+ })}
+ >,
+ {
+ title: "选择新的群主",
+ showFinishButton: false,
+ onFinish: async () => {
+ context.pop();
+ },
+ onFinishContext: (context) => {},
+ }
+ );
+ },
+ },
+ }),
+ ],
+ });
+ }
+ );
+
+ WKApp.shared.channelManageRegister(
+ "channel.setting.manage.mute",
+ (context) => {
+ const data = context.routeData() as ChannelSettingRouteData;
+ const channel = data.channel;
+ const channelInfo = data.channelInfo;
+ return new Section({
+ title: "成员设置",
+ subtitle: "全员禁言启用后,只允许群主和管理员发言。",
+ rows: [
+ new Row({
+ cell: ListItemSwitch,
+ properties: {
+ title: "全员禁言",
+ checked: channelInfo?.orgData?.forbidden === 1,
+ onCheck: (v: boolean, ctx: ListItemSwitchContext) => {
+ ctx.loading = true;
+ ChannelSettingManager.shared
+ .forbidden(v, channel)
+ .then(() => {
+ ctx.loading = false;
+ data.refresh();
+ })
+ .catch((err) => {
+ ctx.loading = false;
+ });
+ },
+ },
+ }),
+ ],
+ });
+ }
+ );
+
+ WKApp.shared.channelManageRegister(
+ "channel.setting.manage.prohibitAddFriend",
+ (context) => {
+ const data = context.routeData() as ChannelSettingRouteData;
+ const channel = data.channel;
+ const channelInfo = data.channelInfo;
+ return new Section({
+ rows: [
+ new Row({
+ cell: ListItemSwitch,
+ properties: {
+ title: "禁止群成员互加好友",
+ checked: channelInfo?.orgData?.forbidden_add_friend === 1,
+ onCheck: (v: boolean, ctx: ListItemSwitchContext) => {
+ ctx.loading = true;
+ ChannelSettingManager.shared
+ .forbiddenAddFriend(v, channel)
+ .then(() => {
+ ctx.loading = false;
+ data.refresh();
+ })
+ .catch((err) => {
+ ctx.loading = false;
+ });
+ },
+ },
+ }),
+ ],
+ });
+ }
+ );
+ WKApp.shared.channelManageRegister(
+ "channel.setting.manage.blacklist",
+ (context) => {
+ return new Section({
+ rows: [
+ new Row({
+ cell: ListItem,
+ properties: {
+ title: "群黑名单",
+ onClick: () => {
+ context.push(
+ ,
+ {
+ title: "群黑名单",
+ }
+ );
+ },
+ },
+ }),
+ ],
+ });
+ }
+ );
+ WKApp.shared.channelManageRegister(
+ "channel.setting.manage.managerlist",
+ (context) => {
+ const data = context.routeData() as ChannelSettingRouteData;
+ const subscriberOfMe = data.subscriberOfMe;
+ if (subscriberOfMe?.role !== GroupRole.owner) {
+ return;
+ }
+ return new Section({
+ title: "群主、管理员",
+ rows: [
+ new Row({
+ cell: ChannelManagerList,
+ properties: {
+ routeContext: context,
+ },
+ }),
+ ],
+ });
+ }
+ );
+ }
}
diff --git a/turbo.json b/turbo.json
index 40ddf1d..fdad91d 100644
--- a/turbo.json
+++ b/turbo.json
@@ -1,14 +1,22 @@
{
"$schema": "https://turborepo.org/schema.json",
"pipeline": {
+ "dev": {
+ "cache": false
+ },
+ "dev-ele": {
+ "dependsOn": ["^dev"],
+ "cache": false
+ },
"build": {
"outputs": [".next/**"]
},
+ "build-ele": {
+ "outputs": [".next/**"],
+ "dependsOn": ["^build"]
+ },
"lint": {
"outputs": []
- },
- "dev": {
- "cache": false
}
}
}