@jx3box/jx3box-ui 2.0.4 → 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 (227) hide show
  1. package/.storybook/main.js +208 -0
  2. package/.storybook/preview.js +93 -0
  3. package/.storybook/storybookMocks.js +191 -0
  4. package/README.md +29 -82
  5. package/assets/css/bread/admin.less +20 -2
  6. package/assets/css/bread/breadcrumb.less +5 -2
  7. package/assets/css/comment/quick-reply.less +1 -1
  8. package/assets/css/common/left-sidebar.less +1 -1
  9. package/assets/css/interact/like2.less +5 -2
  10. package/assets/css/single/author.less +15 -10
  11. package/assets/css/single/cms-single.less +1 -0
  12. package/assets/css/single/thx.less +34 -11
  13. package/assets/data/nav.json +344 -10
  14. package/assets/img/comment/comment.svg +1 -1
  15. package/assets/img/comment/heart_1.svg +1 -1
  16. package/assets/img/comment/hide.svg +1 -1
  17. package/assets/img/leftsidebar/medal.svg +1 -1
  18. package/assets/img/leftsidebar/post.svg +27 -46
  19. package/i18n/messages/en-US.js +357 -22
  20. package/i18n/messages/vi.js +350 -22
  21. package/i18n/messages/zh-CN.js +469 -20
  22. package/i18n/messages/zh-TW.js +350 -22
  23. package/index.js +19 -7
  24. package/package.json +15 -5
  25. package/service/cms.js +22 -0
  26. package/service/commit-history.js +18 -0
  27. package/service/community.js +60 -0
  28. package/service/fav.js +5 -6
  29. package/src/App.vue +154 -80
  30. package/src/Breadcrumb.vue +24 -11
  31. package/src/CommonFooter.vue +4 -4
  32. package/src/Footer.vue +13 -5
  33. package/src/LeftSideToggle.vue +10 -3
  34. package/src/LeftSidebar.vue +19 -5
  35. package/src/Main.vue +9 -2
  36. package/src/RightSidebar.vue +12 -3
  37. package/src/SuspendCommon.vue +52 -38
  38. package/src/author/AuthorFans.vue +7 -5
  39. package/src/author/AuthorFollow.vue +14 -7
  40. package/src/author/AuthorGift.vue +25 -17
  41. package/src/author/AuthorInfo.vue +46 -19
  42. package/src/author/AuthorLink.vue +3 -1
  43. package/src/author/AuthorMedals.vue +5 -2
  44. package/src/author/AuthorPosts.vue +31 -13
  45. package/src/author/AuthorRss.vue +7 -3
  46. package/src/author/AuthorTeams.vue +3 -1
  47. package/src/author/UserPop.vue +29 -17
  48. package/src/bread/Admin.vue +55 -32
  49. package/src/bread/AdminDirectMessage.vue +15 -8
  50. package/src/bread/AdminDrop.vue +124 -45
  51. package/src/bread/CommunityAdmin.vue +527 -0
  52. package/src/bread/DesignTask.vue +30 -26
  53. package/src/bread/ListAdmin.vue +199 -0
  54. package/src/bread/MigrateCommunity.vue +192 -0
  55. package/src/bread/MoveToCommunityDialog.vue +234 -0
  56. package/src/comment/Avatar.vue +18 -24
  57. package/src/comment/CommentContent.vue +57 -37
  58. package/src/comment/CommentContentSimple.vue +61 -63
  59. package/src/comment/CommentInputForm.vue +45 -34
  60. package/src/comment/CommentWithReply.vue +9 -6
  61. package/src/comment/QuickReply.vue +5 -1
  62. package/src/comment/ReplyForReply.vue +6 -4
  63. package/src/comment/ReplyList.vue +28 -18
  64. package/src/comment/Upload.vue +24 -6
  65. package/src/filters/clientBy.vue +10 -8
  66. package/src/filters/markBy.vue +35 -31
  67. package/src/filters/menuBy.vue +20 -22
  68. package/src/filters/orderBy.vue +17 -11
  69. package/src/filters/tagBy.vue +4 -2
  70. package/src/filters/topicBy.vue +12 -10
  71. package/src/filters/versionBy.vue +5 -3
  72. package/src/filters/zlpBy.vue +29 -25
  73. package/src/footer/copyright.vue +5 -5
  74. package/src/footer/links.vue +2 -2
  75. package/src/footer/official.vue +1 -1
  76. package/src/footer/resource.vue +41 -8
  77. package/src/header/alternate.vue +35 -18
  78. package/src/header/asset.vue +9 -19
  79. package/src/header/box.vue +20 -8
  80. package/src/header/box2.vue +25 -13
  81. package/src/header/client.vue +7 -7
  82. package/src/header/lang.vue +41 -6
  83. package/src/header/logo.vue +2 -3
  84. package/src/header/manage.vue +2 -2
  85. package/src/header/message.vue +3 -3
  86. package/src/header/nav.vue +26 -23
  87. package/src/header/publish.vue +2 -2
  88. package/src/header/search.vue +2 -2
  89. package/src/header/shop.vue +2 -2
  90. package/src/header/user.vue +4 -4
  91. package/src/header/userInfo.vue +22 -24
  92. package/src/header/vip.vue +2 -2
  93. package/src/interact/BoxcoinAdmin.vue +30 -16
  94. package/src/interact/BoxcoinRecords.vue +28 -11
  95. package/src/interact/BoxcoinUser.vue +33 -17
  96. package/src/interact/Fav.vue +5 -1
  97. package/src/interact/Homework.vue +318 -0
  98. package/src/interact/Like.vue +4 -2
  99. package/src/interact/Rss.vue +10 -4
  100. package/src/interact/Share.vue +18 -19
  101. package/src/interact/WatchLater.vue +5 -1
  102. package/src/main.js +1 -0
  103. package/src/single/Author.vue +5 -1
  104. package/src/single/CmsSingle.vue +29 -15
  105. package/src/single/Collection.vue +36 -26
  106. package/src/single/Comment.vue +19 -13
  107. package/src/single/Creators.vue +5 -3
  108. package/src/single/PostCollection.vue +158 -0
  109. package/src/single/PostDirectory.vue +0 -126
  110. package/src/single/PostGuide.vue +93 -0
  111. package/src/single/PostHeader.vue +39 -17
  112. package/src/single/PostTopic.vue +3 -3
  113. package/src/single/PostVersion.vue +219 -0
  114. package/src/single/RightAffix.vue +160 -0
  115. package/src/single/SimpleThx.vue +4 -2
  116. package/src/single/Thx.vue +14 -2
  117. package/src/single/VersionDialog.vue +238 -0
  118. package/src/stories/components/StoryPropsTable.vue +137 -0
  119. package/src/stories/filters/FilterGallery.stories.js +110 -0
  120. package/src/stories/filters/clientBy.stories.js +24 -0
  121. package/src/stories/filters/markBy.stories.js +6 -0
  122. package/src/stories/filters/menuBy.stories.js +6 -0
  123. package/src/stories/filters/orderBy.stories.js +6 -0
  124. package/src/stories/filters/tagBy.stories.js +6 -0
  125. package/src/stories/filters/topicBy.stories.js +6 -0
  126. package/src/stories/filters/versionBy.stories.js +6 -0
  127. package/src/stories/filters/zlpBy.stories.js +6 -0
  128. package/src/stories/layout/BaseShell.stories.js +38 -0
  129. package/src/stories/layout/Breadcrumb.stories.js +40 -0
  130. package/src/stories/layout/CommonFooter.stories.js +22 -0
  131. package/src/stories/layout/CommonHeader.stories.js +39 -0
  132. package/src/stories/layout/LeftSideToggle.stories.js +78 -0
  133. package/src/stories/layout/LeftSidebar.stories.js +40 -0
  134. package/src/stories/layout/Main.stories.js +41 -0
  135. package/src/stories/layout/RightSidebar.stories.js +36 -0
  136. package/src/stories/layout/StorybookShell.vue +271 -0
  137. package/src/stories/layout/SuspendCommon.stories.js +67 -0
  138. package/src/stories/layout/SuspendCommonStage.vue +143 -0
  139. package/src/stories/mockData.js +275 -0
  140. package/src/stories/other/UserPop.stories.js +51 -0
  141. package/src/stories/single/Author.stories.js +19 -0
  142. package/src/stories/single/AuthorStoryStage.vue +103 -0
  143. package/src/stories/single/CmsSingle.stories.js +19 -0
  144. package/src/stories/single/CmsSingleStoryStage.vue +118 -0
  145. package/src/stories/single/Collection.stories.js +34 -0
  146. package/src/stories/single/Comment.stories.js +36 -0
  147. package/src/stories/single/Creators.stories.js +34 -0
  148. package/src/stories/single/PostCollection.stories.js +34 -0
  149. package/src/stories/single/PostDirectory.stories.js +31 -0
  150. package/src/stories/single/PostGuide.stories.js +47 -0
  151. package/src/stories/single/PostHeader.stories.js +39 -0
  152. package/src/stories/single/PostVersion.stories.js +41 -0
  153. package/src/stories/single/RightAffix.stories.js +84 -0
  154. package/src/stories/single/SimpleThx.stories.js +39 -0
  155. package/src/stories/single/SingleGallery.stories.js +207 -0
  156. package/src/stories/single/Thx.stories.js +38 -0
  157. package/vue.config.js +2 -12
  158. package/assets/css/common/bottom.less +0 -25
  159. package/assets/css/editor/article.less +0 -36
  160. package/assets/css/editor/combo.less +0 -362
  161. package/assets/css/editor/resource.less +0 -399
  162. package/assets/css/editor/tinymce.less +0 -100
  163. package/assets/css/editor/upload.less +0 -136
  164. package/assets/css/module/author.less +0 -231
  165. package/assets/css/module/buff.less +0 -88
  166. package/assets/css/module/directory.less +0 -165
  167. package/assets/css/module/icon.less +0 -25
  168. package/assets/css/module/item.less +0 -279
  169. package/assets/css/module/item_simple.less +0 -58
  170. package/assets/css/module/jx3_element.less +0 -5
  171. package/assets/css/module/macro.less +0 -89
  172. package/assets/css/module/npc.less +0 -265
  173. package/assets/css/module/resource.less +0 -93
  174. package/assets/css/module/skill.less +0 -74
  175. package/assets/css/module/talent.less +0 -495
  176. package/assets/js/a.js +0 -46
  177. package/assets/js/code.js +0 -13
  178. package/assets/js/combo.js +0 -40
  179. package/assets/js/directory.js +0 -114
  180. package/assets/js/filter2.js +0 -186
  181. package/assets/js/fold.js +0 -11
  182. package/assets/js/gallery.js +0 -14
  183. package/assets/js/hljs_languages.js +0 -177
  184. package/assets/js/iframe.js +0 -38
  185. package/assets/js/img.js +0 -23
  186. package/assets/js/item/attribute_percent.js +0 -88
  187. package/assets/js/item/bind.js +0 -18
  188. package/assets/js/item/border.js +0 -19
  189. package/assets/js/item/border_quest.js +0 -12
  190. package/assets/js/item/color.js +0 -25
  191. package/assets/js/item/hljs_languages.js +0 -177
  192. package/assets/js/item/icon_url.js +0 -15
  193. package/assets/js/item/second_format.js +0 -19
  194. package/assets/js/jx3_element.js +0 -73
  195. package/assets/js/katex.js +0 -181
  196. package/assets/js/macro.js +0 -16
  197. package/assets/js/nextpage.js +0 -4
  198. package/assets/js/pswp.js +0 -67
  199. package/assets/js/pswp_template.js +0 -66
  200. package/assets/js/pz_iframe.js +0 -30
  201. package/assets/js/qixue.js +0 -28
  202. package/assets/js/renderImgPreview.js +0 -18
  203. package/assets/js/script.js +0 -6
  204. package/assets/js/stat.js +0 -107
  205. package/assets/js/talent2.js +0 -21
  206. package/assets/js/tex-mml-chtml.js +0 -36310
  207. package/assets/js/voice.js +0 -238
  208. package/assets/js/xss.js +0 -130
  209. package/src/editor/Article.vue +0 -230
  210. package/src/editor/BoxResource.vue +0 -441
  211. package/src/editor/Resource.vue +0 -623
  212. package/src/editor/Tinymce.vue +0 -204
  213. package/src/editor/Upload.vue +0 -277
  214. package/src/editor/UploadAlum.vue +0 -176
  215. package/src/editor/UploadBanner.vue +0 -156
  216. package/src/editor/components/Author.vue +0 -322
  217. package/src/editor/components/Avatar.vue +0 -95
  218. package/src/editor/components/Buff.vue +0 -80
  219. package/src/editor/components/Combo.vue +0 -259
  220. package/src/editor/components/Equip.vue +0 -299
  221. package/src/editor/components/GameText.vue +0 -242
  222. package/src/editor/components/Item.vue +0 -325
  223. package/src/editor/components/ItemSimple.vue +0 -134
  224. package/src/editor/components/Medal.vue +0 -43
  225. package/src/editor/components/Npc.vue +0 -215
  226. package/src/editor/components/PostAuthor.vue +0 -102
  227. package/src/editor/components/Skill.vue +0 -71
