@jx3box/jx3box-ui 2.0.5 → 2.0.6

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.
Files changed (226) hide show
  1. package/.storybook/preview.js +22 -13
  2. package/.storybook/storybookMocks.js +191 -0
  3. package/README.md +6 -19
  4. package/assets/css/bread/admin.less +20 -2
  5. package/assets/css/bread/breadcrumb.less +5 -2
  6. package/assets/css/comment/quick-reply.less +1 -1
  7. package/assets/css/common/left-sidebar.less +1 -1
  8. package/assets/css/interact/like2.less +5 -2
  9. package/assets/css/single/author.less +15 -10
  10. package/assets/css/single/cms-single.less +1 -0
  11. package/assets/css/single/thx.less +34 -11
  12. package/assets/data/nav.json +344 -10
  13. package/assets/img/comment/comment.svg +1 -1
  14. package/assets/img/comment/heart_1.svg +1 -1
  15. package/assets/img/comment/hide.svg +1 -1
  16. package/assets/img/leftsidebar/medal.svg +1 -1
  17. package/assets/img/leftsidebar/post.svg +27 -46
  18. package/i18n/messages/en-US.js +357 -22
  19. package/i18n/messages/vi.js +350 -22
  20. package/i18n/messages/zh-CN.js +469 -20
  21. package/i18n/messages/zh-TW.js +350 -22
  22. package/index.js +19 -7
  23. package/package.json +8 -5
  24. package/service/cms.js +22 -0
  25. package/service/commit-history.js +18 -0
  26. package/service/community.js +60 -0
  27. package/service/fav.js +5 -6
  28. package/src/App.vue +154 -80
  29. package/src/Breadcrumb.vue +24 -11
  30. package/src/CommonFooter.vue +2 -2
  31. package/src/Footer.vue +13 -5
  32. package/src/LeftSideToggle.vue +10 -3
  33. package/src/LeftSidebar.vue +19 -5
  34. package/src/Main.vue +9 -2
  35. package/src/RightSidebar.vue +12 -3
  36. package/src/SuspendCommon.vue +52 -38
  37. package/src/author/AuthorFans.vue +7 -5
  38. package/src/author/AuthorFollow.vue +14 -7
  39. package/src/author/AuthorGift.vue +25 -17
  40. package/src/author/AuthorInfo.vue +46 -19
  41. package/src/author/AuthorLink.vue +3 -1
  42. package/src/author/AuthorMedals.vue +5 -2
  43. package/src/author/AuthorPosts.vue +31 -13
  44. package/src/author/AuthorRss.vue +7 -3
  45. package/src/author/AuthorTeams.vue +3 -1
  46. package/src/author/UserPop.vue +29 -17
  47. package/src/bread/Admin.vue +55 -32
  48. package/src/bread/AdminDirectMessage.vue +15 -8
  49. package/src/bread/AdminDrop.vue +124 -45
  50. package/src/bread/CommunityAdmin.vue +527 -0
  51. package/src/bread/DesignTask.vue +30 -26
  52. package/src/bread/ListAdmin.vue +199 -0
  53. package/src/bread/MigrateCommunity.vue +192 -0
  54. package/src/bread/MoveToCommunityDialog.vue +234 -0
  55. package/src/comment/Avatar.vue +18 -24
  56. package/src/comment/CommentContent.vue +57 -37
  57. package/src/comment/CommentContentSimple.vue +61 -63
  58. package/src/comment/CommentInputForm.vue +45 -34
  59. package/src/comment/CommentWithReply.vue +9 -6
  60. package/src/comment/QuickReply.vue +5 -1
  61. package/src/comment/ReplyForReply.vue +6 -4
  62. package/src/comment/ReplyList.vue +28 -18
  63. package/src/comment/Upload.vue +24 -6
  64. package/src/filters/clientBy.vue +10 -8
  65. package/src/filters/markBy.vue +35 -31
  66. package/src/filters/menuBy.vue +20 -22
  67. package/src/filters/orderBy.vue +17 -11
  68. package/src/filters/tagBy.vue +4 -2
  69. package/src/filters/topicBy.vue +12 -10
  70. package/src/filters/versionBy.vue +5 -3
  71. package/src/filters/zlpBy.vue +29 -25
  72. package/src/footer/copyright.vue +5 -5
  73. package/src/footer/links.vue +2 -2
  74. package/src/footer/official.vue +1 -1
  75. package/src/footer/resource.vue +6 -6
  76. package/src/header/alternate.vue +35 -18
  77. package/src/header/asset.vue +9 -19
  78. package/src/header/box.vue +20 -8
  79. package/src/header/box2.vue +16 -9
  80. package/src/header/client.vue +7 -7
  81. package/src/header/lang.vue +41 -6
  82. package/src/header/logo.vue +2 -3
  83. package/src/header/manage.vue +2 -2
  84. package/src/header/message.vue +3 -3
  85. package/src/header/nav.vue +26 -23
  86. package/src/header/publish.vue +2 -2
  87. package/src/header/search.vue +2 -2
  88. package/src/header/shop.vue +2 -2
  89. package/src/header/user.vue +4 -4
  90. package/src/header/userInfo.vue +22 -24
  91. package/src/header/vip.vue +2 -2
  92. package/src/interact/BoxcoinAdmin.vue +30 -16
  93. package/src/interact/BoxcoinRecords.vue +28 -11
  94. package/src/interact/BoxcoinUser.vue +33 -17
  95. package/src/interact/Fav.vue +5 -1
  96. package/src/interact/Homework.vue +318 -0
  97. package/src/interact/Like.vue +4 -2
  98. package/src/interact/Rss.vue +10 -4
  99. package/src/interact/Share.vue +18 -19
  100. package/src/interact/WatchLater.vue +5 -1
  101. package/src/main.js +1 -0
  102. package/src/single/Author.vue +5 -1
  103. package/src/single/CmsSingle.vue +29 -15
  104. package/src/single/Collection.vue +36 -26
  105. package/src/single/Comment.vue +19 -13
  106. package/src/single/Creators.vue +5 -3
  107. package/src/single/PostCollection.vue +158 -0
  108. package/src/single/PostDirectory.vue +0 -126
  109. package/src/single/PostGuide.vue +93 -0
  110. package/src/single/PostHeader.vue +39 -17
  111. package/src/single/PostTopic.vue +3 -3
  112. package/src/single/PostVersion.vue +219 -0
  113. package/src/single/RightAffix.vue +160 -0
  114. package/src/single/SimpleThx.vue +4 -2
  115. package/src/single/Thx.vue +14 -2
  116. package/src/single/VersionDialog.vue +238 -0
  117. package/src/stories/components/StoryPropsTable.vue +137 -0
  118. package/src/stories/filters/FilterGallery.stories.js +110 -0
  119. package/src/stories/filters/clientBy.stories.js +24 -0
  120. package/src/stories/filters/markBy.stories.js +6 -0
  121. package/src/stories/filters/menuBy.stories.js +6 -0
  122. package/src/stories/filters/orderBy.stories.js +6 -0
  123. package/src/stories/filters/tagBy.stories.js +6 -0
  124. package/src/stories/filters/topicBy.stories.js +6 -0
  125. package/src/stories/filters/versionBy.stories.js +6 -0
  126. package/src/stories/filters/zlpBy.stories.js +6 -0
  127. package/src/stories/layout/BaseShell.stories.js +38 -0
  128. package/src/stories/layout/Breadcrumb.stories.js +40 -0
  129. package/src/stories/layout/CommonFooter.stories.js +1 -1
  130. package/src/stories/layout/CommonHeader.stories.js +1 -1
  131. package/src/stories/layout/LeftSideToggle.stories.js +78 -0
  132. package/src/stories/layout/LeftSidebar.stories.js +40 -0
  133. package/src/stories/layout/Main.stories.js +41 -0
  134. package/src/stories/layout/RightSidebar.stories.js +36 -0
  135. package/src/stories/layout/StorybookShell.vue +271 -0
  136. package/src/stories/layout/SuspendCommon.stories.js +67 -0
  137. package/src/stories/layout/SuspendCommonStage.vue +143 -0
  138. package/src/stories/mockData.js +275 -0
  139. package/src/stories/other/UserPop.stories.js +51 -0
  140. package/src/stories/single/Author.stories.js +19 -0
  141. package/src/stories/single/AuthorStoryStage.vue +103 -0
  142. package/src/stories/single/CmsSingle.stories.js +19 -0
  143. package/src/stories/single/CmsSingleStoryStage.vue +118 -0
  144. package/src/stories/single/Collection.stories.js +34 -0
  145. package/src/stories/single/Comment.stories.js +36 -0
  146. package/src/stories/single/Creators.stories.js +34 -0
  147. package/src/stories/single/PostCollection.stories.js +34 -0
  148. package/src/stories/single/PostDirectory.stories.js +31 -0
  149. package/src/stories/single/PostGuide.stories.js +47 -0
  150. package/src/stories/single/PostHeader.stories.js +39 -0
  151. package/src/stories/single/PostVersion.stories.js +41 -0
  152. package/src/stories/single/RightAffix.stories.js +84 -0
  153. package/src/stories/single/SimpleThx.stories.js +39 -0
  154. package/src/stories/single/SingleGallery.stories.js +207 -0
  155. package/src/stories/single/Thx.stories.js +38 -0
  156. package/vue.config.js +2 -12
  157. package/assets/css/common/bottom.less +0 -25
  158. package/assets/css/editor/article.less +0 -36
  159. package/assets/css/editor/combo.less +0 -362
  160. package/assets/css/editor/resource.less +0 -399
  161. package/assets/css/editor/tinymce.less +0 -100
  162. package/assets/css/editor/upload.less +0 -136
  163. package/assets/css/module/author.less +0 -231
  164. package/assets/css/module/buff.less +0 -88
  165. package/assets/css/module/directory.less +0 -165
  166. package/assets/css/module/icon.less +0 -25
  167. package/assets/css/module/item.less +0 -279
  168. package/assets/css/module/item_simple.less +0 -58
  169. package/assets/css/module/jx3_element.less +0 -5
  170. package/assets/css/module/macro.less +0 -89
  171. package/assets/css/module/npc.less +0 -265
  172. package/assets/css/module/resource.less +0 -93
  173. package/assets/css/module/skill.less +0 -74
  174. package/assets/css/module/talent.less +0 -495
  175. package/assets/js/a.js +0 -46
  176. package/assets/js/code.js +0 -13
  177. package/assets/js/combo.js +0 -40
  178. package/assets/js/directory.js +0 -114
  179. package/assets/js/filter2.js +0 -186
  180. package/assets/js/fold.js +0 -11
  181. package/assets/js/gallery.js +0 -14
  182. package/assets/js/hljs_languages.js +0 -177
  183. package/assets/js/iframe.js +0 -38
  184. package/assets/js/img.js +0 -23
  185. package/assets/js/item/attribute_percent.js +0 -88
  186. package/assets/js/item/bind.js +0 -18
  187. package/assets/js/item/border.js +0 -19
  188. package/assets/js/item/border_quest.js +0 -12
  189. package/assets/js/item/color.js +0 -25
  190. package/assets/js/item/hljs_languages.js +0 -177
  191. package/assets/js/item/icon_url.js +0 -15
  192. package/assets/js/item/second_format.js +0 -19
  193. package/assets/js/jx3_element.js +0 -73
  194. package/assets/js/katex.js +0 -181
  195. package/assets/js/macro.js +0 -16
  196. package/assets/js/nextpage.js +0 -4
  197. package/assets/js/pswp.js +0 -67
  198. package/assets/js/pswp_template.js +0 -66
  199. package/assets/js/pz_iframe.js +0 -30
  200. package/assets/js/qixue.js +0 -28
  201. package/assets/js/renderImgPreview.js +0 -18
  202. package/assets/js/script.js +0 -6
  203. package/assets/js/stat.js +0 -107
  204. package/assets/js/talent2.js +0 -21
  205. package/assets/js/tex-mml-chtml.js +0 -36310
  206. package/assets/js/voice.js +0 -238
  207. package/assets/js/xss.js +0 -130
  208. package/src/editor/Article.vue +0 -230
  209. package/src/editor/BoxResource.vue +0 -441
  210. package/src/editor/Resource.vue +0 -623
  211. package/src/editor/Tinymce.vue +0 -204
  212. package/src/editor/Upload.vue +0 -277
  213. package/src/editor/UploadAlum.vue +0 -176
  214. package/src/editor/UploadBanner.vue +0 -156
  215. package/src/editor/components/Author.vue +0 -322
  216. package/src/editor/components/Avatar.vue +0 -95
  217. package/src/editor/components/Buff.vue +0 -80
  218. package/src/editor/components/Combo.vue +0 -259
  219. package/src/editor/components/Equip.vue +0 -299
  220. package/src/editor/components/GameText.vue +0 -242
  221. package/src/editor/components/Item.vue +0 -325
  222. package/src/editor/components/ItemSimple.vue +0 -134
  223. package/src/editor/components/Medal.vue +0 -43
  224. package/src/editor/components/Npc.vue +0 -215
  225. package/src/editor/components/PostAuthor.vue +0 -102
  226. package/src/editor/components/Skill.vue +0 -71
