@jx3box/jx3box-ui 0.0.1

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 (408) hide show
  1. package/.env +6 -0
  2. package/README.md +4 -0
  3. package/assets/css/bread/admin.less +131 -0
  4. package/assets/css/bread/breadcrumb.less +163 -0
  5. package/assets/css/bread/crumb.less +17 -0
  6. package/assets/css/comment/quick-reply.less +56 -0
  7. package/assets/css/common/bottom.less +21 -0
  8. package/assets/css/common/footer.less +78 -0
  9. package/assets/css/common/left-sidebar.less +137 -0
  10. package/assets/css/common/main.less +75 -0
  11. package/assets/css/common/right-sidebar.less +193 -0
  12. package/assets/css/common/suspend-common.less +343 -0
  13. package/assets/css/editor/article.less +36 -0
  14. package/assets/css/editor/combo.less +311 -0
  15. package/assets/css/editor/resource.less +335 -0
  16. package/assets/css/editor/tinymce.less +80 -0
  17. package/assets/css/editor/upload.less +111 -0
  18. package/assets/css/filters/client-by.less +33 -0
  19. package/assets/css/header/box.less +181 -0
  20. package/assets/css/interact/like2.less +20 -0
  21. package/assets/css/interact/share2.less +101 -0
  22. package/assets/css/mixin.less +64 -0
  23. package/assets/css/module/author.less +190 -0
  24. package/assets/css/module/buff.less +78 -0
  25. package/assets/css/module/directory.less +143 -0
  26. package/assets/css/module/icon.less +21 -0
  27. package/assets/css/module/item.less +229 -0
  28. package/assets/css/module/item_simple.less +51 -0
  29. package/assets/css/module/jx3_element.less +4 -0
  30. package/assets/css/module/macro.less +72 -0
  31. package/assets/css/module/npc.less +220 -0
  32. package/assets/css/module/resource.less +80 -0
  33. package/assets/css/module/skill.less +65 -0
  34. package/assets/css/module/talent.less +424 -0
  35. package/assets/css/single/author.less +101 -0
  36. package/assets/css/single/cms-single.less +55 -0
  37. package/assets/css/single/thx.less +230 -0
  38. package/assets/css/tinymce/_.less +28 -0
  39. package/assets/css/tinymce/a.less +29 -0
  40. package/assets/css/tinymce/code.less +159 -0
  41. package/assets/css/tinymce/combo.less +86 -0
  42. package/assets/css/tinymce/fold.less +70 -0
  43. package/assets/css/tinymce/h.less +58 -0
  44. package/assets/css/tinymce/hr.less +9 -0
  45. package/assets/css/tinymce/img.less +16 -0
  46. package/assets/css/tinymce/imgpreview.less +14 -0
  47. package/assets/css/tinymce/latex.less +43 -0
  48. package/assets/css/tinymce/list.less +65 -0
  49. package/assets/css/tinymce/macro.less +40 -0
  50. package/assets/css/tinymce/nextpage.less +65 -0
  51. package/assets/css/tinymce/p.less +8 -0
  52. package/assets/css/tinymce/plugin.less +3 -0
  53. package/assets/css/tinymce/pz.less +39 -0
  54. package/assets/css/tinymce/qixue.less +39 -0
  55. package/assets/css/tinymce/quote.less +12 -0
  56. package/assets/css/tinymce/table.less +59 -0
  57. package/assets/css/tinymce/video.less +61 -0
  58. package/assets/css/var.less +1 -0
  59. package/assets/data/box.json +184 -0
  60. package/assets/data/box2.json +606 -0
  61. package/assets/data/detach_type.json +29 -0
  62. package/assets/data/game_font.json +242 -0
  63. package/assets/data/nav.json +12 -0
  64. package/assets/data/panel.json +27 -0
  65. package/assets/data/reply_template.json +6 -0
  66. package/assets/data/weapon_type.json +20 -0
  67. package/assets/data/zlp.json +5 -0
  68. package/assets/img/author/bilibili.png +0 -0
  69. package/assets/img/author/bilibili.svg +1 -0
  70. package/assets/img/author/chat.png +0 -0
  71. package/assets/img/author/douyu.png +0 -0
  72. package/assets/img/author/douyu.svg +1 -0
  73. package/assets/img/author/github.svg +1 -0
  74. package/assets/img/author/huya.png +0 -0
  75. package/assets/img/author/huya.svg +1 -0
  76. package/assets/img/author/msg.svg +55 -0
  77. package/assets/img/author/tuilan.png +0 -0
  78. package/assets/img/author/weibo.svg +70 -0
  79. package/assets/img/bread/menu.svg +1 -0
  80. package/assets/img/comment/comment.svg +1 -0
  81. package/assets/img/comment/heart_1.svg +1 -0
  82. package/assets/img/comment/heart_2.svg +1 -0
  83. package/assets/img/comment/hide.svg +1 -0
  84. package/assets/img/common/add.svg +1 -0
  85. package/assets/img/common/android.svg +1 -0
  86. package/assets/img/common/bell.svg +1 -0
  87. package/assets/img/common/bilibili-black.svg +1 -0
  88. package/assets/img/common/bilibili.svg +1 -0
  89. package/assets/img/common/check.svg +1 -0
  90. package/assets/img/common/coin.svg +1 -0
  91. package/assets/img/common/coupon.svg +56 -0
  92. package/assets/img/common/douyin.svg +1 -0
  93. package/assets/img/common/edit.svg +1 -0
  94. package/assets/img/common/followus.svg +18 -0
  95. package/assets/img/common/gift.svg +1 -0
  96. package/assets/img/common/harmony.svg +1 -0
  97. package/assets/img/common/ios.svg +1 -0
  98. package/assets/img/common/jx3-origin.svg +15 -0
  99. package/assets/img/common/jx3-www.svg +9 -0
  100. package/assets/img/common/lang.svg +6 -0
  101. package/assets/img/common/logo.svg +5 -0
  102. package/assets/img/common/manage.svg +1 -0
  103. package/assets/img/common/miniprogram.jpg +0 -0
  104. package/assets/img/common/miniprogram.svg +1 -0
  105. package/assets/img/common/mp.jpg +0 -0
  106. package/assets/img/common/msg.svg +1 -0
  107. package/assets/img/common/news.svg +20 -0
  108. package/assets/img/common/qqbot.svg +7 -0
  109. package/assets/img/common/qrcode.svg +1 -0
  110. package/assets/img/common/search-key-slash.svg +5 -0
  111. package/assets/img/common/send.svg +56 -0
  112. package/assets/img/common/setting.svg +1 -0
  113. package/assets/img/common/vip.svg +1 -0
  114. package/assets/img/common/wechat.svg +48 -0
  115. package/assets/img/common/weibo.svg +70 -0
  116. package/assets/img/editor/buff.svg +1 -0
  117. package/assets/img/editor/file.svg +51 -0
  118. package/assets/img/editor/icons.svg +15 -0
  119. package/assets/img/editor/item.svg +46 -0
  120. package/assets/img/editor/jx3.svg +11 -0
  121. package/assets/img/editor/jx3box.svg +5 -0
  122. package/assets/img/editor/skill.svg +53 -0
  123. package/assets/img/editor/view.svg +1 -0
  124. package/assets/img/footer/android.svg +1 -0
  125. package/assets/img/footer/china.svg +1 -0
  126. package/assets/img/footer/harmony.svg +1 -0
  127. package/assets/img/footer/ios.svg +1 -0
  128. package/assets/img/footer/logo.svg +5 -0
  129. package/assets/img/footer/miniprogram.svg +1 -0
  130. package/assets/img/footer/qqbot.svg +7 -0
  131. package/assets/img/header/add.svg +1 -0
  132. package/assets/img/header/bell.svg +1 -0
  133. package/assets/img/header/check.svg +1 -0
  134. package/assets/img/header/coin.svg +1 -0
  135. package/assets/img/header/edit.svg +1 -0
  136. package/assets/img/header/gift.svg +1 -0
  137. package/assets/img/header/logo.svg +5 -0
  138. package/assets/img/header/manage.svg +1 -0
  139. package/assets/img/header/msg.svg +1 -0
  140. package/assets/img/header/search-key-slash.svg +5 -0
  141. package/assets/img/header/send.svg +56 -0
  142. package/assets/img/header/setting.svg +1 -0
  143. package/assets/img/header/translator.svg +1 -0
  144. package/assets/img/header/vip.svg +1 -0
  145. package/assets/img/leftsidebar/arrow.svg +64 -0
  146. package/assets/img/leftsidebar/close.svg +49 -0
  147. package/assets/img/leftsidebar/fans.svg +1 -0
  148. package/assets/img/leftsidebar/medal.svg +1 -0
  149. package/assets/img/leftsidebar/more.svg +50 -0
  150. package/assets/img/leftsidebar/open.svg +51 -0
  151. package/assets/img/leftsidebar/post.svg +46 -0
  152. package/assets/img/leftsidebar/team.svg +1 -0
  153. package/assets/img/leftsidebar/united.svg +1 -0
  154. package/assets/img/list/post.svg +1 -0
  155. package/assets/img/mobile/miniprogram.jpg +0 -0
  156. package/assets/img/mobile/mp.jpg +0 -0
  157. package/assets/img/npc/attack.svg +69 -0
  158. package/assets/img/npc/buff.svg +20 -0
  159. package/assets/img/npc/energy.svg +1 -0
  160. package/assets/img/npc/miss.svg +1 -0
  161. package/assets/img/npc/npc.svg +1 -0
  162. package/assets/img/npc/radar.svg +45 -0
  163. package/assets/img/npc/shield.svg +1 -0
  164. package/assets/img/npc/sight.svg +1 -0
  165. package/assets/img/npc/skull.svg +15 -0
  166. package/assets/img/npc/target.svg +55 -0
  167. package/assets/img/price/jin.png +0 -0
  168. package/assets/img/price/tong.png +0 -0
  169. package/assets/img/price/yin.png +0 -0
  170. package/assets/img/price/zhuan.png +0 -0
  171. package/assets/img/rightsidebar/ac.svg +1 -0
  172. package/assets/img/rightsidebar/github.svg +1 -0
  173. package/assets/img/rightsidebar/repo.svg +1 -0
  174. package/assets/img/rightsidebar/topic_bg.svg +1 -0
  175. package/assets/img/rightsidebar/topic_bg_bps.svg +113 -0
  176. package/assets/img/single/author.svg +1 -0
  177. package/assets/img/single/directory-header.svg +1 -0
  178. package/assets/img/single/lock.svg +1 -0
  179. package/assets/img/single/modate.svg +24 -0
  180. package/assets/img/single/podate.svg +23 -0
  181. package/assets/img/single/ticket.svg +1 -0
  182. package/assets/img/suspend/ArrowsLeftRight.svg +1 -0
  183. package/assets/img/suspend/circle.svg +7 -0
  184. package/assets/img/suspend/collect.svg +1 -0
  185. package/assets/img/suspend/collect_slash.svg +1 -0
  186. package/assets/img/suspend/collect_slash_touchbar.svg +1 -0
  187. package/assets/img/suspend/collect_slash_touchbar_100.svg +1 -0
  188. package/assets/img/suspend/collect_touchbar.svg +1 -0
  189. package/assets/img/suspend/collect_touchbar_100.svg +1 -0
  190. package/assets/img/suspend/lafter_touchbar.svg +1 -0
  191. package/assets/img/suspend/later-on.svg +1 -0
  192. package/assets/img/suspend/line.svg +3 -0
  193. package/assets/img/suspend/more.svg +1 -0
  194. package/assets/img/suspend/pin_slash_24.svg +1 -0
  195. package/assets/img/suspend/pin_slash_touchbar.svg +1 -0
  196. package/assets/img/suspend/pin_slash_touchbar_24.svg +1 -0
  197. package/assets/img/suspend/pin_slash_touchbar_40.svg +1 -0
  198. package/assets/img/suspend/pin_touchbar.svg +1 -0
  199. package/assets/img/suspend/pin_touchbar_100.svg +1 -0
  200. package/assets/img/suspend/pin_touchbar_24.svg +1 -0
  201. package/assets/img/suspend/report_100.svg +1 -0
  202. package/assets/img/suspend/rss_touchbar.svg +1 -0
  203. package/assets/img/suspend/rss_touchbar_100.svg +1 -0
  204. package/assets/img/suspend/search.svg +3 -0
  205. package/assets/img/suspend/search_touchbar.svg +1 -0
  206. package/assets/img/widget/admin_gift.svg +10 -0
  207. package/assets/img/widget/gift.svg +1 -0
  208. package/assets/img/widget/heart.svg +17 -0
  209. package/assets/img/widget/heart1.svg +1 -0
  210. package/assets/img/widget/heart2.svg +11 -0
  211. package/assets/img/widget/heart3.svg +37 -0
  212. package/assets/img/widget/like.svg +1 -0
  213. package/assets/img/widget/like2.svg +1 -0
  214. package/assets/img/widget/like3.svg +14 -0
  215. package/assets/img/widget/like4.png +0 -0
  216. package/assets/img/widget/like4ing.gif +0 -0
  217. package/assets/img/widget/qq.svg +1 -0
  218. package/assets/img/widget/qr-code.svg +1 -0
  219. package/assets/img/widget/qzone.svg +1 -0
  220. package/assets/img/widget/records.svg +1 -0
  221. package/assets/img/widget/share-link.png +0 -0
  222. package/assets/img/widget/share.svg +13 -0
  223. package/assets/img/widget/share2.svg +19 -0
  224. package/assets/img/widget/star.svg +9 -0
  225. package/assets/img/widget/tieba.svg +1 -0
  226. package/assets/img/widget/unstar.svg +21 -0
  227. package/assets/img/widget/web_heart_animation.png +0 -0
  228. package/assets/img/widget/weibo.svg +1 -0
  229. package/assets/img/widget/weixin.svg +1 -0
  230. package/assets/js/a.js +46 -0
  231. package/assets/js/app.js +7 -0
  232. package/assets/js/code.js +13 -0
  233. package/assets/js/combo.js +40 -0
  234. package/assets/js/directory.js +114 -0
  235. package/assets/js/filter2.js +186 -0
  236. package/assets/js/fold.js +11 -0
  237. package/assets/js/gallery.js +14 -0
  238. package/assets/js/hljs_languages.js +177 -0
  239. package/assets/js/iframe.js +38 -0
  240. package/assets/js/img.js +23 -0
  241. package/assets/js/item/attribute_percent.js +88 -0
  242. package/assets/js/item/bind.js +18 -0
  243. package/assets/js/item/border.js +19 -0
  244. package/assets/js/item/border_quest.js +12 -0
  245. package/assets/js/item/color.js +25 -0
  246. package/assets/js/item/hljs_languages.js +177 -0
  247. package/assets/js/item/icon_url.js +15 -0
  248. package/assets/js/item/second_format.js +19 -0
  249. package/assets/js/jx3_element.js +73 -0
  250. package/assets/js/katex.js +181 -0
  251. package/assets/js/macro.js +16 -0
  252. package/assets/js/nextpage.js +4 -0
  253. package/assets/js/pswp.js +67 -0
  254. package/assets/js/pswp_template.js +66 -0
  255. package/assets/js/pz_iframe.js +30 -0
  256. package/assets/js/qixue.js +28 -0
  257. package/assets/js/renderImgPreview.js +18 -0
  258. package/assets/js/script.js +6 -0
  259. package/assets/js/stat.js +107 -0
  260. package/assets/js/talent2.js +21 -0
  261. package/assets/js/tex-mml-chtml.js +36310 -0
  262. package/assets/js/voice.js +238 -0
  263. package/assets/js/xss.js +130 -0
  264. package/babel.config.js +3 -0
  265. package/docs/README.md +78 -0
  266. package/i18n/index.js +134 -0
  267. package/i18n/messages/en-US.js +124 -0
  268. package/i18n/messages/vi.js +124 -0
  269. package/i18n/messages/zh-CN.js +124 -0
  270. package/i18n/messages/zh-TW.js +124 -0
  271. package/i18n/mixin.js +23 -0
  272. package/index.js +73 -0
  273. package/package.json +97 -0
  274. package/postcss.config.js +3 -0
  275. package/service/admin.js +20 -0
  276. package/service/author.js +94 -0
  277. package/service/breadcrumb.js +13 -0
  278. package/service/cms.js +137 -0
  279. package/service/comment.js +187 -0
  280. package/service/database.js +115 -0
  281. package/service/design.js +13 -0
  282. package/service/enum/CollectionPublic.js +13 -0
  283. package/service/enum/EquipPosition.js +48 -0
  284. package/service/enum/EquipType.js +33 -0
  285. package/service/fav.js +27 -0
  286. package/service/follow.js +55 -0
  287. package/service/github.js +15 -0
  288. package/service/header.js +42 -0
  289. package/service/item.js +22 -0
  290. package/service/resource.js +31 -0
  291. package/service/suspend.js +81 -0
  292. package/service/thx.js +60 -0
  293. package/src/App.vue +212 -0
  294. package/src/Bottom.vue +23 -0
  295. package/src/Box.vue +149 -0
  296. package/src/Breadcrumb.vue +141 -0
  297. package/src/CommonFooter.vue +69 -0
  298. package/src/CommonHeader.vue +270 -0
  299. package/src/Footer.vue +45 -0
  300. package/src/LeftSideToggle.vue +64 -0
  301. package/src/LeftSidebar.vue +123 -0
  302. package/src/Main.vue +48 -0
  303. package/src/RightSidebar.vue +61 -0
  304. package/src/SuspendCommon.vue +705 -0
  305. package/src/author/AuthorFans.vue +170 -0
  306. package/src/author/AuthorFollow.vue +205 -0
  307. package/src/author/AuthorGift.vue +286 -0
  308. package/src/author/AuthorHonor.vue +128 -0
  309. package/src/author/AuthorInfo.vue +245 -0
  310. package/src/author/AuthorLink.vue +113 -0
  311. package/src/author/AuthorMedals.vue +87 -0
  312. package/src/author/AuthorMsg.vue +25 -0
  313. package/src/author/AuthorPosts.vue +114 -0
  314. package/src/author/AuthorRss.vue +160 -0
  315. package/src/author/AuthorTeams.vue +106 -0
  316. package/src/author/Avatar.vue +168 -0
  317. package/src/author/UserPop.vue +198 -0
  318. package/src/bread/Admin.vue +400 -0
  319. package/src/bread/AdminButton.vue +31 -0
  320. package/src/bread/AdminDirectMessage.vue +73 -0
  321. package/src/bread/AdminDrop.vue +155 -0
  322. package/src/bread/Crumb.vue +27 -0
  323. package/src/bread/DesignTask.vue +194 -0
  324. package/src/comment/Avatar.vue +124 -0
  325. package/src/comment/CommentContent.vue +486 -0
  326. package/src/comment/CommentContentSimple.vue +240 -0
  327. package/src/comment/CommentInputForm.vue +182 -0
  328. package/src/comment/CommentWithReply.vue +261 -0
  329. package/src/comment/QuickReply.vue +64 -0
  330. package/src/comment/ReplyForReply.vue +127 -0
  331. package/src/comment/ReplyItem.vue +92 -0
  332. package/src/comment/ReplyList.vue +126 -0
  333. package/src/comment/Upload.vue +108 -0
  334. package/src/editor/Article.vue +230 -0
  335. package/src/editor/BoxResource.vue +441 -0
  336. package/src/editor/Resource.vue +623 -0
  337. package/src/editor/Tinymce.vue +204 -0
  338. package/src/editor/Upload.vue +277 -0
  339. package/src/editor/UploadAlum.vue +176 -0
  340. package/src/editor/UploadBanner.vue +156 -0
  341. package/src/editor/components/Author.vue +322 -0
  342. package/src/editor/components/Avatar.vue +95 -0
  343. package/src/editor/components/Buff.vue +80 -0
  344. package/src/editor/components/Combo.vue +259 -0
  345. package/src/editor/components/Equip.vue +299 -0
  346. package/src/editor/components/GameText.vue +242 -0
  347. package/src/editor/components/Item.vue +325 -0
  348. package/src/editor/components/ItemSimple.vue +134 -0
  349. package/src/editor/components/Medal.vue +43 -0
  350. package/src/editor/components/Npc.vue +215 -0
  351. package/src/editor/components/PostAuthor.vue +102 -0
  352. package/src/editor/components/Skill.vue +71 -0
  353. package/src/filters/clientBy.vue +96 -0
  354. package/src/filters/markBy.vue +177 -0
  355. package/src/filters/menuBy.vue +63 -0
  356. package/src/filters/orderBy.vue +170 -0
  357. package/src/filters/tagBy.vue +171 -0
  358. package/src/filters/topicBy.vue +151 -0
  359. package/src/filters/versionBy.vue +49 -0
  360. package/src/filters/zlpBy.vue +70 -0
  361. package/src/footer/copyright.vue +59 -0
  362. package/src/footer/links.vue +79 -0
  363. package/src/footer/official.vue +142 -0
  364. package/src/footer/resource.vue +146 -0
  365. package/src/header/alternate.vue +299 -0
  366. package/src/header/asset.vue +180 -0
  367. package/src/header/box.vue +161 -0
  368. package/src/header/box2.vue +479 -0
  369. package/src/header/bus.js +9 -0
  370. package/src/header/client.vue +183 -0
  371. package/src/header/lang.vue +136 -0
  372. package/src/header/logo.vue +95 -0
  373. package/src/header/manage.vue +200 -0
  374. package/src/header/message.vue +93 -0
  375. package/src/header/nav.vue +356 -0
  376. package/src/header/publish.vue +38 -0
  377. package/src/header/search.vue +120 -0
  378. package/src/header/search_map.json +3 -0
  379. package/src/header/shop.vue +121 -0
  380. package/src/header/user.vue +250 -0
  381. package/src/header/userInfo.vue +621 -0
  382. package/src/header/utils.js +126 -0
  383. package/src/header/vip.vue +120 -0
  384. package/src/interact/BoxcoinAdmin.vue +185 -0
  385. package/src/interact/BoxcoinRecords.vue +153 -0
  386. package/src/interact/BoxcoinUser.vue +194 -0
  387. package/src/interact/Contributors.vue +111 -0
  388. package/src/interact/Fav.vue +95 -0
  389. package/src/interact/Like.vue +61 -0
  390. package/src/interact/Rss.vue +163 -0
  391. package/src/interact/Share.vue +166 -0
  392. package/src/interact/WatchLater.vue +108 -0
  393. package/src/main.js +72 -0
  394. package/src/single/Author.vue +72 -0
  395. package/src/single/Collection.vue +176 -0
  396. package/src/single/Comment.vue +454 -0
  397. package/src/single/Creators.vue +214 -0
  398. package/src/single/PostDirectory.vue +147 -0
  399. package/src/single/PostHeader.vue +397 -0
  400. package/src/single/PostTopic.vue +127 -0
  401. package/src/single/SimpleThx.vue +217 -0
  402. package/src/single/Thx.vue +260 -0
  403. package/src/single/cms-single.vue +235 -0
  404. package/tailwind.config.js +13 -0
  405. package/utils/bus.js +5 -0
  406. package/utils/emotion.js +21 -0
  407. package/utils/index.js +36 -0
  408. package/vue.config.js +158 -0
