@liujitcn/kratos-taro-app-system 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git@github.com:liujitcn/kratos-admin.git"
|
|
9
9
|
},
|
|
10
|
-
"version": "0.1.
|
|
10
|
+
"version": "0.1.5",
|
|
11
11
|
"type": "module",
|
|
12
12
|
"files": [
|
|
13
13
|
"dist",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"@tarojs/components": "4.2.1",
|
|
40
40
|
"@tarojs/taro": "4.2.1",
|
|
41
41
|
"react": "18.3.1",
|
|
42
|
-
"@liujitcn/kratos-taro-app-
|
|
43
|
-
"@liujitcn/kratos-taro-app-
|
|
42
|
+
"@liujitcn/kratos-taro-app-core": "^0.1.5",
|
|
43
|
+
"@liujitcn/kratos-taro-app-ui": "^0.1.5"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"build": "pnpm run build:entries && pnpm pack --pack-destination ../../../dist/npm",
|
|
@@ -9,7 +9,7 @@ import type {
|
|
|
9
9
|
MarkAllNotificationReadRequest,
|
|
10
10
|
MarkNotificationReadRequest,
|
|
11
11
|
MarkNotificationUnreadRequest,
|
|
12
|
-
|
|
12
|
+
NotificationDetail,
|
|
13
13
|
NotificationService,
|
|
14
14
|
NotificationSummary,
|
|
15
15
|
PageNotificationRequest,
|
|
@@ -58,7 +58,7 @@ export class NotificationServiceImpl implements NotificationService {
|
|
|
58
58
|
}))
|
|
59
59
|
}
|
|
60
60
|
/** 查询消息详情。 */
|
|
61
|
-
GetNotification(request: GetNotificationRequest): Promise<
|
|
61
|
+
GetNotification(request: GetNotificationRequest): Promise<NotificationDetail> {
|
|
62
62
|
return http({ url: `${NOTIFICATION_URL}/${request.id}`, method: 'GET', authMode: 'required' })
|
|
63
63
|
}
|
|
64
64
|
/** 查询未读汇总。 */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
2
|
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.
|
|
3
|
+
// protoc-gen-ts_proto v2.12.1
|
|
4
4
|
// protoc unknown
|
|
5
5
|
// source: base/v1/notification.proto
|
|
6
6
|
|
|
@@ -274,8 +274,36 @@ export interface DeleteNotificationRequest {
|
|
|
274
274
|
id: number;
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
-
/**
|
|
277
|
+
/** 当前用户消息列表项。 */
|
|
278
278
|
export interface Notification {
|
|
279
|
+
/** 投递ID */
|
|
280
|
+
id: number;
|
|
281
|
+
/** 分类名称 */
|
|
282
|
+
category_name: string;
|
|
283
|
+
/** 分类图标 */
|
|
284
|
+
category_icon: string;
|
|
285
|
+
/** 分类颜色 */
|
|
286
|
+
category_color: string;
|
|
287
|
+
/** 消息标题 */
|
|
288
|
+
title: string;
|
|
289
|
+
/** 动作目标 */
|
|
290
|
+
action_target: string;
|
|
291
|
+
/** 动作参数JSON */
|
|
292
|
+
action_params: string;
|
|
293
|
+
/** 接收时间 */
|
|
294
|
+
received_at: string;
|
|
295
|
+
/** 已读时间 */
|
|
296
|
+
read_at: string;
|
|
297
|
+
/** 归档时间 */
|
|
298
|
+
archived_at: string;
|
|
299
|
+
/** 是否允许归档 */
|
|
300
|
+
allow_archive: boolean;
|
|
301
|
+
/** 是否允许删除 */
|
|
302
|
+
allow_delete: boolean;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/** 消息详情。 */
|
|
306
|
+
export interface NotificationDetail {
|
|
279
307
|
/** 投递ID */
|
|
280
308
|
id: number;
|
|
281
309
|
/** 租户ID */
|
|
@@ -304,8 +332,6 @@ export interface Notification {
|
|
|
304
332
|
action_target: string;
|
|
305
333
|
/** 动作参数JSON */
|
|
306
334
|
action_params: string;
|
|
307
|
-
/** 发送者名称 */
|
|
308
|
-
sender_name: string;
|
|
309
335
|
/** 接收时间 */
|
|
310
336
|
received_at: string;
|
|
311
337
|
/** 已读时间 */
|
|
@@ -329,7 +355,7 @@ export interface NotificationService {
|
|
|
329
355
|
/** 查询当前用户未读汇总。 */
|
|
330
356
|
GetNotificationSummary(request: GetNotificationSummaryRequest): Promise<NotificationSummary>;
|
|
331
357
|
/** 查询当前用户消息详情。 */
|
|
332
|
-
GetNotification(request: GetNotificationRequest): Promise<
|
|
358
|
+
GetNotification(request: GetNotificationRequest): Promise<NotificationDetail>;
|
|
333
359
|
/** 标记消息为已读。 */
|
|
334
360
|
MarkNotificationRead(request: MarkNotificationReadRequest): Promise<Empty>;
|
|
335
361
|
/** 标记消息为未读。 */
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
flex-shrink: 0;
|
|
15
15
|
width: 100%;
|
|
16
16
|
margin-bottom: var(--kratos-tab-bar-space, calc(104px + env(safe-area-inset-bottom)));
|
|
17
|
-
padding: 14px 24px
|
|
17
|
+
padding: 14px 24px 18px;
|
|
18
18
|
overflow: hidden;
|
|
19
19
|
background: var(--kratos-color-surface, #fff);
|
|
20
20
|
border-top: 1PX solid var(--kratos-color-border-accent, rgba(0, 150, 134, 0.28));
|
|
@@ -4,7 +4,7 @@ import { useState } from 'react'
|
|
|
4
4
|
import { KratosNavBar, t, useThemeStore } from '@liujitcn/kratos-taro-app-core'
|
|
5
5
|
import { UniIcon } from '@liujitcn/kratos-taro-app-ui'
|
|
6
6
|
import { defNotificationService } from '../../../api/base/v1/notification'
|
|
7
|
-
import type {
|
|
7
|
+
import type { NotificationDetail } from '../../../rpc/base/v1/notification'
|
|
8
8
|
import { MessageContentFormat } from '../../../rpc/base/v1/notification'
|
|
9
9
|
import { resolvePersistedMessage } from '../../../utils/persisted-message'
|
|
10
10
|
import { resolveMessageCategoryIcon } from './icons'
|
|
@@ -13,7 +13,7 @@ import './message.scss'
|
|
|
13
13
|
/** MessageDetailPage 展示站内信详情与通知操作。 */
|
|
14
14
|
export default function MessageDetailPage() {
|
|
15
15
|
const themeStore = useThemeStore()
|
|
16
|
-
const [detail, setDetail] = useState<
|
|
16
|
+
const [detail, setDetail] = useState<NotificationDetail>()
|
|
17
17
|
|
|
18
18
|
useLoad((options) => {
|
|
19
19
|
const id = Number(options?.id)
|
|
@@ -45,7 +45,6 @@ export default function MessageDetailPage() {
|
|
|
45
45
|
/>
|
|
46
46
|
<Text>{detail.category_name}</Text>
|
|
47
47
|
</View>
|
|
48
|
-
<Text>{resolvePersistedMessage(detail.sender_name)}</Text>
|
|
49
48
|
<Text>{detail.received_at}</Text>
|
|
50
49
|
</View>
|
|
51
50
|
{detail.content_format === MessageContentFormat.MESSAGE_CONTENT_FORMAT_RICH_TEXT ? (
|