@liujitcn/kratos-taro-app-system 0.1.2 → 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.2",
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-core": "^0.1.2",
43
- "@liujitcn/kratos-taro-app-ui": "^0.1.2"
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
- Notification,
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<Notification> {
61
+ GetNotification(request: GetNotificationRequest): Promise<NotificationDetail> {
62
62
  return http({ url: `${NOTIFICATION_URL}/${request.id}`, method: 'GET', authMode: 'required' })
63
63
  }
64
64
  /** 查询未读汇总。 */
@@ -11,7 +11,7 @@ page {
11
11
  }
12
12
 
13
13
  .my-content {
14
- padding: 0 20px calc(40px + env(safe-area-inset-bottom));
14
+ padding: 0 20px var(--kratos-tab-bar-space, calc(104px + env(safe-area-inset-bottom)));
15
15
  }
16
16
 
17
17
  .my-stack {
@@ -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.7.7
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<Notification>;
358
+ GetNotification(request: GetNotificationRequest): Promise<NotificationDetail>;
333
359
  /** 标记消息为已读。 */
334
360
  MarkNotificationRead(request: MarkNotificationReadRequest): Promise<Empty>;
335
361
  /** 标记消息为未读。 */
@@ -13,7 +13,8 @@
13
13
  .composer {
14
14
  flex-shrink: 0;
15
15
  width: 100%;
16
- padding: 14px 24px calc(18px + env(safe-area-inset-bottom));
16
+ margin-bottom: var(--kratos-tab-bar-space, calc(104px + env(safe-area-inset-bottom)));
17
+ padding: 14px 24px 18px;
17
18
  overflow: hidden;
18
19
  background: var(--kratos-color-surface, #fff);
19
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 { Notification } from '../../../rpc/base/v1/notification'
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<Notification>()
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 ? (
@@ -41,7 +41,7 @@
41
41
  .detail-page {
42
42
  box-sizing: border-box;
43
43
  min-height: 100vh;
44
- padding: 0 20px calc(96px + env(safe-area-inset-bottom));
44
+ padding: 0 20px var(--kratos-tab-bar-space, calc(104px + env(safe-area-inset-bottom)));
45
45
  background: var(--kratos-bg-gradient);
46
46
  color: var(--kratos-color-text);
47
47
  }
@@ -6,7 +6,7 @@
6
6
 
7
7
  /* 导航组件统一处理顶部空间,页面只维护内容的水平与底部留白。 */
8
8
  .profile-content {
9
- padding: 0 20px calc(40px + env(safe-area-inset-bottom));
9
+ padding: 0 20px var(--kratos-tab-bar-space, calc(104px + env(safe-area-inset-bottom)));
10
10
  }
11
11
 
12
12
  /* 头像卡 */
@@ -6,7 +6,7 @@ page {
6
6
  .settings-viewport {
7
7
  min-height: 100vh;
8
8
  box-sizing: border-box;
9
- padding: 0 20px calc(40px + env(safe-area-inset-bottom));
9
+ padding: 0 20px var(--kratos-tab-bar-space, calc(104px + env(safe-area-inset-bottom)));
10
10
  background: var(--kratos-bg-gradient);
11
11
  }
12
12
 
@@ -68,7 +68,7 @@ export default function SettingsPage() {
68
68
  feedback: createIcon('<path d="M4 5h16v12H8l-4 4z"/>', violet),
69
69
  contact: createIcon('<path d="M4 5c0 9 6 15 15 15 1 0 2-1 2-2v-2l-4-2-2 2a11 11 0 0 1-5-5l2-2-2-4H6c-1 0-2 1-2 2Z"/>', primary),
70
70
  }
71
- }, [themeStore.theme])
71
+ }, [themeStore.colors.aiPrimary, themeStore.colors.aiWarning, themeStore.colors.aiViolet])
72
72
 
73
73
  const loadMfaStatus = async (force = false) => {
74
74
  if (!useUserStore.getState().isAuthenticated() || (mfaStatusLoading && !force)) return