@@ -0,0 +1,240 @@
1
+ <template>
2
+ <div class="u-reply">
3
+ <div class="u-reply-content">
4
+ <span class="u-reply-label" v-if="replyForUserId != 0">
5
+ 回复
6
+ <el-link type="primary" target="_blank" :href="userHref"
7
+ >@{{ replyForUsername }}</el-link
8
+ >
9
+ :
10
+ </span>
11
+ <div class="u-reply-text" v-html="renderContent"></div>
12
+ <!--<div class="u-reply-text" v-html="content"></div>-->
13
+ <!-- <p v-for="(p, index) in getPList(content)" :key="index" v-html="formatContent(p)"></p> -->
14
+ </div>
15
+ <div class="u-attachements" v-if="attachments.length">
16
+ <el-image
17
+ v-for="url in attachments"
18
+ :key="url"
19
+ :src="showAttachment(url)"
20
+ :preview-src-list="[showPreview(url)]"
21
+ lazy
22
+ ></el-image>
23
+ </div>
24
+ <div class="u-toolbar">
25
+ <el-button
26
+ class="u-admin"
27
+ v-if="!currentUserHadLike"
28
+ link
29
+ size="small"
30
+ @click="doLike(true)"
31
+ ><img
32
+ class="u-up"
33
+ src="../../assets/img/comment/heart_1.svg"
34
+ alt=""
35
+ />点赞<span class="u-like-count">{{
36
+ likesFormat(hasLikeCount)
37
+ }}</span></el-button
38
+ >
39
+ <el-button
40
+ class="u-admin"
41
+ link
42
+ size="small"
43
+ v-if="currentUserHadLike"
44
+ @click="doLike(false)"
45
+ ><img
46
+ class="u-up"
47
+ src="../../assets/img/comment/heart_2.svg"
48
+ alt=""
49
+ />已赞<span class="u-like-count">{{
50
+ likesFormat(hasLikeCount)
51
+ }}</span></el-button
52
+ >
53
+ <el-button
54
+ class="u-admin"
55
+ v-if="canReply"
56
+ link
57
+ icon="ChatLineRound"
58
+ size="small"
59
+ @click="showReplyForReplyInput"
60
+ type="primary"
61
+ >回复</el-button
62
+ >
63
+ <el-button
64
+ class="u-admin"
65
+ v-if="canDelete"
66
+ link
67
+ icon="Delete"
68
+ size="small"
69
+ type="danger"
70
+ @click="deleteComment"
71
+ >删除</el-button
72
+ >
73
+ <el-button
74
+ class="u-admin"
75
+ link
76
+ size="small"
77
+ icon="Delete"
78
+ v-if="canHide"
79
+ @click="hideComment"
80
+ title="拉入黑洞后,仅评论者自己独自可见"
81
+ >
82
+ 黑洞</el-button
83
+ >
84
+ <time class="u-date">
85
+ <i class="Clock"></i>
86
+ {{ dataFormat(date) }}
87
+ </time>
88
+ </div>
89
+ </div>
90
+ </template>
91
+
92
+ <script>
93
+ import { resolveImagePath, authorLink } from "@jx3box/jx3box-common/js/utils";
94
+ import { formatContent } from "../../utils/emotion";
95
+ function fillZero(num) {
96
+ return num > 9 ? num : `0${num}`;
97
+ }
98
+ export default {
99
+ props: [
100
+ "commentId",
101
+ "content",
102
+ "attachments",
103
+ "date",
104
+ "hasReply",
105
+ "canDelete",
106
+ "canHide",
107
+ "canReply",
108
+ "isLike", // 是否已点赞
109
+ "likes", // 点赞数
110
+ "userHref",
111
+ "replyForUsername",
112
+ "replyForUserId",
113
+ ],
114
+ data: function () {
115
+ return {
116
+ showInput: false,
117
+ currentUserHadLike: this.isLike,
118
+ hasLikeCount: this.likes,
119
+
120
+ renderContent: "",
121
+ };
122
+ },
123
+ computed: {
124
+ _attachments: function () {
125
+ return this.attachments.map((val) => {
126
+ return resolveImagePath(val);
127
+ });
128
+ },
129
+ },
130
+ watch: {
131
+ content: {
132
+ handler: function (val) {
133
+ this.formatContent(val);
134
+ },
135
+ immediate: true,
136
+ },
137
+ },
138
+ methods: {
139
+ profileLink: function (uid) {
140
+ return authorLink(uid);
141
+ },
142
+ showAttachment: function (val) {
143
+ return resolveImagePath(val) + "?x-oss-process=style/comment_thumb";
144
+ },
145
+ async formatContent(str) {
146
+ this.renderContent = await formatContent(str);
147
+ },
148
+ getPList(content) {
149
+ return content.split("\n");
150
+ },
151
+ doLike(setLike) {
152
+ if (setLike === this.currentUserHadLike) {
153
+ return;
154
+ }
155
+ this.currentUserHadLike = setLike;
156
+ this.hasLikeCount = setLike
157
+ ? this.hasLikeCount + 1
158
+ : this.hasLikeCount - 1;
159
+ this.$emit("setLikeComment", setLike);
160
+ },
161
+ deleteComment() {
162
+ this.$confirm("确定删除该评论吗?", "提示", {
163
+ confirmButtonText: "确定",
164
+ cancelButtonText: "取消",
165
+ type: "warning",
166
+ })
167
+ .then(() => {
168
+ this.$emit("delete", this.commentId);
169
+ })
170
+ .catch(() => {});
171
+ },
172
+ hideComment() {
173
+ this.$confirm("确定隐藏该评论吗?", "提示", {
174
+ confirmButtonText: "确定",
175
+ cancelButtonText: "取消",
176
+ type: "warning",
177
+ })
178
+ .then(() => {
179
+ this.$emit("hide", this.commentId);
180
+ })
181
+ .catch(() => {});
182
+ },
183
+ likesFormat(count) {
184
+ return count > 0 ? count : "";
185
+ },
186
+ dataFormat(str) {
187
+ let d = new Date(str);
188
+ return (
189
+ d.getFullYear() +
190
+ "-" +
191
+ fillZero(d.getMonth() + 1) +
192
+ "-" +
193
+ fillZero(d.getDate()) +
194
+ " " +
195
+ fillZero(d.getHours()) +
196
+ ":" +
197
+ fillZero(d.getMinutes()) +
198
+ ":" +
199
+ fillZero(d.getSeconds())
200
+ );
201
+ },
202
+ showReplyForReplyInput() {
203
+ this.$emit("showReplyInput");
204
+ },
205
+ previewImg(i) {
206
+ this.$hevueImgPreview({
207
+ multiple: true,
208
+ nowImgIndex: i,
209
+ imgList: this._attachments,
210
+ controlBar: false,
211
+ clickMaskCLose: true,
212
+ });
213
+ },
214
+ showPreview: function (val) {
215
+ return resolveImagePath(val);
216
+ },
217
+ },
218
+ };
219
+ </script>
220
+
221
+ <style lang="less">
222
+ .u-reply-content {
223
+ div,
224
+ p {
225
+ padding: 0;
226
+ margin: 0;
227
+ line-height: 1.75;
228
+ font-size: 14px;
229
+ img {
230
+ vertical-align: -3px;
231
+ }
232
+ }
233
+ }
234
+ .u-reply-text {
235
+ white-space: pre-line;
236
+ }
237
+ .u-attachements {
238
+ margin-top: 10px;
239
+ }
240
+ </style>
@@ -0,0 +1,182 @@
1
+ <template>
2
+ <el-form ref="form" :model="newComment" class="c-comment-box">
3
+ <div class="u-mask">
4
+ 参与评论,需先进行<a href="/dashboard/auth" target="_blank" class="u-link">账号认证</a>。
5
+ </div>
6
+ <el-form-item>
7
+ <el-input
8
+ :rows="3"
9
+ type="textarea"
10
+ maxlength="300"
11
+ show-word-limit
12
+ v-model="newComment.content"
13
+ placeholder="参与讨论..."
14
+ :id="inputId"
15
+ ></el-input>
16
+ <div class="c-comment-tools">
17
+ <el-icon class="u-upload-icon" @click="showUploader = !showUploader"><Picture /></el-icon>
18
+ <Emotion
19
+ class="c-comment-emotion"
20
+ @selected="handleEmotionSelected"
21
+ type="pop"
22
+ :max="6">
23
+ </Emotion>
24
+ <quickReply @reply="onQuickReply"></quickReply>
25
+ <div class="c-comment-secret">
26
+ <el-checkbox class="u-secret" v-model="is_secret" border size="small">悄悄话
27
+ <el-tooltip class="item" effect="dark" content="勾选悄悄话后仅作者和你可见,并且不可再变更状态" placement="top">
28
+ <el-icon><InfoFilled></InfoFilled></el-icon> </el-tooltip></el-checkbox>
29
+ </div>
30
+ </div>
31
+ <Uploader
32
+ class="u-uploader"
33
+ ref="uploader"
34
+ @onFinish="attachmentUploadFinish"
35
+ @onError="attachmentUploadError"
36
+ v-if="showUploader"
37
+ />
38
+ <div class="u-toolbar">
39
+ <el-button
40
+ type="primary"
41
+ @click="onSubmit"
42
+ class="u-publish"
43
+ :disabled="disableSubmitBtn"
44
+ >发表评论</el-button
45
+ >
46
+ </div>
47
+ </el-form-item>
48
+ </el-form>
49
+ </template>
50
+
51
+ <script>
52
+ import Uploader from "./Upload.vue";
53
+ import Emotion from "@jx3box/jx3box-emotion/src/Emotion2.vue";
54
+ import QuickReply from "./QuickReply.vue";
55
+
56
+ export default {
57
+ components: {
58
+ Uploader,
59
+ Emotion,
60
+ QuickReply
61
+ },
62
+ props: {
63
+ // 用于判定该评论组件是否在底部
64
+ isBottom: {
65
+ type: Boolean,
66
+ default: false
67
+ }
68
+ },
69
+ mounted() {
70
+ if (this.isBottom) this.inputId = "textarea-bottom";
71
+ },
72
+ data: function() {
73
+ return {
74
+ showUploader: false,
75
+ disableSubmitBtn: false,
76
+ newComment: {
77
+ content: ""
78
+ },
79
+ inputId: "textarea-top",
80
+ is_secret: false,
81
+ };
82
+ },
83
+ methods: {
84
+ onSubmit() {
85
+ this.disableSubmitBtn = true;
86
+ if (this.$refs.uploader) {
87
+ this.$refs.uploader.upload();
88
+ } else {
89
+ this.attachmentUploadFinish([]);
90
+ }
91
+ },
92
+ onQuickReply(item) {
93
+ this.$emit("submit", {
94
+ content: item,
95
+ attachmentList: [],
96
+ is_template: 1,
97
+ });
98
+ },
99
+ // 文件上传完成后,进行数据提交
100
+ attachmentUploadFinish(data) {
101
+ this.$emit("submit", {
102
+ content: this.newComment.content,
103
+ attachmentList: data
104
+ });
105
+ this.newComment = {
106
+ content: ""
107
+ };
108
+ this.showUploader = false;
109
+
110
+ this.disableSubmitBtn = false;
111
+ },
112
+ attachmentUploadError() {
113
+ this.disableSubmitBtn = false;
114
+ },
115
+ // 处理表情
116
+ handleEmotionSelected(key) {
117
+ this.insertVariable(key);
118
+ },
119
+ /**
120
+ * add emotion to textarea
121
+ * @parma {string} emotionVal emotion key
122
+ */
123
+ async insertVariable(emotionVal) {
124
+ const myField = document.querySelector(`#${this.inputId}`);
125
+ const value = emotionVal.key
126
+ if (myField.selectionStart || myField.selectionStart === 0) {
127
+ let startPos = myField.selectionStart;
128
+ let endPos = myField.selectionEnd;
129
+
130
+ this.newComment.content =
131
+ myField.value.substring(0, startPos) +
132
+ value +
133
+ myField.value.substring(endPos, myField.value.length);
134
+
135
+ await this.$nextTick();
136
+
137
+ myField.focus();
138
+ myField.setSelectionRange(
139
+ endPos + value.length,
140
+ endPos + value.length
141
+ );
142
+ } else {
143
+ this.newComment.content = value;
144
+ }
145
+ }
146
+ }
147
+ };
148
+ </script>
149
+
150
+ <style lang="less">
151
+ .c-comment-secret {
152
+ margin-left: 15px;
153
+
154
+ .u-secret {
155
+ display: flex;
156
+ align-items: center;
157
+ .el-checkbox__inner{
158
+ display:block;
159
+ }
160
+ }
161
+ }
162
+ .c-comment-box {
163
+ .pr;
164
+
165
+ .u-mask {
166
+ .pa;
167
+ top: 0;
168
+ left: 0;
169
+ width: 100%;
170
+ height: 100%;
171
+ background: rgba(255, 255, 255, 0.8);
172
+ z-index: 10;
173
+ display: none;
174
+ text-align: center;
175
+ align-content: center;
176
+ }
177
+
178
+ .u-link {
179
+ color: @primary;
180
+ }
181
+ }
182
+ </style>
@@ -0,0 +1,261 @@
1
+ <template>
2
+ <div class="c-comment-cmt">
3
+ <div class="c-comment-cmt__box" :style="decorationStyles">
4
+ <CommentAvatar
5
+ :user-avatar="showAvatar(item.avatar)"
6
+ :user-href="profileLink(item.userId)"
7
+ :username="item.displayName"
8
+ :avatarFrame="item.user_avatar_frame"
9
+ :withFrame="true"
10
+ :avatarSize="48"
11
+ />
12
+ <div class="u-flex-1">
13
+ <div class="c-comment-cmt__author">
14
+ <el-link class="u-name" type="primary" target="_blank" :href="userHref">{{
15
+ username || "人字榜800线无名小侠"
16
+ }}</el-link>
17
+ <span class="u-mark u-top" v-if="item.is_top"
18
+ ><el-icon><Download></Download></el-icon>置顶</span
19
+ >
20
+ <span class="u-mark u-star" v-if="item.is_star"
21
+ ><el-icon><Star></Star></el-icon>精华</span
22
+ >
23
+ <span class="u-mark u-secret" v-if="item.is_secret"
24
+ ><el-icon><Cherry></Cherry></el-icon>悄悄话</span
25
+ >
26
+ </div>
27
+ <CommentContent
28
+ :date="item.commentDate"
29
+ :content="item.content"
30
+ :comment-id="item.id"
31
+ :attachments="stringToArray(item.attachments)"
32
+ :can-delete="power.can_del || power.uid == item.userId"
33
+ :can-set-top="(power.is_author || power.is_editor) && !item.is_top"
34
+ :can-cancel-top="(power.is_author || power.is_editor) && item.is_top"
35
+ :can-set-star="!item.is_star && (power.is_author || power.is_editor)"
36
+ :can-cancel-star="item.is_star && (power.is_author || power.is_editor)"
37
+ :can-add-white="!item.is_white && power.article_open_white == 1"
38
+ :can-remove-white="item.is_white && (power.is_author == 1 || power.is_editor == 1)"
39
+ :can-hide="power.is_author == 1 || power.is_editor == 1"
40
+ :is-like="item.is_likes == 1"
41
+ :likes="~~item.likes"
42
+ @addNewReply="addNewReply"
43
+ @deleteComment="deleteComment"
44
+ @setTopComment="setTopComment"
45
+ @setStarComment="setStarComment"
46
+ @setLikeComment="setLikeComment"
47
+ @setWhiteComment="setWhiteComment"
48
+ @hide="hideComment"
49
+ />
50
+ </div>
51
+ </div>
52
+ <ReplyList
53
+ :data="replyList"
54
+ :pager="pager"
55
+ :power="power"
56
+ @addNewReply="addNewReply"
57
+ @deleteReply="deleteReply"
58
+ @goto="gotoReplyListIndex"
59
+ @resetReply="resetReply"
60
+ @setLikeComment="setLikeReply"
61
+ @hide="hideComment"
62
+ />
63
+ </div>
64
+ </template>
65
+
66
+ <script>
67
+ import { showAvatar, authorLink } from "@jx3box/jx3box-common/js/utils";
68
+ import CommentContent from "./CommentContent.vue";
69
+ import ReplyList from "./ReplyList.vue";
70
+ import { POST, DELETE, GET } from "../../service/comment";
71
+ import CommentAvatar from "../comment/Avatar.vue";
72
+ import { getDecoration } from "../../service/cms";
73
+ import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
74
+ const { __imgPath } = JX3BOX;
75
+ const DECORATION_KEY = "decoration_comment_";
76
+ export default {
77
+ props: ["item", "baseApi", "power", "user-href", "username"],
78
+ components: {
79
+ CommentContent,
80
+ ReplyList,
81
+ CommentAvatar,
82
+ },
83
+ emits: ["deleteComment", "setTopComment", "setStarComment", "addNewReply", "deleteReply", "goto", "resetReply"],
84
+ data: function () {
85
+ return {
86
+ replyList: [],
87
+ pager: {
88
+ index: 1,
89
+ pageSize: 10,
90
+ pageTotal: 1,
91
+ total: 0,
92
+ },
93
+ decoration: null,
94
+ };
95
+ },
96
+ computed: {
97
+ uid() {
98
+ return this.item.userId;
99
+ },
100
+ decorationStyles() {
101
+ return this.decoration
102
+ ? {
103
+ backgroundImage: `url(${this.decoration})`,
104
+ borderRadius: "8px",
105
+ }
106
+ : null;
107
+ },
108
+ },
109
+ created() {
110
+ this.replyList = this.item.reply || [];
111
+ this.getDecoration();
112
+ },
113
+ methods: {
114
+ setDecoration(decoration) {
115
+ this.decoration = __imgPath + `decoration/images/${decoration.val}/comment.png`;
116
+ },
117
+ getDecoration() {
118
+ let decoration_local = sessionStorage.getItem(DECORATION_KEY + this.uid);
119
+ if (decoration_local) {
120
+ //解析本地缓存
121
+ let decoration_parse = JSON.parse(decoration_local);
122
+ if (decoration_parse) {
123
+ this.setDecoration(decoration_parse);
124
+ this.decoration = __imgPath + `decoration/images/${decoration_parse.val}/comment.png`;
125
+ return;
126
+ }
127
+ }
128
+ getDecoration({ using: 1, user_id: this.uid, type: "comment" }).then((res) => {
129
+ let decorationList = res.data.data;
130
+ //筛选个人装扮
131
+ let decoration = decorationList.find((item) => item.type == "comment");
132
+ if (decoration) {
133
+ this.decoration = __imgPath + `decoration/images/${decoration.val}/comment.png`;
134
+ sessionStorage.setItem(DECORATION_KEY + this.uid, JSON.stringify(decoration));
135
+ return;
136
+ }
137
+ });
138
+ },
139
+ profileLink: function (uid) {
140
+ return authorLink(uid);
141
+ },
142
+ showAvatar: function (val) {
143
+ return showAvatar(val, 144);
144
+ },
145
+ stringToArray: function (str) {
146
+ if (!str) {
147
+ return [];
148
+ }
149
+ return JSON.parse(str);
150
+ },
151
+ deleteComment() {
152
+ this.$emit("deleteComment", this.item.id);
153
+ },
154
+ hideComment() {
155
+ this.$emit("hide", this.item.id);
156
+ },
157
+ setTopComment(setTop) {
158
+ this.$emit("setTopComment", this.item.id, setTop);
159
+ },
160
+ setStarComment(setStar) {
161
+ this.$emit("setStarComment", this.item.id, setStar);
162
+ },
163
+ setLikeComment(setLike) {
164
+ this.$emit("setLikeComment", this.item.id, setLike);
165
+ },
166
+ setLikeReply(id, setLike) {
167
+ this.$emit("setLikeComment", id, setLike);
168
+ },
169
+ setWhiteComment(white) {
170
+ this.$emit("setWhiteComment", this.item.id, white);
171
+ },
172
+ addNewReply(data) {
173
+ POST(`${this.baseApi}/comment/${this.item.id}/reply`, null, data)
174
+ .then(() => {
175
+ this.$notify({
176
+ title: "",
177
+ message: "评论成功!",
178
+ type: "success",
179
+ duration: 3000,
180
+ position: "bottom-right",
181
+ });
182
+
183
+ this.loadReplyList(this.pager.index);
184
+ })
185
+ .catch(() => {});
186
+ },
187
+ deleteReply(id) {
188
+ DELETE(`${this.baseApi}/comment/${id}`)
189
+ .then(() => {
190
+ this.$notify({
191
+ title: "",
192
+ message: "删除成功!",
193
+ type: "success",
194
+ duration: 3000,
195
+ position: "bottom-right",
196
+ });
197
+ this.loadReplyList(this.pager.index);
198
+ })
199
+ .catch(() => {});
200
+ },
201
+ gotoReplyListIndex(index) {
202
+ this.loadReplyList(index, 6);
203
+ },
204
+ loadReplyList(index, pageSize) {
205
+ GET(`${this.baseApi}/comment/${this.item.id}/reply/page/${index}?pageSize=${pageSize}`)
206
+ .then((resp) => {
207
+ if (index == 1 && pageSize == 3) {
208
+ // eslint-disable-next-line vue/no-mutating-props
209
+ this.item.reply = resp.data || [];
210
+ }
211
+ this.replyList = resp.data || [];
212
+ this.pager = resp.page;
213
+ })
214
+ .catch(() => {});
215
+ },
216
+ resetReply() {
217
+ this.loadReplyList(1, 3);
218
+ },
219
+ },
220
+ };
221
+ </script>
222
+
223
+ <style lang="less">
224
+ .c-comment-cmt {
225
+ .u-name {
226
+ margin-right: 6px;
227
+ }
228
+ .u-mark {
229
+ font-style: normal;
230
+ font-size: 12px;
231
+ padding: 1px 5px 2px 5px;
232
+ border-radius: 2px;
233
+ color: #fff;
234
+ margin-left: 5px;
235
+ cursor: default;
236
+ }
237
+ .u-top {
238
+ background-color: #6f42c1;
239
+ i {
240
+ transform: rotate(180deg);
241
+ }
242
+ }
243
+ .u-star {
244
+ background-color: #f39;
245
+ i {
246
+ margin-right: 2px;
247
+ }
248
+ }
249
+ .u-secret {
250
+ background-color: #ff99cc;
251
+ }
252
+ }
253
+ .c-comment-cmt__box {
254
+ display: flex;
255
+ padding-top: 5px;
256
+ background-size: cover;
257
+ .u-flex-1 {
258
+ flex: 1;
259
+ }
260
+ }
261
+ </style>