@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
@@ -0,0 +1,318 @@
1
+ <template>
2
+ <div class="w-boxcoin-admin">
3
+ <el-dialog
4
+ :title="dialogTitle"
5
+ v-model="show"
6
+ class="w-boxcoin-pop"
7
+ :close-on-click-modal="false"
8
+ append-to-body
9
+ @close="onClose"
10
+ >
11
+ <div class="w-boxcoin-admin-content">
12
+ <div class="u-left" v-if="type == 'grant'">
13
+ <em class="u-label">本月状态</em>
14
+ 已用<b>{{ this.used }}</b> 剩余<b>{{ this.left }}</b> 总计<b>{{ this.total }}</b>
15
+ <el-progress
16
+ :percentage="this.total ? 100 - (this.used * 100) / this.total : 0"
17
+ :stroke-width="15"
18
+ :text-inside="true"
19
+ ></el-progress>
20
+ </div>
21
+ <div class="u-left" v-else>
22
+ <em class="u-label">当前拥有盒币</em>
23
+ <b>{{ left }}</b>
24
+ <!-- <a class="u-charge" :href="chargeLink" target="_blank">[充值]</a> -->
25
+ </div>
26
+ <el-radio-group class="u-homework-type" v-model="type" size="small" v-if="hasPermission">
27
+ <el-radio-button label="grant">品鉴</el-radio-button>
28
+ <el-radio-button label="reward">打赏</el-radio-button>
29
+ </el-radio-group>
30
+ <div class="u-list">
31
+ <em class="u-label">❤️ {{ type == "reward" ? "打赏" : "品鉴" }}</em>
32
+ <div class="u-points">
33
+ <el-radio-group v-model="count">
34
+ <el-radio :value="item" v-for="item in fitPoints" :key="item" border>
35
+ <b>{{ item }}</b
36
+ >盒币
37
+ </el-radio>
38
+ <el-radio value="custom" border>自定义</el-radio>
39
+ <el-input
40
+ v-model="amount"
41
+ v-show="count === 'custom'"
42
+ placeholder="输入自定义数量"
43
+ ></el-input>
44
+ </el-radio-group>
45
+ </div>
46
+ </div>
47
+ <div class="u-msg">
48
+ <em class="u-label">📝 寄语</em>
49
+ <div class="u-input">
50
+ <el-input
51
+
52
+ v-model="remark"
53
+ placeholder="请输入寄语(必填)"
54
+ :minlength="2"
55
+ :maxlength="30"
56
+ show-word-limit
57
+ ></el-input>
58
+ <el-button :disabled="fetchingCurrentRelease" @click="insertCurrentRelease"
59
+ >插入当前版本</el-button
60
+ >
61
+ </div>
62
+ </div>
63
+ </div>
64
+ <template #footer>
65
+ <el-button @click="onClose" >取 消</el-button>
66
+ <el-button type="primary" @click="submit" :disabled="!ready || submitting" >确 定</el-button>
67
+ </template>
68
+ </el-dialog>
69
+ </div>
70
+ </template>
71
+
72
+ <script>
73
+ import { grantBoxcoin, getPostBoxcoinConfig, getBoxcoinStatus, rewardBoxcoin } from "../../service/thx.js";
74
+ import User from "@jx3box/jx3box-common/js/user";
75
+ import { getBreadcrumb } from "@jx3box/jx3box-common/js/system";
76
+ export default {
77
+ name: "Homework",
78
+ props: {
79
+ postType: {
80
+ type: String,
81
+ default: "",
82
+ },
83
+ postId: {
84
+ type: [String, Number],
85
+ default: 0,
86
+ },
87
+ userId: {
88
+ type: [String, Number],
89
+ default: 0,
90
+ },
91
+ client: {
92
+ type: String,
93
+ default: "",
94
+ },
95
+ modelValue: {
96
+ type: Boolean,
97
+ default: false,
98
+ },
99
+ articleId: {
100
+ type: [String, Number],
101
+ default: 0,
102
+ },
103
+ category: {
104
+ type: String,
105
+ default: "",
106
+ },
107
+ title: {
108
+ type: String,
109
+ default: "",
110
+ },
111
+ placeholder: {
112
+ type: String,
113
+ default: "",
114
+ }
115
+ },
116
+ emits: ["update:modelValue", "updateRecord"],
117
+ data: function () {
118
+ return {
119
+ count: 0,
120
+
121
+ remark: "不错,加油!",
122
+ chosen: "", // 被选中的人
123
+ amount: "",
124
+
125
+ submitting: false,
126
+ fetchingCurrentRelease: false,
127
+
128
+ // 打赏or品鉴
129
+ type: "reward",
130
+
131
+ // config
132
+ admin_max: 0,
133
+ admin_min: 0,
134
+ admin_left: 0,
135
+ admin_total: 0,
136
+ admin_points: [100],
137
+
138
+ user_left: 0,
139
+ user_points: [100],
140
+ boxcoin_enable: false,
141
+
142
+ show: false,
143
+ };
144
+ },
145
+ computed: {
146
+ left() {
147
+ return this.type === "reward" ? this.user_left : this.admin_left;
148
+ },
149
+ hasPermission() {
150
+ return User.hasPermission("manage_bbs_reward");
151
+ },
152
+ total: function () {
153
+ return this.admin_total;
154
+ },
155
+ used: function () {
156
+ return this.total - this.left;
157
+ },
158
+ ready: function () {
159
+ const count = this.count === "custom" ? this.amount : this.count;
160
+ // 不能给自己打赏,打赏目标不能是自己
161
+ // 打赏数量不能超过剩余数量
162
+ // 打赏数量不能为0
163
+ // 打赏寄语不能为空
164
+ return !!(!this.isSelf && !this.targetIsSelf && this.isEnough && count && this.remark);
165
+ },
166
+ isNotSelf: function () {
167
+ return this.userId != User.getInfo().uid;
168
+ },
169
+ targetIsSelf: function () {
170
+ return this.chosen == User.getInfo().uid;
171
+ },
172
+ isEnough: function () {
173
+ const count = this.count === "custom" ? this.amount : this.count;
174
+ return this.left && this.left >= count;
175
+ },
176
+ allowBoxcoin: function () {
177
+ return this.postType && this.postId && (this.userId || (this.authors && this.authors.length));
178
+ },
179
+ hostClient: function () {
180
+ return location.href.includes("origin") ? "origin" : "std";
181
+ },
182
+ points: function () {
183
+ return this.type === "reward" ? this.user_points : this.admin_points;
184
+ },
185
+ fitPoints: function () {
186
+ const points = this.points.filter((item) => item <= this.left);
187
+ if (this.isSignAuthor) {
188
+ // 最大值为1000
189
+ return points.filter((item) => item <= 1000);
190
+ }
191
+ return points;
192
+ },
193
+ isSignAuthor: function () {
194
+ return User.getInfo().group == 32;
195
+ },
196
+ finalClient: function () {
197
+ if (this.client == "wujie") {
198
+ return "std";
199
+ }
200
+ return this.client;
201
+ },
202
+ dialogTitle() {
203
+ return this.title || "批改作业";
204
+ },
205
+ },
206
+ watch: {
207
+ own: function (val) {
208
+ this.left = val;
209
+ },
210
+ modelValue: function (val) {
211
+ if (val) {
212
+ this.show = true;
213
+ this.loadBoxcoinConfig();
214
+
215
+ if (this.hasPermission) {
216
+ this.type = 'grant'
217
+ }
218
+ }
219
+ },
220
+ show: function (val) {
221
+ this.$emit("update:modelValue", val);
222
+ },
223
+ },
224
+ methods: {
225
+ // 选择要打赏的对象
226
+ handleChosen(userId) {
227
+ this.chosen = userId;
228
+ },
229
+ submit: function () {
230
+ this.submitting = true;
231
+ const count = this.count === "custom" ? this.amount : this.count;
232
+ let client = this.client || this.hostClient;
233
+ if (!["std", "origin", "all"].includes(client)) {
234
+ client = "std";
235
+ }
236
+ const fn = this.type === "reward" ? rewardBoxcoin : grantBoxcoin;
237
+ fn(this.postType, this.postId, this.userId, count, {
238
+ remark: this.remark,
239
+ client: client,
240
+ redirect: `/${this.category}/${this.articleId}`,
241
+ })
242
+ .then((res) => {
243
+ this.$message({
244
+ message: "操作成功",
245
+ type: "success",
246
+ });
247
+ return res.data.data;
248
+ })
249
+ .then((data) => {
250
+ // 1.扣除额度
251
+ this.left -= this.count;
252
+ // 2.将修改emit出去
253
+ this.$emit("updateRecord", data);
254
+ })
255
+ .finally(() => {
256
+ this.submitting = false;
257
+ this.onClose();
258
+ });
259
+ },
260
+ insertCurrentRelease: function () {
261
+ this.fetchingCurrentRelease = true;
262
+ getBreadcrumb(`current-release-${this.hostClient}`)
263
+ .then((res) => {
264
+ this.remark += res;
265
+ })
266
+ .catch((err) => {
267
+ this.$message({
268
+ message: "获取失败",
269
+ type: "error",
270
+ });
271
+ })
272
+ .finally(() => {
273
+ this.fetchingCurrentRelease = false;
274
+ });
275
+ },
276
+ loadBoxcoinConfig: function () {
277
+ User.isLogin() &&
278
+ getPostBoxcoinConfig(this.postType).then((res) => {
279
+ this.admin_max = res.data.data.limit.admin_max || 0;
280
+ this.admin_min = res.data.data.limit.admin_min || 0;
281
+ this.admin_points = res.data.data.limit.admin_points || [10, 1000];
282
+ this.admin_left = res.data.data.asManagerBoxCoinRemain || 0;
283
+ this.admin_total = res.data.data.asManagerBoxCoinTotal || 0;
284
+
285
+ this.user_points = res.data.data.limit.user_points || [10, 1000];
286
+ // 根据多端展示剩余币
287
+ // 作品是n端,接受n端币+all币
288
+ if (this.finalClient == "origin") {
289
+ this.user_left = res.data.data.asUserBoxCoinRemainOrigin + res.data.data.asUserBoxCoinRemainAll;
290
+ } else if (this.finalClient == "std") {
291
+ this.user_left = res.data.data.asUserBoxCoinRemainStd + res.data.data.asUserBoxCoinRemainAll;
292
+ } else {
293
+ this.user_left =
294
+ res.data.data.asUserBoxCoinRemainAll +
295
+ res.data.data.asUserBoxCoinRemainStd +
296
+ res.data.data.asUserBoxCoinRemainOrigin;
297
+ }
298
+ });
299
+ getBoxcoinStatus().then((res) => {
300
+ this.boxcoin_enable = !!~~res.data?.data?.val;
301
+ });
302
+ },
303
+ onClose() {
304
+ this.show = false
305
+ },
306
+ },
307
+ mounted() {
308
+ this.remark = this.placeholder || "不错,加油!";
309
+ },
310
+ };
311
+ </script>
312
+
313
+ <style lang="less">
314
+ @import "../../assets/css/single/thx.less";
315
+ .u-homework-type {
316
+ margin-top: 10px;
317
+ }
318
+ </style>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="w-like2" :class="{ disabled: !status }" @click="addLike" v-if="ready">
3
- <el-tooltip effect="dark" content="点赞" placement="top-start">
4
- <div>
3
+ <el-tooltip effect="dark" :content="$jx3boxT('jx3boxUi.like.like', '点赞')" placement="top-start">
4
+ <div class="w-like2__trigger">
5
5
  <img class="u-icon" svg-inline :src="iconPath" />