@@ -1,33 +1,33 @@
1
1
  <template>
2
- <span class="w-filter-menu">
3
- <el-dropdown>
4
- <span class="el-dropdown-link">
5
- <span class="u-menu-label">
6
- <el-icon> <operation /> </el-icon>
7
- {{ value ? value : "资料片" }}
8
- <el-icon>
9
- <arrow-down />
10
- </el-icon>
11
- </span>
2
+ <el-dropdown class="w-filter-menu w-filter-zlp">
3
+ <span class="el-dropdown-link">
4
+ <span class="u-menu-label">
5
+ <el-icon> <operation /> </el-icon>
6
+ {{ value ? value : $jx3boxT("jx3boxUi.zlpBy.default", "资料片") }}
7
+ <el-icon>
8
+ <arrow-down />
9
+ </el-icon>
12
10
  </span>
13
- <template #dropdown>
14
- <el-dropdown-menu>
15
- <el-dropdown-item @click="filter('')">
16
- {{ "全部" }}
17
- </el-dropdown-item>
18
- <el-dropdown-item v-for="item in data" :key="item" @click="filter(item)">{{
19
- item
20
- }}</el-dropdown-item>
21
- </el-dropdown-menu>
22
- </template>
23
- </el-dropdown>
24
- </span>
11
+ </span>
12
+ <template #dropdown>
13
+ <el-dropdown-menu class="w-filter-zlp__list">
14
+ <el-dropdown-item @click="filter('')">
15
+ {{ $jx3boxT("jx3boxUi.zlpBy.all", "全部") }}
16
+ </el-dropdown-item>
17
+ <el-dropdown-item v-for="item in data" :key="item" @click="filter(item)">{{
18
+ item
19
+ }}</el-dropdown-item>
20
+ </el-dropdown-menu>
21
+ </template>
22
+ </el-dropdown>
25
23
  </template>