@@ -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>
@@ -2,12 +2,12 @@
2
2
  <div
3
3
  class="c-header-logo"
4
4
  @click="toggleBox($event)"
5
- :title="$jx3boxT('jx3boxUi.header.expandBoxMatrix', '点击展开魔盒矩阵')"
5
+ :title="$jx3boxT('jx3boxUi.commonHeader.expandBoxMatrix', '点击展开魔盒矩阵')"
6
6
  >
7
7
  <i class="u-pic" id="c-header-logo">
8
8
  <img svg-inline src="../../assets/img/common/logo.svg" alt="JX3BOX" />
9
9
  </i>
10
- <span class="u-txt" :class="{ on: isIndex }" href="/">{{ $jx3boxT("jx3boxUi.header.box", "魔盒") }}</span>
10
+ <span class="u-txt" :class="{ on: isIndex }" href="/">{{ $jx3boxT("jx3boxUi.commonHeader.box", "魔盒") }}</span>
11
11
  </div>
12
12
  </template>
13
13
 
@@ -30,7 +30,6 @@ export default {
30
30
  },
31
31
  computed: {},
32
32
  methods: {
33
- // TODO: 主页和魔盒矩阵的切换
34
33
  // 盒子
35
34
  toggleBox: function (e) {
36
35
  e.stopPropagation();
@@ -7,7 +7,7 @@
7
7
  class="u-add"
8
8
  svg-inline
9
9
  src="../../assets/img/common/manage.svg"
10
- :alt="$jx3boxT('jx3boxUi.header.manageCenter', '扩展中心')"
10
+ :alt="$jx3boxT('jx3boxUi.commonHeader.manageCenter', '扩展中心')"
11
11
  />
12
12
  </span>
13
13
  <ul class="u-menu u-pop-content">
@@ -87,7 +87,7 @@ export default {
87
87
  },
88
88
  methods: {
89
89
  getPanelLabel(item) {
90
- if (item?.key) return this.$jx3boxT(`jx3boxUi.header.panel.${item.key}`, item.label || item.key);
90
+ if (item?.key) return this.$jx3boxT(`jx3boxUi.commonHeader.panel.${item.key}`, item.label || item.key);
91
91
  return item?.label || "";
92
92
  },
93
93
  loadPanel: function () {
@@ -2,7 +2,7 @@
2
2
  <div class="c-header-msg" id="c-header-msg">
3
3
  <el-tooltip
4
4
  effect="dark"
5
- :content="$jx3boxT('jx3boxUi.header.messageCenter', '消息中心')"
5
+ :content="$jx3boxT('jx3boxUi.commonHeader.messageCenter', '消息中心')"
6
6
  placement="bottom"
7
7
  popper-class="c-header-tooltip"
8
8
  >
@@ -13,7 +13,7 @@
13
13
  <img
14
14
  svg-inline
15
15
  src="../../assets/img/common/bell.svg"
16
- :alt="$jx3boxT('jx3boxUi.header.messageCenter', '消息中心')"
16
+ :alt="$jx3boxT('jx3boxUi.commonHeader.messageCenter', '消息中心')"
17
17
  />
18
18
  </i>
19
19
  </a>
@@ -80,7 +80,7 @@ export default {
80
80
  border-radius: 50%;
81
81
  position: absolute;
82
82
  right: -5px;
83
- top: -6px;
83
+ top: -2px;
84
84
  .z(1);
85
85
  }
86
86
  }
@@ -10,7 +10,7 @@
10
10
  :class="{ on: isFocus(item.link) }"
11
11
  :href="item.link"
12
12
  :target="isSelf(item.link)"
13
- >{{ $jx3boxT(`jx3boxUi.nav.${item.key}`, item.label) }}</a
13
+ >{{ $jx3boxT(`jx3boxUi.commonHeader.nav.${item.key}`, item.label) }}</a
14
14
  >
15
15
  <template #dropdown>
16
16
  <el-dropdown-menu class="c-header-menu">
@@ -21,7 +21,7 @@
21
21
  class="u-menu-item"
22
22
  >
23
23
  <a :href="subitem.link" :target="isSelf(subitem.link)"
24
- >{{ $jx3boxT(`jx3boxUi.nav.${subitem.key}`, subitem.label) }}
24
+ >{{ $jx3boxT(`jx3boxUi.commonHeader.nav.${subitem.key}`, subitem.label) }}
25
25
  <span v-if="subitem.desc">{{ subitem.desc }}</span></a
26
26
  >
27
27
  </el-dropdown-item>
@@ -32,7 +32,7 @@
32
32
  </template>
33
33
  <template v-else>
34
34
  <a class="u-item" :class="{ on: isFocus(item.link) }" :href="item.link">{{
35
- $jx3boxT(`jx3boxUi.nav.${item.key}`, item.label)
35
+ $jx3boxT(`jx3boxUi.commonHeader.nav.${item.key}`, item.label)
36
36
  }}</a>
37
37
  </template>
38
38
  </template>
@@ -41,7 +41,7 @@
41
41
  <!-- <div class="c-header-nav--pad">
42
42
  <el-menu mode="horizontal" class="c-quick-menu" :default-active="activeIndex">
43
43
  <el-sub-menu index="quick-menu" popper-class="c-quick-menu__submenu">
44
- <template #title>快捷导航</template>
44
+ <template #title>{{ $jx3boxT("jx3boxUi.nav.quickNav", "快捷导航") }}</template>
45
45
  <template v-for="item in finalNav" :key="'header-nav-' + item.key">
46
46
  <el-sub-menu
47
47
  v-if="matchedClient(item.client) && item.children && item.children.length"
@@ -127,13 +127,14 @@ const activeNav = {
127
127
  import { getMenu } from "../../service/header";
128
128
  import { trimSlash } from "./utils";
129
129
  import i18nMixin from "../../i18n/mixin";
130
+ import navData from "../../assets/data/nav.json";
130
131
 
131
132
  export default {
132
133
  mixins: [i18nMixin],
133
134
  props: {},
134
135
  data: function () {
135
136
  return {
136
- nav: default_nav,
137
+ nav: navData,
137
138
 
138
139
  activeIndex: "",
139
140
  };
@@ -190,24 +191,25 @@ export default {
190
191
  return link.startsWith("/") ? "_self" : "_blank";
191
192
  },
192
193
  loadNav() {
193
- try {
194
- const nav = (sessionStorage.getItem("nav") && JSON.parse(sessionStorage.getItem("nav"))) || null;
195
- if (nav) {
196
- this.nav = nav;
197
- this.syncActiveIndex();
198
- } else {
199
- getMenu("nav").then((res) => {
200
- if (res.data) {
201
- this.nav = res?.data?.data?.val;
202
- sessionStorage.setItem("nav", JSON.stringify(this.nav));
203
- this.syncActiveIndex();
204
- }
205
- });
206
- }
207
- } catch (e) {
208
- this.nav = default_nav;
209
- console.log("loadNav error", e);
210
- }
194
+ this.nav = navData;
195
+ // try {
196
+ // const nav = (sessionStorage.getItem("nav") && JSON.parse(sessionStorage.getItem("nav"))) || null;
197
+ // if (nav) {
198
+ // this.nav = nav;
199
+ // this.syncActiveIndex();
200
+ // } else {
201
+ // getMenu("nav").then((res) => {
202
+ // if (res.data) {
203
+ // this.nav = res?.data?.data?.val;
204
+ // sessionStorage.setItem("nav", JSON.stringify(this.nav));
205
+ // this.syncActiveIndex();
206
+ // }
207
+ // });
208
+ // }
209
+ // } catch (e) {
210
+ // this.nav = default_nav;
211
+ // console.log("loadNav error", e);
212
+ // }
211
213
  },
212
214
  trimSlash(link) {
213
215
  return trimSlash(`${this.prefix}:${link}`);
@@ -287,6 +289,7 @@ export default {
287
289
 
288
290
  .c-header-nav--pc,
289
291
  .c-header-nav--pad {
292
+ // .flex;
290
293
  .flex(y);
291
294
  }
292
295
  .c-header-nav--pad {
@@ -2,7 +2,7 @@
2
2
  <div class="c-header-panel" id="c-header-panel">
3
3
  <el-tooltip
4
4
  effect="dark"
5
- :content="$jx3boxT('jx3boxUi.header.createCenter', '创作中心')"
5
+ :content="$jx3boxT('jx3boxUi.commonHeader.createCenter', '创作中心')"
6
6
  placement="bottom"
7
7
  popper-class="c-header-tooltip"
8
8
  >
@@ -12,7 +12,7 @@
12
12
  class="u-add"
13
13
  svg-inline
14
14
  src="../../assets/img/common/edit.svg"
15
- :alt="$jx3boxT('jx3boxUi.header.createCenter', '创作中心')"
15
+ :alt="$jx3boxT('jx3boxUi.commonHeader.createCenter', '创作中心')"
16
16
  />
17
17
  </a>
18
18
  </el-tooltip>
@@ -7,7 +7,7 @@
7
7
  type="text"
8
8
  autocomplete="off"
9
9
  name="q"
10
- :placeholder="$jx3boxT('jx3boxUi.header.searchPlaceholder', '搜索..')"
10
+ :placeholder="$jx3boxT('jx3boxUi.commonHeader.searchPlaceholder', '搜索..')"
11
11
  ref="searchInput"
12
12
  />
13
13
  <input type="hidden" name="client" :value="client" />
@@ -16,7 +16,7 @@
16
16
  <img
17
17
  svg-inline
18
18
  src="../../assets/img/common/search-key-slash.svg"
19
- :alt="$jx3boxT('jx3boxUi.header.search', '搜索')"
19
+ :alt="$jx3boxT('jx3boxUi.commonHeader.search', '搜索')"
20
20
  />
21
21
  </i>
22
22
  </form>
@@ -2,7 +2,7 @@
2
2
  <div class="c-header-panel c-header-shop">
3
3
  <el-tooltip
4
4
  effect="dark"
5
- :content="$jx3boxT('jx3boxUi.header.mallPoints', '积分商城')"
5
+ :content="$jx3boxT('jx3boxUi.commonHeader.mallPoints', '积分商城')"
6
6
  placement="bottom"
7
7
  popper-class="c-header-tooltip"
8
8
  >
@@ -14,7 +14,7 @@
14
14
  class="u-icon"
15
15
  svg-inline
16
16
  src="../../assets/img/common/gift.svg"
17
- :alt="$jx3boxT('jx3boxUi.header.mallPoints', '积分商城')"
17
+ :alt="$jx3boxT('jx3boxUi.commonHeader.mallPoints', '积分商城')"
18
18
  />
19
19
  </i>
20
20
  </a>
@@ -30,13 +30,13 @@
30
30
  <lang />
31
31
 
32
32
  <a class="c-header-console" :href="login_url">{{
33
- $jx3boxT("jx3boxUi.header.loginRegister", "登录/注册")
33
+ $jx3boxT("jx3boxUi.commonHeader.loginRegister", "登录/注册")
34
34
  }}</a>
35
35
 
36
36
  <!-- <div class="c-header-login">
37
- <a class="u-register u-default" :href="register_url">注册</a>
37
+ <a class="u-register u-default" :href="register_url">{{ $jx3boxT("jx3boxUi.user.register", "注册") }}</a>
38
38
  <em>|</em>
39
- <a class="u-login u-default" :href="login_url">登录</a>
39
+ <a class="u-login u-default" :href="login_url">{{ $jx3boxT("jx3boxUi.user.login", "登录") }}</a>
40
40
  </div> -->
41
41
  </template>
42
42
  </div>
@@ -118,7 +118,7 @@ export default {
118
118
  .then(() => {
119
119
  let msg = this.$message({
120
120
  type: "success",
121
- message: this.$jx3boxT("jx3boxUi.header.signInSuccess", "签到成功"),
121
+ message: this.$jx3boxT("jx3boxUi.commonHeader.signInSuccess", "签到成功"),
122
122
  customClass: "c-header-signin",
123
123
  duration: 0,
124
124
  });
@@ -5,31 +5,29 @@
5
5
  <template v-if="isPhone">
6
6
  <ul class="u-menu u-pop-content">
7
7
  <li>
8
- <a href="/dashboard">{{ $jx3boxT("jx3boxUi.header.profileCenter", "个人中心") }}</a>
8
+ <a href="/dashboard">{{ $jx3boxT("jx3boxUi.commonHeader.profileCenter", "个人中心") }}</a>
9
9
  </li>
10
10
  <li>
11
- <a :href="url.msg">{{ $jx3boxT("jx3boxUi.header.messageCenter", "消息中心") }}</a>
11
+ <a :href="url.msg">{{ $jx3boxT("jx3boxUi.commonHeader.messageCenter", "消息中心") }}</a>
12
12
  </li>
13
13
  <li>
14
- <a :href="url.publish">{{ $jx3boxT("jx3boxUi.header.publishCenter", "发布中心") }}</a>
14
+ <a :href="url.publish">{{ $jx3boxT("jx3boxUi.commonHeader.publishCenter", "发布中心") }}</a>
15
15
  </li>
16
16
  <hr />
17
17
  <li v-for="item in userPanel" :key="item.label">
18
18
  <a :href="item.link" :target="item.target || '_self'">
19
- <!-- <i :class="item.icon || 'el-icon-present'"></i> -->
20
19
  {{ item.label }}
21
20
  </a>
22
21
  </li>
23
22
  <template v-if="isTeammate">
24
23
  <li v-for="item in adminPanel" :key="item.label">
25
24
  <a :href="item.link" :target="item.target || '_self'">
26
- <!-- <i :class="item.icon || 'el-icon-present'"></i> -->
27
25
  {{ item.label }}
28
26
  </a>
29
27
  </li>
30
28
  </template>
31
29
  <li>
32
- <a @click="logout">{{ $jx3boxT("jx3boxUi.header.logout", "退出登录") }}</a>
30
+ <a @click="logout">{{ $jx3boxT("jx3boxUi.commonHeader.logout", "退出登录") }}</a>
33
31
  </li>
34
32
  </ul>
35
33
  </template>
@@ -45,18 +43,18 @@
45
43
  :src="super_author_icon"
46
44
  class="u-superauthor-profile"
47
45
  alt="superauthor"
48
- :title="$jx3boxT('jx3boxUi.header.superAuthor', '签约作者')"
46
+ :title="$jx3boxT('jx3boxUi.commonHeader.superAuthor', '签约作者')"
49
47
  :class="{ off: !isSuperAuthor }"
50
48
  /></a>
51
49
  <a
52
50
  class="u-vip"
53
51
  href="/vip/premium?from=header_usermenu"
54
52
  target="_blank"
55
- :title="$jx3boxT('jx3boxUi.header.proAccount', '专业版账号')"
53
+ :title="$jx3boxT('jx3boxUi.commonHeader.proAccount', '专业版账号')"
56
54
  >
57
55
  <i class="i-icon-vip" :class="{ on: isPRO }">{{ vipType }}</i>
58
56
  <span class="u-expire" v-if="isPRO">{{
59
- $jx3boxT("jx3boxUi.header.proExpireUntil", "(有效期至:{date})", {
57
+ $jx3boxT("jx3boxUi.commonHeader.proExpireUntil", "(有效期至:{date})", {
60
58
  date: pro_expire_date,
61
59
  })
62
60
  }}</span>
@@ -64,9 +62,9 @@
64
62
  </div>
65
63
  <div class="u-id">
66
64
  <span
67
- >{{ $jx3boxT("jx3boxUi.header.uidPrefix", "魔盒UID:") }}<b>{{ user.ID }}</b></span
65
+ >{{ $jx3boxT("jx3boxUi.commonHeader.uidPrefix", "魔盒UID:") }}<b>{{ user.ID }}</b></span
68
66
  >
69
- <el-icon class="el-icon-document-copy u-copy" @click.stop="copyText(user.ID)"
67
+ <el-icon class="u-copy" @click.stop="copyText(user.ID)"
70
68
  ><DocumentCopy
71
69
  /></el-icon>
72
70
  </div>
@@ -74,39 +72,39 @@
74
72
 
75
73
  <el-button-group class="u-actions">
76
74
  <a class="el-button el-button--default is-plain" href="/dashboard/config">{{
77
- $jx3boxT("jx3boxUi.header.config", "偏好设置")
75
+ $jx3boxT("jx3boxUi.commonHeader.config", "偏好设置")
78
76
  }}</a>
79
77
  <a class="el-button el-button--default is-plain" @click="changeAlternate">{{
80
- $jx3boxT("jx3boxUi.header.switchAlternate", "切换马甲")
78
+ $jx3boxT("jx3boxUi.commonHeader.switchAlternate", "切换马甲")
81
79
  }}</a>
82
80
  <a class="el-button el-button--default is-plain" href="/dashboard/frame">{{
83
- $jx3boxT("jx3boxUi.header.themeStyle", "主题风格")
81
+ $jx3boxT("jx3boxUi.commonHeader.themeStyle", "主题风格")
84
82
  }}</a>
85
83
  </el-button-group>
86
84
 
87
85
  <div class="u-other">
88
86
  <a href="/dashboard/role" class="u-item"
89
- ><el-icon><User /></el-icon>{{ $jx3boxT("jx3boxUi.header.roleManage", "角色管理") }}
87
+ ><el-icon><User /></el-icon>{{ $jx3boxT("jx3boxUi.commonHeader.roleManage", "角色管理") }}
90
88
  </a>
91
89
  <a href="/dashboard/fav" class="u-item"
92
- ><el-icon><Star /></el-icon>{{ $jx3boxT("jx3boxUi.header.favorites", "收藏订阅") }}
90
+ ><el-icon><Star /></el-icon>{{ $jx3boxT("jx3boxUi.commonHeader.favorites", "收藏订阅") }}
93
91
  </a>
94
92
  <a href="/dashboard/mall" class="u-item"
95
- ><el-icon><Memo /></el-icon>{{ $jx3boxT("jx3boxUi.header.orderCenter", "订单中心") }}
93
+ ><el-icon><Memo /></el-icon>{{ $jx3boxT("jx3boxUi.commonHeader.orderCenter", "订单中心") }}
96
94
  </a>
97
95
  <a href="/dashboard/config" class="u-item"
98
- ><el-icon><Help /></el-icon>{{ $jx3boxT("jx3boxUi.header.dashboard", "个人中心") }}
96
+ ><el-icon><Help /></el-icon>{{ $jx3boxT("jx3boxUi.commonHeader.dashboard", "个人中心") }}
99
97
  </a>
100
98
  <hr />
101
99
  <a href="/dashboard/profile" class="u-item"
102
- ><el-icon><Setting /></el-icon>{{ $jx3boxT("jx3boxUi.header.profile", "资料修改") }}
100
+ ><el-icon><Setting /></el-icon>{{ $jx3boxT("jx3boxUi.commonHeader.profile", "资料修改") }}
103
101
  </a>
104
102
  <a href="/dashboard/feedback" class="u-item"
105
- ><el-icon><Phone /></el-icon>{{ $jx3boxT("jx3boxUi.header.feedbackHelp", "反馈帮助") }}
103
+ ><el-icon><Phone /></el-icon>{{ $jx3boxT("jx3boxUi.commonHeader.feedbackHelp", "反馈帮助") }}
106
104
  </a>
107
105
  <hr />
108
106
  <div class="u-logout">
109
- <el-button @click="logout" plain>{{ $jx3boxT("jx3boxUi.header.logout", "退出登录") }}</el-button>
107
+ <el-button @click="logout" plain>{{ $jx3boxT("jx3boxUi.commonHeader.logout", "退出登录") }}</el-button>
110
108
  </div>
111
109
  </div>
112
110
  </div>
@@ -228,15 +226,15 @@ export default {
228
226
  .then(() => {
229
227
  if (mute) return;
230
228
  this.$notify({
231
- title: this.$jx3boxT("jx3boxUi.header.success", "成功"),
232
- message: this.$jx3boxT("jx3boxUi.header.logoutSuccess", "登出成功"),
229
+ title: this.$jx3boxT("jx3boxUi.commonHeader.success", "成功"),
230
+ message: this.$jx3boxT("jx3boxUi.commonHeader.logoutSuccess", "登出成功"),
233
231
  type: "success",
234
232
  duration: 1000,
235
233
  });
236
234
  });
237
235
  },
238
236
  showUserName: function (val) {
239
- return val || this.$jx3boxT("jx3boxUi.header.anonymous", "匿名");
237
+ return val || this.$jx3boxT("jx3boxUi.commonHeader.anonymous", "匿名");
240
238
  },
241
239
  loadMyInfo: function () {
242
240
  getMyInfo()
@@ -2,7 +2,7 @@
2
2
  <div class="c-header-panel c-header-vip" id="c-header-vip">
3
3
  <el-tooltip
4
4
  effect="dark"
5
- :content="$jx3boxT('jx3boxUi.header.vipCenter', '会员中心')"
5
+ :content="$jx3boxT('jx3boxUi.commonHeader.vipCenter', '会员中心')"
6
6
  placement="bottom"
7
7
  popper-class="c-header-tooltip"
8
8
  >
@@ -14,7 +14,7 @@
14
14
  class="u-add"
15
15
  svg-inline
16
16
  src="../../assets/img/common/vip.svg"
17
- :alt="$jx3boxT('jx3boxUi.header.vipCenter', '会员中心')"
17
+ :alt="$jx3boxT('jx3boxUi.commonHeader.vipCenter', '会员中心')"
18
18
  />
19
19
  </i>
20
20
  </a>