@jx3box/jx3box-ui 2.0.5 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (226) hide show
  1. package/.storybook/preview.js +22 -13
  2. package/.storybook/storybookMocks.js +191 -0
  3. package/README.md +6 -19
  4. package/assets/css/bread/admin.less +20 -2
  5. package/assets/css/bread/breadcrumb.less +5 -2
  6. package/assets/css/comment/quick-reply.less +1 -1
  7. package/assets/css/common/left-sidebar.less +1 -1
  8. package/assets/css/interact/like2.less +5 -2
  9. package/assets/css/single/author.less +15 -10
  10. package/assets/css/single/cms-single.less +1 -0
  11. package/assets/css/single/thx.less +34 -11
  12. package/assets/data/nav.json +344 -10
  13. package/assets/img/comment/comment.svg +1 -1
  14. package/assets/img/comment/heart_1.svg +1 -1
  15. package/assets/img/comment/hide.svg +1 -1
  16. package/assets/img/leftsidebar/medal.svg +1 -1
  17. package/assets/img/leftsidebar/post.svg +27 -46
  18. package/i18n/messages/en-US.js +357 -22
  19. package/i18n/messages/vi.js +350 -22
  20. package/i18n/messages/zh-CN.js +469 -20
  21. package/i18n/messages/zh-TW.js +350 -22
  22. package/index.js +19 -7
  23. package/package.json +8 -5
  24. package/service/cms.js +22 -0
  25. package/service/commit-history.js +18 -0
  26. package/service/community.js +60 -0
  27. package/service/fav.js +5 -6
  28. package/src/App.vue +154 -80
  29. package/src/Breadcrumb.vue +24 -11
  30. package/src/CommonFooter.vue +2 -2
  31. package/src/Footer.vue +13 -5
  32. package/src/LeftSideToggle.vue +10 -3
  33. package/src/LeftSidebar.vue +19 -5
  34. package/src/Main.vue +9 -2
  35. package/src/RightSidebar.vue +12 -3
  36. package/src/SuspendCommon.vue +52 -38
  37. package/src/author/AuthorFans.vue +7 -5
  38. package/src/author/AuthorFollow.vue +14 -7
  39. package/src/author/AuthorGift.vue +25 -17
  40. package/src/author/AuthorInfo.vue +46 -19
  41. package/src/author/AuthorLink.vue +3 -1
  42. package/src/author/AuthorMedals.vue +5 -2
  43. package/src/author/AuthorPosts.vue +31 -13
  44. package/src/author/AuthorRss.vue +7 -3
  45. package/src/author/AuthorTeams.vue +3 -1
  46. package/src/author/UserPop.vue +29 -17
  47. package/src/bread/Admin.vue +55 -32
  48. package/src/bread/AdminDirectMessage.vue +15 -8
  49. package/src/bread/AdminDrop.vue +124 -45
  50. package/src/bread/CommunityAdmin.vue +527 -0
  51. package/src/bread/DesignTask.vue +30 -26
  52. package/src/bread/ListAdmin.vue +199 -0
  53. package/src/bread/MigrateCommunity.vue +192 -0
  54. package/src/bread/MoveToCommunityDialog.vue +234 -0
  55. package/src/comment/Avatar.vue +18 -24
  56. package/src/comment/CommentContent.vue +57 -37
  57. package/src/comment/CommentContentSimple.vue +61 -63
  58. package/src/comment/CommentInputForm.vue +45 -34
  59. package/src/comment/CommentWithReply.vue +9 -6
  60. package/src/comment/QuickReply.vue +5 -1
  61. package/src/comment/ReplyForReply.vue +6 -4
  62. package/src/comment/ReplyList.vue +28 -18
  63. package/src/comment/Upload.vue +24 -6
  64. package/src/filters/clientBy.vue +10 -8
  65. package/src/filters/markBy.vue +35 -31
  66. package/src/filters/menuBy.vue +20 -22
  67. package/src/filters/orderBy.vue +17 -11
  68. package/src/filters/tagBy.vue +4 -2
  69. package/src/filters/topicBy.vue +12 -10
  70. package/src/filters/versionBy.vue +5 -3
  71. package/src/filters/zlpBy.vue +29 -25
  72. package/src/footer/copyright.vue +5 -5
  73. package/src/footer/links.vue +2 -2
  74. package/src/footer/official.vue +1 -1
  75. package/src/footer/resource.vue +6 -6
  76. package/src/header/alternate.vue +35 -18
  77. package/src/header/asset.vue +9 -19
  78. package/src/header/box.vue +20 -8
  79. package/src/header/box2.vue +16 -9
  80. package/src/header/client.vue +7 -7
  81. package/src/header/lang.vue +41 -6
  82. package/src/header/logo.vue +2 -3
  83. package/src/header/manage.vue +2 -2
  84. package/src/header/message.vue +3 -3
  85. package/src/header/nav.vue +26 -23
  86. package/src/header/publish.vue +2 -2
  87. package/src/header/search.vue +2 -2
  88. package/src/header/shop.vue +2 -2
  89. package/src/header/user.vue +4 -4
  90. package/src/header/userInfo.vue +22 -24
  91. package/src/header/vip.vue +2 -2
  92. package/src/interact/BoxcoinAdmin.vue +30 -16
  93. package/src/interact/BoxcoinRecords.vue +28 -11
  94. package/src/interact/BoxcoinUser.vue +33 -17
  95. package/src/interact/Fav.vue +5 -1
  96. package/src/interact/Homework.vue +318 -0
  97. package/src/interact/Like.vue +4 -2
  98. package/src/interact/Rss.vue +10 -4
  99. package/src/interact/Share.vue +18 -19
  100. package/src/interact/WatchLater.vue +5 -1
  101. package/src/main.js +1 -0
  102. package/src/single/Author.vue +5 -1
  103. package/src/single/CmsSingle.vue +29 -15
  104. package/src/single/Collection.vue +36 -26
  105. package/src/single/Comment.vue +19 -13
  106. package/src/single/Creators.vue +5 -3
  107. package/src/single/PostCollection.vue +158 -0
  108. package/src/single/PostDirectory.vue +0 -126
  109. package/src/single/PostGuide.vue +93 -0
  110. package/src/single/PostHeader.vue +39 -17
  111. package/src/single/PostTopic.vue +3 -3
  112. package/src/single/PostVersion.vue +219 -0
  113. package/src/single/RightAffix.vue +160 -0
  114. package/src/single/SimpleThx.vue +4 -2
  115. package/src/single/Thx.vue +14 -2
  116. package/src/single/VersionDialog.vue +238 -0
  117. package/src/stories/components/StoryPropsTable.vue +137 -0
  118. package/src/stories/filters/FilterGallery.stories.js +110 -0
  119. package/src/stories/filters/clientBy.stories.js +24 -0
  120. package/src/stories/filters/markBy.stories.js +6 -0
  121. package/src/stories/filters/menuBy.stories.js +6 -0
  122. package/src/stories/filters/orderBy.stories.js +6 -0
  123. package/src/stories/filters/tagBy.stories.js +6 -0
  124. package/src/stories/filters/topicBy.stories.js +6 -0
  125. package/src/stories/filters/versionBy.stories.js +6 -0
  126. package/src/stories/filters/zlpBy.stories.js +6 -0
  127. package/src/stories/layout/BaseShell.stories.js +38 -0
  128. package/src/stories/layout/Breadcrumb.stories.js +40 -0
  129. package/src/stories/layout/CommonFooter.stories.js +1 -1
  130. package/src/stories/layout/CommonHeader.stories.js +1 -1
  131. package/src/stories/layout/LeftSideToggle.stories.js +78 -0
  132. package/src/stories/layout/LeftSidebar.stories.js +40 -0
  133. package/src/stories/layout/Main.stories.js +41 -0
  134. package/src/stories/layout/RightSidebar.stories.js +36 -0
  135. package/src/stories/layout/StorybookShell.vue +271 -0
  136. package/src/stories/layout/SuspendCommon.stories.js +67 -0
  137. package/src/stories/layout/SuspendCommonStage.vue +143 -0
  138. package/src/stories/mockData.js +275 -0
  139. package/src/stories/other/UserPop.stories.js +51 -0
  140. package/src/stories/single/Author.stories.js +19 -0
  141. package/src/stories/single/AuthorStoryStage.vue +103 -0
  142. package/src/stories/single/CmsSingle.stories.js +19 -0
  143. package/src/stories/single/CmsSingleStoryStage.vue +118 -0
  144. package/src/stories/single/Collection.stories.js +34 -0
  145. package/src/stories/single/Comment.stories.js +36 -0
  146. package/src/stories/single/Creators.stories.js +34 -0
  147. package/src/stories/single/PostCollection.stories.js +34 -0
  148. package/src/stories/single/PostDirectory.stories.js +31 -0
  149. package/src/stories/single/PostGuide.stories.js +47 -0
  150. package/src/stories/single/PostHeader.stories.js +39 -0
  151. package/src/stories/single/PostVersion.stories.js +41 -0
  152. package/src/stories/single/RightAffix.stories.js +84 -0
  153. package/src/stories/single/SimpleThx.stories.js +39 -0
  154. package/src/stories/single/SingleGallery.stories.js +207 -0
  155. package/src/stories/single/Thx.stories.js +38 -0
  156. package/vue.config.js +2 -12
  157. package/assets/css/common/bottom.less +0 -25
  158. package/assets/css/editor/article.less +0 -36
  159. package/assets/css/editor/combo.less +0 -362
  160. package/assets/css/editor/resource.less +0 -399
  161. package/assets/css/editor/tinymce.less +0 -100
  162. package/assets/css/editor/upload.less +0 -136
  163. package/assets/css/module/author.less +0 -231
  164. package/assets/css/module/buff.less +0 -88
  165. package/assets/css/module/directory.less +0 -165
  166. package/assets/css/module/icon.less +0 -25
  167. package/assets/css/module/item.less +0 -279
  168. package/assets/css/module/item_simple.less +0 -58
  169. package/assets/css/module/jx3_element.less +0 -5
  170. package/assets/css/module/macro.less +0 -89
  171. package/assets/css/module/npc.less +0 -265
  172. package/assets/css/module/resource.less +0 -93
  173. package/assets/css/module/skill.less +0 -74
  174. package/assets/css/module/talent.less +0 -495
  175. package/assets/js/a.js +0 -46
  176. package/assets/js/code.js +0 -13
  177. package/assets/js/combo.js +0 -40
  178. package/assets/js/directory.js +0 -114
  179. package/assets/js/filter2.js +0 -186
  180. package/assets/js/fold.js +0 -11
  181. package/assets/js/gallery.js +0 -14
  182. package/assets/js/hljs_languages.js +0 -177
  183. package/assets/js/iframe.js +0 -38
  184. package/assets/js/img.js +0 -23
  185. package/assets/js/item/attribute_percent.js +0 -88
  186. package/assets/js/item/bind.js +0 -18
  187. package/assets/js/item/border.js +0 -19
  188. package/assets/js/item/border_quest.js +0 -12
  189. package/assets/js/item/color.js +0 -25
  190. package/assets/js/item/hljs_languages.js +0 -177
  191. package/assets/js/item/icon_url.js +0 -15
  192. package/assets/js/item/second_format.js +0 -19
  193. package/assets/js/jx3_element.js +0 -73
  194. package/assets/js/katex.js +0 -181
  195. package/assets/js/macro.js +0 -16
  196. package/assets/js/nextpage.js +0 -4
  197. package/assets/js/pswp.js +0 -67
  198. package/assets/js/pswp_template.js +0 -66
  199. package/assets/js/pz_iframe.js +0 -30
  200. package/assets/js/qixue.js +0 -28
  201. package/assets/js/renderImgPreview.js +0 -18
  202. package/assets/js/script.js +0 -6
  203. package/assets/js/stat.js +0 -107
  204. package/assets/js/talent2.js +0 -21
  205. package/assets/js/tex-mml-chtml.js +0 -36310
  206. package/assets/js/voice.js +0 -238
  207. package/assets/js/xss.js +0 -130
  208. package/src/editor/Article.vue +0 -230
  209. package/src/editor/BoxResource.vue +0 -441
  210. package/src/editor/Resource.vue +0 -623
  211. package/src/editor/Tinymce.vue +0 -204
  212. package/src/editor/Upload.vue +0 -277
  213. package/src/editor/UploadAlum.vue +0 -176
  214. package/src/editor/UploadBanner.vue +0 -156
  215. package/src/editor/components/Author.vue +0 -322
  216. package/src/editor/components/Avatar.vue +0 -95
  217. package/src/editor/components/Buff.vue +0 -80
  218. package/src/editor/components/Combo.vue +0 -259
  219. package/src/editor/components/Equip.vue +0 -299
  220. package/src/editor/components/GameText.vue +0 -242
  221. package/src/editor/components/Item.vue +0 -325
  222. package/src/editor/components/ItemSimple.vue +0 -134
  223. package/src/editor/components/Medal.vue +0 -43
  224. package/src/editor/components/Npc.vue +0 -215
  225. package/src/editor/components/PostAuthor.vue +0 -102
  226. package/src/editor/components/Skill.vue +0 -71