26
24
 
27
25
  <script>
28
26
  import zlps from "@jx3box/jx3box-common/data/jx3_zlp.json";
27
+ import i18nMixin from "../../i18n/mixin";
29
28
  export default {
30
29
  name: "zlpBy",
30
+ mixins: [i18nMixin],
31
31
  emits: ["filter"],
32
32
  props: {
33
33
  client: {
@@ -66,10 +66,14 @@ export default {
66
66
  .w-filter-menu {
67
67
  .pointer;
68
68
  .u-menu-label {
69
- i {
70
- .mr(5px);
71
- }
69
+ .flex;
70
+ align-items: center;
71
+ gap: 5px;
72
72
  .fz(12px);
73
73
  }
74
74
  }
75
+ .w-filter-zlp__list{
76
+ max-height: 200px;
77
+ overflow-y: auto;
78
+ }
75
79
  </style>
@@ -5,9 +5,9 @@
5
5
  >
6
6
  <div class="flex flex-wrap items-center justify-center gap-x-6 gap-y-2 md:justify-start">
7
7
  <span>{{
8
- $jx3boxT("jx3boxUi.footer.copyright", "© 2019-{year} JX3BOX {poweredBy}", {
8
+ $jx3boxT("jx3boxUi.commonFooter.copyright", "© 2019-{year} JX3BOX {poweredBy}", {
9
9
  year: new Date().getFullYear(),
10
- poweredBy: $jx3boxT("jx3boxUi.footer.poweredBy", "All rights reserved."),
10
+ poweredBy: $jx3boxT("jx3boxUi.commonFooter.poweredBy", "All rights reserved."),
11
11
  })
12
12
  }}</span>
13
13
  <a
@@ -16,7 +16,7 @@
16
16
  target="_blank"
17
17
  rel="noopener noreferrer"
18
18
  >
19
- {{ $jx3boxT("jx3boxUi.footer.icp", "湘ICP备2021002288号") }}
19
+ {{ $jx3boxT("jx3boxUi.commonFooter.icp", "湘ICP备2021002288号") }}
20
20
  </a>
21
21
  </div>
22
22
  <div class="mt-4 flex items-center space-x-6 md:mt-0">
@@ -26,7 +26,7 @@
26
26
  target="_blank"
27
27
  rel="noopener noreferrer"
28
28
  >
29
- {{ $jx3boxT("jx3boxUi.footer.contactUs", "联系我们") }}
29
+ {{ $jx3boxT("jx3boxUi.commonFooter.contactUs", "联系我们") }}
30
30
  </a>
31
31
  <a
32
32
  class="text-gray-500 transition-colors hover:text-white"
@@ -34,7 +34,7 @@
34
34
  target="_blank"
35
35
  rel="noopener noreferrer"
36
36
  >
37
- {{ $jx3boxT("jx3boxUi.footer.feedback", "反馈建议") }}
37
+ {{ $jx3boxT("jx3boxUi.commonFooter.feedback", "反馈建议") }}
38
38
  </a>
39
39
  </div>
40
40
  </div>
@@ -3,7 +3,7 @@
3
3
  <div class="grid grid-cols-1 gap-8 sm:grid-cols-3">
4
4
  <div v-for="group in footerGroups" :key="group.title">
5
5
  <h3 class="text-sm font-semibold tracking-wide text-white">
6
- {{ $jx3boxT(`jx3boxUi.footer.${group.key}`, group.title) }}
6
+ {{ $jx3boxT(`jx3boxUi.commonFooter.${group.key}`, group.title) }}
7
7
  </h3>
8
8
  <div class="mt-4 space-y-3">
9
9
  <a
@@ -14,7 +14,7 @@
14
14
  target="_blank"
15
15
  rel="noopener noreferrer"
16
16
  >
17
- {{ $jx3boxT(`jx3boxUi.footer.${item.key}`, item.name) }}
17
+ {{ $jx3boxT(`jx3boxUi.commonFooter.${item.key}`, item.name) }}
18
18
  </a>
19
19
  </div>
20
20
  </div>
@@ -123,7 +123,7 @@ export default {
123
123
  douyin: "douyin",
124
124
  };
125
125
  const tKey = map[item.key] || item.key;
126
- return this.$jx3boxT(`jx3boxUi.footer.${tKey}`, item.name || tKey);
126
+ return this.$jx3boxT(`jx3boxUi.commonFooter.${tKey}`, item.name || tKey);
127
127
  },
128
128
  },
129
129
  created: function () {},
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <section class="lg:col-span-4 lg:col-start-9">
3
3
  <h3 class="text-sm font-semibold tracking-wide text-white">
4
- {{ $jx3boxT("jx3boxUi.footer.downloadCenter", "下载中心") }}
4
+ {{ $jx3boxT("jx3boxUi.commonFooter.downloadCenter", "下载中心") }}
5
5
  </h3>
6
6
  <div class="mt-4 grid grid-cols-1 gap-3 sm:grid-cols-2">
7
7
  <div v-for="item in downloadLinks" :key="item.name">
@@ -86,12 +86,12 @@
86
86
  class="h-6 w-6"
87
87
  svg-inline
88
88
  src="../../assets/img/common/qqbot.svg"
89
- :alt="$jx3boxT('jx3boxUi.footer.qqBot', 'QQ机器人')"
89
+ :alt="$jx3boxT('jx3boxUi.commonFooter.qqBot', 'QQ机器人')"
90
90
  />
91
91
  </div>
92
92
  <div @click="copyText('3889010020')" class="cursor-pointer">
93
93
  <p class="font-bold uppercase tracking-wider text-gray-500" style="font-size: 10px">
94
- {{ $jx3boxT("jx3boxUi.footer.qqBotService", "QQ 机器人服务") }}
94
+ {{ $jx3boxT("jx3boxUi.commonFooter.qqBotService", "QQ 机器人服务") }}
95
95
  </p>
96
96
  <p class="mt-1 font-mono text-sm font-semibold text-white">3889 010 020</p>
97
97
  </div>
@@ -102,7 +102,7 @@
102
102
  target="_blank"
103
103
  rel="noopener noreferrer"
104
104
  >
105
- {{ $jx3boxT("jx3boxUi.footer.add", "添加") }}
105
+ {{ $jx3boxT("jx3boxUi.commonFooter.add", "添加") }}
106
106
  </a>
107
107
  </div>
108
108
  </section>
@@ -162,13 +162,13 @@ export default {
162
162
  getDownloadName(item) {
163
163
  if (item?.key) {
164
164
  const k = item.key === "harmonyNext" ? "harmonyNext" : item.key;
165
- const maybe = `jx3boxUi.footer.${k}`;
165
+ const maybe = `jx3boxUi.commonFooter.${k}`;
166
166
  return this.$jx3boxT(maybe, item.name || k);
167
167
  }
168
168
  return item?.name || "";
169
169
  },
170
170
  getDownloadLabel(item) {
171
- if (item?.labelKey) return this.$jx3boxT(`jx3boxUi.footer.${item.labelKey}`, item.label || item.labelKey);
171
+ if (item?.labelKey) return this.$jx3boxT(`jx3boxUi.commonFooter.${item.labelKey}`, item.label || item.labelKey);
172
172
  return item?.label || "";
173
173
  },
174
174
  handleLinkClick(e, item) {
@@ -4,7 +4,7 @@
4
4
  v-model="visible"
5
5
  custom-class="c-alternate"
6
6
  width="320px"
7
- :title="$jx3boxT('jx3boxUi.alternate.title', '切换马甲')"
7
+ :title="$jx3boxT('jx3boxUi.commonHeader.alternate.title', '切换马甲')"
8
8
  >
9
9
  <div class="c-alternate__content">
10
10
  <div
@@ -20,14 +20,14 @@
20
20
  </div>
21
21
  <div class="m-misc">
22
22
  <span class="u-name"
23
- ><span class="u-label">{{ $jx3boxT("jx3boxUi.alternate.userNickname", "用户昵称:") }}</span
23
+ ><span class="u-label">{{ $jx3boxT("jx3boxUi.commonHeader.alternate.userNickname", "用户昵称:") }}</span
24
24
  >{{ item.name }}</span
25
25
  >
26
26
  <span class="u-time">
27
- <span class="u-label">{{ $jx3boxT("jx3boxUi.alternate.lastLogin", "上次登录:") }}</span
27
+ <span class="u-label">{{ $jx3boxT("jx3boxUi.commonHeader.alternate.lastLogin", "上次登录:") }}</span
28
28
  >{{ getFormatTime(item.created_at) }}
29
29
  <span class="u-extra" v-if="isExpired(item.created_at)">{{
30
- $jx3boxT("jx3boxUi.alternate.expired", "(已过期)")
30
+ $jx3boxT("jx3boxUi.commonHeader.alternate.expired", "(已过期)")
31
31
  }}</span>
32
32
  </span>
33
33
  </div>
@@ -75,11 +75,18 @@ export default {
75
75
  },
76
76
  },
77
77
  mounted() {
78
- Bus.on("showAlternate", () => {
78
+ this.__showAlternateHandler = () => {
79
79
  this.visible = true;
80
- });
80
+ };
81
+ Bus.on("showAlternate", this.__showAlternateHandler);
81
82
  this.init();
82
83
  },
84
+ beforeUnmount() {
85
+ if (this.__showAlternateHandler) {
86
+ Bus.off("showAlternate", this.__showAlternateHandler);
87
+ this.__showAlternateHandler = null;
88
+ }
89
+ },
83
90
  methods: {
84
91
  init() {
85
92
  // 获取localStorage中以jx3box-alternate-开头的数据
@@ -138,17 +145,23 @@ export default {
138
145
  // 选择马甲
139
146
  onSelectAlternate(item) {
140
147
  if (this.isExpired(item.created_at)) {
141
- this.$message.error(this.$jx3boxT("jx3boxUi.alternate.expiredNeedRelogin", "该马甲已过期,请重新登录"));
148
+ this.$message.error(
149
+ this.$jx3boxT("jx3boxUi.commonHeader.alternate.expiredNeedRelogin", "该马甲已过期,请重新登录")
150
+ );
142
151
  return;
143
152
  }
144
153
  if (this.profile.uid == item.uid) {
145
154
  return;
146
155
  }
147
- this.$confirm(this.$jx3boxT("jx3boxUi.alternate.switchConfirm", "确定要切换到该马甲吗?"), this.$jx3boxT("jx3boxUi.common.tip", "提示"), {
148
- confirmButtonText: this.$jx3boxT("jx3boxUi.common.confirm", "确定"),
149
- cancelButtonText: this.$jx3boxT("jx3boxUi.common.cancel", "取消"),
150
- type: "warning",
151
- })
156
+ this.$confirm(
157
+ this.$jx3boxT("jx3boxUi.commonHeader.alternate.switchConfirm", "确定要切换到该马甲吗?"),
158
+ this.$jx3boxT("jx3boxUi.common.tip", "提示"),
159
+ {
160
+ confirmButtonText: this.$jx3boxT("jx3boxUi.common.confirm", "确定"),
161
+ cancelButtonText: this.$jx3boxT("jx3boxUi.common.cancel", "取消"),
162
+ type: "warning",
163
+ }
164
+ )
152
165
  .then(() => {
153
166
  User.update(item).then(async () => {
154
167
  localStorage.setItem(
@@ -167,11 +180,15 @@ export default {
167
180
  },
168
181
  // 删除马甲
169
182
  onRemoveAlternate(item) {
170
- this.$confirm(this.$jx3boxT("jx3boxUi.alternate.deleteConfirm", "确定要删除该马甲吗?"), this.$jx3boxT("jx3boxUi.common.tip", "提示"), {
171
- confirmButtonText: this.$jx3boxT("jx3boxUi.common.confirm", "确定"),
172
- cancelButtonText: this.$jx3boxT("jx3boxUi.common.cancel", "取消"),
173
- type: "warning",
174
- })
183
+ this.$confirm(
184
+ this.$jx3boxT("jx3boxUi.commonHeader.alternate.deleteConfirm", "确定要删除该马甲吗?"),
185
+ this.$jx3boxT("jx3boxUi.common.tip", "提示"),
186
+ {
187
+ confirmButtonText: this.$jx3boxT("jx3boxUi.common.confirm", "确定"),
188
+ cancelButtonText: this.$jx3boxT("jx3boxUi.common.cancel", "取消"),
189
+ type: "warning",
190
+ }
191
+ )
175
192
  .then(() => {
176
193
  localStorage.removeItem("jx3box-alternate-" + item.uid);
177
194
 
@@ -182,7 +199,7 @@ export default {
182
199
  // 新增马甲
183
200
  onAddAlternate() {
184
201
  if (this.overLength) {
185
- this.$message.error(this.$jx3boxT("jx3boxUi.alternate.maxFive", "最多只能添加5个马甲"));
202
+ this.$message.error(this.$jx3boxT("jx3boxUi.commonHeader.alternate.maxFive", "最多只能添加5个马甲"));
186
203
  return;
187
204
  }
188
205
  // 跳转至登录页
@@ -5,7 +5,7 @@
5
5
  class="u-icon"
6
6
  svg-inline
7
7
  src="../../assets/img/common/coin.svg"
8
- :alt="$jx3boxT('jx3boxUi.header.asset', '资产')"
8
+ :alt="$jx3boxT('jx3boxUi.commonHeader.asset', '资产')"
9
9
  />
10
10
  </a>
11
11
 
@@ -14,7 +14,7 @@
14
14
  <span class="u-item">
15
15
  <a class="u-item-primary" href="/about/incentives" :target="target">
16
16
  <span class="u-label"
17
- ><el-icon><User /></el-icon> {{ $jx3boxT("jx3boxUi.header.level", "等级") }}</span
17
+ ><el-icon><User /></el-icon> {{ $jx3boxT("jx3boxUi.commonHeader.level", "等级") }}</span
18
18
  >
19
19
  <span class="u-value u-level" :style="levelStyle">Lv.{{ level }}</span>
20
20
  </a>
@@ -23,49 +23,39 @@
23
23
  <span class="u-item">
24
24
  <a class="u-item-primary" href="/dashboard/boxcoin" :target="target"
25
25
  ><span class="u-label"
26
- ><el-icon><Coin /></el-icon> {{ $jx3boxT("jx3boxUi.header.boxCoin", "盒币") }}</span
26
+ ><el-icon><Coin /></el-icon> {{ $jx3boxT("jx3boxUi.commonHeader.boxCoin", "盒币") }}</span
27
27
  >
28
28
  <span class="u-value">{{ asset.box_coin }}</span></a
29
29
  >
30
30
  <span class="u-item-extend"
31
31
  ><a href="/dashboard/boxcoin" :target="target"
32
- >[{{ $jx3boxT("jx3boxUi.header.exchangeTongbao", "兑换通宝") }}]</a
32
+ >[{{ $jx3boxT("jx3boxUi.commonHeader.exchangeTongbao", "兑换通宝") }}]</a
33
33
  ></span
34
34
  >
35
35
  </span>
36
- <!-- <span class="u-item">
37
- <a class="u-item-primary" href="/dashboard/cny" :target="target"
38
- ><span class="u-label"><i class="el-icon-wallet"></i> 金箔</span
39
- ><span class="u-value">{{ asset.cny }}</span></a
40
- >
41
- <span class="u-item-extend"
42
- ><a href="/vip/cny" :target="target">[充值]</a>
43
- <a href="/dashboard/cny" :target="target">[提现]</a></span
44
- >
45
- </span> -->
46
36
  <span class="u-item">
47
37
  <a class="u-item-primary" href="/dashboard/points" :target="target"
48
38
  ><span class="u-label"
49
- ><el-icon><Sugar /></el-icon> {{ $jx3boxT("jx3boxUi.header.points", "积分") }}</span
39
+ ><el-icon><Sugar /></el-icon> {{ $jx3boxT("jx3boxUi.commonHeader.points", "积分") }}</span
50
40
  >
51
41
  <span class="u-value">{{ asset.points }}</span></a
52
42
  >
53
43
  <span class="u-item-extend"
54
- ><a href="/vip/mall" :target="target">[{{ $jx3boxT("jx3boxUi.header.redeem", "兑礼") }}]</a
44
+ ><a href="/vip/mall" :target="target">[{{ $jx3boxT("jx3boxUi.commonHeader.redeem", "兑礼") }}]</a
55
45
  ><a href="/vip/lottery" :target="target"
56
- >[{{ $jx3boxT("jx3boxUi.header.lottery", "抽奖") }}]</a
46
+ >[{{ $jx3boxT("jx3boxUi.commonHeader.lottery", "抽奖") }}]</a
57
47
  ></span
58
48
  >
59
49
  </span>
60
50
  <span class="u-item">
61
51
  <a class="u-item-primary" href="/dashboard/card" :target="target"
62
52
  ><span class="u-label"
63
- ><el-icon><CreditCard /></el-icon> {{ $jx3boxT("jx3boxUi.header.card", "卡密") }}</span
53
+ ><el-icon><CreditCard /></el-icon> {{ $jx3boxT("jx3boxUi.commonHeader.card", "卡密") }}</span
64
54
  >
65
55
  <span class="u-value">{{ asset.ext_info ? asset.ext_info.keycode : 0 }}</span></a
66
56
  >
67
57
  <span class="u-item-extend"
68
- ><a href="/dashboard/card" :target="target">[{{ $jx3boxT("jx3boxUi.header.view", "查看") }}]</a></span
58
+ ><a href="/dashboard/card" :target="target">[{{ $jx3boxT("jx3boxUi.commonHeader.view", "查看") }}]</a></span
69
59
  >
70
60
  </span>
71
61
  </div>
@@ -9,20 +9,19 @@
9
9
  <a class="u-item" href="/index">
10
10
  <img class="u-pic" svg-inline :src="homeicon" />
11
11
  <img class="u-pic-hover" svg-inline :src="homeicon" />
12
- <span class="u-txt">{{ $jx3boxT("jx3boxUi.header.home", "首页") }}</span>
12
+ <span class="u-txt">{{ $jx3boxT("jx3boxUi.commonHeader.home", "首页") }}</span>
13
13
  </a>
14
14
  </li>
15
15
  <li v-for="(item, i) in list" :key="i" :class="{ 'u-app-start': item.lf }">
16
16
  <a class="u-item" :href="item.href" :target="getTarget(item.href)">
17
17
  <img class="u-pic" :src="getBoxIcon(item.img)" />
18
- <!-- <img class="u-pic-hover" svg-inline :src="item.hover | getBoxIcon" /> -->
19
18
  <span class="u-txt">{{ item.abbr }}</span>
20
19
  </a>
21
20
  </li>
22
21
  </ul>
23
22
  <span class="u-close" @click="closeBox($event)">
24
- <i class="el-icon-upload2"></i>
25
- <span>{{ $jx3boxT("jx3boxUi.header.collapse", "收起") }}</span>
23
+ <el-icon><Upload /></el-icon>
24
+ <span>{{ $jx3boxT("jx3boxUi.commonHeader.collapse", "收起") }}</span>
26
25
  </span>
27
26
  </div>
28
27
  </template>
@@ -126,16 +125,29 @@ export default {
126
125
  this.loadMenu();
127
126
  },
128
127
  mounted: function () {
129
- Bus.on("toggleBox", (status) => {
128
+ this.__toggleBoxHandler = (status) => {
130
129
  if (status == undefined) {
131
130
  this.status = !this.status;
132
131
  } else {
133
132
  this.status = status;
134
133
  }
135
- });
136
- document.addEventListener("click", function () {
134
+ };
135
+ Bus.on("toggleBox", this.__toggleBoxHandler);
136
+
137
+ this.__docClickHandler = () => {
137
138
  Bus.emit("toggleBox", false);
138
- });
139
+ };
140
+ document.addEventListener("click", this.__docClickHandler);
141
+ },
142
+ beforeUnmount() {
143
+ if (this.__toggleBoxHandler) {
144
+ Bus.off("toggleBox", this.__toggleBoxHandler);
145
+ this.__toggleBoxHandler = null;
146
+ }
147
+ if (this.__docClickHandler) {
148
+ document.removeEventListener("click", this.__docClickHandler);
149
+ this.__docClickHandler = null;
150
+ }
139
151
  },
140
152
  components: {
141
153
  "header-search": search,
@@ -10,15 +10,20 @@
10
10
  <img svg-inline src="../../assets/img/common/logo.svg" alt="JX3BOX" />
11
11
  </div>
12
12
  <div>
13
- <h2 class="u-title">魔盒矩阵</h2>
13
+ <h2 class="u-title">{{ $jx3boxT("jx3boxUi.box2.title", "魔盒矩阵") }}</h2>
14
14
  <p class="u-subtitle">THE BOX MATRIX NAVIGATION</p>
15
15
  </div>
16
16
  </div>
17
17
  <div class="u-search">
18
- <i class="el-icon-search u-search-icon"></i>
19
- <input v-model.trim="searchQuery" class="u-search-input" type="text" placeholder="搜索应用" />
18
+ <el-icon class="u-search-icon"><Search></Search></el-icon>
19
+ <input
20
+ v-model.trim="searchQuery"
21
+ class="u-search-input"
22
+ type="text"
23
+ :placeholder="$jx3boxT('jx3boxUi.box2.searchPlaceholder', '搜索应用')"
24
+ />
20
25
  <button v-if="searchQuery" class="u-search-clear" type="button" @click="searchQuery = ''">
21
- <i class="el-icon-close"></i>
26
+ <el-icon><Close /></el-icon>
22
27
  </button>
23
28
  </div>
24
29
  </div>
@@ -30,7 +35,7 @@
30
35
  <div class="u-icon-wrap">
31
36
  <img class="u-pic" svg-inline :src="homeicon" />
32
37
  </div>
33
- <span class="u-txt">{{ $jx3boxT("jx3boxUi.header.home", "首页") }}</span>
38
+ <span class="u-txt">{{ $jx3boxT("jx3boxUi.commonHeader.home", "首页") }}</span>
34
39
  </a>
35
40
  </li>
36
41
  <li v-for="(item, i) in filteredList" :key="i">
@@ -46,12 +51,12 @@
46
51
  <div class="u-icon-wrap">
47
52
  <img class="u-pic" svg-inline :src="allicon" />
48
53
  </div>
49
- <span class="u-txt">{{ $jx3boxT("jx3boxUi.header.all", "全部") }}</span>
54
+ <span class="u-txt">{{ $jx3boxT("jx3boxUi.commonHeader.all", "全部") }}</span>
50
55
  </a>
51
56
  </li>
52
57
  </ul>
53
58
  <div v-if="searchQuery && !homeMatched && filteredList.length === 0" class="u-empty">
54
- 未找到匹配应用
59
+ {{ $jx3boxT("jx3boxUi.box2.empty", "未找到匹配应用") }}
55
60
  </div>
56
61
  </div>
57
62
  </section>
@@ -120,12 +125,12 @@ export default {
120
125
  homeMatched: function () {
121
126
  const query = (this.searchQuery || "").toLowerCase().trim();
122
127
  if (!query) return true;
123
- return this.$jx3boxT("jx3boxUi.header.home", "首页").includes(query);
128
+ return this.$jx3boxT("jx3boxUi.commonHeader.home", "首页").includes(query);
124
129
  },
125
130
  allMatched: function () {
126
131
  const query = (this.searchQuery || "").toLowerCase().trim();
127
132
  if (!query) return true;
128
- return this.$jx3boxT("jx3boxUi.header.all", "全部").includes(query);
133
+ return this.$jx3boxT("jx3boxUi.commonHeader.all", "全部").includes(query);
129
134
  },
130
135
  },
131
136
  methods: {
@@ -334,6 +339,8 @@ export default {
334
339
  width: min(460px, 100%);
335
340
  margin-left: auto;
336
341
  position: relative;
342
+ .flex;
343
+ align-items: center;
337
344
  }
338
345
 
339
346
  .u-search-input {
@@ -25,7 +25,7 @@
25
25
  role="menu"
26
26
  >
27
27
  <div class="px-3 py-2 text-[10px] text-gray-500 uppercase tracking-widest border-b border-gray-800 mb-1">
28
- {{ $jx3boxT("jx3boxUi.header.chooseGameVersion", "选择游戏版本") }}
28
+ {{ $jx3boxT("jx3boxUi.commonHeader.chooseGameVersion", "选择游戏版本") }}
29
29
  </div>
30
30
 
31
31
  <!-- 剑网3 -->
@@ -45,13 +45,13 @@
45
45
  class="w-4 h-4"
46
46
  svg-inline
47
47
  src="../../assets/img/common/jx3-www.svg"
48
- :alt="$jx3boxT('jx3boxUi.header.jx3Full', '剑网3 / 无界')"
48
+ :alt="$jx3boxT('jx3boxUi.commonHeader.jx3Full', '剑网3 / 无界')"
49
49
  />
50
50
  <!-- <Jx3Icon class="w-4 h-4" /> -->
51
51
  </span>
52
52
  <div>
53
53
  <div class="text-sm font-bold text-gray-200 group-hover/item:text-white">
54
- {{ $jx3boxT("jx3boxUi.header.jx3Full", "剑网3 / 无界") }}
54
+ {{ $jx3boxT("jx3boxUi.commonHeader.jx3Full", "剑网3 / 无界") }}
55
55
  </div>
56
56
  <div class="text-[10px] text-gray-500 group-hover/item:text-indigo-200">www.jx3box.com</div>
57
57
  </div>
@@ -79,13 +79,13 @@
79
79
  class="w-4 h-4"
80
80
  svg-inline
81
81
  src="../../assets/img/common/jx3-origin.svg"
82
- :alt="$jx3boxT('jx3boxUi.header.originFull', '剑网3·缘起')"
82
+ :alt="$jx3boxT('jx3boxUi.commonHeader.originFull', '剑网3·缘起')"
83
83
  />
84
84
  <!-- <OriginIcon class="w-4 h-4" /> -->
85
85
  </span>
86
86
  <div>
87
87
  <div class="text-sm font-bold text-gray-200 group-hover/item:text-white">
88
- {{ $jx3boxT("jx3boxUi.header.originFull", "剑网3·缘起") }}
88
+ {{ $jx3boxT("jx3boxUi.commonHeader.originFull", "剑网3·缘起") }}
89
89
  </div>
90
90
  <div class="text-[10px] text-gray-500 group-hover/item:text-indigo-200">origin.jx3box.com</div>
91
91
  </div>
@@ -121,8 +121,8 @@ export default {
121
121
  computed: {
122
122
  currentGameLabel: function () {
123
123
  return this.activeKey === "origin"
124
- ? this.$jx3boxT("jx3boxUi.header.originShort", "缘起")
125
- : this.$jx3boxT("jx3boxUi.header.jx3Short", "剑网3");
124
+ ? this.$jx3boxT("jx3boxUi.commonHeader.originShort", "缘起")
125
+ : this.$jx3boxT("jx3boxUi.commonHeader.jx3Short", "剑网3");
126
126
  },
127
127
  },
128
128
  watch: {
@@ -5,7 +5,7 @@
5
5
  class="u-icon"
6
6
  svg-inline
7
7
  src="../../assets/img/common/lang.svg"
8
- :alt="$jx3boxT('jx3boxUi.header.langSwitch', '语言切换')"
8
+ :alt="$jx3boxT('jx3boxUi.commonHeader.langSwitch', '语言切换')"
9
9
  />
10
10
  </span>
11
11
  <ul class="u-menu u-pop-content">
@@ -25,6 +25,8 @@
25
25
  // import langIcon from "@/assets/img/components/common/header/lang.svg";
26
26
  import { getJx3boxUiAvailableLocales, setJx3boxUiLocale } from "../../i18n";
27
27
  import i18nMixin from "../../i18n/mixin";
28
+ import User from "@jx3box/jx3box-common/js/user";
29
+ import { getUserConfig, setUserConfig } from "../../service/cms";
28
30
 
29
31
  function normalizeLocaleKey(key) {
30
32
  if (!key) return null;
@@ -41,6 +43,11 @@ export default {
41
43
  components: {
42
44
  // langIcon,
43
45
  },
46
+ computed: {
47
+ isLogin() {
48
+ return User.isLogin();
49
+ }
50
+ },
44
51
  data() {
45
52
  const supported = getJx3boxUiAvailableLocales();
46
53
  return {
@@ -70,10 +77,7 @@ export default {
70
77
  };
71
78
  },
72
79
  mounted() {
73
- const lang = localStorage.getItem("lang") || "zh-cn";
74
- this.currentLang = lang;
75
- const normalized = normalizeLocaleKey(lang);
76
- normalized && setJx3boxUiLocale(normalized);
80
+ this.init();
77
81
  },
78
82
  methods: {
79
83
  onLangChange({ disabled, key }) {
@@ -85,8 +89,39 @@ export default {
85
89
  if (!normalized) return;
86
90
 
87
91
  const ok = setJx3boxUiLocale(normalized);
88
- if (ok) location.reload();
92
+ if (ok) {
93
+ if (this.isLogin) {
94
+ setUserConfig({ default_lang: key }).then(() => {
95
+ location.reload();
96
+ });
97
+ } else {
98
+ location.reload();
99
+ }
100
+ }
89
101
  },
102
+ init() {
103
+ if (!this.isLogin) {
104
+ const lang = localStorage.getItem("lang") || "zh-cn";
105
+ this.currentLang = lang;
106
+ const normalized = normalizeLocaleKey(lang);
107
+ normalized && setJx3boxUiLocale(normalized);
108
+ } else {
109
+ const lang = localStorage.getItem("lang");
110
+ if (lang) {
111
+ this.currentLang = lang;
112
+ const normalized = normalizeLocaleKey(lang);
113
+ normalized && setJx3boxUiLocale(normalized);
114
+ } else {
115
+ getUserConfig({ key: "default_lang" }).then((res) => {
116
+ const defaultLang = res || "zh-cn";
117
+ this.currentLang = defaultLang;
118
+ const normalized = normalizeLocaleKey(defaultLang);
119
+ normalized && setJx3boxUiLocale(normalized);
120
+ localStorage.setItem("lang", defaultLang);
121
+ });
122
+ }
123
+ }
124
+ }
90
125
  },
91
126
  };
92
127
  </script>