@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
@@ -1,7 +1,8 @@
1
1
  <template>
2
2
  <div class="w-collection" v-if="list && list.length">
3
3
  <div class="w-collection-title" @click="handleShow" :class="{ on: visible }">
4
- <span> <el-icon><Notebook /></el-icon> 该作品已被收录至作者的剑三小册 </span>
4
+ <el-icon><Notebook /></el-icon>
5
+ {{ $jx3boxT("jx3boxUi.collection.included", "该作品已被收录至作者的剑三小册") }}
5
6
  <a @click.stop :href="collectionLink(id)" target="_blank">《{{ title }}》</a>
6
7
  </div>
7
8
  <transition name="fade">
@@ -9,7 +10,6 @@
9
10
  <ol v-if="list && list.length" class="u-list" :style="{ display: visible ? 'block' : 'none' }">
10
11
  <li v-for="(item, i) in list" :key="i" class="u-item">
11
12
  <a v-if="item" :href="showLink(item)" target="_blank">
12
- <!-- <i class="el-icon-link"></i> -->
13
13
  {{ item.title }}
14
14
  </a>
15
15
  </li>
@@ -23,21 +23,23 @@
23
23
  import * as utilModule from "@jx3box/jx3box-common/js/utils";
24
24
  const { getLink } = utilModule;
25
25
  import { getCollection } from "../../service/cms";