@@ -1,19 +1,29 @@
1
1
  <template>
2
2
  <div class="w-boxcoin-user" v-if="allowBoxcoin">
3
- <el-tooltip effect="dark" content="投币" placement="top-start" v-if="canGift">
3
+ <el-tooltip
4
+ effect="dark"
5
+ :content="$jx3boxT('jx3boxUi.boxcoinUser.tooltip', '投币')"
6
+ placement="top-start"
7
+ v-if="canGift"
8
+ >
4
9
  <div class="w-boxcoin-block" @click="openBoxcoinPop">
5
10
  <img class="u-icon" svg-inline :src="iconPath" />
6
11
  <span class="u-count" v-if="boxcoin">{{ boxcoin }}</span>
7
12
  </div>
8
13
  </el-tooltip>
9
- <el-tooltip effect="dark" content="您当前等级不够,不能够进行投币。" placement="top" v-else>
14
+ <el-tooltip
15
+ effect="dark"
16
+ :content="$jx3boxT('jx3boxUi.boxcoinUser.disabledTooltip', '您当前等级不够,不能够进行投币。')"
17
+ placement="top"
18
+ v-else
19
+ >
10
20
  <div class="w-boxcoin-block disabled">
11
21
  <img class="u-icon" svg-inline :src="iconPath" />
