ms-comment.htm 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340
  1. <script type="text/x-template" id="ms-comment">
  2. <div class="comment-container">
  3. <!--评论开始-->
  4. <div class="article-comment">
  5. <a style="width: 50px;height: 50px;margin-right: 10px;">
  6. <img src="/upload/1/people/icon/1872457333638361088.png" alt="icon">
  7. </a>
  8. <!--输入框-start-->
  9. <el-form ref="form" :model="form" :rules="rules" style="width:100%;margin-top: 5px;">
  10. <el-form-item prop="commentContent" style="margin-top: -5px">
  11. <el-input type="textarea" placeholder="快来评论吧~" v-model="form.commentContent">
  12. </el-input>
  13. </el-form-item>
  14. <el-form-item>
  15. <el-button style="margin-left: 40px" type="primary" plain @click="send()" :disabled="!form.commentContent">提交评论</el-button>
  16. </el-form-item>
  17. </el-form>
  18. <!--输入框-end-->
  19. </div>
  20. <!--评论结束-->
  21. <!--评论回复列表-start-->
  22. <div class="messages" v-if="total>0">
  23. <div class="w-commentlist-header">
  24. <div class="w-commentlist-total">{{total}}条评论</div>
  25. </div>
  26. <!--评论列表-start-->
  27. <div class="messages-item">
  28. <div class="w-comment-list">
  29. <!-- 评论模型 -->
  30. <div v-show="flag" v-for="(item,index) in commentDataList" :key="item.id + item.parentName"
  31. style="margin-bottom: 20px;">
  32. <!-- 父级评论start -->
  33. <div class="w-comment-item" style="display:flex">
  34. <!--头像默认用一个图标替代-start-->
  35. <a class="w-comment-userpic" style="margin-right: 10px;">
  36. <img class="w-user-pic" v-if="item.puIcon"
  37. :src="item.puIcon" />
  38. <img class="w-user-pic" v-else
  39. src="/upload/1/people/icon/1872457333638361088.png" />
  40. </a>
  41. <!--头像默认用一个图标替代-end-->
  42. <!--评论内容-start-->
  43. <div class="w-comment-item-box">
  44. <!-- 评论用户名start -->
  45. <div class="w-comment-item-box-head">
  46. <a class="w-comment-item-username">
  47. {{item.peopleName?item.peopleName:'游客'}}
  48. </a>
  49. </div>
  50. <!-- 评论用户名end -->
  51. <!--具体评论内容-start-->
  52. <div class="w-comment-item-box-content">
  53. <p> {{item.commentContent}} </p>
  54. <!--图片-->
  55. <!-- <div v-if="item.commentPicture">-->
  56. <!-- <template v-for="picture in JSON.parse(item.commentPicture)">-->
  57. <!-- <el-image-->
  58. <!-- style="width: 100px; height: 100px;margin: 0 10px 10px 0px"-->
  59. <!-- :src="`{ms:global.contextPath/}`+picture.path"-->
  60. <!-- :preview-src-list="item.pictureList"-->
  61. <!-- >-->
  62. <!-- </el-image>-->
  63. <!-- </template>-->
  64. <!-- </div>-->
  65. <!-- &lt;!&ndash;视频&ndash;&gt;-->
  66. <!-- <div v-if="item.commentFileJson">-->
  67. <!-- <template v-for="file in JSON.parse(item.commentFileJson)">-->
  68. <!-- <video class="video-demo">-->
  69. <!-- <source :src="file.path" type="video/mp4"/>-->
  70. <!-- </video>-->
  71. <!-- </template>-->
  72. <!-- </div>-->
  73. </div>
  74. <!--具体评论内容-start-->
  75. <!-- 评论底部交互start -->
  76. <div class="w-comment-item-box-bottom">
  77. <span class="w-comment-time">{{item.commentTime}}&nbsp;&nbsp;IP 属地:{{item.commentIp}} </span>
  78. <div class="w-comment-interaction">
  79. <button class="w-comment-reply-btn">
  80. <i class="iconfont icon-pinglun label"></i>
  81. <label :for="'reply-input'+index" class="value" @click="switchShowComment(item)">
  82. 回复
  83. </label>
  84. </button>
  85. <button class="w-comment-like-btn" @click="like(item)" :class="{checked:item.likeLabel=='取消'}">
  86. <i class="iconfont icon-zan label"></i>
  87. <span v-if="!item.likeTotal">赞</span>
  88. <span class="value" v-else>
  89. {{item.likeTotal}}
  90. </span>
  91. </button>
  92. </div>
  93. </div>
  94. <!-- 评论底部交互end -->
  95. <!-- 回复框start -->
  96. <div class="w-comment-reply" v-show="item.showChildComment">
  97. <el-input style="width: 98%;margin-right: 10px" type="text" :placeholder="'请输入回复内容'" v-model="form.replyContent"
  98. :id="'reply-input'+index">
  99. </el-input>
  100. <el-button @click="reply(item)" :disabled="!form.replyContent" type="primary">发送</el-button>
  101. </div>
  102. <!-- 回复框end -->
  103. </div>
  104. </div>
  105. <!-- 父级评论end -->
  106. <!-- 子评论列表start -->
  107. <div
  108. v-for="child,index in (showChildComment?item.childCommentDataLists:item.childCommentDataLists.slice(0,2))"
  109. :key="child.id+child.parentName">
  110. <div class="w-comment-item w-child-reply" style="display:flex">
  111. <!--头像默认用一个图标替代-start-->
  112. <a class="w-comment-userpic" style="margin-right: 10px;">
  113. <img class="w-user-pic" v-if="child.puIcon"
  114. :src="child.puIcon" />
  115. <img class="w-user-pic" v-else
  116. src="https://pic2.zhimg.com/v2-abed1a8c04700ba7d72b45195223e0ff_xl.jpg?source=32738c0c" />
  117. </a>
  118. <!--头像默认用一个图标替代-end-->
  119. <!--评论内容-start-->
  120. <div class="w-comment-item-box">
  121. <!-- 评论用户名start -->
  122. <div class="w-comment-item-box-head">
  123. <a class="w-comment-item-username">
  124. {{child.peopleName?child.peopleName:'游客'}}
  125. </a>
  126. <i class="el-icon-caret-right"
  127. style="font-size: 12px;color:rgb(153, 153, 153);margin: 0px 4px;"></i>
  128. <a class="w-comment-item-replyname">{{child.parentName?child.parentName:'游客'}}</a>
  129. </div>
  130. <!-- 评论用户名end -->
  131. <!--具体评论内容-start-->
  132. <div class="w-comment-item-box-content">
  133. <p> {{child.commentContent}} </p>
  134. </div>
  135. <!--具体评论内容-start-->
  136. <!-- 评论底部交互start -->
  137. <div class="w-comment-item-box-bottom">
  138. <span class="w-comment-time">{{child.commentTime}}&nbsp;&nbsp;IP 属地:{{item.commentIp}} </span>
  139. <div class="w-comment-interaction">
  140. <button class="w-comment-reply-btn">
  141. <i class="iconfont icon-pinglun label"></i>
  142. <label class="value" :for="'child-reply'+index" @click="switchShowComment(child)">
  143. 回复
  144. </label>
  145. </button>
  146. <button class="w-comment-like-btn" @click="like(child)"
  147. :class="{checked:child.likeLabel=='取消'}">
  148. <i class="iconfont icon-zan label"></i>
  149. <span v-if="!child.likeTotal">赞</span>
  150. <span class="value" v-else>
  151. {{child.likeTotal}}
  152. </span>
  153. </button>
  154. </div>
  155. </div>
  156. <!-- 评论底部交互end -->
  157. <!-- 回复框start -->
  158. <div class="w-comment-reply" v-show="child.showChildComment">
  159. <el-input style="width: 98%;margin-right: 10px" type="text" :placeholder="'请输入回复内容'" v-model="form.replyContent"
  160. :id="'child-reply'+index">
  161. </el-input>
  162. <el-button @click="reply(child)" :disabled="!form.replyContent" type="primary">发送</el-button>
  163. </div>
  164. <!-- 回复框end -->
  165. </div>
  166. </div>
  167. </div>
  168. <!-- 子评论列表end -->
  169. <!-- 当子列表大于2时出现start -->
  170. <button class="w-show-other-childcomment"
  171. v-if="item.childCommentDataLists.length > 2 && item.childCommentDataLists.length <= 5 && !showChildComment"
  172. @click="showOtherchildComment(item)">
  173. 展开其他 {{item.childCommentDataLists.length - 2}} 条回复<i class="el-icon-arrow-right"></i>
  174. </button>
  175. <button class="w-show-other-childcomment" v-else-if="item.childCommentDataLists.length > 5"
  176. @click="showAllChildComment(item)">
  177. 查看全部 {{item.childCommentDataLists.length}} 条回复<i class="el-icon-arrow-right"></i>
  178. </button>
  179. <!-- 当子列表大于2时出现end -->
  180. </div>
  181. <!-- -->
  182. <el-dialog title="评论回复" :visible.sync="dialogTableVisible" v-if="currentComment" class="w-dialog-container"
  183. :lock-scroll="false">
  184. <div class="w-dialog-reply">
  185. <div class="current-comment">
  186. <div class="w-comment-item" style="display:flex">
  187. <!--头像默认用一个图标替代-start-->
  188. <a class="w-comment-userpic" style="margin-right: 10px;">
  189. <img class="w-user-pic" v-if="currentComment.puIcon"
  190. :src="currentComment.puIcon" />
  191. <img class="w-user-pic" v-else
  192. src="https://pic2.zhimg.com/v2-abed1a8c04700ba7d72b45195223e0ff_xl.jpg?source=32738c0c" />
  193. </a>
  194. <!--头像默认用一个图标替代-end-->
  195. <!--评论内容-start-->
  196. <div class="w-comment-item-box">
  197. <!-- 评论用户名start -->
  198. <div class="w-comment-item-box-head">
  199. <a class="w-comment-item-username">
  200. {{currentComment.peopleName?currentComment.peopleName:'游客'}}
  201. </a>
  202. </div>
  203. <!-- 评论用户名end -->
  204. <!--具体评论内容-start-->
  205. <div class="w-comment-item-box-content">
  206. <p> {{currentComment.commentContent}} </p>
  207. </div>
  208. <!--具体评论内容-start-->
  209. <!-- 评论底部交互start -->
  210. <div class="w-comment-item-box-bottom">
  211. <span class="w-comment-time">{{currentComment.commentTime}}&nbsp;&nbsp;IP 属地:{{item.commentIp}} </span>
  212. <div class="w-comment-interaction">
  213. <button class="w-comment-reply-btn">
  214. <i class="iconfont icon-pinglun label"></i>
  215. <label class="value" :for="'dialog-reply'+currentComment.puNickname"
  216. @click="switchShowComment(currentComment)">
  217. 回复
  218. </label>
  219. </button>
  220. <button class="w-comment-like-btn" @click="like(currentComment)"
  221. :class="{checked:currentComment.likeLabel=='取消'}">
  222. <i class="iconfont icon-zan label"></i>
  223. <span v-if="!currentComment.likeTotal">赞</span>
  224. <span class="value" v-else>
  225. {{currentComment.likeTotal}}
  226. </span>
  227. </button>
  228. </div>
  229. </div>
  230. <!-- 评论底部交互end -->
  231. <div class="w-comment-reply" v-show="currentComment.showChildComment">
  232. <el-input style="width: 98%" type="text" :placeholder="'请输入回复内容'" v-model="form.replyContent"
  233. :id="'dialog-reply'+currentComment.puNickname">
  234. </el-input>
  235. <el-button @click="reply(currentComment)" :disabled="!form.replyContent" type="primary">发送
  236. </el-button>
  237. </div>
  238. </div>
  239. </div>
  240. </div>
  241. <div class="w-reply-list">
  242. <div class="w-commentlist-header">
  243. <div class="w-commentlist-total">{{currentComment.childCommentDataLists.length}}条回复</div>
  244. </div>
  245. <div class="w-reply-list-container">
  246. <div class="w-reply-item" v-for="childReply,index in currentComment.childCommentDataLists"
  247. :key="childReply.id">
  248. <div class="w-comment-item w-child-reply" style="display:flex">
  249. <!--头像默认用一个图标替代-start-->
  250. <a class="w-comment-userpic" style="margin-right: 10px;">
  251. <img class="w-user-pic" v-if="childReply.puIcon"
  252. :src="childReply.puIcon" />
  253. <img class="w-user-pic" v-else="childReply.puIcon"
  254. src="https://pic2.zhimg.com/v2-abed1a8c04700ba7d72b45195223e0ff_xl.jpg?source=32738c0c" />
  255. </a>
  256. <!--头像默认用一个图标替代-end-->
  257. <!--评论内容-start-->
  258. <div class="w-comment-item-box">
  259. <!-- 评论用户名start -->
  260. <div class="w-comment-item-box-head">
  261. <a class="w-comment-item-username">
  262. {{childReply.peopleName?childReply.peopleName:'游客'}}
  263. </a>
  264. <i class="el-icon-caret-right"
  265. style="font-size: 12px;color:rgb(153, 153, 153);margin: 0px 4px;"></i>
  266. <a class="w-comment-item-replyname">{{childReply.parentName?childReply.parentName:'游客'}}</a>
  267. </div>
  268. <!-- 评论用户名end -->
  269. <!--具体评论内容-start-->
  270. <div class="w-comment-item-box-content">
  271. <p> {{childReply.commentContent}} </p>
  272. </div>
  273. <!--具体评论内容-start-->
  274. <!-- 评论底部交互start -->
  275. <div class="w-comment-item-box-bottom">
  276. <span class="w-comment-time">{{childReply.commentTime}}&nbsp;&nbsp;IP 属地:{{item.commentIp}} </span>
  277. <div class="w-comment-interaction">
  278. <button class="w-comment-reply-btn" @click="switchShowComment(childReply)">
  279. <i class="iconfont icon-pinglun label"></i>
  280. <label class="value" :for="'dialog-reply'+index">
  281. 回复
  282. </label>
  283. </button>
  284. <button class="w-comment-like-btn" @click="like(childReply)"
  285. :class="{checked:reply.likeLabel=='取消'}">
  286. <i class="iconfont icon-zan label"></i>
  287. <span v-if="!reply.likeTotal">赞</span>
  288. <span class="value" v-else>
  289. {{childReply.likeTotal}}
  290. </span>
  291. </button>
  292. </div>
  293. </div>
  294. <!-- 评论底部交互end -->
  295. <!-- 回复框start -->
  296. <div class="w-comment-reply" v-show="childReply.showChildComment">
  297. <el-input style="width: 98%" type="text" :placeholder="'请输入回复内容'" v-model="form.replyContent"
  298. :id="'dialog-reply'+index">
  299. </el-input>
  300. <el-button @click="reply(childReply)" :disabled="!form.replyContent" type="primary">发送
  301. </el-button>
  302. </div>
  303. <!-- 回复框end -->
  304. </div>
  305. </div>
  306. </div>
  307. </div>
  308. </div>
  309. </div>
  310. </el-dialog>
  311. </div>
  312. </div>
  313. <!--评论列表-end-->
  314. <!-- 当子列表大于2时出现start -->
  315. <button class="w-show-other-comment"
  316. :style="loadMoreStyle"
  317. @click="showNextComment()"
  318. :disabled="isMoreDisabled"
  319. >
  320. {{moreText}}<i class="el-icon-arrow-right"></i>
  321. </button>
  322. <!-- 当子列表大于2时出现end -->
  323. </div>
  324. <div v-else class="emptyText">
  325. <span>{{emptyText}}</span>
  326. </div>
  327. <!--评论回复列表-end-->
  328. </div>
  329. </script>
  330. <script>
  331. Vue.component('ms-comment',{
  332. template: "#ms-comment",
  333. name: "ms-comment",
  334. props:{
  335. // 业务编号
  336. dataId:{
  337. type: String
  338. },
  339. // 当前页
  340. pageNo:{
  341. type: String
  342. },
  343. // 业务名称(文章标题)
  344. dataTitle:{
  345. type: String
  346. },
  347. // 业务类型
  348. dataType: {
  349. type: String
  350. },
  351. },
  352. data: function(){
  353. return{
  354. // 加载更多控制
  355. loadMoreStyle:'',
  356. // 控制加在更多按钮的禁用
  357. isMoreDisabled: false,
  358. // 加载更多文本
  359. moreText: '加载更多',
  360. // 已弃用web接口,默认移除验证码校验
  361. verifCode: ms.base + "/code?t=" + (new Date).getTime(),//ms.base + "/code?t=" + new Date().getTime()
  362. windowScrollStyle: '',
  363. flag: true,
  364. commentDataList: [], //评论表列表
  365. pageSize: 10, //页面数量
  366. currentPage: 1, //初始页,
  367. emptyText: '',
  368. //总记录数量
  369. total: 0,
  370. form: {
  371. //评论内容
  372. commentContent: '',
  373. //文章商品id
  374. dataId: this.dataId,
  375. //业务链接
  376. collectionDataUrl: window.location.href,
  377. //业务类型
  378. dataType: this.dataType,
  379. // 业务名称
  380. dataTitle: this.dataTitle,
  381. //回复内容
  382. replyContent: '',
  383. // 评论图片
  384. commentPicture: [],
  385. // 附件JSON
  386. commentFileJson: [],
  387. // 评论打分
  388. commentPoints: 0
  389. },
  390. rules: {
  391. commentContent: [{
  392. // "required": true,
  393. // "message": "请输入评论"
  394. }]
  395. },
  396. isVisitor: 'false', //是否开启游客
  397. // likeLabel: '点赞', //评论点赞label
  398. dialogTableVisible: false,
  399. showChildComment: false, //是否展开其他的子评论
  400. dialogTableVisible: false,
  401. // 展示当前评论的所有子评论
  402. currentComment: null,
  403. // 评价颜色
  404. commentPointsColor: ['#99A9BF', '#F7BA2A', '#FF9900'],
  405. }
  406. },
  407. computed: {
  408. //表格最大高度 用来自适应
  409. tableHeight: function () {
  410. return document.documentElement.clientHeight - 171;
  411. }
  412. },
  413. methods: {
  414. // 加载更多
  415. showNextComment: function () {
  416. this.pageNo = this.pageNo+1
  417. // 默认返回了所有数据,此方法弃用
  418. // this.list()
  419. },
  420. //初始化评论数据
  421. initCommentItem: function(data) {
  422. //回复框的显示与隐藏
  423. data.showChildComment = false
  424. //初始化评论点赞总数
  425. data.likeTotal = 0
  426. //初始化评论点赞的状态
  427. data.likeLabel = "点赞"
  428. //初始化子评论列表
  429. data.childCommentDataLists = []
  430. // 查询当前评论的点赞数
  431. ms.http.post( ms.base + "/attention/collectionLog/count.do", {
  432. dataId: data.id,
  433. dataType: '评论点赞'
  434. }).then(function (res) {
  435. // 将点赞数添加到data中
  436. if (res.result) {
  437. data.likeTotal = res.data;
  438. }
  439. })
  440. },
  441. //展开其他的子评论列表
  442. showOtherchildComment: function(item) {
  443. this.showChildComment = true
  444. this.childCommentList = item.childCommentDataLists
  445. },
  446. //展示所有的子评论列表
  447. showAllChildComment: function(item) {
  448. this.dialogTableVisible = true
  449. this.currentComment = item
  450. },
  451. //转换时间
  452. dateHandler: function(millisecond) {
  453. var timdedetail = millisecond; //假如是10位毫秒需要乘1000
  454. //获取年份
  455. var year = new Date(timdedetail).getFullYear();
  456. //获取月份,获取的月份比实际小1,所以在使用的时候需要+1
  457. var month = new Date(timdedetail).getMonth() + 1;
  458. //获取日
  459. var date = new Date(timdedetail).getDate();
  460. //获取时
  461. var hours = new Date(timdedetail).getHours();
  462. //获取分
  463. var minutes = new Date(timdedetail).getMinutes();
  464. //获取秒
  465. var seconds = new Date(timdedetail).getSeconds();
  466. //组合格式为年-月-日 时:分:秒(2021-7-5 21:21:21)
  467. var time = year + "-" + month + "-" + date + " " + hours + ":" + minutes + ":" + seconds;
  468. return time
  469. },
  470. // 回复评论
  471. reply: function (item) {
  472. var that = this;
  473. ms.http.post( ms.base + '/people/comment/save.do', {
  474. commentId: item.id,
  475. dataId: that.form.dataId,
  476. commentContent: that.form.replyContent,
  477. dataType: that.dataType, //业务类型
  478. dataTitle: that.dataTitle,
  479. }).then(function (res) {
  480. if (res.result) {
  481. that.form.replyContent = ""
  482. item.showChildComment = false
  483. that.$notify({
  484. title: '成功',
  485. type: 'success',
  486. message: '回复成功!',
  487. duration: 1000,
  488. onClose: function () {
  489. that.$refs.form.resetFields()
  490. location.reload();
  491. }
  492. });
  493. } else {
  494. that.clearForm();
  495. that.$message.error(res.msg);
  496. }
  497. }).catch(function (err) {
  498. that.clearForm();
  499. that.$notify({
  500. title: '提示',
  501. dangerouslyUseHTMLString: true,
  502. message: '需要安装评论插件才能使用,请先进入后台MStore安装评论插件使用。<span style="color: #409EFF; text-decoration: underline;">'
  503. +'<a href="http://store.mingsoft.net/#/detail?id=268&type=plugin" target="_blank">点击查看评论插件</a></span>',
  504. type: 'warning'
  505. });
  506. console.log(err);
  507. })
  508. },
  509. // 评论点赞
  510. like: function (item) {
  511. var that = this
  512. ms.http.post( ms.base + "/people/attention/collection/save.do", {
  513. dataId: item.id,
  514. dataType: '评论点赞',
  515. collectionDataTitle: item.commentContent,
  516. }).then(function (res) {
  517. if (res.data){
  518. that.$message({
  519. message: '点赞成功',
  520. type: 'success'
  521. });
  522. item.likeLabel = '取消'
  523. } else {
  524. that.$message('取消点赞');
  525. item.likeLabel = '点赞'
  526. }
  527. that.likeTotals(item)
  528. });
  529. },
  530. // 评论点赞数
  531. likeTotals: function (item) {
  532. var that = this;
  533. //用户-关注接口
  534. ms.http.post( ms.base + "/attention/collection/queryCollectionCount.do", {
  535. dataIds: item.id,
  536. dataType: "评论点赞"
  537. }).then((res) => {
  538. item.likeTotal = 0;
  539. if (res.data && res.data.rows.length > 0) {
  540. item.likeTotal = res.data.rows[0].dataCount;
  541. }
  542. })
  543. },
  544. // 判断是否开启游客
  545. // 已弃用,开发者可以自由扩展游客功能
  546. enableVisitor: function () {
  547. var that = this;
  548. ms.http.get( ms.base + '/mdiy/config/get.do', {
  549. configName: '评论配置',
  550. key: 'enableVisitor'
  551. }).then(function (res) {
  552. if (res.result) {
  553. that.isVisitor = res.data
  554. }
  555. })
  556. },
  557. hide: function (arr) {
  558. var that = this
  559. arr.forEach(function (x) {
  560. let e = that.$el.querySelector("#key_" + x)
  561. if (e) {
  562. e.style.display = 'none'
  563. }
  564. })
  565. },
  566. //vue方法异步请求评论保存接口
  567. send: function () {
  568. var that = this;
  569. that.form.dataType = that.dataType;
  570. ms.http.post( ms.base + '/people/comment/save.do', that.form).then(function (res) {
  571. if (res.result) {
  572. that.$notify({
  573. title: '成功',
  574. type: 'success',
  575. message: '评论成功!',
  576. duration: 1000,
  577. onClose: function () {
  578. that.$refs.form.resetFields()
  579. location.reload();
  580. }
  581. });
  582. } else {
  583. that.clearForm();
  584. that.$message.error(res.msg);
  585. }
  586. }).catch(function (err) {
  587. that.clearForm();
  588. that.$notify({
  589. title: '提示',
  590. dangerouslyUseHTMLString: true,
  591. message: '需要安装会员插件才能使用,请先进入后台MStore安装会员插件使用。<span style="color: #409EFF; text-decoration: underline;">' +
  592. '<a href="http://store.mingsoft.net/#/detail?id=269&type=plugin" target="_blank">点击查看会员插件</a></span>',
  593. type: 'warning'
  594. });
  595. })
  596. },
  597. //查询所有评论
  598. list: function () {
  599. var that = this;
  600. ms.http.post( ms.base + '/comment/list.do', {
  601. dataId: that.dataId,
  602. dataType: that.dataType,
  603. //当前页数
  604. pageNo: that.pageNo,
  605. //每页文章条数
  606. pageSize: 9999,
  607. }).then(function (res) {
  608. if (res.result) {
  609. // 所有评论
  610. var allComment = res.data.rows;
  611. if (allComment.length <= 0) {
  612. that.emptyText = '还没有评论,发表第一个评论吧'
  613. } else {
  614. // 控制 加载更多按钮是否显示
  615. if (allComment.length < 10){
  616. // 按钮添加禁用
  617. that.loadMoreStyle = "background:none #1214191a;cursor: not-allowed;"
  618. // 按钮禁用
  619. that.isMoreDisabled = true
  620. // 更改提示信息
  621. that.moreText = '已加载全部'
  622. }
  623. ms.http.get( ms.base + '/comment/count.do', {
  624. dataId: that.dataId,
  625. dataType: that.dataType
  626. }).then(function (res) {
  627. that.total = res.data;
  628. });
  629. var commentDataIds = [];
  630. // 取出dataId
  631. allComment.forEach(function (data) {
  632. commentDataIds.push(data.id);
  633. })
  634. var allCommentCount = [];
  635. // 先请求一遍点赞数据
  636. ms.http.post( ms.base + "/attention/collection/queryCollectionCount.do", {
  637. dataIds: commentDataIds.toString(),
  638. dataType: '评论点赞'
  639. }).then(function (res) {
  640. allCommentCount = res.data;
  641. allComment.forEach(function (comment) {
  642. comment.likeTotal = 0;
  643. comment.likeLabel = '点赞';
  644. allCommentCount.rows.forEach(function (item) {
  645. if (comment.id == item.dataId) {
  646. comment.likeTotal = item.dataCount;
  647. comment.likeLabel = item.isLike ? '取消' : '点赞';
  648. }
  649. })
  650. })
  651. // 评论数据处理
  652. that.commentDataFormat(allComment);
  653. }).catch(function (err) {
  654. console.log(err);
  655. // 异常处理,抛异常且处理评论数据格式
  656. that.commentDataFormat(allComment);
  657. })
  658. }
  659. } else{
  660. that.$notify({
  661. title: '失败',
  662. message: res.msg,
  663. type: 'warning'
  664. });
  665. }
  666. }).catch(function (err){
  667. that.$notify({
  668. title: '提示',
  669. dangerouslyUseHTMLString: true,
  670. message: '需要安装评论插件才能使用,请先进入后台MStore安装评论插件使用。<span style="color: #409EFF; text-decoration: underline;">' +
  671. '<a href="http://store.mingsoft.net/#/detail?id=268&type=plugin" target="_blank">点击查看评论插件</a></span>',
  672. type: 'warning'
  673. });
  674. })
  675. },
  676. //
  677. commentDataFormat: function (allComment) {
  678. var that = this;
  679. // 第一级评论
  680. var topComment = allComment.filter(c => !c.topId || c.topId==0)
  681. // 遍历所有评论,设置层级关系
  682. topComment.forEach(function (data) {
  683. // 如果有peopleInfo 取出头像
  684. if (data.peopleInfo && data.peopleInfo!='{}'){
  685. var peopleInfo = JSON.parse(data.peopleInfo)
  686. data.puIcon = peopleInfo.puIcon;
  687. }
  688. // 处理ip
  689. if (data.commentIp){
  690. data.commentIp = JSON.parse(data.commentIp).addr;
  691. }
  692. //回复框的显示与隐藏
  693. data.showChildComment = false
  694. //初始化子评论列表
  695. data.childCommentDataLists = [];
  696. // 当前遍历到评论的所有子评论
  697. var childComments = allComment.filter(item => item.topId && item.topId==data.id)
  698. childComments.forEach(function (childData) {
  699. // 子评论头像
  700. if (childData.peopleInfo && childData.peopleInfo!='{}'){
  701. var peopleInfo = JSON.parse(childData.peopleInfo)
  702. childData.puIcon = peopleInfo.puIcon;
  703. }
  704. // 处理ip
  705. if (childData.commentIp){
  706. childData.commentIp = JSON.parse(childData.commentIp).addr;
  707. }
  708. //回复框的显示与隐藏
  709. childData.showChildComment = false
  710. // 如果父评论为顶级评论则直接赋值
  711. if (childData.commentId == data.id){
  712. childData.parentName = data.peopleName;
  713. } else {
  714. // 找到当前遍历子评论的父评论
  715. var parentComment = childComments.find(function (item) {
  716. return item.id == childData.commentId;
  717. })
  718. if (parentComment){
  719. childData.parentName = parentComment.peopleName;
  720. }
  721. }
  722. // 将处理完的数据push到顶级评论的子集中
  723. data.childCommentDataLists.push(childData);
  724. });
  725. // 存放顶级评论
  726. that.commentDataList.push(data)
  727. });
  728. },
  729. // 清理评论表单数据
  730. clearForm: function () {
  731. var that = this;
  732. that.$refs.form.resetFields();
  733. },
  734. show: function (arr) {
  735. var that = this
  736. arr.forEach(function (x) {
  737. let e = that.$el.querySelector("#key_" + x)
  738. if (e) {
  739. e.style.display = 'flex'
  740. }
  741. })
  742. },
  743. //切换回复框
  744. switchShowComment: function(comment) {
  745. if (comment.showChildComment) comment.showChildComment = !comment.showChildComment
  746. else {
  747. this.commentDataList.forEach((item) => {
  748. item.showChildComment = false;
  749. item.childCommentDataLists.forEach((child) => {
  750. child.showChildComment = false;
  751. })
  752. })
  753. comment.showChildComment = true
  754. }
  755. },
  756. switchShow: function (arr) {
  757. var that = this
  758. arr.forEach(function (x) {
  759. let e = that.$el.querySelector("#key_" + x)
  760. if (e) {
  761. e.style.display = e.style.display == 'none' ? 'flex' : 'none'
  762. }
  763. })
  764. },
  765. windowScroll: function() {
  766. // 滚动条距离页面顶部的距离
  767. // 以下写法原生兼容
  768. let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
  769. if (scrollTop > 200) {
  770. this.windowScrollStyle = "rgba(255, 255, 255, 1)"
  771. } else {
  772. this.windowScrollStyle = "rgba(255, 255, 255, 0.4)"
  773. }
  774. },
  775. // 验证码 看不清换一张
  776. code: function () {
  777. this.verifCode = ms.base + "/code?t=" + (new Date).getTime();//
  778. },
  779. // 移除图片交互效果
  780. commentPictureHandRemove: function (file, files) {
  781. var index = -1;
  782. index = this.form.commentPicture.findIndex(function (text) {
  783. return text == file;
  784. });
  785. if (index != -1) {
  786. this.form.commentPicture.splice(index, 1);
  787. }
  788. },
  789. //上传超过限制
  790. commentPictureHandExceed: function (files, fileList) {
  791. this.$notify({
  792. title: '失败',
  793. message: '当前最多上传5张图片',
  794. type: 'warning'
  795. });
  796. },
  797. // 上传图片成功后
  798. successImg: function (response, file, fileList) {
  799. var that = this;
  800. if(response.result){
  801. that.form.commentPicture.push({
  802. url: response.data,
  803. name: file.name,
  804. uid: file.uid,
  805. });
  806. }else {
  807. this.$notify({
  808. title: '失败',
  809. message: response.msg,
  810. type: 'warning'
  811. });
  812. }
  813. },
  814. // 附件上传
  815. // 点击已上传文件
  816. fileHandlePreview: function (file){
  817. console.log(file);
  818. },
  819. // 移除附件前
  820. beforeRemove: function (file, fileList){
  821. return this.$confirm(`确定移除 ${ file.name }?`);
  822. },
  823. // 移除附件
  824. handleRemove: function (file,fileList){
  825. var fileJsonList = this.form.commentFileJson;
  826. this.form.commentFileJson = fileJsonList.filter(function (fileJson){
  827. return fileJson.uid != file.uid;
  828. })
  829. },
  830. // 超出限制
  831. fileHandleExceed: function (files, fileList){
  832. this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
  833. },
  834. // 上传附件成功后
  835. successFile: function (response, file, fileList) {
  836. var that = this;
  837. if(response.result){
  838. that.form.commentFileJson.push({
  839. url: response.data,
  840. name: file.name,
  841. uid: file.uid,
  842. });
  843. }else {
  844. this.$notify({
  845. title: '失败',
  846. message: response.msg,
  847. type: 'warning'
  848. });
  849. }
  850. },
  851. // 视频播放
  852. playVideo: function (){
  853. var myVideo = document.getElementsByClassName("video-demo");
  854. if (myVideo.paused)
  855. myVideo.play();
  856. else
  857. myVideo.pause();
  858. }
  859. },
  860. created: function () {
  861. this.list();
  862. this.enableVisitor();
  863. },
  864. mounted: function () {
  865. window.addEventListener('scroll', this.windowScroll)
  866. },
  867. beforeDestroy: function () {
  868. window.removeEventListener('scroll', this.windowScroll)
  869. }
  870. })
  871. </script>
  872. <style scoped>
  873. .thumbsUpchecked {
  874. color: #06f;
  875. }
  876. .w-show-other-comment{
  877. width: 50%;
  878. display: inline-block;
  879. font-size: 14px;
  880. line-height: 32px;
  881. text-align: center;
  882. cursor: pointer;
  883. background: none rgba(133, 144, 166, 0.1);
  884. border: 1px solid transparent;
  885. border-radius: 3px;
  886. margin: 10px 0px 10px 150px;
  887. padding: 0px 6px 0px 12px;
  888. height: 32px;
  889. color: rgb(133, 144, 166);
  890. font-weight: 500;
  891. }
  892. .emptyText {
  893. display: flex;
  894. width: 50%;
  895. min-height: 100px;
  896. flex-direction: column;
  897. justify-content: center;
  898. align-items: center;
  899. border: 1px solid #c1c1c1;
  900. border-radius: 2px;
  901. font-size: 20px;
  902. color: rgb(133, 144, 166);
  903. margin-bottom: 40px;
  904. }
  905. .messages {
  906. margin-bottom: 10px;
  907. display: flex;
  908. flex-direction: column;
  909. align-items: stretch;
  910. width: 50%;
  911. border: 1px solid rgb(235, 235, 235);
  912. border-radius: 4px;
  913. box-sizing: border-box;
  914. }
  915. .messages a:hover {
  916. cursor: pointer;
  917. color: #444444;
  918. }
  919. .messages .w-comment-list {
  920. padding-top: 10px;
  921. padding-bottom: 10px;
  922. }
  923. .messages .w-comment-list .w-show-other-childcomment {
  924. display: inline-block;
  925. font-size: 14px;
  926. line-height: 32px;
  927. text-align: center;
  928. cursor: pointer;
  929. background: none rgba(133, 144, 166, 0.1);
  930. border: 1px solid transparent;
  931. border-radius: 3px;
  932. margin: 10px 0px 10px 54px;
  933. padding: 0px 6px 0px 12px;
  934. height: 32px;
  935. color: rgb(133, 144, 166);
  936. font-weight: 500;
  937. }
  938. .messages .w-commentlist-header {
  939. box-sizing: border-box;
  940. position: relative;
  941. flex: 0 0 auto;
  942. padding-left: 20px;
  943. padding-right: 20px;
  944. height: 50px;
  945. -webkit-box-align: center;
  946. align-items: center;
  947. -webkit-box-pack: justify;
  948. justify-content: space-between;
  949. display: flex;
  950. }
  951. .messages .w-commentlist-header::before {
  952. display: block;
  953. content: " ";
  954. position: absolute;
  955. inset: -50%;
  956. pointer-events: none;
  957. transform: scale(0.5, 0.5);
  958. border-bottom: 1px solid rgb(235, 235, 235);
  959. }
  960. .messages .w-commentlist-header .w-commentlist-total {
  961. box-sizing: border-box;
  962. margin: 0px;
  963. min-width: 0px;
  964. font-size: 15px;
  965. color: rgb(68, 68, 68);
  966. font-weight: 600;
  967. }
  968. .messages .w-comment-item {
  969. box-sizing: border-box;
  970. display: flex;
  971. padding: 10px 20px 14px;
  972. }
  973. .w-comment-item .w-comment-userpic {
  974. box-sizing: border-box;
  975. margin: 0px;
  976. min-width: 0px;
  977. color: rgb(23, 81, 153);
  978. flex: 0 0 auto;
  979. height: 24px;
  980. width: 24px;
  981. }
  982. .w-comment-item .w-comment-userpic .w-user-pic {
  983. box-sizing: border-box;
  984. max-width: 100%;
  985. background-color: rgb(255, 255, 255);
  986. width: 24px;
  987. height: 24px;
  988. border-radius: 2px;
  989. filter: brightness(0.95);
  990. flex: 0 0 auto;
  991. }
  992. .messages .w-comment-item-box-head {
  993. display: flex;
  994. align-items: center;
  995. }
  996. .messages .w-comment-item-box-head .w-comment-item-username,
  997. .messages .w-comment-item-box-head .w-comment-item-replyname {
  998. box-sizing: border-box;
  999. margin: 0px;
  1000. min-width: 0px;
  1001. font-size: 15px;
  1002. font-weight: bold;
  1003. text-decoration: none;
  1004. color: #444444;
  1005. }
  1006. .messages .w-comment-item-box {
  1007. width: 100%;
  1008. }
  1009. .messages .w-comment-item-box .w-comment-reply {
  1010. box-sizing: border-box;
  1011. margin: 8px 0px 0px;
  1012. min-width: 0px;
  1013. flex: 1 1 auto;
  1014. display: flex;
  1015. }
  1016. .messages .w-comment-item-box-content {
  1017. color: rgb(68, 68, 68);
  1018. overflow-wrap: break-word;
  1019. font-size: 15px;
  1020. line-height: 21px;
  1021. margin-top: 5px;
  1022. box-sizing: border-box;
  1023. }
  1024. .messages .w-comment-item-box-bottom {
  1025. box-sizing: border-box;
  1026. margin: 4px 0px 0px;
  1027. min-width: 0px;
  1028. -webkit-box-align: center;
  1029. align-items: center;
  1030. -webkit-box-pack: justify;
  1031. justify-content: space-between;
  1032. display: flex;
  1033. }
  1034. .messages .w-comment-item-box-bottom .w-comment-time {
  1035. box-sizing: border-box;
  1036. margin: 0px;
  1037. min-width: 0px;
  1038. -webkit-box-align: center;
  1039. align-items: center;
  1040. flex: 0 0 auto;
  1041. font-size: 14px;
  1042. color: rgb(153, 153, 153);
  1043. display: flex;
  1044. }
  1045. .w-comment-interaction button {
  1046. margin-left: 16px;
  1047. }
  1048. .w-comment-interaction .w-comment-reply-btn {
  1049. display: inline-block;
  1050. padding: 0px;
  1051. font-size: 14px;
  1052. line-height: inherit;
  1053. color: rgb(133, 144, 166);
  1054. text-align: center;
  1055. cursor: pointer;
  1056. background: none transparent;
  1057. border: none;
  1058. border-radius: 0px;
  1059. height: auto;
  1060. }
  1061. .w-comment-interaction .w-comment-reply-btn label {
  1062. cursor: pointer;
  1063. }
  1064. .w-comment-interaction .w-comment-like-btn {
  1065. display: inline-block;
  1066. padding: 0px;
  1067. font-size: 14px;
  1068. line-height: inherit;
  1069. color: rgb(133, 144, 166);
  1070. text-align: center;
  1071. cursor: pointer;
  1072. background: none transparent;
  1073. border: none rgb(133, 144, 166);
  1074. border-radius: 0px;
  1075. height: auto;
  1076. }
  1077. .w-comment-interaction .checked {
  1078. color: rgb(0, 97, 242);
  1079. }
  1080. .messages .w-child-reply {
  1081. padding: 10px 20px 14px 54px;
  1082. }
  1083. /* 弹出全部回复 */
  1084. .w-dialog-container {
  1085. overflow: hidden auto;
  1086. z-index: 2001;
  1087. display: flex;
  1088. flex-direction: column;
  1089. justify-content: center;
  1090. position: fixed;
  1091. }
  1092. .el-dialog__title {
  1093. box-sizing: border-box;
  1094. margin: 0px;
  1095. min-width: 0px;
  1096. color: rgb(68, 68, 68);
  1097. font-weight: 600;
  1098. }
  1099. .el-dialog__body {
  1100. overflow-y: scroll;
  1101. padding: 0;
  1102. }
  1103. .current-comment {
  1104. border-top: 1px solid rgb(235, 235, 235);
  1105. border-bottom: 20px solid rgba(133, 144, 166, 0.1);
  1106. padding: 20px;
  1107. }
  1108. .current-comment .w-comment-item {
  1109. padding: 0;
  1110. }
  1111. .el-dialog {
  1112. margin-top: 0 !important;
  1113. height: calc(100vh - 48px);
  1114. display: flex;
  1115. flex-direction: column;
  1116. position: relative;
  1117. z-index: 1;
  1118. box-sizing: border-box;
  1119. max-height: calc(100vh - 48px);
  1120. box-sizing: border-box;
  1121. margin: 0 auto;
  1122. width: 700px;
  1123. }
  1124. .w-reply-list-container .w-reply-item {
  1125. padding: 20px;
  1126. }
  1127. .w-reply-list-container .w-reply-item .w-child-reply {
  1128. padding: 0;
  1129. }
  1130. .w-reply-bottom-input {
  1131. box-sizing: border-box;
  1132. margin: 0px;
  1133. min-width: 0px;
  1134. display: flex;
  1135. flex: 0 0 auto;
  1136. padding: 10px 20px;
  1137. box-shadow: rgb(18 18 18 / 12%) 0px -1px 3px;
  1138. }
  1139. .w-reply-bottom-input .w-avatar {
  1140. box-sizing: border-box;
  1141. margin: 0px 10px 0px 0px;
  1142. min-width: 0px;
  1143. max-width: 100%;
  1144. background-color: rgb(255, 255, 255);
  1145. width: 40px;
  1146. height: 40px;
  1147. border-radius: 3px;
  1148. }
  1149. .comment-container {
  1150. width: 100%;
  1151. }
  1152. .comment-container .article-comment {
  1153. display: flex;
  1154. box-sizing: border-box;
  1155. border-top-left-radius: 0px;
  1156. padding-bottom: 12px;
  1157. flex-wrap: nowrap;
  1158. border-bottom-left-radius: 0px;
  1159. width: 50%;
  1160. border-bottom-right-radius: 0px;
  1161. margin-bottom: 0px;
  1162. border-top-right-radius: 0px;
  1163. padding-top: 12px;
  1164. margin-top: 30px;
  1165. }
  1166. .article-comment>span {
  1167. padding-bottom: 0px;
  1168. color: #333333;
  1169. flex-direction: row;
  1170. word-wrap: break-word;
  1171. display: inline-block;
  1172. padding-right: 0px;
  1173. width: 100%;
  1174. font-size: 32PX;
  1175. margin-bottom: 6px;
  1176. padding-top: 0px;
  1177. padding-left: 0px;
  1178. margin-top: 0px;
  1179. }
  1180. .article-comment .ms-input {
  1181. border-color: #DCDFE6;
  1182. background-color: #FFFFFF;
  1183. align-items: center;
  1184. flex-direction: row;
  1185. display: flex;
  1186. padding-right: 4px;
  1187. box-sizing: border-box;
  1188. justify-content: space-between;
  1189. border-top-left-radius: 2px;
  1190. padding-bottom: 0px;
  1191. flex-wrap: nowrap;
  1192. border-bottom-left-radius: 2px;
  1193. border-width: 1px;
  1194. width: 100%;
  1195. border-bottom-right-radius: 2px;
  1196. border-top-right-radius: 2px;
  1197. margin-bottom: 0px;
  1198. padding-top: 0px;
  1199. border-style: solid;
  1200. padding-left: 4px;
  1201. margin-top: 0px;
  1202. height: 100px;
  1203. }
  1204. .article-comment .ms-input span {
  1205. color: #DCDFE6;
  1206. flex-direction: row;
  1207. word-wrap: break-word;
  1208. display: inline-block;
  1209. padding-right: 0px;
  1210. border-top-left-radius: 0px;
  1211. padding-bottom: 0px;
  1212. border-bottom-left-radius: 0px;
  1213. border-bottom-right-radius: 0px;
  1214. border-top-right-radius: 0px;
  1215. font-size: 14PX;
  1216. padding-top: 0px;
  1217. padding-left: 0px;
  1218. }
  1219. .article-comment>.post-comment {
  1220. cursor: pointer;
  1221. background-color: #0099ff;
  1222. color: #FFFFFF;
  1223. text-align: center;
  1224. display: inline-block;
  1225. padding-right: 20px;
  1226. box-sizing: border-box;
  1227. border-top-left-radius: 8px;
  1228. padding-bottom: 0px;
  1229. border-bottom-left-radius: 8px;
  1230. border-bottom-right-radius: 8px;
  1231. line-height: 42px;
  1232. font-size: 16px;
  1233. margin-bottom: 0px;
  1234. border-top-right-radius: 8px;
  1235. padding-top: 0px;
  1236. padding-left: 20px;
  1237. margin-top: 10px;
  1238. height: 42px;
  1239. }
  1240. .article-comment>.hot-comment {
  1241. padding-bottom: 0px;
  1242. flex-wrap: nowrap;
  1243. flex-direction: column;
  1244. display: flex;
  1245. padding-right: 0px;
  1246. width: 100%;
  1247. box-sizing: border-box;
  1248. padding-top: 0px;
  1249. padding-left: 0px;
  1250. justify-content: center;
  1251. margin-top: 20px;
  1252. }
  1253. .article-comment>.hot-comment span {
  1254. flex-direction: row;
  1255. word-wrap: break-word;
  1256. display: inline-block;
  1257. width: 100%;
  1258. font-size: 16PX;
  1259. line-height: 36px;
  1260. margin-top: 0px;
  1261. height: 36px;
  1262. }
  1263. .article-comment>.hot-comment div {
  1264. padding-bottom: 0px;
  1265. flex-wrap: nowrap;
  1266. flex-direction: row;
  1267. display: flex;
  1268. padding-right: 0px;
  1269. width: 100%;
  1270. box-sizing: border-box;
  1271. padding-top: 0px;
  1272. padding-left: 0px;
  1273. margin-top: 12px;
  1274. height: 100px;
  1275. }
  1276. .article-comment>.hot-comment div img {
  1277. width: 100%;
  1278. margin-top: 0px;
  1279. height: 100%;
  1280. }
  1281. .el-upload--picture-card i {
  1282. line-height: unset !important;
  1283. }
  1284. </style>