@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
@@ -3,7 +3,7 @@
3
3
  <!-- 标题 -->
4
4
  <div class="m-single-title">
5
5
  <span class="u-title u-sub-block" :href="url" :title="title">
6
- <i class="u-original" v-if="isOriginal">原创</i>
6
+ <i class="u-original" v-if="isOriginal">{{ $jx3boxT("jx3boxUi.postHeader.original", "原创") }}</i>
7
7
  <i class="u-private" v-if="post.post_status != 'publish' || !!~~post.visible">
8
8
  <el-icon
9
9
  v-if="post.post_status == 'draft' || post.post_status == 'pending' || !!~~post.visible"
@@ -16,7 +16,7 @@
16
16
  <template v-if="titleExtra">
17
17
  <span class="u-client" :class="'i-client-' + client">{{ showClientLabel(client) }}</span>
18
18
  <span class="u-client u-zlp" v-if="zlp">{{ zlp }}</span>
19
- <span class="u-client i-client-wujie" v-if="is_wujie">无界</span>
19
+ <span class="u-client i-client-wujie" v-if="is_wujie">{{ $jx3boxT("jx3boxUi.postHeader.wujie", "无界") }}</span>
20
20
  </template>
21
21
  </span>
22
22
  </div>
@@ -29,7 +29,7 @@
29
29
  <img svg-inline src="../../assets/img/single/author.svg" />
30
30
  </i>
31
31
  <a class="u-name" :href="author_link" v-if="!anonymous">{{ author_name }}</a>
32
- <span class="u-name u-anonymous" v-else>神秘侠士</span>
32
+ <span class="u-name u-anonymous" v-else>{{ $jx3boxT("jx3boxUi.postHeader.mysterious", "神秘侠士") }}</span>
33
33
  </div>
34
34
 
35
35
  <!-- 自定义字段 -->
@@ -43,13 +43,16 @@
43
43
 
44
44
  <!-- 客户端 -->
45
45
  <div class="u-meta u-sub-block">
46
- <em class="u-label">适用客户端</em>
46
+ <em class="u-label">{{ $jx3boxT("jx3boxUi.postHeader.client", "适用客户端") }}</em>
47
47
  <span class="u-value u-client" :class="client">{{ showClientLabel(client) }}</span>
48
- <span class="u-value u-client wujie" v-if="is_wujie">无界</span>
48
+ <span class="u-value u-client wujie" v-if="is_wujie">{{ $jx3boxT("jx3boxUi.postHeader.wujie", "无界") }}</span>
49
49
  </div>
50
50
 
51
51
  <!-- 发布日期 -->
52
- <span class="u-podate u-sub-block" :title="'发布日期:' + post_time">
52
+ <span
53
+ class="u-podate u-sub-block"
54
+ :title="$jx3boxT('jx3boxUi.postHeader.publishDateTitle', '发布日期:{time}', { time: post_time })"
55
+ >
53
56
  <i class="u-icon-podate">
54
57
  <img svg-inline src="../../assets/img/single/podate.svg" />
55
58
  </i>
@@ -57,7 +60,10 @@
57
60
  </span>
58
61
 
59
62
  <!-- 最后更新 -->
60
- <span class="u-modate u-sub-block" :title="'最后更新:' + update_time">
63
+ <span
64
+ class="u-modate u-sub-block"
65
+ :title="$jx3boxT('jx3boxUi.postHeader.updateDateTitle', '最后更新:{time}', { time: update_time })"
66
+ >
61
67
  <i class="u-icon-modate">
62
68
  <img svg-inline src="../../assets/img/single/modate.svg" />
63
69
  </i>
@@ -70,7 +76,11 @@
70
76
  {{ views }}
71
77
  </span>
72
78
 
73
- <span class="u-word-count u-sub-block" v-if="wordCount" title="累计字数">
79
+ <span
80
+ class="u-word-count u-sub-block"
81
+ v-if="wordCount"
82
+ :title="$jx3boxT('jx3boxUi.postHeader.wordCount', '累计字数')"
83
+ >
74
84
  <el-icon :size="15"><Sunny /></el-icon>