26
+ import i18nMixin from "../../i18n/mixin";
26
27
  export default {
27
28
  name: "SingleCollection",
29
+ mixins: [i18nMixin],
28
30
  props: {
29
31
  id: {
30
32
  type: [Number, String],
31
33
  default: 0,
32
34
  },
33
35
  defaultVisible: {
34
- type: Boolean,
36
+ type: [Boolean, Number],
35
37
  default: false,
36
38
  },
37
39
  },
38
40
  inject: [],
39
41
  components: {},
40
- data: function() {
42
+ data: function () {
41
43
  return {
42
44
  visible: this.defaultVisible || false,
43
45
  data: {
@@ -47,17 +49,17 @@ export default {
47
49
  };
48
50
  },
49
51
  computed: {
50
- title: function() {
52
+ title: function () {
51
53
  return this.data?.title;
52
54
  },
53
- list: function() {
55
+ list: function () {
54
56
  return this.data?.posts;
55
57
  },
56
58
  },
57
59
  watch: {
58
60
  id: {
59
61
  immediate: true,
60
- handler: function(val) {
62
+ handler: function (val) {
61
63
  if (~~val) {
62
64
  this.loadData();
63
65
  } else {
@@ -68,24 +70,24 @@ export default {
68
70
  }
69
71
  },
70
72
  },
71
- defaultVisible: function(val) {
73
+ defaultVisible: function (val) {
72
74
  this.visible = val;
73
75
  },
74
76
  },
75
77
  methods: {
76
- handleShow: function() {
78
+ handleShow: function () {
77
79
  this.visible = !this.visible;
78
80
  },
79
- loadData: function() {
81
+ loadData: function () {
80
82
  getCollection(this.id).then((res) => {
81
83
  this.data = res.data?.data;
82
- this.$emit('collectionUpdate',this.data)
84
+ this.$emit("collectionUpdate", this.data);
83
85
  });
84
86
  },
85
- collectionLink: function(id) {
87
+ collectionLink: function (id) {
86
88
  return getLink("collection", id);
87
89
  },
88
- showLink: function(item) {
90
+ showLink: function (item) {
89
91
  if (item.type == "custom") {
90
92
  return item.url;
91
93
  } else {
@@ -93,20 +95,23 @@ export default {
93
95
  }
94
96
  },
95
97
  },
96
- created: function() {},
97
- mounted: function() {},
98
+ created: function () {},
99
+ mounted: function () {},
98
100
  };
99
101
  </script>
100
102
 
101
103
  <style lang="less">
102
104
  .w-collection {
103
- &-title {
105
+ --el-color-primary: @primary;
106
+
107
+ .w-collection-title {
104
108
  cursor: pointer;
105
109
  position: relative;
106
110
  border: 1px solid #ddd;
107
111
  background-color: #fafbfc;
108
112
  padding: 8px 10px 8px 10px;
109
- display: block;
113
+ // display: block;
114
+ .flex(y);
110
115
  margin-bottom: 0;
111
116
  border-radius: 4px;
112
117
  line-height: 1.6;
@@ -130,17 +135,30 @@ export default {
130
135
  }
131
136
 
132
137
  a {
133
- .underline(@color-link);
138
+ color: var(--el-color-primary);
139
+ &:hover {
140
+ .underline(var(--el-color-primary));
141
+ }
134
142
  }
135
143
  }
136
144
 
137
145
  counter-reset: collection;
146
+
147
+ .u-list {
148
+ padding: 10px 20px;
149
+ margin: 0;
150
+ border: 1px dashed #ddd;
151
+ background: none;
152
+ border-top: none;
153
+ }
154
+
138
155
  .u-item {
139
156
  .fz(13px, 32px);
140
157
  border-bottom: 1px solid #eee;
141
158
  transition: 0.15s ease-in-out;
142
159
  .nobreak;
143
160
  a {
161
+ color: var(--el-color-primary);
144
162
  .db;
145
163
  &:before {
146
164
  counter-increment: collection;
@@ -158,14 +176,6 @@ export default {
158
176
  }
159
177
  }
160
178
 
161
- .u-list {
162
- padding: 10px 20px;
163
- margin: 0;
164
- border: 1px dashed #ddd;
165
- background: none;
166
- border-top: none;
167
- }
168
-
169
179
  .on {
170
180
  &::after {
171
181
  transform: rotate(90deg);
@@ -4,10 +4,10 @@
4
4
  <CommentInputForm @submit="userSubmitInputForm" />
5
5
  <div class="c-comment-panel">
6
6
  <div class="u-order">
7
- <span class="u-label">排序模式:</span>
7
+ <span class="u-label">{{ $jx3boxT("jx3boxUi.comment.sortMode", "排序模式:") }}</span>
8
8
  <el-radio-group v-model="isDesc" @change="changeOrder" size="small">
9
- <el-radio-button value="DESC">最后靠前</el-radio-button>
10
- <el-radio-button value="ASC">最早靠前</el-radio-button>
9
+ <el-radio-button value="DESC">{{ $jx3boxT("jx3boxUi.comment.desc", "最后靠前") }}</el-radio-button>
10
+ <el-radio-button value="ASC">{{ $jx3boxT("jx3boxUi.comment.asc", "最早靠前") }}</el-radio-button>
11
11
  </el-radio-group>
12
12
  </div>
13
13
  <div class="u-op">
@@ -15,7 +15,7 @@
15
15
  class="c-comment-panel-likes"
16
16
  v-model="orderByLikes"
17
17
  @change="changeOrderByLikes"
18
- active-text="获赞靠前"
18
+ :active-text="$jx3boxT('jx3boxUi.comment.likesFirst', '获赞靠前')"
19
19
  >
20
20
  </el-switch>
21
21
  <el-switch
@@ -23,8 +23,8 @@
23
23
  v-model="openWhiteList"
24
24
  @change="changeWhiteList"
25
25
  v-if="commentPower.is_author || commentPower.is_editor"
26
- active-text="开启过滤"
27
- title="开启过滤后,仅设为显示的评论可被其他人所见"
26
+ :active-text="$jx3boxT('jx3boxUi.comment.openWhitelist', '开启过滤')"
27
+ :title="$jx3boxT('jx3boxUi.comment.openWhitelistTip', '开启过滤后,仅设为显示的评论可被其他人所见')"
28
28
  >
29
29
  </el-switch>
30
30
  </div>
@@ -87,8 +87,10 @@ import CommentWithReply from "../comment/CommentWithReply.vue";
87
87
  import { GET, POST, DELETE, PUT, getOrderMode, setOrderMode } from "../../service/comment";
88
88
  import { getConfig } from "../../service/cms";
89
89
  import User from "@jx3box/jx3box-common/js/user";
90
+ import i18nMixin from "../../i18n/mixin";
90
91
  export default {
91
92
  name: "CommentComp",
93
+ mixins: [i18nMixin],
92
94
  props: {
93
95
  id: {
94
96
  type: [Number, String],
@@ -197,7 +199,7 @@ export default {
197
199
  .then(() => {
198
200
  this.$notify({
199
201
  title: "",
200
- message: "删除成功!",
202
+ message: this.$jx3boxT("jx3boxUi.comment.deleteSuccess", "删除成功!"),
201
203
  type: "success",
202
204
  duration: 3000,
203
205
  position: "bottom-right",
@@ -211,7 +213,7 @@ export default {
211
213
  .then(() => {
212
214
  this.$notify({
213
215
  title: "",
214
- message: "操作成功!",
216
+ message: this.$jx3boxT("jx3boxUi.comment.actionSuccess", "操作成功!"),
215
217
  type: "success",
216
218
  duration: 3000,
217
219
  position: "bottom-right",
@@ -245,7 +247,7 @@ export default {
245
247
  .then((responseJSON) => {
246
248
  if (responseJSON && ~~responseJSON.code > 0) {
247
249
  this.$notify({
248
- title: "评论失败",
250
+ title: this.$jx3boxT("jx3boxUi.comment.commentFailed", "评论失败"),
249
251
  message: responseJSON.msg || "",
250
252
  type: "error",
251
253
  duration: 3000,
@@ -255,7 +257,7 @@ export default {
255
257
  }
256
258
  this.$notify({
257
259
  title: "",
258
- message: "评论成功!",
260
+ message: this.$jx3boxT("jx3boxUi.comment.commentSuccess", "评论成功!"),
259
261
  type: "success",
260
262
  duration: 3000,
261
263
  position: "bottom-right",
@@ -371,16 +373,16 @@ export default {
371
373
  cursor: pointer;
372
374
  margin-right: 10px;
373
375
  // margin-left: 10px;
374
- color: #3d454d;
376
+ color: #555;
377
+ .pr;top:-1px;
375
378
 
376
379
  &:hover {
377
- color: #23ade5;
380
+ color: var(--el-color-primary);
378
381
  }
379
382
  }
380
383
  .c-jx3box-emotion {
381
384
  margin: 0;
382
385
  position: relative;
383
- top: 7px;
384
386
  }
385
387
  .c-comment-emotion {
386
388
  overflow: hidden;
@@ -448,6 +450,10 @@ export default {
448
450
  b {
449
451
  color: #0366d6;
450
452
  }
453
+ .u-order{
454
+ .flex;
455
+ align-items: center;
456
+ }
451
457
  }
452
458
  .c-comment-emotion {
453
459
  max-height: 168px;
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="w-creators" v-if="visible">
3
- <span class="w-creators-title">联合创作</span>
3
+ <span class="w-creators-title">{{ $jx3boxT("jx3boxUi.creators.title", "联合创作") }}</span>
4
4
  <a
5
5
  class="w-creators-super w-creators-item"
6
6
  v-if="super_author"
@@ -26,7 +26,7 @@
26
26
  </a>
27
27
  </div>
28
28
  <a class="w-creators-edit" :href="editLink" v-if="isCreator">
29
- <el-icon><Edit /></el-icon> 编辑当前作品
29
+ <el-icon><Edit /></el-icon> {{ $jx3boxT("jx3boxUi.creators.editCurrent", "编辑当前作品") }}
30
30
  </a>
31
31
  </div>
32
32
  </template>
@@ -35,8 +35,10 @@
35
35
  import { getPostAuthors } from "../../service/cms";
36
36
  import { showAvatar, authorLink, editLink } from "@jx3box/jx3box-common/js/utils";
37
37
  import User from "@jx3box/jx3box-common/js/user";
38
+ import i18nMixin from "../../i18n/mixin";
38
39
  export default {
39
40
  name: "SingleCreators",
41
+ mixins: [i18nMixin],
40
42
  props: {
41
43
  postId: {
42
44
  type: [Number, String],
@@ -173,7 +175,7 @@ export default {
173
175
  .bold;
174
176
  .db;
175
177
  color: @color;
176
- margin-bottom: 2px;
178
+ // margin-bottom: 2px;
177
179
  .nobreak;
178
180
  max-width: 120px;
179
181
  }
@@ -0,0 +1,158 @@
1
+ <template>
2
+ <div class="c-post-collection" v-if="list && list.length">
3
+ <div class="m-title">
4
+ <div class="c-post-collection-title">
5
+ <el-icon class="u-icon"><Connection>></Connection></el-icon> 关联
6
+ </div>
7
+ <div class="u-op" @click="toggle"><el-icon><DCaret></DCaret></el-icon> 折叠</div>
8
+ </div>
9
+ <transition name="collapse">
10
+ <ul v-show="show" class="c-post-collection-list">
11
+ <li v-for="(item, i) in list" :key="i">
12
+ <el-tooltip class="item" effect="dark" :content="item.title" placement="left">
13
+ <a :href="showLink(item)" target="_blank">
14
+ <el-icon><Link></Link></el-icon>
15
+ {{ item.title }}
16
+ </a>
17
+ </el-tooltip>
18
+ </li>
19
+ </ul>
20
+ </transition>
21
+ </div>
22
+ </template>
23
+
24
+ <script>
25
+ import { getLink, resolveImagePath } from "@jx3box/jx3box-common/js/utils";
26
+ import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
27
+ import { getCollection } from "../../service/cms";
28
+ const { __imgPath } = JX3BOX;
29
+ export default {
30
+ name: "PostCollection",
31
+ props: ["id", "store"],
32
+ components: {},
33
+ data: function () {
34
+ return {
35
+ data: {
36
+ title: "",
37
+ posts: [],
38
+ },
39
+ show: true,
40
+ };
41
+ },
42
+ computed: {
43
+ list: function () {
44
+ return this.store?.posts || this.data?.posts;
45
+ },
46
+ },
47
+ watch: {
48
+ id: {
49
+ immediate: true,
50
+ handler: function (val) {
51
+ !!~~val && this.loadData();
52
+ },
53
+ },
54
+ },
55
+ methods: {
56
+ loadData: function () {
57
+ getCollection(this.id).then((res) => {
58
+ this.data = res.data?.data;
59
+ });
60
+ },
61
+ showLink: function (item) {
62
+ if (item.type == "custom") {
63
+ return item.url;
64
+ } else {
65
+ return getLink(item.type, item.id);
66
+ }
67
+ },
68
+ getCover: function (val) {
69
+ return val ? resolveImagePath(val) : `${__imgPath}image/collection/default_cover.png`;
70
+ },
71
+ toggle: function () {
72
+ this.show = !this.show;
73
+ },
74
+ },
75
+ };
76
+ </script>
77
+ <style lang="less">
78
+ .c-post-collection {
79
+ .m-title {
80
+ .flex;
81
+ justify-content: space-between;
82
+ align-items: center;
83
+ line-height: 24px;
84
+ .u-op {
85
+ font-size: 13px;
86
+ font-weight: 500;
87
+ line-height: 18px;
88
+ padding: 0 5px;
89
+ color: #cdd1db;
90
+ cursor: pointer;
91
+ .flex(y);
92
+ &:hover {
93
+ color: #a1a9bb;
94
+ }
95
+ }
96
+ }
97
+ .u-image {
98
+ img {
99
+ .w(100%);
100
+ height: 226px;
101
+ object-fit: cover;
102
+ }
103
+ }
104
+ .c-post-collection-title {
105
+ font-weight: normal;
106
+ font-size: 16px;
107
+ line-height: 18px;
108
+ color: #333;
109
+ .flex;
110
+ align-items: center;
111
+ gap: 5px;
112
+ }
113
+ .u-icon {
114
+ font-size: 18px;
115
+ }
116
+ .c-post-collection-list {
117
+ list-style: none;
118
+ padding: 10px 20px;
119
+ margin: 0;
120
+ overflow: hidden;
121
+ li {
122
+ .fz(13px, 36px);
123
+ }
124
+ a {
125
+ .db;
126
+ color: var(--el-color-primary);
127
+ transition: 0.15s ease-in-out;
128
+ .nobreak;
129
+ &:hover {
130
+ background-color: #e6f0fb;
131
+ }
132
+ }
133
+ i {
134
+ .pr;
135
+ top: 2px;
136
+ }
137
+ }
138
+
139
+ .collapse-enter-active,
140
+ .collapse-leave-active {
141
+ transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.25s ease;
142
+ }
143
+
144
+ .collapse-enter-from,
145
+ .collapse-leave-to {
146
+ max-height: 0;
147
+ opacity: 0;
148
+ padding-top: 0;
149
+ padding-bottom: 0;
150
+ }
151
+
152
+ .collapse-enter-to,
153
+ .collapse-leave-from {
154
+ max-height: 480px;
155
+ opacity: 1;
156
+ }
157
+ }
158
+ </style>
@@ -19,129 +19,3 @@ export default {
19
19
  mounted:function(){},
20
20
  }
21
21
  </script>
22
-
23
- <style lang="less">
24
- .c-article-directory {
25
- h1,
26
- h2,
27
- h3,
28
- h4,
29
- h5,
30
- h6 {
31
- margin: 0;
32
- padding: 0;
33
- cursor: pointer;
34
- font-weight: normal;
35
- white-space: nowrap;
36
- word-wrap: normal;
37
- word-break: keep-all;
38
- text-overflow: ellipsis;
39
- overflow: hidden;
40
- letter-spacing: 0.2px;
41
- line-height: 20px;
42
- padding: 8px 0;
43
- &:hover {
44
- // font-weight: 600;
45
- color: #0366d6;
46
- }
47
- font-size: 12px;
48
- }
49
- a {
50
- color: @color;
51
- }
52
-
53
- h1,
54
- h2,
55
- h3,
56
- h4,
57
- h5,
58
- h6 {
59
- &::before {
60
- content: "\e78b";
61
-
62
- font-family: element-icons !important;
63
- speak: none;
64
- font-style: normal;
65
- font-weight: 400;
66
- font-variant: normal;
67
- text-transform: none;
68
- line-height: 1;
69
- vertical-align: baseline;
70
- display: inline-block;
71
- -webkit-font-smoothing: antialiased;
72
- margin-right: 5px;
73
- font-size: 16px;
74
- }
75
- }
76
-
77
- // .hasChild {
78
- // font-size: 14px;
79
- // &::before {
80
- // content: "\e784";
81
- // }
82
- // }
83
-
84
- // h2,h3,h4,h5,h6{
85
- // margin-left: 20px;
86
- // }
87
- // .hasChild{
88
- // margin-left: 0;
89
- // }
90
-
91
- // h3 + h2,h4 + h3,h5 + h4,h6 + h5{
92
- // margin-left: 0;
93
- // }
94
-
95
- .lv2 {
96
- padding-left: 20px;
97
- }
98
-
99
- .lv3 {
100
- padding-left: 40px;
101
- }
102
-
103
- .lv0 {
104
- display: none;
105
- }
106
- }
107
-
108
- .c-article-directory-title {
109
- margin-bottom: 5px;
110
- .c-article-directory-title-label {
111
- font-weight: 300;
112
- font-size: 20px;
113
- // cursor: pointer;
114
- // &:hover {
115
- // color: #f39;
116
- // }
117
- }
118
- .c-article-directory-title-skip,
119
- .c-article-directory-title-folder {
120
- font-size: 14px;
121
- float: right;
122
- padding: 0 5px;
123
- line-height: 25px;
124
- color: darken(#dcdfe6, 5%);
125
- cursor: pointer;
126
- &:hover {
127
- color: darken(#dcdfe6, 20%);
128
- }
129
- }
130
- }
131
- .c-article-directory-content {
132
- padding: 10px 15px;
133
- }
134
-
135
- @keyframes focusFade {
136
- from {
137
- background-color: #c3fcff;
138
- }
139
- to {
140
- background-color: transparent;
141
- }
142
- }
143
-
144
- .c-article .isScrollFocus {
145
- animation: focusFade 0.5s ease-in-out;
146
- }
147
- </style>
@@ -0,0 +1,93 @@
1
+ <template>
2
+ <div class="w-post-guide" v-if="hasGuide">
3
+ <div class="u-prev">
4
+ <a :href="getPostLink(post?.prev_post)" class="el-button el-button--default el-button--small is-plain" :class="{'is-disabled': !post?.prev_post }">
5
+ <el-icon><ArrowLeft></ArrowLeft></el-icon>
6
+ <span>上一篇</span>
7
+ </a>
8
+ <a :href="getPostLink(post?.prev_post)" class="u-post-title">{{ getPostTitle(post?.prev_post) }}</a>
9
+ </div>
10
+ <div class="u-next">
11
+ <a :href="getPostLink(post?.next_post)" class="el-button el-button--default el-button--small is-plain" :class="{'is-disabled': !post.next_post }">
12
+ <span>下一篇</span>
13
+ <el-icon><ArrowRight></ArrowRight></el-icon>
14
+ </a>
15
+ <a :href="getPostLink(post?.next_post)" class="u-post-title">{{ getPostTitle(post?.next_post) }}</a>
16
+ </div>
17
+ </div>
18
+ </template>
19
+
20
+ <script>
21
+ import { getLink } from '@jx3box/jx3box-common/js/utils';
22
+ export default {
23
+ name: "PostGuide",
24
+ props: {
25
+ post: {
26
+ type: Object,
27
+ default: () => ({}),
28
+ },
29
+ },
30
+ computed: {
31
+ hasGuide() {
32
+ const isPrevValid = this.post.prev_post && typeof this.post.prev_post === "object";
33
+ const isNextValid = this.post.next_post && typeof this.post.next_post === "object";
34
+ return isPrevValid || isNextValid;
35
+ }
36
+ },
37
+ methods: {
38
+ getPostLink({ ID: id, post_type }) {
39
+ const link = id ? getLink(post_type, id) : "javascript:;";
40
+ return link;
41
+ },
42
+ getPostTitle(item) {
43
+ return item?.post_title || "";
44
+ }
45
+ },
46
+ };
47
+ </script>
48
+
49
+ <style lang="less">
50
+ .w-post-guide {
51
+ .flex;
52
+ align-items: center;
53
+ justify-content: space-between;
54
+
55
+ .u-post-title {
56
+ margin-left: 10px;
57
+ font-size: 14px;
58
+ // color: #666;
59
+
60
+ &:hover {
61
+ // color: #0366d6;
62
+ // box-shadow: 0 1px 0 #0366d6;
63
+ .underline(var(--el-color-primary));
64
+ color:var(--el-color-primary);
65
+ }
66
+ }
67
+ }
68
+
69
+ @media screen and (max-width: @phone) {
70
+ .w-post-guide {
71
+ flex-wrap: wrap;
72
+
73
+ .u-prev,.u-next {
74
+ width: 100%;
75
+ .nobreak;
76
+ }
77
+
78
+ .u-prev {
79
+ margin-bottom: 10px;
80
+ span{
81
+ margin-left:5px;
82
+ }
83
+ }
84
+
85
+ .u-next {
86
+ margin-left: 0;
87
+ span{
88
+ margin-right:5px;
89
+ }
90
+ }
91
+ }
92
+ }
93
+ </style>