12
22
  <span class="u-count" v-if="boxcoin">{{ boxcoin }}</span>
13
23
  </div>
14
24
  </el-tooltip>
15
25
  <el-dialog
16
- title="投币打赏"
26
+ :title="$jx3boxT('jx3boxUi.boxcoinUser.dialogTitle', '投币打赏')"
17
27
  v-model="visible"
18
28
  class="w-boxcoin-pop"
19
29
  append-to-body
@@ -21,34 +31,34 @@
21
31
  >
22
32
  <div class="w-boxcoin-user-content">
23
33
  <div class="u-left">
24
- <em class="u-label">当前拥有盒币</em>
34
+ <em class="u-label">{{ $jx3boxT("jx3boxUi.boxcoinUser.currentBoxcoin", "当前拥有盒币") }}</em>
25
35
  <b>{{ left }}</b>
26
- <a class="u-charge" :href="chargeLink" target="_blank">[充值]</a>
36
+ <a class="u-charge" :href="chargeLink" target="_blank">[{{ $jx3boxT("jx3boxUi.boxcoinUser.recharge", "充值") }}]</a>
27
37
  </div>
28
38
  <div class="u-list">
29
- <em class="u-label">❤️ 打赏</em>
39
+ <em class="u-label">❤️ {{ $jx3boxT("jx3boxUi.boxcoinUser.reward", "打赏") }}</em>
30
40
  <Contributors v-if="authors && authors.length" :authors="authors" @chosen="handleChosen" />