75
85
  {{ wordCount }}
76
86
  </span>
@@ -78,7 +88,7 @@
78
88
  <!-- 编辑 -->
79
89
  <a class="u-edit u-sub-block" :href="edit_link" v-if="canEdit && !anonymous">
80
90
  <el-icon class="u-icon-edit" :size="16"><Edit /></el-icon>
81
- <span>编辑</span>
91
+ <span>{{ $jx3boxT("jx3boxUi.postHeader.edit", "编辑") }}</span>
82
92
  </a>
83
93
  </div>
84
94
  </header>
@@ -90,10 +100,12 @@ import { showDate, showTime } from "@jx3box/jx3box-common/js/moment";
90
100
  import { editLink, authorLink } from "@jx3box/jx3box-common/js/utils.js";
91
101
  import User from "@jx3box/jx3box-common/js/user.js";
92
102
  import $ from "jquery";
103
+ import i18nMixin from "../../i18n/mixin";
93
104
  const { __clients } = JX3BOX;
94
105
 
95
106
  export default {
96
107
  name: "PostHeader",
108
+ mixins: [i18nMixin],
97
109
  props: {
98
110
  post: {
99
111
  type: Object,
@@ -125,13 +137,13 @@ export default {
125
137
  return !!~~this.post?.original;
126
138
  },
127
139
  title: function () {
128
- return this.post?.post_title || "无标题";
140
+ return this.post?.post_title || this.$jx3boxT("jx3boxUi.postHeader.noTitle", "无标题");
129
141
  },
130
142
  author_link: function () {
131
143
  return authorLink(this.post?.post_author);
132
144
  },
133
145
  author_name: function () {
134
- return this.post?.author_info?.display_name || "匿名";
146
+ return this.post?.author_info?.display_name || this.$jx3boxT("jx3boxUi.postHeader.anonymous", "匿名");
135
147
  },
136
148
  post_date: function () {
137
149
  return showDate(new Date(this.post?.post_date));
@@ -218,8 +230,8 @@ export default {
218
230
  // padding-right: 280px;
219
231
  .pr;
220
232
  .u-sub-block {
221
- .dbi;
222
- .y(top);
233
+ .flex;
234
+ align-items: center;
223
235
  }
224
236
  }
225
237
  @media screen and (max-width: @phone) {
@@ -244,7 +256,7 @@ export default {
244
256
  // }
245
257
  letter-spacing: 0.5px;
246
258
  font-weight: 300;
247
- .db;
259
+ // .db;
248
260
  .nobreak;
249
261
  }
250
262
  .u-author {
@@ -263,9 +275,11 @@ export default {
263
275
  }
264
276
 
265
277
  .u-private {
266
- .y(-4px);
278
+ // .y(-4px);
267
279
  margin-right: 5px;
268
280
  color: #111;
281
+ top:2px;
282
+ .pr;
269
283
  }
270
284
  }
271
285
  @media screen and (max-width: @phone) {
@@ -285,15 +299,20 @@ export default {
285
299
  }
286
300
 
287
301
  .m-single-info {
302
+
303
+
288
304
  margin-top: 10px;
289
305
  .clearfix;
290
306
  .fz(12px, 20px);
291
307
  color: #666;
308
+ .flex;
309
+ align-items: center;
292
310
 
293
311
  @origin: #0eb7ce;
294
312
  @std: #f0b400;
295
313
  @all: #a26ef7;
296
314
  @wujie: #fc79bf;
315
+ --el-color-primary: @primary;
297
316
 
298
317
  .u-client {
299
318
  // .fl;
@@ -343,8 +362,11 @@ export default {
343
362
  }
344
363
 
345
364
  .u-author {
365
+ a {
366
+ color: var(--el-color-primary);
367
+ }
346
368
  a:hover {
347
- box-shadow: 0 1px 0 @color-link;
369
+ .underline(var(--el-color-primary));
348
370
  }
349
371
  i {
350
372
  .pr;
@@ -373,9 +395,9 @@ export default {
373
395
  font-size: 16px;
374
396
  }
375
397
  .pr;
376
- top: 4px;
377
398
  .mr(1px);
378
399
  }
400
+ color: var(--el-color-primary);
379
401
  &:hover {
380
402
  box-shadow: 0 1px 0 @color-link;
381
403
  }
@@ -80,14 +80,14 @@ export default {
80
80
  }
81
81
  </script>
82
82
 
83
- <style lang="less" scoped>
83
+ <style lang="less">
84
84
  .c-post-topic {
85
- margin-bottom: 10px;
85
+ margin-bottom: 20px;
86
86
  }
87
87
  .c-post-topic__banner {
88
88
  position: relative;
89
89
  margin-bottom: 10px;
90
- padding: 10px 10px 0 10px;
90
+ //padding: 10px 10px 0 10px;
91
91
  .c-topic-text {
92
92
  font-size: 12px;
93
93
  font-weight: 700;
@@ -0,0 +1,219 @@
1
+ <template>
2
+ <div class="c-post-version" v-if="list && list.length">
3
+ <div class="m-title">
4
+ <div class="u-title">
5
+ <el-icon class="u-icon"><Clock /></el-icon>历史版本
6
+ </div>
7
+ <div class="u-op" @click="toggle">
8
+ <el-icon><DCaret></DCaret></el-icon> 折叠
9
+ </div>
10
+ </div>
11
+ <transition name="collapse">
12
+ <ul v-show="show" class="u-list">
13
+ <li v-for="(item, i) in list" class="u-item" :key="i" @click="handleContrast(item)">
14
+ <div class="u-version">
15
+ <span>{{ item.version }}</span> - <span>{{ item.created_at }}</span>
16
+ </div>
17
+ <el-button class="u-compare" size="small" type="primary" link
18
+ ><el-icon class="u-icon"><Sort></Sort></el-icon>对比</el-button
19
+ >
20
+ </li>
21
+ </ul>
22
+ </transition>
23
+ <version-dialog
24
+ v-model="visible"
25
+ :link_content_meta_id="link_content_meta_id"
26
+ :title="title"
27
+ :content="content"
28
+ :commit_hash="commit_hash"
29
+ :versions="list"
30
+ ></version-dialog>
31
+ </div>
32
+ </template>
33
+
34
+ <script>
35
+ import { getCommitHistories, commitHistory } from "../../service/commit-history";
36
+ import VersionDialog from "./VersionDialog.vue";
37
+ export default {
38
+ name: "PostVersion",
39
+ props: ["post"],
40
+ components: { VersionDialog },
41
+ data() {
42
+ return {
43
+ loading: false,
44
+ index: 1,
45
+ pageSize: 10, // 取最新的10个版本即可
46
+ total: 0,
47
+ list: [],
48
+ show: true,
49
+ visible: false,
50
+ commit_hash: "",
51
+ isMobile: window.innerWidth < 768,
52
+ };
53
+ },
54
+ computed: {
55
+ link_content_meta_id() {
56
+ return this.post?.link_content_meta_id || 0;
57
+ },
58
+ content() {
59
+ return this.post?.post_content || "";
60
+ },
61
+ title() {
62
+ return this.post?.post_title || "";
63
+ },
64
+ pageParams() {
65
+ return {
66
+ index: this.index,
67
+ pageSize: this.pageSize,
68
+ };
69
+ },
70
+ },
71
+ watch: {
72
+ link_content_meta_id: {
73
+ immediate: true,
74
+ handler: function (val) {
75
+ !!val && this.load();
76
+ },
77
+ },
78
+ page() {
79
+ this.load();
80
+ },
81
+ },
82
+ methods: {
83
+ onAdd() {
84
+ commitHistory(this.link_content_meta_id, {
85
+ commit: "提交测试4",
86
+ content: `每日机缘4`,
87
+ })
88
+ .then((res) => {
89
+ this.$message.success("创建成功");
90
+ this.load();
91
+ })
92
+ .catch((err) => {
93
+ this.$message.error(err.message);
94
+ });
95
+ },
96
+ handleContrast(item) {
97
+ if (this.isMobile) {
98
+ return;
99
+ }
100
+ this.commit_hash = item.commit_hash;
101
+ this.visible = true;
102
+ },
103
+ load() {
104
+ this.loading = true;
105
+ getCommitHistories(this.link_content_meta_id, this.pageParams)
106
+ .then((res) => {
107
+ const list = res.data?.data?.list || [];
108
+ if (list.length) {
109
+ this.list = list.map((item, i) => {
110
+ return {
111
+ ...item,
112
+ version: "v" + (list.length - i),
113
+ };
114
+ });
115
+ this.total = res.data?.data?.page?.total || 0;
116
+ }
117
+ })
118
+ .finally(() => {
119
+ this.loading = false;
120
+ });
121
+ },
122
+ toggle() {
123
+ this.show = !this.show;
124
+ },
125
+ },
126
+ };
127
+ </script>
128
+ <style lang="less">
129
+ .c-post-version {
130
+ .m-title {
131
+ .flex;
132
+ justify-content: space-between;
133
+ align-items: center;
134
+ //margin-bottom: 5px;
135
+ line-height: 24px;
136
+ .u-op {
137
+ font-size: 13px;
138
+ font-weight: 500;
139
+ line-height: 18px;
140
+ //float: right;
141
+ padding: 0 5px;
142
+ color: #cdd1db;
143
+ cursor: pointer;
144
+ .flex(y);
145
+ &:hover {
146
+ color: #a1a9bb;
147
+ }
148
+ }
149
+ }
150
+ .u-title {
151
+ //font-weight: 400;
152
+ font-weight: normal;
153
+ font-size: 16px;
154
+ line-height: 18px;
155
+ color: #333;
156
+ .flex;
157
+ align-items: center;
158
+ gap: 5px;
159
+ .u-icon {
160
+ font-size: 18px;
161
+ }
162
+ }
163
+ .u-list {
164
+ list-style: none;
165
+ padding: 10px;
166
+ margin: 0;
167
+ overflow: hidden;
168
+ li {
169
+ padding: 0 10px;
170
+ .fz(13px, 36px);
171
+ .flex;
172
+ justify-content: space-between;
173
+ align-items: center;
174
+ transition: 0.15s ease-in-out;
175
+ .nobreak;
176
+ &:hover {
177
+ background-color: #fcfcfc;
178
+ .r(4px);
179
+
180
+ .u-compare {
181
+ .db;
182
+ @media screen and (max-width: @phone) {
183
+ .none;
184
+ }
185
+ }
186
+ }
187
+ .pointer;
188
+ }
189
+
190
+ .u-compare {
191
+ .none;
192
+
193
+ .u-icon {
194
+ transform: rotate(90deg);
195
+ margin-right: 3px;
196
+ }
197
+ }
198
+ }
199
+
200
+ .collapse-enter-active,
201
+ .collapse-leave-active {
202
+ transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.25s ease;
203
+ }
204
+
205
+ .collapse-enter-from,
206
+ .collapse-leave-to {
207
+ max-height: 0;
208
+ opacity: 0;
209
+ padding-top: 0;
210
+ padding-bottom: 0;
211
+ }
212
+
213
+ .collapse-enter-to,
214
+ .collapse-leave-from {
215
+ max-height: 480px;
216
+ opacity: 1;
217
+ }
218
+ }
219
+ </style>
@@ -0,0 +1,160 @@
1
+ <template>
2
+ <div class="c-right-affix" :class="{ 'is-close': !isOpen }">
3
+ <div class="item">
4
+ <fav :postId="postId" :postType="postType" :postTitle="postTitle" :hiddenNum="true" :isOld="true"></fav>
5
+ </div>
6
+ <el-tooltip v-if="showCommentBtn && showComment" effect="dark" content="去评论" placement="left">
7
+ <div class="u-item" @click="toComment">
8
+ <el-icon class="u-icon"><ChatDotSquare></ChatDotSquare></el-icon>
9
+ </div>
10
+ </el-tooltip>
11
+ <el-tooltip effect="dark" content="回到顶部" placement="bottom">
12
+ <div class="u-item" v-show="scrollBtnShow" @click="goTop">
13
+ <div class="u-to-top"></div>
14
+ </div>
15
+ </el-tooltip>
16
+ </div>
17
+ </template>
18
+
19
+ <script>
20
+ import Fav from "../interact/Fav.vue";
21
+ import Bus from "../../utils/bus";
22
+ export default {
23
+ name: "RightAffix",
24
+ props: {
25
+ postId: {
26
+ type: [String, Number],
27
+ default: "",
28
+ },
29
+ postType: {
30
+ type: String,
31
+ default: "",
32
+ },
33
+ postTitle: {
34
+ type: String,
35
+ default: "",
36
+ },
37
+ showComment: {
38
+ type: [Boolean, Number],
39
+ default: false,
40
+ },
41
+ },
42
+ data() {
43
+ return {
44
+ scrollToptimer: null,
45
+ scrollBtnShow: false,
46
+ showCommentBtn: false, // 等待img等元素加载完毕再显示评论按钮
47
+
48
+ isOpen: true,
49
+ };
50
+ },
51
+ components: {
52
+ Fav,
53
+ },
54
+ methods: {
55
+ goTop() {
56
+ window.scrollTo({
57
+ top: 0,
58
+ behavior: "smooth",
59
+ });
60
+ },
61
+ toComment() {
62
+ this.$emit("toComment");
63
+ },
64
+ },
65
+ mounted() {
66
+ //获取页面可视区高度
67
+ var clientHeight = document.documentElement.clientHeight;
68
+ const self = this;
69
+ window.addEventListener("scroll", function () {
70
+ //显示回到顶部按钮
71
+ var osTop = document.documentElement.scrollTop || document.body.scrollTop;
72
+ if (osTop >= clientHeight) {
73
+ self.scrollBtnShow = true;
74
+ } else {
75
+ self.scrollBtnShow = false;
76
+ }
77
+ });
78
+
79
+ setTimeout(() => {
80
+ this.showCommentBtn = true;
81
+ }, 1000);
82
+
83
+ Bus.on("toggleRightSide", (data) => {
84
+ this.isOpen = data;
85
+ });
86
+ },
87
+ beforeUnmount() {
88
+ Bus.off("toggleRightSide");
89
+ },
90
+ };
91
+ </script>
92
+
93
+ <style lang="less">
94
+ .closeLeftSidebar() {
95
+ transition: 0.2s ease-in-out;
96
+ transform: translateX(100%);
97
+ }
98
+
99
+ .openLeftSidebar() {
100
+ transition: 0.2s ease-in-out;
101
+ transform: translateX(0);
102
+ }
103
+
104
+ .c-right-affix {
105
+ .openLeftSidebar();
106
+ position: fixed;
107
+ display: flex;
108
+ flex-direction: column;
109
+ justify-content: center;
110
+ align-items: center;
111
+ right: @aside-right;
112
+ top: @header-height + @bread-height + 100px;
113
+ background-color: #fafbfc;
114
+ padding: 8px 5px;
115
+ z-index: 200;
116
+ border-top-left-radius: 6px;
117
+ border-bottom-left-radius: 6px;
118
+ .u-item {
119
+ display: flex;
120
+ justify-content: center;
121
+ align-items: center;
122
+ width: 32px;
123
+ height: 32px;
124
+ cursor: pointer;
125
+ &:hover {
126
+ background-color: #f6fcff;
127
+ }
128
+ .w-fav2 svg {
129
+ .size(26px);
130
+ }
131
+ }
132
+ .u-to-top {
133
+ width: 0;
134
+ height: 0;
135
+ border-left: 10px solid transparent;
136
+ border-right: 10px solid transparent;
137
+ border-bottom: 16px solid #87ceeb;
138
+ }
139
+
140
+ &.is-close {
141
+ .closeLeftSidebar();
142
+ right: 42px;
143
+ }
144
+
145
+ .u-icon {
146
+ font-size: 20px;
147
+ color: #3871e0;
148
+ }
149
+ }
150
+ @media screen and (max-width: @smallpc) {
151
+ .c-right-affix {
152
+ right: 0;
153
+ }
154
+ }
155
+ @media screen and (max-width: @phone) {
156
+ .c-right-affix {
157
+ .none;
158
+ }
159
+ }
160
+ </style>
@@ -29,7 +29,7 @@
29
29
  @updateRecord="updateRecord"
30
30
  :client="client"
31
31
  />
32
- <el-tooltip effect="dark" content="打赏记录" placement="top-start">
32
+ <el-tooltip effect="dark" :content="$jx3boxT('jx3boxUi.simpleThx.record', '打赏记录')" placement="top-start">
33
33
  <!-- <div class="w-boxcoin-block"> -->
34
34
  <img
35
35
  src="../../assets/img/widget/records.svg"
@@ -42,7 +42,7 @@
42
42
  </el-tooltip>
43
43
  </div>
44
44
 
45
- <el-drawer v-model="showDrawer" title="打赏记录" append-to-body>
45
+ <el-drawer v-model="showDrawer" :title="$jx3boxT('jx3boxUi.simpleThx.record', '打赏记录')" append-to-body>
46
46
  <BoxcoinRecords
47
47
  :postId="postId"
48
48
  :postType="postType"
@@ -63,9 +63,11 @@ import BoxcoinUser from "../interact/BoxcoinUser.vue";
63
63
  import BoxcoinRecords from "../interact/BoxcoinRecords.vue";
64
64
  import User from "@jx3box/jx3box-common/js/user";
65
65
  import { getBoxcoinStatus, getPostBoxcoinConfig } from "../../service/thx";
66
+ import i18nMixin from "../../i18n/mixin";
66
67
 
67
68
  export default {
68
69
  name: "SimpleThx",
70
+ mixins: [i18nMixin],
69
71
  components: {
70
72
  Like,
71
73
  Fav,
@@ -57,8 +57,18 @@
57
57
  </div>
58
58
  <div class="w-thx-copyright">
59
59
  &copy;
60
- 所有原创作品,著作权归作者所有,所有未经授权的非署名转载或抄袭将有权追究法律责任,所有法律事务由专聘律师代理。<br />
61
- 签约作者独家特约稿件,及所有魔盒官方评分作品用户一经兑现则视为有偿付费稿件,所有商业稿件的转载引用需同时征得魔盒平台授权。
60
+ {{
61
+ $jx3boxT(
62
+ "jx3boxUi.thx.copyright1",
63
+ "所有原创作品,著作权归作者所有,所有未经授权的非署名转载或抄袭将有权追究法律责任,所有法律事务由专聘律师代理。"
64
+ )
65
+ }}<br />
66
+ {{
67
+ $jx3boxT(
68
+ "jx3boxUi.thx.copyright2",
69
+ "签约作者独家特约稿件,及所有魔盒官方评分作品用户一经兑现则视为有偿付费稿件,所有商业稿件的转载引用需同时征得魔盒平台授权。"
70
+ )
71
+ }}
62
72
  </div>
63
73
  </div>
64
74
  </template>
@@ -76,9 +86,11 @@ import Rss from "../interact/Rss.vue";
76
86
  import User from "@jx3box/jx3box-common/js/user";
77
87
  import { getBoxcoinStatus, getPostBoxcoinConfig } from "../../service/thx";
78
88
  import { getConfig, getUserPermission } from "../../service/cms";
89
+ import i18nMixin from "../../i18n/mixin";
79
90
 
80
91
  export default {
81
92
  name: "ThxComp",
93
+ mixins: [i18nMixin],
82
94
  components: {
83
95
  Like,
84
96
  Fav,