6
6
  <span class="u-count" v-if="count">{{ count }}</span>
7
7
  </div>
@@ -12,8 +12,10 @@
12
12
  <script>
13
13
  import { postStat, getStat } from "@jx3box/jx3box-common/js/stat";
14
14
  import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
15
+ import i18nMixin from "../../i18n/mixin";
15
16
  export default {
16
17
  name: "LikeComp",
18
+ mixins: [i18nMixin],
17
19
  props: {
18
20
  postType: {
19
21
  type: String,
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="w-rss">
3
3
  <el-tooltip effect="dark" :content="tooltipContent" placement="top-start">
4
- <div @click="onRssClick">
4
+ <div class="w-rss__trigger" @click="onRssClick">
5
5
  <img v-if="subscribed" class="u-icon" svg-inline :src="rmSrc" />
6
6
  <img v-else class="u-icon" svg-inline :src="addSrc" />
7
7
  <span class="u-count" v-if="!hiddenNum && total > 0">{{ total }}</span>
@@ -24,9 +24,11 @@ import {
24
24
  unsubscribePost,
25
25
  } from "@jx3box/jx3box-common/js/rss";
26
26
  const jx3box = require("@jx3box/jx3box-common/data/jx3box.json");
27
+ import i18nMixin from "../../i18n/mixin";
27
28
 
28
29
  export default {
29
30
  name: "RssComponent",
31
+ mixins: [i18nMixin],
30
32
  props: {
31
33
  type: {
32
34
  type: String,
@@ -53,7 +55,9 @@ export default {
53
55
  },
54
56
  computed: {
55
57
  tooltipContent() {
56
- return this.subscribed ? "已订阅" : "加入订阅";
58
+ return this.subscribed
59
+ ? this.$jx3boxT("jx3boxUi.rss.subscribed", "已订阅")
60
+ : this.$jx3boxT("jx3boxUi.rss.subscribe", "加入订阅");
57
61
  },
58
62
  addSrc() {
59
63
  return jx3box.__cdn + "design/vector/icon/rss.svg";
@@ -153,11 +157,13 @@ export default {
153
157
  .y;
154
158
  .pr;
155
159
  }
160
+ .w-rss__trigger {
161
+ .flex;
162
+ align-items: center;
163
+ }
156
164
  .u-count {
157
165
  color: #888;
158
166
  .ml(10px);
159
- top: 2px;
160
- .pr;
161
167
  }
162
168
  }
163
169
  </style>
@@ -8,7 +8,7 @@
8
8
  class="u-share2-item"
9
9
  :key="shareItem.key"
10
10
  @click="share(shareItem.key)"
11
- title="分享"
11
+ :title="$jx3boxT('jx3boxUi.share.share', '分享')"
12
12
  >
13
13
  <img class="u-share-icon" svg-inline :src="shareItem.img" :alt="shareItem.name">
14
14
  <div class="u-share2-name">{{ shareItem.name }}</div>
@@ -22,24 +22,21 @@
22
22
  :size="75"
23
23
  level="H"
24
24
  ></qrcode-vue>
25
- <span>微信扫一扫分享</span>
25
+ <span>{{ $jx3boxT("jx3boxUi.share.wechatShare", "微信扫一扫分享") }}</span>
26
26
  </div>
27
27
  </div>
28
28
 
29
29
  <template #reference>
30
- <!-- <el-tooltip class="item" effect="dark" content="分享" placement="top"> -->
31
- <div v-if="simple">
32
- <img class="u-icon u-simple-icon" svg-inline :src="iconPath" />
33
- <!-- <i class="el-icon-position"></i> -->
34
- <span class="u-text">分享</span>
35
- </div>
36
- <img
37
- v-else
38
- class="u-icon"
39
- svg-inline
40
- :src="iconPath"
41
- />
42
- <!-- </el-tooltip> -->
30
+ <div v-if="simple">
31
+ <img class="u-icon u-simple-icon" svg-inline :src="iconPath" />
32
+ <span class="u-text">{{ $jx3boxT("jx3boxUi.share.share", "分享") }}</span>
33
+ </div>
34
+ <img
35
+ v-else
36
+ class="u-icon"
37
+ svg-inline
38
+ :src="iconPath"
39
+ />
43
40
  </template>
44
41
  </el-popover>
45
42
  </div>
@@ -48,10 +45,12 @@
48
45
  <script>
49
46
  import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
50
47
  import QrcodeVue from "qrcode.vue";
48
+ import i18nMixin from "../../i18n/mixin";
51
49
 
52
50
  const { __imgPath } = JX3BOX;
53
51
  export default {
54
52
  name: "ShareComp",
53
+ mixins: [i18nMixin],
55
54
  props: {
56
55
  postType: {
57
56
  type: String,
@@ -81,22 +80,22 @@ export default {
81
80
  },
82
81
  shareList: [
83
82
  {
84
- name: '微博',
83
+ name: this.$jx3boxT("jx3boxUi.share.weibo", "微博"),
85
84
  key: 'weibo',
86
85
  img: require('../../assets/img/widget/weibo.svg'),
87
86
  },
88
87
  {
89
- name: 'QQ',
88
+ name: this.$jx3boxT("jx3boxUi.share.qq", "QQ"),
90
89
  key: 'qq',
91
90
  img: require('../../assets/img/widget/qq.svg'),
92
91
  },
93
92
  {
94
- name: 'QQ空间',
93
+ name: this.$jx3boxT("jx3boxUi.share.qzone", "QQ空间"),
95
94
  key: 'qzone',
96
95
  img: require('../../assets/img/widget/qzone.svg'),
97
96
  },
98
97
  {
99
- name: '贴吧',
98
+ name: this.$jx3boxT("jx3boxUi.share.tieba", "贴吧"),
100
99
  key: 'tieba',
101
100
  img: require('../../assets/img/widget/tieba.svg'),
102
101
  },
@@ -14,8 +14,10 @@ import User from "@jx3box/jx3box-common/js/user";
14
14
  const JX3BOX = require("@jx3box/jx3box-common/data/jx3box.json");
15
15
  import { addWatchLater, delWatchLater } from "../../service/fav";
16
16
  import { omit } from "lodash";
17
+ import i18nMixin from "../../i18n/mixin";
17
18
  export default {
18
19
  name: "WatchLater",
20
+ mixins: [i18nMixin],
19
21
  props: {
20
22
  category: {
21
23
  type: String,
@@ -46,7 +48,9 @@ export default {
46
48
  },
47
49
  computed: {
48
50
  favContent() {
49
- return this.favorite ? "已添加稍后在看" : "添加至稍后再看";
51
+ return this.favorite
52
+ ? this.$jx3boxT("jx3boxUi.watchLater.added", "已添加稍后在看")
53
+ : this.$jx3boxT("jx3boxUi.watchLater.add", "添加至稍后再看");
50
54
  },
51
55
  addSrc() {
52
56
  return JX3BOX.__cdn + "design/vector/icon/time.svg"
package/src/main.js CHANGED
@@ -46,6 +46,7 @@ import zhTw from "element-plus/es/locale/lang/zh-tw";
46
46
  import vi from "element-plus/es/locale/lang/vi";
47
47
  import "element-plus/dist/index.css";
48
48
  import "@jx3box/jx3box-common/css/element-plus-theme.scss";
49
+ import "@jx3box/jx3box-common/css/element-fonticon.css";
49
50
 
50
51
  const __elementLocaleMap = {
51
52
  "zh-CN": zhCn,
@@ -6,7 +6,9 @@
6
6
  <!-- <AuthorFollow style="margin-right: 8px;" :uid="uid" /> -->
7
7
  <AuthorRss :uid="uid" :data="data" />
8
8
  <!-- <AuthorGift :uid="uid" /> -->
9
- <el-button class="u-btn" size="small" @click="onMessage" icon="Message">私信</el-button
9
+ <el-button class="u-btn" size="small" @click="onMessage" icon="Message">{{
10
+ $jx3boxT("jx3boxUi.author.message", "私信")
11
+ }}</el-button
10
12
  >
11
13
  </div>
12
14
  <!-- <AuthorLink class="u-block u-links" :uid="uid" :data="data" /> -->
@@ -29,9 +31,11 @@ import AuthorMedals from "../author/AuthorMedals.vue";
29
31
  // import AuthorTeams from "../author/AuthorTeams.vue";
30
32
  import AuthorPosts from "../author/AuthorPosts.vue";
31
33
  import AuthorRss from "../author/AuthorRss.vue";
34
+ import i18nMixin from "../../i18n/mixin";
32
35
  const jx3box = require("@jx3box/jx3box-common/data/jx3box.json");
33
36
  export default {
34
37
  name: "AuthorComp",
38
+ mixins: [i18nMixin],
35
39
  props: {
36
40
  uid: {
37
41
  type: [Number, String],
@@ -24,8 +24,7 @@
24
24
  <el-divider content-position="left">JX3BOX</el-divider>
25
25
  <div class="m-single-content">
26
26
  <slot></slot>
27
- <!-- <ArticleMarkdown v-if="isMarkdown" :content="post_content" @directoryRendered="updateDirectory" /> -->
28
- <Article :content="post_content" @directoryRendered="updateDirectory" />
27
+ <Article :content="post_content" :post_mode="post_mode" @directoryRendered="updateDirectory" />
29
28
  </div>
30
29
  </div>
31
30
  <div class="m-single-null" v-else>
@@ -48,13 +47,19 @@
48
47
  :authors="authors"
49
48
  :client="post_client"
50
49
  showRss
50
+ v-if="showThx"
51
51
  />
52
52
 
53
53
  <!-- 评论 -->
54
54
  <div ref="commentView" class="m-single-comment">
55
- <el-divider content-position="left">评论</el-divider>
55
+ <el-divider content-position="left">{{ $jx3boxT("jx3boxUi.cmsSingle.comment", "评论") }}</el-divider>
56
56
  <Comment :id="id" category="post" v-if="id && allow_comment" />
57
- <el-alert title="作者没有开启评论功能" type="warning" show-icon v-else></el-alert>
57
+ <el-alert
58
+ :title="$jx3boxT('jx3boxUi.cmsSingle.commentDisabled', '作者没有开启评论功能')"
59
+ type="warning"
60
+ show-icon
61
+ v-else
62
+ ></el-alert>
58
63
  </div>
59
64
  </div>
60
65
 
@@ -63,13 +68,13 @@
63
68
  <slot name="single-footer"></slot>
64
69
  </footer>
65
70
 
66
- <!-- <right-affix
71
+ <right-affix
67
72
  :postId="id"
68
73
  :postType="post_type"
69
74
  :postTitle="post_title"
70
75
  :showComment="id && allow_comment"
71
76
  @toComment="toComment($event)"
72
- ></right-affix> -->
77
+ ></right-affix>
73
78
  </div>
74
79
  </template>
75
80
 
@@ -78,26 +83,24 @@ import PostHeader from "./PostHeader.vue";
78
83
  import Creators from "./Creators.vue";
79
84
  import Collection from "./Collection.vue";
80
85
  import Thx from "./Thx.vue";
81
- // import RightAffix from "./right-affix.vue";
82
- import Article from "../editor/Article.vue";
83
- // import ArticleMarkdown from "@jx3box/jx3box-editor/src/ArticleMarkdown.vue";
84
- import Comment from "./Comment.vue";
86
+ import RightAffix from "./RightAffix.vue";
87
+ import Article from "@jx3box/jx3box-editor/src/Article.vue";
85
88
  import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
86
89
  import { getAppType } from "@jx3box/jx3box-common/js/utils";
90
+ import i18nMixin from "../../i18n/mixin";
87
91
 
88
92
  const { __visibleMap } = JX3BOX;
89
93
 
90
94
  export default {
91
95
  name: "cms-single",
96
+ mixins: [i18nMixin],
92
97
  components: {
93
98
  PostHeader,
94
99
  Creators,
95
100
  Collection,
96
101
  Thx,
97
102
  Article,
98
- // ArticleMarkdown,
99
- Comment,
100
- // RightAffix,
103
+ RightAffix,
101
104
  },
102
105
  props: {
103
106
  post: {
@@ -108,6 +111,10 @@ export default {
108
111
  type: Object,
109
112
  default: () => ({}),
110
113
  },
114
+ showThx: {
115
+ type: Boolean,
116
+ default: true,
117
+ },
111
118
  },
112
119
  data: function () {
113
120
  return {
@@ -145,7 +152,7 @@ export default {
145
152
  return !!this.post?._check;
146
153
  },
147
154
  null_tip: function () {
148
- let str = "作者设置了【";
155
+ let str = this.$jx3boxT("jx3boxUi.cmsSingle.authorSet", "作者设置了【");
149
156
  str += __visibleMap[this.post?.visible];
150
157
  str += "】";
151
158
  return str;
@@ -185,6 +192,10 @@ export default {
185
192
  }
186
193
  },
187
194
  methods: {
195
+ shouldSkipNavigation: function () {
196
+ if (typeof window === "undefined" || typeof location === "undefined") return false;
197
+ return location.pathname.includes("iframe.html") || !!window.__STORYBOOK_PREVIEW__;
198
+ },
188
199
  updateCollection: function (val) {
189
200
  this.collection_data = val;
190
201
  },
@@ -214,7 +225,7 @@ export default {
214
225
  deep: true,
215
226
  immediate: true,
216
227
  handler: function (val) {
217
- if (location.host.includes("localhost")) {
228
+ if (location.host.includes("localhost") || this.shouldSkipNavigation()) {
218
229
  return;
219
230
  }
220
231
 
@@ -226,6 +237,9 @@ export default {
226
237
  community_id: {
227
238
  immediate: true,
228
239
  handler(val) {
240
+ if (this.shouldSkipNavigation()) {
241
+ return;
242
+ }
229
243
  if (val && val != 0) {
230
244
  // 防止死循环
231
245
  if (location.href.includes(`/community/${val}`)) {