31
41
  <div class="u-points">
32
42
  <el-radio-group v-model="count">
33
43
  <el-radio :value="item" v-for="item in fitPoints" :key="item" border>
34
44
  <b>{{ item }}</b
35
- >盒币
45
+ >{{ $jx3boxT("jx3boxUi.boxcoinUser.boxcoin", "盒币") }}
36
46
  </el-radio>
37
- <el-radio value="custom" border>自定义</el-radio>
47
+ <el-radio value="custom" border>{{ $jx3boxT("jx3boxUi.boxcoinUser.custom", "自定义") }}</el-radio>
38
48
  <el-input
39
49
  v-model="amount"
40
50
  v-show="count === 'custom'"
41
- placeholder="输入自定义数量"
51
+ :placeholder="$jx3boxT('jx3boxUi.boxcoinUser.customPlaceholder', '输入自定义数量')"
42
52
  ></el-input>
43
53
  </el-radio-group>
44
54
  </div>
45
55
  </div>
46
56
  <div class="u-msg">
47
- <em class="u-label">📝 寄语</em>
57
+ <em class="u-label">📝 {{ $jx3boxT("jx3boxUi.boxcoinUser.remark", "寄语") }}</em>
48
58
  <div class="u-input">
49
59
  <el-input
50
60
  v-model="remark"
