@liujitcn/kratos-uni-app-system 0.0.82 → 0.0.84
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/README.md +31 -0
- package/dist/index.mjs +0 -24
- package/dist/module.mjs +0 -24
- package/package.json +3 -2
- package/src/components/KratosMyPage.vue +166 -0
- package/src/locales/en-US.json +0 -6
- package/src/locales/ja-JP.json +0 -6
- package/src/locales/zh-CN.json +0 -6
- package/src/locales/zh-TW.json +0 -6
- package/src/views/pages/my/components/MyExtensions.vue +9 -0
- package/src/views/pages/my/my.vue +7 -152
package/README.md
CHANGED
|
@@ -8,9 +8,11 @@
|
|
|
8
8
|
packages/modules/system
|
|
9
9
|
├── src
|
|
10
10
|
│ ├── api/base/v1 # AI 消息、会话、快捷入口和Provider模型选项接口
|
|
11
|
+
│ ├── components # 可复用的 KratosMyPage 公共个人中心
|
|
11
12
|
│ ├── rpc # system 相关 Buf 生成类型
|
|
12
13
|
│ ├── views
|
|
13
14
|
│ │ ├── pages/my # 个人中心主页
|
|
15
|
+
│ │ │ └── components # MyExtensions 业务扩展的空实现
|
|
14
16
|
│ │ └── pagesMember # AI、个人资料和默认设置包装页
|
|
15
17
|
│ ├── index.ts # systemModule 定义和公开入口
|
|
16
18
|
│ └── pages.ts # 页面样式与分包声明
|
|
@@ -29,4 +31,33 @@ packages/modules/system
|
|
|
29
31
|
- 允许后续模块按相同物理路由或 `viewKey` 覆盖 system 静态视图。
|
|
30
32
|
- npm 根入口使用 `dist/index.mjs`;workspace 的 Turbo 任务和 `prepare:modules` 会先构建 system 及其依赖的 core Node 入口,干净安装后不依赖历史 dist。
|
|
31
33
|
|
|
34
|
+
## 个人中心扩展
|
|
35
|
+
|
|
36
|
+
公共组件 `KratosMyPage` 保留顶部标题与设置、个人信息和 AI 助手入口;AI 卡片继续由应用的 `aiEnabled` 配置控制显隐。唯一业务插槽 `extensions` 位于这些固定内容之后,与它们共用滚动区域、主题和卡片间距。未传入内容时不增加容器或留白,业务卡片、数据请求和权限由项目模块维护。
|
|
37
|
+
|
|
38
|
+
内置 [我的页面](src/views/pages/my/my.vue) 已使用该组件,并在插槽中挂载 [MyExtensions 空实现](src/views/pages/my/components/MyExtensions.vue)。空实现保留一个 `view` 作为业务内容容器,不显示占位卡片;项目可以按这个结构组织自己的业务内容。
|
|
39
|
+
|
|
40
|
+
在项目业务模块的 `src/views/pages/my/my.vue` 复用公开组件入口:
|
|
41
|
+
|
|
42
|
+
```vue
|
|
43
|
+
<script setup lang="ts">
|
|
44
|
+
import KratosMyPage from '@liujitcn/kratos-uni-app-system/components/KratosMyPage.vue'
|
|
45
|
+
import OrderSection from './components/OrderSection.vue'
|
|
46
|
+
import ServiceSection from './components/ServiceSection.vue'
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<template>
|
|
50
|
+
<KratosMyPage>
|
|
51
|
+
<template #extensions>
|
|
52
|
+
<OrderSection />
|
|
53
|
+
<ServiceSection />
|
|
54
|
+
</template>
|
|
55
|
+
</KratosMyPage>
|
|
56
|
+
</template>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
项目模块的 `pages` 声明 `'pages/my/my': { style: { navigationStyle: 'custom', navigationBarTitleText: '' } }`,`views` 声明 `PROFILE_HOME: 'pages/my/my'`,并在宿主 `module-manifest.ts` 中排在 system 模块之后。使用相同的物理路由可以保留微信原生 tab 切换;页面 wrapper 和底部 tabBar 继续由构建插件生成,不在业务页面重复挂载。
|
|
60
|
+
|
|
61
|
+
插槽可以直接放多个业务卡片,不需要复制公共页面或给顶部入口提供替换内容。需要登录态、用户资料或导航时,通过 core 的公开 store 与导航 API 获取。
|
|
62
|
+
|
|
32
63
|
模块装配与动态导航约定见 [workspace 文档](../../../README.md)。
|
package/dist/index.mjs
CHANGED
|
@@ -330,7 +330,6 @@ var zh_CN_default = {
|
|
|
330
330
|
"system.profile.account": "\u8D26\u53F7",
|
|
331
331
|
"system.profile.avatar_change": "\u70B9\u51FB\u4FEE\u6539\u5934\u50CF",
|
|
332
332
|
"system.profile.avatar_upload_failed": "\u4E0A\u4F20\u5934\u50CF\u5931\u8D25",
|
|
333
|
-
"system.profile.avatar_update": "\u66F4\u65B0\u5934\u50CF\u6635\u79F0",
|
|
334
333
|
"system.profile.gender": "\u6027\u522B",
|
|
335
334
|
"system.profile.email": "\u90AE\u7BB1",
|
|
336
335
|
"system.profile.email_placeholder": "\u8BF7\u8F93\u5165\u90AE\u7BB1",
|
|
@@ -362,23 +361,18 @@ var zh_CN_default = {
|
|
|
362
361
|
"system.settings.go_ask": "\u53BB\u63D0\u95EE",
|
|
363
362
|
"system.notification.title": "\u6D88\u606F",
|
|
364
363
|
"system.notification.sender.system": "\u7CFB\u7EDF",
|
|
365
|
-
"system.notification.description": "\u67E5\u770B\u7CFB\u7EDF\u901A\u77E5\u548C\u4E1A\u52A1\u6D88\u606F",
|
|
366
364
|
"system.notification.empty": "\u6682\u65E0\u6D88\u606F",
|
|
367
365
|
"system.notification.empty_inbox_hint": "\u65B0\u6D88\u606F\u5C06\u5728\u6B64\u663E\u793A",
|
|
368
366
|
"system.notification.empty_unread_hint": "\u5168\u90E8\u6D88\u606F\u5747\u5DF2\u8BFB\u5B8C",
|
|
369
367
|
"system.notification.empty_archived_hint": "\u5F52\u6863\u7684\u6D88\u606F\u5C06\u5728\u6B64\u663E\u793A",
|
|
370
|
-
"system.notification.action.view_all": "\u67E5\u770B\u5168\u90E8",
|
|
371
368
|
"system.notification.view.inbox": "\u5168\u90E8",
|
|
372
369
|
"system.notification.view.unread": "\u672A\u8BFB",
|
|
373
370
|
"system.notification.view.archived": "\u5DF2\u5F52\u6863",
|
|
374
|
-
"system.notification.category_filter": "\u5206\u7C7B ID",
|
|
375
371
|
"system.notification.mark_all_read": "\u5168\u90E8\u5DF2\u8BFB",
|
|
376
372
|
"system.notification.action.archive": "\u5F52\u6863",
|
|
377
373
|
"system.notification.action.restore": "\u6062\u590D",
|
|
378
374
|
"system.notification.action.delete": "\u5220\u9664",
|
|
379
|
-
"system.ai.model.provider_placeholder": "\u9009\u62E9\u4F9B\u5E94\u5546",
|
|
380
375
|
"system.ai.model.model_placeholder": "\u9009\u62E9\u6A21\u578B",
|
|
381
|
-
"system.ai.model.load_failed": "\u52A0\u8F7D\u4F9B\u5E94\u5546\u548C\u6A21\u578B\u5931\u8D25",
|
|
382
376
|
"system.ai.model.title": "\u9009\u62E9\u6A21\u578B",
|
|
383
377
|
"system.ai.model.provider_model_count": "{providers} \u4E2A\u4F9B\u5E94\u5546 \xB7 {models} \u4E2A\u6A21\u578B",
|
|
384
378
|
"system.ai.model.empty": "\u6682\u65E0\u53EF\u9009\u6A21\u578B",
|
|
@@ -460,7 +454,6 @@ var en_US_default = {
|
|
|
460
454
|
"system.profile.account": "Account",
|
|
461
455
|
"system.profile.avatar_change": "Tap to change avatar",
|
|
462
456
|
"system.profile.avatar_upload_failed": "Avatar upload failed",
|
|
463
|
-
"system.profile.avatar_update": "Update avatar and name",
|
|
464
457
|
"system.profile.gender": "Gender",
|
|
465
458
|
"system.profile.email": "Email",
|
|
466
459
|
"system.profile.email_placeholder": "Enter email",
|
|
@@ -492,23 +485,18 @@ var en_US_default = {
|
|
|
492
485
|
"system.settings.go_ask": "Ask now",
|
|
493
486
|
"system.notification.title": "Messages",
|
|
494
487
|
"system.notification.sender.system": "System",
|
|
495
|
-
"system.notification.description": "View system notifications and business messages",
|
|
496
488
|
"system.notification.empty": "No messages",
|
|
497
489
|
"system.notification.empty_inbox_hint": "New messages will appear here",
|
|
498
490
|
"system.notification.empty_unread_hint": "You're all caught up",
|
|
499
491
|
"system.notification.empty_archived_hint": "Archived messages will appear here",
|
|
500
|
-
"system.notification.action.view_all": "View all",
|
|
501
492
|
"system.notification.view.inbox": "All",
|
|
502
493
|
"system.notification.view.unread": "Unread",
|
|
503
494
|
"system.notification.view.archived": "Archived",
|
|
504
|
-
"system.notification.category_filter": "Category ID",
|
|
505
495
|
"system.notification.mark_all_read": "Mark all read",
|
|
506
496
|
"system.notification.action.archive": "Archive",
|
|
507
497
|
"system.notification.action.restore": "Restore",
|
|
508
498
|
"system.notification.action.delete": "Delete",
|
|
509
|
-
"system.ai.model.provider_placeholder": "Select a provider",
|
|
510
499
|
"system.ai.model.model_placeholder": "Select a model",
|
|
511
|
-
"system.ai.model.load_failed": "Failed to load providers and models",
|
|
512
500
|
"system.ai.model.title": "Select Model",
|
|
513
501
|
"system.ai.model.provider_model_count": "{providers} providers \xB7 {models} models",
|
|
514
502
|
"system.ai.model.empty": "No models available",
|
|
@@ -590,7 +578,6 @@ var ja_JP_default = {
|
|
|
590
578
|
"system.profile.account": "\u30A2\u30AB\u30A6\u30F3\u30C8",
|
|
591
579
|
"system.profile.avatar_change": "\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u30A2\u30D0\u30BF\u30FC\u3092\u5909\u66F4\u3057\u307E\u3059",
|
|
592
580
|
"system.profile.avatar_upload_failed": "\u30A2\u30D0\u30BF\u30FC\u306E\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
|
|
593
|
-
"system.profile.avatar_update": "\u30A2\u30D0\u30BF\u30FC\u306E\u30CB\u30C3\u30AF\u30CD\u30FC\u30E0\u3092\u66F4\u65B0",
|
|
594
581
|
"system.profile.gender": "\u6027\u5225",
|
|
595
582
|
"system.profile.email": "\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",
|
|
596
583
|
"system.profile.email_placeholder": "\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
@@ -622,23 +609,18 @@ var ja_JP_default = {
|
|
|
622
609
|
"system.settings.go_ask": "\u8CEA\u554F\u3057\u3066\u307F\u3088\u3046",
|
|
623
610
|
"system.notification.title": "\u30E1\u30C3\u30BB\u30FC\u30B8",
|
|
624
611
|
"system.notification.sender.system": "\u30B7\u30B9\u30C6\u30E0",
|
|
625
|
-
"system.notification.description": "\u30B7\u30B9\u30C6\u30E0\u901A\u77E5\u3068\u696D\u52D9\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u78BA\u8A8D",
|
|
626
612
|
"system.notification.empty": "\u30E1\u30C3\u30BB\u30FC\u30B8\u306F\u3042\u308A\u307E\u305B\u3093",
|
|
627
613
|
"system.notification.empty_inbox_hint": "\u65B0\u3057\u3044\u30E1\u30C3\u30BB\u30FC\u30B8\u306F\u3053\u3053\u306B\u8868\u793A\u3055\u308C\u307E\u3059",
|
|
628
614
|
"system.notification.empty_unread_hint": "\u3059\u3079\u3066\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u65E2\u8AAD\u306B\u3057\u307E\u3057\u305F",
|
|
629
615
|
"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",
|
|
630
|
-
"system.notification.action.view_all": "\u3059\u3079\u3066\u8868\u793A",
|
|
631
616
|
"system.notification.view.inbox": "\u3059\u3079\u3066",
|
|
632
617
|
"system.notification.view.unread": "\u672A\u8AAD",
|
|
633
618
|
"system.notification.view.archived": "\u30A2\u30FC\u30AB\u30A4\u30D6\u6E08\u307F",
|
|
634
|
-
"system.notification.category_filter": "\u30AB\u30C6\u30B4\u30EAID",
|
|
635
619
|
"system.notification.mark_all_read": "\u3059\u3079\u3066\u65E2\u8AAD",
|
|
636
620
|
"system.notification.action.archive": "\u30A2\u30FC\u30AB\u30A4\u30D6",
|
|
637
621
|
"system.notification.action.restore": "\u5FA9\u5143",
|
|
638
622
|
"system.notification.action.delete": "\u524A\u9664",
|
|
639
|
-
"system.ai.model.provider_placeholder": "\u30D7\u30ED\u30D0\u30A4\u30C0\u30FC\u3092\u9078\u629E",
|
|
640
623
|
"system.ai.model.model_placeholder": "\u30E2\u30C7\u30EB\u3092\u9078\u629E",
|
|
641
|
-
"system.ai.model.load_failed": "\u30D7\u30ED\u30D0\u30A4\u30C0\u30FC\u3068\u30E2\u30C7\u30EB\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",
|
|
642
624
|
"system.ai.model.title": "\u30E2\u30C7\u30EB\u3092\u9078\u629E",
|
|
643
625
|
"system.ai.model.provider_model_count": "{providers} \u30D7\u30ED\u30D0\u30A4\u30C0\u30FC \xB7 {models} \u30E2\u30C7\u30EB",
|
|
644
626
|
"system.ai.model.empty": "\u9078\u629E\u53EF\u80FD\u306A\u30E2\u30C7\u30EB\u304C\u3042\u308A\u307E\u305B\u3093",
|
|
@@ -720,7 +702,6 @@ var zh_TW_default = {
|
|
|
720
702
|
"system.profile.account": "\u8CEC\u865F",
|
|
721
703
|
"system.profile.avatar_change": "\u9EDE\u9078\u4FEE\u6539\u982D\u50CF",
|
|
722
704
|
"system.profile.avatar_upload_failed": "\u4E0A\u50B3\u982D\u50CF\u5931\u6557",
|
|
723
|
-
"system.profile.avatar_update": "\u66F4\u65B0\u982D\u50CF\u66B1\u7A31",
|
|
724
705
|
"system.profile.gender": "\u6027\u5225",
|
|
725
706
|
"system.profile.email": "\u96FB\u5B50\u90F5\u4EF6",
|
|
726
707
|
"system.profile.email_placeholder": "\u8ACB\u8F38\u5165\u96FB\u5B50\u90F5\u4EF6",
|
|
@@ -752,23 +733,18 @@ var zh_TW_default = {
|
|
|
752
733
|
"system.settings.go_ask": "\u53BB\u63D0\u554F",
|
|
753
734
|
"system.notification.title": "\u6D88\u606F",
|
|
754
735
|
"system.notification.sender.system": "\u7CFB\u7D71",
|
|
755
|
-
"system.notification.description": "\u67E5\u770B\u7CFB\u7D71\u901A\u77E5\u548C\u696D\u52D9\u6D88\u606F",
|
|
756
736
|
"system.notification.empty": "\u66AB\u7121\u6D88\u606F",
|
|
757
737
|
"system.notification.empty_inbox_hint": "\u65B0\u8A0A\u606F\u5C07\u5728\u6B64\u986F\u793A",
|
|
758
738
|
"system.notification.empty_unread_hint": "\u5168\u90E8\u8A0A\u606F\u5747\u5DF2\u8B80\u5B8C",
|
|
759
739
|
"system.notification.empty_archived_hint": "\u5C01\u5B58\u7684\u8A0A\u606F\u5C07\u5728\u6B64\u986F\u793A",
|
|
760
|
-
"system.notification.action.view_all": "\u67E5\u770B\u5168\u90E8",
|
|
761
740
|
"system.notification.view.inbox": "\u5168\u90E8",
|
|
762
741
|
"system.notification.view.unread": "\u672A\u8B80",
|
|
763
742
|
"system.notification.view.archived": "\u5DF2\u6B78\u6A94",
|
|
764
|
-
"system.notification.category_filter": "\u5206\u985E ID",
|
|
765
743
|
"system.notification.mark_all_read": "\u5168\u90E8\u5DF2\u8B80",
|
|
766
744
|
"system.notification.action.archive": "\u6B78\u6A94",
|
|
767
745
|
"system.notification.action.restore": "\u6062\u5FA9",
|
|
768
746
|
"system.notification.action.delete": "\u522A\u9664",
|
|
769
|
-
"system.ai.model.provider_placeholder": "\u9078\u64C7\u4F9B\u61C9\u5546",
|
|
770
747
|
"system.ai.model.model_placeholder": "\u9078\u64C7\u6A21\u578B",
|
|
771
|
-
"system.ai.model.load_failed": "\u8F09\u5165\u4F9B\u61C9\u5546\u8207\u6A21\u578B\u5931\u6557",
|
|
772
748
|
"system.ai.model.title": "\u9078\u64C7\u6A21\u578B",
|
|
773
749
|
"system.ai.model.provider_model_count": "{providers} \u500B\u4F9B\u61C9\u5546 \xB7 {models} \u500B\u6A21\u578B",
|
|
774
750
|
"system.ai.model.empty": "\u66AB\u7121\u53EF\u9078\u6A21\u578B",
|
package/dist/module.mjs
CHANGED
|
@@ -106,7 +106,6 @@ var zh_CN_default = {
|
|
|
106
106
|
"system.profile.account": "\u8D26\u53F7",
|
|
107
107
|
"system.profile.avatar_change": "\u70B9\u51FB\u4FEE\u6539\u5934\u50CF",
|
|
108
108
|
"system.profile.avatar_upload_failed": "\u4E0A\u4F20\u5934\u50CF\u5931\u8D25",
|
|
109
|
-
"system.profile.avatar_update": "\u66F4\u65B0\u5934\u50CF\u6635\u79F0",
|
|
110
109
|
"system.profile.gender": "\u6027\u522B",
|
|
111
110
|
"system.profile.email": "\u90AE\u7BB1",
|
|
112
111
|
"system.profile.email_placeholder": "\u8BF7\u8F93\u5165\u90AE\u7BB1",
|
|
@@ -138,23 +137,18 @@ var zh_CN_default = {
|
|
|
138
137
|
"system.settings.go_ask": "\u53BB\u63D0\u95EE",
|
|
139
138
|
"system.notification.title": "\u6D88\u606F",
|
|
140
139
|
"system.notification.sender.system": "\u7CFB\u7EDF",
|
|
141
|
-
"system.notification.description": "\u67E5\u770B\u7CFB\u7EDF\u901A\u77E5\u548C\u4E1A\u52A1\u6D88\u606F",
|
|
142
140
|
"system.notification.empty": "\u6682\u65E0\u6D88\u606F",
|
|
143
141
|
"system.notification.empty_inbox_hint": "\u65B0\u6D88\u606F\u5C06\u5728\u6B64\u663E\u793A",
|
|
144
142
|
"system.notification.empty_unread_hint": "\u5168\u90E8\u6D88\u606F\u5747\u5DF2\u8BFB\u5B8C",
|
|
145
143
|
"system.notification.empty_archived_hint": "\u5F52\u6863\u7684\u6D88\u606F\u5C06\u5728\u6B64\u663E\u793A",
|
|
146
|
-
"system.notification.action.view_all": "\u67E5\u770B\u5168\u90E8",
|
|
147
144
|
"system.notification.view.inbox": "\u5168\u90E8",
|
|
148
145
|
"system.notification.view.unread": "\u672A\u8BFB",
|
|
149
146
|
"system.notification.view.archived": "\u5DF2\u5F52\u6863",
|
|
150
|
-
"system.notification.category_filter": "\u5206\u7C7B ID",
|
|
151
147
|
"system.notification.mark_all_read": "\u5168\u90E8\u5DF2\u8BFB",
|
|
152
148
|
"system.notification.action.archive": "\u5F52\u6863",
|
|
153
149
|
"system.notification.action.restore": "\u6062\u590D",
|
|
154
150
|
"system.notification.action.delete": "\u5220\u9664",
|
|
155
|
-
"system.ai.model.provider_placeholder": "\u9009\u62E9\u4F9B\u5E94\u5546",
|
|
156
151
|
"system.ai.model.model_placeholder": "\u9009\u62E9\u6A21\u578B",
|
|
157
|
-
"system.ai.model.load_failed": "\u52A0\u8F7D\u4F9B\u5E94\u5546\u548C\u6A21\u578B\u5931\u8D25",
|
|
158
152
|
"system.ai.model.title": "\u9009\u62E9\u6A21\u578B",
|
|
159
153
|
"system.ai.model.provider_model_count": "{providers} \u4E2A\u4F9B\u5E94\u5546 \xB7 {models} \u4E2A\u6A21\u578B",
|
|
160
154
|
"system.ai.model.empty": "\u6682\u65E0\u53EF\u9009\u6A21\u578B",
|
|
@@ -236,7 +230,6 @@ var en_US_default = {
|
|
|
236
230
|
"system.profile.account": "Account",
|
|
237
231
|
"system.profile.avatar_change": "Tap to change avatar",
|
|
238
232
|
"system.profile.avatar_upload_failed": "Avatar upload failed",
|
|
239
|
-
"system.profile.avatar_update": "Update avatar and name",
|
|
240
233
|
"system.profile.gender": "Gender",
|
|
241
234
|
"system.profile.email": "Email",
|
|
242
235
|
"system.profile.email_placeholder": "Enter email",
|
|
@@ -268,23 +261,18 @@ var en_US_default = {
|
|
|
268
261
|
"system.settings.go_ask": "Ask now",
|
|
269
262
|
"system.notification.title": "Messages",
|
|
270
263
|
"system.notification.sender.system": "System",
|
|
271
|
-
"system.notification.description": "View system notifications and business messages",
|
|
272
264
|
"system.notification.empty": "No messages",
|
|
273
265
|
"system.notification.empty_inbox_hint": "New messages will appear here",
|
|
274
266
|
"system.notification.empty_unread_hint": "You're all caught up",
|
|
275
267
|
"system.notification.empty_archived_hint": "Archived messages will appear here",
|
|
276
|
-
"system.notification.action.view_all": "View all",
|
|
277
268
|
"system.notification.view.inbox": "All",
|
|
278
269
|
"system.notification.view.unread": "Unread",
|
|
279
270
|
"system.notification.view.archived": "Archived",
|
|
280
|
-
"system.notification.category_filter": "Category ID",
|
|
281
271
|
"system.notification.mark_all_read": "Mark all read",
|
|
282
272
|
"system.notification.action.archive": "Archive",
|
|
283
273
|
"system.notification.action.restore": "Restore",
|
|
284
274
|
"system.notification.action.delete": "Delete",
|
|
285
|
-
"system.ai.model.provider_placeholder": "Select a provider",
|
|
286
275
|
"system.ai.model.model_placeholder": "Select a model",
|
|
287
|
-
"system.ai.model.load_failed": "Failed to load providers and models",
|
|
288
276
|
"system.ai.model.title": "Select Model",
|
|
289
277
|
"system.ai.model.provider_model_count": "{providers} providers \xB7 {models} models",
|
|
290
278
|
"system.ai.model.empty": "No models available",
|
|
@@ -366,7 +354,6 @@ var ja_JP_default = {
|
|
|
366
354
|
"system.profile.account": "\u30A2\u30AB\u30A6\u30F3\u30C8",
|
|
367
355
|
"system.profile.avatar_change": "\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u30A2\u30D0\u30BF\u30FC\u3092\u5909\u66F4\u3057\u307E\u3059",
|
|
368
356
|
"system.profile.avatar_upload_failed": "\u30A2\u30D0\u30BF\u30FC\u306E\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
|
|
369
|
-
"system.profile.avatar_update": "\u30A2\u30D0\u30BF\u30FC\u306E\u30CB\u30C3\u30AF\u30CD\u30FC\u30E0\u3092\u66F4\u65B0",
|
|
370
357
|
"system.profile.gender": "\u6027\u5225",
|
|
371
358
|
"system.profile.email": "\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",
|
|
372
359
|
"system.profile.email_placeholder": "\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
@@ -398,23 +385,18 @@ var ja_JP_default = {
|
|
|
398
385
|
"system.settings.go_ask": "\u8CEA\u554F\u3057\u3066\u307F\u3088\u3046",
|
|
399
386
|
"system.notification.title": "\u30E1\u30C3\u30BB\u30FC\u30B8",
|
|
400
387
|
"system.notification.sender.system": "\u30B7\u30B9\u30C6\u30E0",
|
|
401
|
-
"system.notification.description": "\u30B7\u30B9\u30C6\u30E0\u901A\u77E5\u3068\u696D\u52D9\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u78BA\u8A8D",
|
|
402
388
|
"system.notification.empty": "\u30E1\u30C3\u30BB\u30FC\u30B8\u306F\u3042\u308A\u307E\u305B\u3093",
|
|
403
389
|
"system.notification.empty_inbox_hint": "\u65B0\u3057\u3044\u30E1\u30C3\u30BB\u30FC\u30B8\u306F\u3053\u3053\u306B\u8868\u793A\u3055\u308C\u307E\u3059",
|
|
404
390
|
"system.notification.empty_unread_hint": "\u3059\u3079\u3066\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u65E2\u8AAD\u306B\u3057\u307E\u3057\u305F",
|
|
405
391
|
"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",
|
|
406
|
-
"system.notification.action.view_all": "\u3059\u3079\u3066\u8868\u793A",
|
|
407
392
|
"system.notification.view.inbox": "\u3059\u3079\u3066",
|
|
408
393
|
"system.notification.view.unread": "\u672A\u8AAD",
|
|
409
394
|
"system.notification.view.archived": "\u30A2\u30FC\u30AB\u30A4\u30D6\u6E08\u307F",
|
|
410
|
-
"system.notification.category_filter": "\u30AB\u30C6\u30B4\u30EAID",
|
|
411
395
|
"system.notification.mark_all_read": "\u3059\u3079\u3066\u65E2\u8AAD",
|
|
412
396
|
"system.notification.action.archive": "\u30A2\u30FC\u30AB\u30A4\u30D6",
|
|
413
397
|
"system.notification.action.restore": "\u5FA9\u5143",
|
|
414
398
|
"system.notification.action.delete": "\u524A\u9664",
|
|
415
|
-
"system.ai.model.provider_placeholder": "\u30D7\u30ED\u30D0\u30A4\u30C0\u30FC\u3092\u9078\u629E",
|
|
416
399
|
"system.ai.model.model_placeholder": "\u30E2\u30C7\u30EB\u3092\u9078\u629E",
|
|
417
|
-
"system.ai.model.load_failed": "\u30D7\u30ED\u30D0\u30A4\u30C0\u30FC\u3068\u30E2\u30C7\u30EB\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",
|
|
418
400
|
"system.ai.model.title": "\u30E2\u30C7\u30EB\u3092\u9078\u629E",
|
|
419
401
|
"system.ai.model.provider_model_count": "{providers} \u30D7\u30ED\u30D0\u30A4\u30C0\u30FC \xB7 {models} \u30E2\u30C7\u30EB",
|
|
420
402
|
"system.ai.model.empty": "\u9078\u629E\u53EF\u80FD\u306A\u30E2\u30C7\u30EB\u304C\u3042\u308A\u307E\u305B\u3093",
|
|
@@ -496,7 +478,6 @@ var zh_TW_default = {
|
|
|
496
478
|
"system.profile.account": "\u8CEC\u865F",
|
|
497
479
|
"system.profile.avatar_change": "\u9EDE\u9078\u4FEE\u6539\u982D\u50CF",
|
|
498
480
|
"system.profile.avatar_upload_failed": "\u4E0A\u50B3\u982D\u50CF\u5931\u6557",
|
|
499
|
-
"system.profile.avatar_update": "\u66F4\u65B0\u982D\u50CF\u66B1\u7A31",
|
|
500
481
|
"system.profile.gender": "\u6027\u5225",
|
|
501
482
|
"system.profile.email": "\u96FB\u5B50\u90F5\u4EF6",
|
|
502
483
|
"system.profile.email_placeholder": "\u8ACB\u8F38\u5165\u96FB\u5B50\u90F5\u4EF6",
|
|
@@ -528,23 +509,18 @@ var zh_TW_default = {
|
|
|
528
509
|
"system.settings.go_ask": "\u53BB\u63D0\u554F",
|
|
529
510
|
"system.notification.title": "\u6D88\u606F",
|
|
530
511
|
"system.notification.sender.system": "\u7CFB\u7D71",
|
|
531
|
-
"system.notification.description": "\u67E5\u770B\u7CFB\u7D71\u901A\u77E5\u548C\u696D\u52D9\u6D88\u606F",
|
|
532
512
|
"system.notification.empty": "\u66AB\u7121\u6D88\u606F",
|
|
533
513
|
"system.notification.empty_inbox_hint": "\u65B0\u8A0A\u606F\u5C07\u5728\u6B64\u986F\u793A",
|
|
534
514
|
"system.notification.empty_unread_hint": "\u5168\u90E8\u8A0A\u606F\u5747\u5DF2\u8B80\u5B8C",
|
|
535
515
|
"system.notification.empty_archived_hint": "\u5C01\u5B58\u7684\u8A0A\u606F\u5C07\u5728\u6B64\u986F\u793A",
|
|
536
|
-
"system.notification.action.view_all": "\u67E5\u770B\u5168\u90E8",
|
|
537
516
|
"system.notification.view.inbox": "\u5168\u90E8",
|
|
538
517
|
"system.notification.view.unread": "\u672A\u8B80",
|
|
539
518
|
"system.notification.view.archived": "\u5DF2\u6B78\u6A94",
|
|
540
|
-
"system.notification.category_filter": "\u5206\u985E ID",
|
|
541
519
|
"system.notification.mark_all_read": "\u5168\u90E8\u5DF2\u8B80",
|
|
542
520
|
"system.notification.action.archive": "\u6B78\u6A94",
|
|
543
521
|
"system.notification.action.restore": "\u6062\u5FA9",
|
|
544
522
|
"system.notification.action.delete": "\u522A\u9664",
|
|
545
|
-
"system.ai.model.provider_placeholder": "\u9078\u64C7\u4F9B\u61C9\u5546",
|
|
546
523
|
"system.ai.model.model_placeholder": "\u9078\u64C7\u6A21\u578B",
|
|
547
|
-
"system.ai.model.load_failed": "\u8F09\u5165\u4F9B\u61C9\u5546\u8207\u6A21\u578B\u5931\u6557",
|
|
548
524
|
"system.ai.model.title": "\u9078\u64C7\u6A21\u578B",
|
|
549
525
|
"system.ai.model.provider_model_count": "{providers} \u500B\u4F9B\u61C9\u5546 \xB7 {models} \u500B\u6A21\u578B",
|
|
550
526
|
"system.ai.model.empty": "\u66AB\u7121\u53EF\u9078\u6A21\u578B",
|
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.
|
|
10
|
+
"version": "0.0.84",
|
|
11
11
|
"type": "module",
|
|
12
12
|
"files": [
|
|
13
13
|
"dist",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"import": "./dist/module.mjs",
|
|
26
26
|
"default": "./dist/module.mjs"
|
|
27
27
|
},
|
|
28
|
+
"./components/*.vue": "./src/components/*.vue",
|
|
28
29
|
"./views/*": "./src/views/*",
|
|
29
30
|
"./package.json": "./package.json"
|
|
30
31
|
},
|
|
@@ -35,7 +36,7 @@
|
|
|
35
36
|
"@dcloudio/uni-app": "3.0.0-5010520260709002",
|
|
36
37
|
"@dcloudio/uni-ui": "^1.4.28",
|
|
37
38
|
"vue": "^3.4.21",
|
|
38
|
-
"@liujitcn/kratos-uni-app-core": "^0.0.
|
|
39
|
+
"@liujitcn/kratos-uni-app-core": "^0.0.84"
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
|
41
42
|
"esbuild": "^0.20.2",
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useSettingStore, useThemeStore, useUserStore } from '@liujitcn/kratos-uni-app-core/stores'
|
|
3
|
+
import { computed } from 'vue'
|
|
4
|
+
import { formatSrc, getMpCapsuleRightGap } from '@liujitcn/kratos-uni-app-core/utils/index'
|
|
5
|
+
import { navigateToLogin } from '@liujitcn/kratos-uni-app-core/utils/navigation'
|
|
6
|
+
import { navigateAppRoute } from '@liujitcn/kratos-uni-app-core'
|
|
7
|
+
import defaultAvatar from '@liujitcn/kratos-uni-app-core/static/images/avatar.png'
|
|
8
|
+
import { useI18n } from '@liujitcn/kratos-uni-app-core'
|
|
9
|
+
|
|
10
|
+
defineOptions({ name: 'KratosMyPage' })
|
|
11
|
+
|
|
12
|
+
defineSlots<{
|
|
13
|
+
/** 在个人信息和 AI 助手之后渲染的项目业务内容。 */
|
|
14
|
+
extensions?: () => unknown
|
|
15
|
+
}>()
|
|
16
|
+
|
|
17
|
+
// 公共个人中心统一复用用户、设置和主题状态。
|
|
18
|
+
const userStore = useUserStore()
|
|
19
|
+
const settingStore = useSettingStore()
|
|
20
|
+
const themeStore = useThemeStore()
|
|
21
|
+
const { t } = useI18n()
|
|
22
|
+
const isLoggedIn = computed(() => userStore.isAuthenticated())
|
|
23
|
+
const profile = computed(() => userStore.userInfo)
|
|
24
|
+
|
|
25
|
+
/** MP-WEIXIN 原生胶囊按钮右侧避让宽度,写入 --mp-capsule-gap 供 .k-top 预留空间。 */
|
|
26
|
+
const capsuleGap = getMpCapsuleRightGap()
|
|
27
|
+
|
|
28
|
+
/** 昵称或占位账号首字符,用于渐变头像兜底。 */
|
|
29
|
+
const avatarText = computed(() => (profile.value?.nick_name || 'U').slice(0, 1))
|
|
30
|
+
|
|
31
|
+
/** 设计稿齿轮线稿,随主题取色的 data URI,替代 CSS 手绘图标。 */
|
|
32
|
+
const gearIcon = computed(() => {
|
|
33
|
+
const color = themeStore.theme === 'light' ? '#102232' : '#e9f4f6'
|
|
34
|
+
const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="${color}" 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>`
|
|
35
|
+
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
/** 个人卡账号行:登录展示账号,未登录提示去登录。 */
|
|
39
|
+
const accountText = computed(() => {
|
|
40
|
+
if (isLoggedIn.value && profile.value) {
|
|
41
|
+
return profile.value.user_name || profile.value.nick_name || ''
|
|
42
|
+
}
|
|
43
|
+
return t('system.profile.login_prompt')
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
/** 打开移动端 AI 助手静态页,未登录时先进入登录流程。 */
|
|
47
|
+
const navigateToAi = () => {
|
|
48
|
+
if (!userStore.ensureAuthenticated()) {
|
|
49
|
+
navigateToLogin()
|
|
50
|
+
return
|
|
51
|
+
}
|
|
52
|
+
navigateAppRoute('app/ai')
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** 打开设置页,未登录时先进入登录流程。 */
|
|
56
|
+
const navigateToSettings = () => {
|
|
57
|
+
if (!userStore.ensureAuthenticated()) {
|
|
58
|
+
navigateToLogin()
|
|
59
|
+
return
|
|
60
|
+
}
|
|
61
|
+
navigateAppRoute('app/settings')
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** 打开当前用户资料。 */
|
|
65
|
+
const navigateToProfile = () => navigateAppRoute('app/profile')
|
|
66
|
+
</script>
|
|
67
|
+
|
|
68
|
+
<template>
|
|
69
|
+
<scroll-view enable-back-to-top class="my-viewport" scroll-y :class="themeStore.themeClass">
|
|
70
|
+
<view class="my-content">
|
|
71
|
+
<!-- 顶栏:标题 + 设置入口(Tab 根页,无返回) -->
|
|
72
|
+
<view class="k-top" :style="{ '--mp-capsule-gap': `${capsuleGap}px` }">
|
|
73
|
+
<view class="k-top__title">{{ t('core.navigation.my') }}</view>
|
|
74
|
+
<view class="k-ic" @tap="navigateToSettings">
|
|
75
|
+
<image class="my-gear" :src="gearIcon" mode="aspectFit" />
|
|
76
|
+
</view>
|
|
77
|
+
</view>
|
|
78
|
+
|
|
79
|
+
<view class="my-stack">
|
|
80
|
+
<!-- 个人资料 -->
|
|
81
|
+
<view class="k-glass k-glass--lit k-pfx my-profile" @tap="navigateToProfile">
|
|
82
|
+
<view class="my-pfx-main">
|
|
83
|
+
<image
|
|
84
|
+
v-if="isLoggedIn && profile"
|
|
85
|
+
class="k-pfx__av"
|
|
86
|
+
:src="profile.avatar ? formatSrc(profile.avatar) : defaultAvatar"
|
|
87
|
+
mode="aspectFill"
|
|
88
|
+
></image>
|
|
89
|
+
<view v-else class="k-pfx__av">{{ avatarText }}</view>
|
|
90
|
+
<view class="my-pfx-meta">
|
|
91
|
+
<view class="k-pfx__nm">
|
|
92
|
+
{{ isLoggedIn && profile ? profile.nick_name : t('system.profile.not_logged_in') }}
|
|
93
|
+
</view>
|
|
94
|
+
<view class="k-pfx__ac">{{ accountText }}</view>
|
|
95
|
+
</view>
|
|
96
|
+
</view>
|
|
97
|
+
<view class="k-pfx__ent">{{ t('system.profile.title') }} ›</view>
|
|
98
|
+
</view>
|
|
99
|
+
|
|
100
|
+
<!-- AI 助手入口 -->
|
|
101
|
+
<view v-if="settingStore.aiEnabled" class="k-aix" @tap="navigateToAi">
|
|
102
|
+
<view class="k-aix__ic">AI</view>
|
|
103
|
+
<view class="my-aix-copy">
|
|
104
|
+
<view class="k-aix__t">{{ t('system.settings.ai_title') }}</view>
|
|
105
|
+
<view class="k-aix__d">{{ t('system.settings.ai_description') }}</view>
|
|
106
|
+
</view>
|
|
107
|
+
<view class="k-aix__b">{{ t('system.settings.go_ask') }}</view>
|
|
108
|
+
</view>
|
|
109
|
+
|
|
110
|
+
<slot name="extensions" />
|
|
111
|
+
</view>
|
|
112
|
+
</view>
|
|
113
|
+
</scroll-view>
|
|
114
|
+
</template>
|
|
115
|
+
|
|
116
|
+
<style lang="scss">
|
|
117
|
+
.my-viewport {
|
|
118
|
+
height: 100%;
|
|
119
|
+
min-height: 100vh;
|
|
120
|
+
box-sizing: border-box;
|
|
121
|
+
background: var(--kratos-bg-gradient);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.my-content {
|
|
125
|
+
padding: calc(env(safe-area-inset-top) + 24rpx) 32rpx calc(40rpx + env(safe-area-inset-bottom));
|
|
126
|
+
|
|
127
|
+
/* #ifdef MP-WEIXIN */
|
|
128
|
+
/* k-top 在小程序端自带 44px 状态栏高度的导航带,页面不再额外让出顶部空间 */
|
|
129
|
+
padding-top: 0;
|
|
130
|
+
/* #endif */
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.my-stack {
|
|
134
|
+
display: flex;
|
|
135
|
+
flex-direction: column;
|
|
136
|
+
gap: 24rpx;
|
|
137
|
+
margin-top: 16rpx;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.my-gear {
|
|
141
|
+
width: 34rpx;
|
|
142
|
+
height: 34rpx;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/* k-pfx 仅定义 flex 排布,卡片内边距交由页面控制 */
|
|
146
|
+
.my-profile {
|
|
147
|
+
padding: 36rpx 30rpx;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.my-pfx-main {
|
|
151
|
+
display: flex;
|
|
152
|
+
align-items: center;
|
|
153
|
+
gap: 24rpx;
|
|
154
|
+
min-width: 0;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.my-pfx-meta {
|
|
158
|
+
min-width: 0;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/* k-aix 中部文案占位伸展 */
|
|
162
|
+
.my-aix-copy {
|
|
163
|
+
flex: 1;
|
|
164
|
+
min-width: 0;
|
|
165
|
+
}
|
|
166
|
+
</style>
|
package/src/locales/en-US.json
CHANGED
|
@@ -68,7 +68,6 @@
|
|
|
68
68
|
"system.profile.account": "Account",
|
|
69
69
|
"system.profile.avatar_change": "Tap to change avatar",
|
|
70
70
|
"system.profile.avatar_upload_failed": "Avatar upload failed",
|
|
71
|
-
"system.profile.avatar_update": "Update avatar and name",
|
|
72
71
|
"system.profile.gender": "Gender",
|
|
73
72
|
"system.profile.email": "Email",
|
|
74
73
|
"system.profile.email_placeholder": "Enter email",
|
|
@@ -100,23 +99,18 @@
|
|
|
100
99
|
"system.settings.go_ask": "Ask now",
|
|
101
100
|
"system.notification.title": "Messages",
|
|
102
101
|
"system.notification.sender.system": "System",
|
|
103
|
-
"system.notification.description": "View system notifications and business messages",
|
|
104
102
|
"system.notification.empty": "No messages",
|
|
105
103
|
"system.notification.empty_inbox_hint": "New messages will appear here",
|
|
106
104
|
"system.notification.empty_unread_hint": "You're all caught up",
|
|
107
105
|
"system.notification.empty_archived_hint": "Archived messages will appear here",
|
|
108
|
-
"system.notification.action.view_all": "View all",
|
|
109
106
|
"system.notification.view.inbox": "All",
|
|
110
107
|
"system.notification.view.unread": "Unread",
|
|
111
108
|
"system.notification.view.archived": "Archived",
|
|
112
|
-
"system.notification.category_filter": "Category ID",
|
|
113
109
|
"system.notification.mark_all_read": "Mark all read",
|
|
114
110
|
"system.notification.action.archive": "Archive",
|
|
115
111
|
"system.notification.action.restore": "Restore",
|
|
116
112
|
"system.notification.action.delete": "Delete",
|
|
117
|
-
"system.ai.model.provider_placeholder": "Select a provider",
|
|
118
113
|
"system.ai.model.model_placeholder": "Select a model",
|
|
119
|
-
"system.ai.model.load_failed": "Failed to load providers and models",
|
|
120
114
|
"system.ai.model.title": "Select Model",
|
|
121
115
|
"system.ai.model.provider_model_count": "{providers} providers · {models} models",
|
|
122
116
|
"system.ai.model.empty": "No models available",
|
package/src/locales/ja-JP.json
CHANGED
|
@@ -68,7 +68,6 @@
|
|
|
68
68
|
"system.profile.account": "アカウント",
|
|
69
69
|
"system.profile.avatar_change": "クリックしてアバターを変更します",
|
|
70
70
|
"system.profile.avatar_upload_failed": "アバターのアップロードに失敗しました",
|
|
71
|
-
"system.profile.avatar_update": "アバターのニックネームを更新",
|
|
72
71
|
"system.profile.gender": "性別",
|
|
73
72
|
"system.profile.email": "メールアドレス",
|
|
74
73
|
"system.profile.email_placeholder": "メールアドレスを入力してください",
|
|
@@ -100,23 +99,18 @@
|
|
|
100
99
|
"system.settings.go_ask": "質問してみよう",
|
|
101
100
|
"system.notification.title": "メッセージ",
|
|
102
101
|
"system.notification.sender.system": "システム",
|
|
103
|
-
"system.notification.description": "システム通知と業務メッセージを確認",
|
|
104
102
|
"system.notification.empty": "メッセージはありません",
|
|
105
103
|
"system.notification.empty_inbox_hint": "新しいメッセージはここに表示されます",
|
|
106
104
|
"system.notification.empty_unread_hint": "すべてのメッセージを既読にしました",
|
|
107
105
|
"system.notification.empty_archived_hint": "アーカイブ済みのメッセージはここに表示されます",
|
|
108
|
-
"system.notification.action.view_all": "すべて表示",
|
|
109
106
|
"system.notification.view.inbox": "すべて",
|
|
110
107
|
"system.notification.view.unread": "未読",
|
|
111
108
|
"system.notification.view.archived": "アーカイブ済み",
|
|
112
|
-
"system.notification.category_filter": "カテゴリID",
|
|
113
109
|
"system.notification.mark_all_read": "すべて既読",
|
|
114
110
|
"system.notification.action.archive": "アーカイブ",
|
|
115
111
|
"system.notification.action.restore": "復元",
|
|
116
112
|
"system.notification.action.delete": "削除",
|
|
117
|
-
"system.ai.model.provider_placeholder": "プロバイダーを選択",
|
|
118
113
|
"system.ai.model.model_placeholder": "モデルを選択",
|
|
119
|
-
"system.ai.model.load_failed": "プロバイダーとモデルを読み込めませんでした",
|
|
120
114
|
"system.ai.model.title": "モデルを選択",
|
|
121
115
|
"system.ai.model.provider_model_count": "{providers} プロバイダー · {models} モデル",
|
|
122
116
|
"system.ai.model.empty": "選択可能なモデルがありません",
|
package/src/locales/zh-CN.json
CHANGED
|
@@ -68,7 +68,6 @@
|
|
|
68
68
|
"system.profile.account": "账号",
|
|
69
69
|
"system.profile.avatar_change": "点击修改头像",
|
|
70
70
|
"system.profile.avatar_upload_failed": "上传头像失败",
|
|
71
|
-
"system.profile.avatar_update": "更新头像昵称",
|
|
72
71
|
"system.profile.gender": "性别",
|
|
73
72
|
"system.profile.email": "邮箱",
|
|
74
73
|
"system.profile.email_placeholder": "请输入邮箱",
|
|
@@ -100,23 +99,18 @@
|
|
|
100
99
|
"system.settings.go_ask": "去提问",
|
|
101
100
|
"system.notification.title": "消息",
|
|
102
101
|
"system.notification.sender.system": "系统",
|
|
103
|
-
"system.notification.description": "查看系统通知和业务消息",
|
|
104
102
|
"system.notification.empty": "暂无消息",
|
|
105
103
|
"system.notification.empty_inbox_hint": "新消息将在此显示",
|
|
106
104
|
"system.notification.empty_unread_hint": "全部消息均已读完",
|
|
107
105
|
"system.notification.empty_archived_hint": "归档的消息将在此显示",
|
|
108
|
-
"system.notification.action.view_all": "查看全部",
|
|
109
106
|
"system.notification.view.inbox": "全部",
|
|
110
107
|
"system.notification.view.unread": "未读",
|
|
111
108
|
"system.notification.view.archived": "已归档",
|
|
112
|
-
"system.notification.category_filter": "分类 ID",
|
|
113
109
|
"system.notification.mark_all_read": "全部已读",
|
|
114
110
|
"system.notification.action.archive": "归档",
|
|
115
111
|
"system.notification.action.restore": "恢复",
|
|
116
112
|
"system.notification.action.delete": "删除",
|
|
117
|
-
"system.ai.model.provider_placeholder": "选择供应商",
|
|
118
113
|
"system.ai.model.model_placeholder": "选择模型",
|
|
119
|
-
"system.ai.model.load_failed": "加载供应商和模型失败",
|
|
120
114
|
"system.ai.model.title": "选择模型",
|
|
121
115
|
"system.ai.model.provider_model_count": "{providers} 个供应商 · {models} 个模型",
|
|
122
116
|
"system.ai.model.empty": "暂无可选模型",
|
package/src/locales/zh-TW.json
CHANGED
|
@@ -68,7 +68,6 @@
|
|
|
68
68
|
"system.profile.account": "賬號",
|
|
69
69
|
"system.profile.avatar_change": "點選修改頭像",
|
|
70
70
|
"system.profile.avatar_upload_failed": "上傳頭像失敗",
|
|
71
|
-
"system.profile.avatar_update": "更新頭像暱稱",
|
|
72
71
|
"system.profile.gender": "性別",
|
|
73
72
|
"system.profile.email": "電子郵件",
|
|
74
73
|
"system.profile.email_placeholder": "請輸入電子郵件",
|
|
@@ -100,23 +99,18 @@
|
|
|
100
99
|
"system.settings.go_ask": "去提問",
|
|
101
100
|
"system.notification.title": "消息",
|
|
102
101
|
"system.notification.sender.system": "系統",
|
|
103
|
-
"system.notification.description": "查看系統通知和業務消息",
|
|
104
102
|
"system.notification.empty": "暫無消息",
|
|
105
103
|
"system.notification.empty_inbox_hint": "新訊息將在此顯示",
|
|
106
104
|
"system.notification.empty_unread_hint": "全部訊息均已讀完",
|
|
107
105
|
"system.notification.empty_archived_hint": "封存的訊息將在此顯示",
|
|
108
|
-
"system.notification.action.view_all": "查看全部",
|
|
109
106
|
"system.notification.view.inbox": "全部",
|
|
110
107
|
"system.notification.view.unread": "未讀",
|
|
111
108
|
"system.notification.view.archived": "已歸檔",
|
|
112
|
-
"system.notification.category_filter": "分類 ID",
|
|
113
109
|
"system.notification.mark_all_read": "全部已讀",
|
|
114
110
|
"system.notification.action.archive": "歸檔",
|
|
115
111
|
"system.notification.action.restore": "恢復",
|
|
116
112
|
"system.notification.action.delete": "刪除",
|
|
117
|
-
"system.ai.model.provider_placeholder": "選擇供應商",
|
|
118
113
|
"system.ai.model.model_placeholder": "選擇模型",
|
|
119
|
-
"system.ai.model.load_failed": "載入供應商與模型失敗",
|
|
120
114
|
"system.ai.model.title": "選擇模型",
|
|
121
115
|
"system.ai.model.provider_model_count": "{providers} 個供應商 · {models} 個模型",
|
|
122
116
|
"system.ai.model.empty": "暫無可選模型",
|
|
@@ -1,157 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { formatSrc, getMpCapsuleRightGap } from '@liujitcn/kratos-uni-app-core/utils/index'
|
|
5
|
-
import { navigateToLogin } from '@liujitcn/kratos-uni-app-core/utils/navigation'
|
|
6
|
-
import { navigateAppRoute } from '@liujitcn/kratos-uni-app-core'
|
|
7
|
-
import defaultAvatar from '@liujitcn/kratos-uni-app-core/static/images/avatar.png'
|
|
8
|
-
import { useI18n } from '@liujitcn/kratos-uni-app-core'
|
|
9
|
-
|
|
10
|
-
// 获取会员信息
|
|
11
|
-
const userStore = useUserStore()
|
|
12
|
-
const settingStore = useSettingStore()
|
|
13
|
-
const themeStore = useThemeStore()
|
|
14
|
-
const { t } = useI18n()
|
|
15
|
-
const isLoggedIn = computed(() => userStore.isAuthenticated())
|
|
16
|
-
const profile = computed(() => userStore.userInfo)
|
|
17
|
-
|
|
18
|
-
/** MP-WEIXIN 原生胶囊按钮右侧避让宽度,写入 --mp-capsule-gap 供 .k-top 预留空间。 */
|
|
19
|
-
const capsuleGap = getMpCapsuleRightGap()
|
|
20
|
-
|
|
21
|
-
/** 昵称或占位账号首字符,用于渐变头像兜底。 */
|
|
22
|
-
const avatarText = computed(() => (profile.value?.nick_name || 'U').slice(0, 1))
|
|
23
|
-
|
|
24
|
-
/** 设计稿齿轮线稿,随主题取色的 data URI,替代 CSS 手绘图标。 */
|
|
25
|
-
const gearIcon = computed(() => {
|
|
26
|
-
const color = themeStore.theme === 'light' ? '#102232' : '#e9f4f6'
|
|
27
|
-
const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="${color}" 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>`
|
|
28
|
-
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
/** 个人卡账号行:登录展示账号,未登录提示去登录。 */
|
|
32
|
-
const accountText = computed(() => {
|
|
33
|
-
if (isLoggedIn.value && profile.value) {
|
|
34
|
-
return profile.value.user_name || profile.value.nick_name || ''
|
|
35
|
-
}
|
|
36
|
-
return t('system.profile.login_prompt')
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
/** 打开移动端 AI 助手静态页,未登录时先进入登录流程。 */
|
|
40
|
-
const navigateToAi = () => {
|
|
41
|
-
if (!userStore.ensureAuthenticated()) {
|
|
42
|
-
navigateToLogin()
|
|
43
|
-
return
|
|
44
|
-
}
|
|
45
|
-
navigateAppRoute('app/ai')
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/** 打开设置页,未登录时先进入登录流程。 */
|
|
49
|
-
const navigateToSettings = () => {
|
|
50
|
-
if (!userStore.ensureAuthenticated()) {
|
|
51
|
-
navigateToLogin()
|
|
52
|
-
return
|
|
53
|
-
}
|
|
54
|
-
navigateAppRoute('app/settings')
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/** 打开当前用户资料。 */
|
|
58
|
-
const navigateToProfile = () => navigateAppRoute('app/profile')
|
|
2
|
+
import KratosMyPage from '@liujitcn/kratos-uni-app-system/components/KratosMyPage.vue'
|
|
3
|
+
import MyExtensions from './components/MyExtensions.vue'
|
|
59
4
|
</script>
|
|
60
5
|
|
|
61
6
|
<template>
|
|
62
|
-
<
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
<view class="k-ic" @tap="navigateToSettings">
|
|
68
|
-
<image class="my-gear" :src="gearIcon" mode="aspectFit" />
|
|
69
|
-
</view>
|
|
70
|
-
</view>
|
|
71
|
-
|
|
72
|
-
<view class="my-stack">
|
|
73
|
-
<!-- 个人资料 -->
|
|
74
|
-
<view class="k-glass k-glass--lit k-pfx my-profile" @tap="navigateToProfile">
|
|
75
|
-
<view class="my-pfx-main">
|
|
76
|
-
<image
|
|
77
|
-
v-if="isLoggedIn && profile"
|
|
78
|
-
class="k-pfx__av"
|
|
79
|
-
:src="profile.avatar ? formatSrc(profile.avatar) : defaultAvatar"
|
|
80
|
-
mode="aspectFill"
|
|
81
|
-
></image>
|
|
82
|
-
<view v-else class="k-pfx__av">{{ avatarText }}</view>
|
|
83
|
-
<view class="my-pfx-meta">
|
|
84
|
-
<view class="k-pfx__nm">
|
|
85
|
-
{{ isLoggedIn && profile ? profile.nick_name : t('system.profile.not_logged_in') }}
|
|
86
|
-
</view>
|
|
87
|
-
<view class="k-pfx__ac">{{ accountText }}</view>
|
|
88
|
-
</view>
|
|
89
|
-
</view>
|
|
90
|
-
<view class="k-pfx__ent">{{ t('system.profile.title') }} ›</view>
|
|
91
|
-
</view>
|
|
92
|
-
|
|
93
|
-
<!-- AI 助手入口 -->
|
|
94
|
-
<view v-if="settingStore.aiEnabled" class="k-aix" @tap="navigateToAi">
|
|
95
|
-
<view class="k-aix__ic">AI</view>
|
|
96
|
-
<view class="my-aix-copy">
|
|
97
|
-
<view class="k-aix__t">{{ t('system.settings.ai_title') }}</view>
|
|
98
|
-
<view class="k-aix__d">{{ t('system.settings.ai_description') }}</view>
|
|
99
|
-
</view>
|
|
100
|
-
<view class="k-aix__b">{{ t('system.settings.go_ask') }}</view>
|
|
101
|
-
</view>
|
|
102
|
-
</view>
|
|
103
|
-
</view>
|
|
104
|
-
</scroll-view>
|
|
7
|
+
<KratosMyPage>
|
|
8
|
+
<template #extensions>
|
|
9
|
+
<MyExtensions />
|
|
10
|
+
</template>
|
|
11
|
+
</KratosMyPage>
|
|
105
12
|
</template>
|
|
106
|
-
|
|
107
|
-
<style lang="scss">
|
|
108
|
-
.my-viewport {
|
|
109
|
-
height: 100%;
|
|
110
|
-
min-height: 100vh;
|
|
111
|
-
box-sizing: border-box;
|
|
112
|
-
background: var(--kratos-bg-gradient);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.my-content {
|
|
116
|
-
padding: calc(env(safe-area-inset-top) + 24rpx) 32rpx calc(40rpx + env(safe-area-inset-bottom));
|
|
117
|
-
|
|
118
|
-
/* #ifdef MP-WEIXIN */
|
|
119
|
-
/* k-top 在小程序端自带 44px 状态栏高度的导航带,页面不再额外让出顶部空间 */
|
|
120
|
-
padding-top: 0;
|
|
121
|
-
/* #endif */
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.my-stack {
|
|
125
|
-
display: flex;
|
|
126
|
-
flex-direction: column;
|
|
127
|
-
gap: 24rpx;
|
|
128
|
-
margin-top: 16rpx;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.my-gear {
|
|
132
|
-
width: 34rpx;
|
|
133
|
-
height: 34rpx;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/* k-pfx 仅定义 flex 排布,卡片内边距交由页面控制 */
|
|
137
|
-
.my-profile {
|
|
138
|
-
padding: 36rpx 30rpx;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.my-pfx-main {
|
|
142
|
-
display: flex;
|
|
143
|
-
align-items: center;
|
|
144
|
-
gap: 24rpx;
|
|
145
|
-
min-width: 0;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.my-pfx-meta {
|
|
149
|
-
min-width: 0;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
/* k-aix 中部文案占位伸展 */
|
|
153
|
-
.my-aix-copy {
|
|
154
|
-
flex: 1;
|
|
155
|
-
min-width: 0;
|
|
156
|
-
}
|
|
157
|
-
</style>
|