@liujitcn/kratos-taro-app-system 0.0.80 → 0.0.82

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/dist/build.mjs CHANGED
@@ -8,7 +8,6 @@ var systemPages = {
8
8
  "pages/my/my": {
9
9
  style: {
10
10
  navigationStyle: "custom",
11
- navigationBarTextStyle: "white",
12
11
  navigationBarTitleText: ""
13
12
  }
14
13
  },
@@ -22,7 +21,6 @@ var systemPages = {
22
21
  "pagesMember/profile/profile": {
23
22
  style: {
24
23
  navigationStyle: "custom",
25
- navigationBarTextStyle: "white",
26
24
  navigationBarTitleText: ""
27
25
  }
28
26
  },
package/dist/module.mjs CHANGED
@@ -6,7 +6,6 @@ var systemPages = {
6
6
  "pages/my/my": {
7
7
  style: {
8
8
  navigationStyle: "custom",
9
- navigationBarTextStyle: "white",
10
9
  navigationBarTitleText: ""
11
10
  }
12
11
  },
@@ -20,7 +19,6 @@ var systemPages = {
20
19
  "pagesMember/profile/profile": {
21
20
  style: {
22
21
  navigationStyle: "custom",
23
- navigationBarTextStyle: "white",
24
22
  navigationBarTitleText: ""
25
23
  }
26
24
  },
@@ -155,10 +153,13 @@ var zh_CN_default = {
155
153
  "system.settings.mfa_disable_success": "\u591A\u56E0\u7D20\u8BA4\u8BC1\u5DF2\u7981\u7528",
156
154
  "system.settings.mfa_copy_uri": "\u590D\u5236\u7ED1\u5B9A\u5730\u5740",
157
155
  "system.settings.mfa_copy_success": "\u590D\u5236\u6210\u529F",
158
- "system.notification.title": "\u6D88\u606F\u4E2D\u5FC3",
156
+ "system.notification.title": "\u6D88\u606F",
159
157
  "system.notification.sender.system": "\u7CFB\u7EDF",
160
158
  "system.notification.description": "\u67E5\u770B\u7CFB\u7EDF\u901A\u77E5\u548C\u4E1A\u52A1\u6D88\u606F",
161
159
  "system.notification.empty": "\u6682\u65E0\u6D88\u606F",
160
+ "system.notification.empty_inbox_hint": "\u65B0\u6D88\u606F\u5C06\u5728\u6B64\u663E\u793A",
161
+ "system.notification.empty_unread_hint": "\u5168\u90E8\u6D88\u606F\u5747\u5DF2\u8BFB\u5B8C",
162
+ "system.notification.empty_archived_hint": "\u5F52\u6863\u7684\u6D88\u606F\u5C06\u5728\u6B64\u663E\u793A",
162
163
  "system.notification.action.view_all": "\u67E5\u770B\u5168\u90E8",
163
164
  "system.notification.view.inbox": "\u5168\u90E8",
164
165
  "system.notification.view.unread": "\u672A\u8BFB",
@@ -307,10 +308,13 @@ var en_US_default = {
307
308
  "system.settings.mfa_disable_success": "Multi-factor authentication disabled",
308
309
  "system.settings.mfa_copy_uri": "Copy binding address",
309
310
  "system.settings.mfa_copy_success": "Copied",
310
- "system.notification.title": "Message Center",
311
+ "system.notification.title": "Messages",
311
312
  "system.notification.sender.system": "System",
312
313
  "system.notification.description": "View system notifications and business messages",
313
314
  "system.notification.empty": "No messages",
315
+ "system.notification.empty_inbox_hint": "New messages will appear here",
316
+ "system.notification.empty_unread_hint": "You're all caught up",
317
+ "system.notification.empty_archived_hint": "Archived messages will appear here",
314
318
  "system.notification.action.view_all": "View all",
315
319
  "system.notification.view.inbox": "All",
316
320
  "system.notification.view.unread": "Unread",
@@ -459,10 +463,13 @@ var ja_JP_default = {
459
463
  "system.settings.mfa_disable_success": "\u591A\u8981\u7D20\u8A8D\u8A3C\u3092\u7121\u52B9\u306B\u3057\u307E\u3057\u305F",
460
464
  "system.settings.mfa_copy_uri": "\u767B\u9332\u30A2\u30C9\u30EC\u30B9\u3092\u30B3\u30D4\u30FC",
461
465
  "system.settings.mfa_copy_success": "\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F",
462
- "system.notification.title": "\u30E1\u30C3\u30BB\u30FC\u30B8\u30BB\u30F3\u30BF\u30FC",
466
+ "system.notification.title": "\u30E1\u30C3\u30BB\u30FC\u30B8",
463
467
  "system.notification.sender.system": "\u30B7\u30B9\u30C6\u30E0",
464
468
  "system.notification.description": "\u30B7\u30B9\u30C6\u30E0\u901A\u77E5\u3068\u696D\u52D9\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u78BA\u8A8D",
465
469
  "system.notification.empty": "\u30E1\u30C3\u30BB\u30FC\u30B8\u306F\u3042\u308A\u307E\u305B\u3093",
470
+ "system.notification.empty_inbox_hint": "\u65B0\u3057\u3044\u30E1\u30C3\u30BB\u30FC\u30B8\u306F\u3053\u3053\u306B\u8868\u793A\u3055\u308C\u307E\u3059",
471
+ "system.notification.empty_unread_hint": "\u3059\u3079\u3066\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u65E2\u8AAD\u306B\u3057\u307E\u3057\u305F",
472
+ "system.notification.empty_archived_hint": "\u30A2\u30FC\u30AB\u30A4\u30D6\u6E08\u307F\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u306F\u3053\u3053\u306B\u8868\u793A\u3055\u308C\u307E\u3059",
466
473
  "system.notification.action.view_all": "\u3059\u3079\u3066\u8868\u793A",
467
474
  "system.notification.view.inbox": "\u3059\u3079\u3066",
468
475
  "system.notification.view.unread": "\u672A\u8AAD",
@@ -611,10 +618,13 @@ var zh_TW_default = {
611
618
  "system.settings.mfa_disable_success": "\u591A\u56E0\u7D20\u8A8D\u8B49\u5DF2\u505C\u7528",
612
619
  "system.settings.mfa_copy_uri": "\u8907\u88FD\u7D81\u5B9A\u5730\u5740",
613
620
  "system.settings.mfa_copy_success": "\u8907\u88FD\u6210\u529F",
614
- "system.notification.title": "\u6D88\u606F\u4E2D\u5FC3",
621
+ "system.notification.title": "\u6D88\u606F",
615
622
  "system.notification.sender.system": "\u7CFB\u7D71",
616
623
  "system.notification.description": "\u67E5\u770B\u7CFB\u7D71\u901A\u77E5\u548C\u696D\u52D9\u6D88\u606F",
617
624
  "system.notification.empty": "\u66AB\u7121\u6D88\u606F",
625
+ "system.notification.empty_inbox_hint": "\u65B0\u8A0A\u606F\u5C07\u5728\u6B64\u986F\u793A",
626
+ "system.notification.empty_unread_hint": "\u5168\u90E8\u8A0A\u606F\u5747\u5DF2\u8B80\u5B8C",
627
+ "system.notification.empty_archived_hint": "\u5C01\u5B58\u7684\u8A0A\u606F\u5C07\u5728\u6B64\u986F\u793A",
618
628
  "system.notification.action.view_all": "\u67E5\u770B\u5168\u90E8",
619
629
  "system.notification.view.inbox": "\u5168\u90E8",
620
630
  "system.notification.view.unread": "\u672A\u8B80",
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.0.80",
10
+ "version": "0.0.82",
11
11
  "type": "module",
12
12
  "files": [
13
13
  "dist",
@@ -38,8 +38,8 @@
38
38
  "@tarojs/components": "4.2.1",
39
39
  "@tarojs/taro": "4.2.1",
40
40
  "react": "18.3.1",
41
- "@liujitcn/kratos-taro-app-core": "^0.0.80",
42
- "@liujitcn/kratos-taro-app-ui": "^0.0.80"
41
+ "@liujitcn/kratos-taro-app-core": "^0.0.82",
42
+ "@liujitcn/kratos-taro-app-ui": "^0.0.82"
43
43
  },
44
44
  "scripts": {
45
45
  "build": "pnpm run build:entries && pnpm pack --pack-destination ../../../dist/npm",
@@ -119,10 +119,13 @@
119
119
  "system.settings.mfa_disable_success": "Multi-factor authentication disabled",
120
120
  "system.settings.mfa_copy_uri": "Copy binding address",
121
121
  "system.settings.mfa_copy_success": "Copied",
122
- "system.notification.title": "Message Center",
122
+ "system.notification.title": "Messages",
123
123
  "system.notification.sender.system": "System",
124
124
  "system.notification.description": "View system notifications and business messages",
125
125
  "system.notification.empty": "No messages",
126
+ "system.notification.empty_inbox_hint": "New messages will appear here",
127
+ "system.notification.empty_unread_hint": "You're all caught up",
128
+ "system.notification.empty_archived_hint": "Archived messages will appear here",
126
129
  "system.notification.action.view_all": "View all",
127
130
  "system.notification.view.inbox": "All",
128
131
  "system.notification.view.unread": "Unread",
@@ -119,10 +119,13 @@
119
119
  "system.settings.mfa_disable_success": "多要素認証を無効にしました",
120
120
  "system.settings.mfa_copy_uri": "登録アドレスをコピー",
121
121
  "system.settings.mfa_copy_success": "コピーしました",
122
- "system.notification.title": "メッセージセンター",
122
+ "system.notification.title": "メッセージ",
123
123
  "system.notification.sender.system": "システム",
124
124
  "system.notification.description": "システム通知と業務メッセージを確認",
125
125
  "system.notification.empty": "メッセージはありません",
126
+ "system.notification.empty_inbox_hint": "新しいメッセージはここに表示されます",
127
+ "system.notification.empty_unread_hint": "すべてのメッセージを既読にしました",
128
+ "system.notification.empty_archived_hint": "アーカイブ済みのメッセージはここに表示されます",
126
129
  "system.notification.action.view_all": "すべて表示",
127
130
  "system.notification.view.inbox": "すべて",
128
131
  "system.notification.view.unread": "未読",
@@ -119,10 +119,13 @@
119
119
  "system.settings.mfa_disable_success": "多因素认证已禁用",
120
120
  "system.settings.mfa_copy_uri": "复制绑定地址",
121
121
  "system.settings.mfa_copy_success": "复制成功",
122
- "system.notification.title": "消息中心",
122
+ "system.notification.title": "消息",
123
123
  "system.notification.sender.system": "系统",
124
124
  "system.notification.description": "查看系统通知和业务消息",
125
125
  "system.notification.empty": "暂无消息",
126
+ "system.notification.empty_inbox_hint": "新消息将在此显示",
127
+ "system.notification.empty_unread_hint": "全部消息均已读完",
128
+ "system.notification.empty_archived_hint": "归档的消息将在此显示",
126
129
  "system.notification.action.view_all": "查看全部",
127
130
  "system.notification.view.inbox": "全部",
128
131
  "system.notification.view.unread": "未读",
@@ -119,10 +119,13 @@
119
119
  "system.settings.mfa_disable_success": "多因素認證已停用",
120
120
  "system.settings.mfa_copy_uri": "複製綁定地址",
121
121
  "system.settings.mfa_copy_success": "複製成功",
122
- "system.notification.title": "消息中心",
122
+ "system.notification.title": "消息",
123
123
  "system.notification.sender.system": "系統",
124
124
  "system.notification.description": "查看系統通知和業務消息",
125
125
  "system.notification.empty": "暫無消息",
126
+ "system.notification.empty_inbox_hint": "新訊息將在此顯示",
127
+ "system.notification.empty_unread_hint": "全部訊息均已讀完",
128
+ "system.notification.empty_archived_hint": "封存的訊息將在此顯示",
126
129
  "system.notification.action.view_all": "查看全部",
127
130
  "system.notification.view.inbox": "全部",
128
131
  "system.notification.view.unread": "未讀",
package/src/pages.ts CHANGED
@@ -5,7 +5,6 @@ export const systemPages: Record<string, KratosTaroPageConfig> = {
5
5
  'pages/my/my': {
6
6
  style: {
7
7
  navigationStyle: 'custom',
8
- navigationBarTextStyle: 'white',
9
8
  navigationBarTitleText: '',
10
9
  },
11
10
  },
@@ -19,7 +18,6 @@ export const systemPages: Record<string, KratosTaroPageConfig> = {
19
18
  'pagesMember/profile/profile': {
20
19
  style: {
21
20
  navigationStyle: 'custom',
22
- navigationBarTextStyle: 'white',
23
21
  navigationBarTitleText: '',
24
22
  },
25
23
  },
@@ -14,8 +14,8 @@ page {
14
14
  }
15
15
 
16
16
  .my-viewport--weapp .my-content {
17
- /* 44PX 是系统导航栏高度,88px 按设计稿转换为 44 物理像素。 */
18
- padding-top: calc(44PX + 88px);
17
+ /* k-top 在小程序端自带 44PX 状态栏高度的导航带,页面不再额外让出顶部空间 */
18
+ padding-top: 0;
19
19
  }
20
20
 
21
21
  .my-stack {
@@ -29,7 +29,7 @@ export default function MyPage() {
29
29
  const gearIcon = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(
30
30
  `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="${
31
31
  themeStore.theme === 'light' ? '#102232' : '#e9f4f6'
32
- }" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.6 1.6 0 0 0 .3 1.8 2 2 0 1 1-2.8 2.8 1.6 1.6 0 0 0-2.7 1.1 2 2 0 1 1-4 0 1.6 1.6 0 0 0-2.6-1.1 2 2 0 1 1-2.8-2.8A1.6 1.6 0 0 0 3 13.9a2 2 0 1 1 0-4 1.6 1.6 0 0 0 1.5-2.7 2 2 0 1 1 2.8-2.8A1.6 1.6 0 0 0 10 4.6a2 2 0 1 1 4 0 1.6 1.6 0 0 0 2.7.6 2 2 0 1 1 2.8 2.8 1.6 1.6 0 0 0-.1 2.6"/></svg>`,
32
+ }" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.6 1.6 0 0 0 .3 1.8 2 2 0 1 1-2.8 2.8 1.6 1.6 0 0 0-2.7 1.1 2 2 0 1 1-4 0 1.6 1.6 0 0 0-2.6-1.1 2 2 0 1 1-2.8-2.8A1.6 1.6 0 0 0 3 13.9a2 2 0 1 1 0-4 1.6 1.6 0 0 0 1.5-2.7 2 2 0 1 1 2.8-2.8A1.6 1.6 0 0 0 10 4.6a2 2 0 1 1 4 0 1.6 1.6 0 0 0 2.7.6 2 2 0 1 1 2.8 2.8 1.6 1.6 0 0 0-.1 2.6a2.2 2.2 0 1 1 0 4.4Z"/></svg>`,
33
33
  )}`
34
34
  /** 个人卡账号行:登录展示账号,未登录提示去登录。 */
35
35
  const accountText =
@@ -64,8 +64,6 @@ export default function MyPage() {
64
64
  className='k-glass k-glass--lit k-pfx my-profile'
65
65
  onClick={() => navigateAppRoute('app/profile')}
66
66
  >
67
- <View className='k-cnr k-cnr--tr' aria-hidden />
68
- <View className='k-cnr k-cnr--bl' aria-hidden />
69
67
  <View className='my-pfx-main'>
70
68
  {isLoggedIn && profile ? (
71
69
  <Image
@@ -26,6 +26,7 @@ export default function MessageDetailPage() {
26
26
  if (!value.read_at) await defNotificationService.MarkNotificationRead({ ids: [id] })
27
27
  }
28
28
 
29
+ /** 将系统通知发送者映射到当前语言。 */
29
30
  function resolveSenderName(value?: string) {
30
31
  if (value === '系统' || value === '__I18N__:system.notification.sender.system') {
31
32
  return t('system.notification.sender.system')
@@ -2,7 +2,13 @@ import type { CSSProperties } from 'react'
2
2
  import { useDidShow } from '@tarojs/taro'
3
3
  import { Button, Text, View } from '@tarojs/components'
4
4
  import { useRef, useState } from 'react'
5
- import { getMpCapsuleRightGap, navigateAppView, t, useThemeStore } from '@liujitcn/kratos-taro-app-core'
5
+ import {
6
+ getMpCapsuleRightGap,
7
+ KratosEmpty,
8
+ navigateAppView,
9
+ t,
10
+ useThemeStore,
11
+ } from '@liujitcn/kratos-taro-app-core'
6
12
  import { UniIcon } from '@liujitcn/kratos-taro-app-ui'
7
13
  import { defNotificationService } from '../../../api/base/v1/notification'
8
14
  import type { Notification, NotificationCategory } from '../../../rpc/base/v1/notification'
@@ -155,6 +161,15 @@ export default function MessageInboxPage() {
155
161
  navigateAppView('MESSAGE_DETAIL', { id: String(item.id) })
156
162
  }
157
163
 
164
+ /** 空态提示语随当前视图切换。 */
165
+ function emptyHintKey() {
166
+ if (selectedView === NotificationView.NOTIFICATION_VIEW_UNREAD)
167
+ return 'system.notification.empty_unread_hint'
168
+ if (selectedView === NotificationView.NOTIFICATION_VIEW_ARCHIVED)
169
+ return 'system.notification.empty_archived_hint'
170
+ return 'system.notification.empty_inbox_hint'
171
+ }
172
+
158
173
  return (
159
174
  <View
160
175
  className={`message-page ${
@@ -163,7 +178,7 @@ export default function MessageInboxPage() {
163
178
  >
164
179
  <View className='k-top message-header' style={topNavStyle}>
165
180
  <View className='message-header__title'>
166
- <Text className='k-top__t2'>{t('system.notification.title')}</Text>
181
+ <Text className='message-header__text'>{t('system.notification.title')}</Text>
167
182
  {unreadTotal > 0 && <View className='message-unread-dot' aria-hidden='true' />}
168
183
  </View>
169
184
  {selectedView !== NotificationView.NOTIFICATION_VIEW_ARCHIVED && unreadTotal > 0 && (
@@ -227,9 +242,11 @@ export default function MessageInboxPage() {
227
242
  </View>
228
243
  <View className='message-item__body'>
229
244
  <Text className='k-msg-item__title'>{item.title}</Text>
230
- <Text className='k-msg-item__meta'>{item.category_name}</Text>
245
+ <View className='k-msg-item__foot'>
246
+ <Text className='k-msg-item__meta'>{item.category_name}</Text>
247
+ <Text className='k-msg-item__time'>{item.received_at}</Text>
248
+ </View>
231
249
  </View>
232
- <Text className='k-msg-item__time'>{item.received_at}</Text>
233
250
  </View>
234
251
  {(selectedView === NotificationView.NOTIFICATION_VIEW_ARCHIVED ||
235
252
  item.allow_archive ||
@@ -283,7 +300,13 @@ export default function MessageInboxPage() {
283
300
  </Button>
284
301
  )}
285
302
  {finished && items.length === 0 && (
286
- <View className='empty'>{t('system.notification.empty')}</View>
303
+ <KratosEmpty
304
+ icon={
305
+ <UniIcon type='notification-filled' size={26} color='var(--kratos-color-primary)' />
306
+ }
307
+ title={t('system.notification.empty')}
308
+ description={t(emptyHintKey())}
309
+ />
287
310
  )}
288
311
  </View>
289
312
  )
@@ -7,16 +7,35 @@
7
7
  }
8
8
 
9
9
  .message-header {
10
+ /* 标题绝对居中后头部不再依赖流内内容撑高,保证标题行与筛选行留出间距 */
11
+ min-height: 76px;
10
12
  padding: 20px 4px 24px;
11
13
  }
12
14
 
15
+ /* 标题排版与 k-page-nav__title/k-top__title 同规格,绝对居中后文字与红点同行排布 */
13
16
  .message-header__title {
17
+ position: absolute;
18
+ left: 50%;
14
19
  display: flex;
15
20
  align-items: center;
16
21
  min-width: 0;
22
+ max-width: calc(100% - 190px);
23
+ overflow: hidden;
24
+ font-size: 16PX;
25
+ font-weight: 700;
26
+ color: var(--kratos-color-text);
27
+ transform: translateX(-50%);
28
+ white-space: nowrap;
29
+ }
30
+
31
+ .message-header__text {
32
+ min-width: 0;
33
+ overflow: hidden;
34
+ text-overflow: ellipsis;
17
35
  }
18
36
 
19
37
  .message-unread-dot {
38
+ flex-shrink: 0;
20
39
  width: 12px;
21
40
  height: 12px;
22
41
  margin-left: 12px;
@@ -39,10 +58,6 @@
39
58
  min-width: 0;
40
59
  }
41
60
 
42
- .message-item__body .k-msg-item__meta {
43
- display: block;
44
- }
45
-
46
61
  .load-more {
47
62
  box-sizing: border-box;
48
63
  width: 100%;
@@ -61,13 +76,6 @@
61
76
  border: 0;
62
77
  }
63
78
 
64
- .empty {
65
- padding: 120px 0;
66
- color: var(--kratos-color-text-dim);
67
- font-family: var(--kratos-font-mono);
68
- text-align: center;
69
- }
70
-
71
79
  .detail-page {
72
80
  box-sizing: border-box;
73
81
  min-height: 100vh;
@@ -94,7 +102,8 @@
94
102
 
95
103
  .detail-meta {
96
104
  display: flex;
97
- flex-wrap: wrap;
105
+ align-items: center;
106
+ justify-content: space-between;
98
107
  gap: 18px;
99
108
  margin: 24px 0 36px;
100
109
  padding-bottom: 28px;
@@ -107,6 +116,10 @@
107
116
  .detail-category {
108
117
  display: inline-flex;
109
118
  align-items: center;
119
+ min-width: 0;
120
+ overflow: hidden;
121
+ text-overflow: ellipsis;
122
+ white-space: nowrap;
110
123
  }
111
124
 
112
125
  .detail-category__icon {
@@ -164,8 +164,6 @@ export default function ProfilePage() {
164
164
  </View>
165
165
 
166
166
  <View className='k-glass k-glass--lit k-pfx profile-id' onClick={() => void onAvatarChange()}>
167
- <View className='k-cnr k-cnr--tl' aria-hidden />
168
- <View className='k-cnr k-cnr--br' aria-hidden />
169
167
  <View className='profile-id__main'>
170
168
  <View className='k-pfx__av'>
171
169
  <Image className='profile-av-img' src={userInfo.avatar ? formatSrc(userInfo.avatar) : defaultAvatar} mode='aspectFill' />