51
- placeholder="请输入寄语(必填)"
61
+ :placeholder="$jx3boxT('jx3boxUi.boxcoinUser.remarkPlaceholder', '请输入寄语(必填)')"
52
62
  :minlength="2"
53
63
  :maxlength="30"
54
64
  show-word-limit
@@ -58,8 +68,10 @@
58
68
  </div>
59
69
  <template #footer>
60
70
  <span class="dialog-footer">
61
- <el-button @click="visible = false">取 消</el-button>
62
- <el-button type="primary" @click="submit" :disabled="!ready">确 定</el-button>
71
+ <el-button @click="visible = false">{{ $jx3boxT("jx3boxUi.common.cancel", "取消") }}</el-button>
72
+ <el-button type="primary" @click="submit" :disabled="!ready">{{
73
+ $jx3boxT("jx3boxUi.common.confirm", "确定")
74
+ }}</el-button>
63
75
  </span>
64
76
  </template>
65
77
  </el-dialog>
@@ -72,8 +84,10 @@ import User from "@jx3box/jx3box-common/js/user";
72
84
  import Contributors from "./Contributors.vue";
73
85
  import { debounce } from "lodash";
74
86
  import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
87
+ import i18nMixin from "../../i18n/mixin";
75
88
  export default {
76
89
  name: "BoxcoinUser",
90
+ mixins: [i18nMixin],
77
91
  props: {
78
92
  boxcoin: {
79
93
  type: Number,
@@ -124,7 +138,7 @@ export default {
124
138
  visible: false,
125
139
 
126
140
  count: 0,
127
- remark: "辛苦了,谢谢大大!",
141
+ remark: this.$jx3boxT("jx3boxUi.boxcoinUser.defaultRemark", "辛苦了,谢谢大大!"),
128
142
  amount: "",
129
143
 
130
144
  left: this.own,
@@ -190,7 +204,7 @@ export default {
190
204
  })
191
205
  .then((res) => {
192
206
  this.$message({
193
- message: "操作成功",
207
+ message: this.$jx3boxT("jx3boxUi.boxcoinUser.success", "操作成功"),
194
208
  type: "success",
195
209
  });
196
210
  return res.data.data;
@@ -216,6 +230,10 @@ export default {
216
230
  .w-boxcoin-user {
217
231
  .dbi;
218
232
  .x(left);
233
+ .w-boxcoin-block {
234
+ .flex;
235
+ align-items: center;
236
+ }
219
237
  .u-icon {
220
238
  .size(26px);
221
239
  .y;
@@ -224,8 +242,6 @@ export default {
224
242
  .u-count {
225
243
  color: #888;
226
244
  .ml(10px);
227
- .pr;
228
- top: 4px;
229
245
  }
230
246
  .u-charge {
231
247
  .underline(@color-link);
@@ -14,8 +14,10 @@
14
14
  import User from "@jx3box/jx3box-common/js/user";
15
15
  import { hasFav, addFav, delFav } from "../../service/fav";
16
16
  import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
17
+ import i18nMixin from "../../i18n/mixin";
17
18
  export default {
18
19
  name: "FavoriteComp",
20
+ mixins: [i18nMixin],
19
21
  props: {
20
22
  postType: {
21
23
  type: String,
@@ -47,7 +49,9 @@ export default {
47
49
  },
48
50
  computed: {
49
51
  favContent() {
50
- return this.favorite ? "已收藏" : "收藏";
52
+ return this.favorite
53
+ ? this.$jx3boxT("jx3boxUi.fav.collected", "已收藏")
54
+ : this.$jx3boxT("jx3boxUi.fav.collect", "收藏");
51
55
  },
52
56
  starIcon() {
53
57
  return this.isOld ? require("../../assets/img/widget/star.svg") : JX3BOX.__cdn + "design/vector/icon/collect.svg"
@@ -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,