| 12 |
- var e=Object.defineProperty,t=Object.defineProperties,o=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,c=(t,o,n)=>o in t?e(t,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[o]=n;import{A as s}from"./index-DF0Gm8tW.js";/* empty css *//* empty css */import{k as m,r,B as i,P as d,D as u,R as p,V as v,Q as h,X as y,F as N,$ as f,C as b,a7 as g,aK as w,af as F,u as D,M as _,x as k,G as x,W as C,i as j,ai as O}from"./vendor-CgKklJ4r.js";import{_ as R}from"./_plugin-vue_export-helper-BCo6x5W8.js";const E={class:"comment-item"},I={class:"comment-main"},M={class:"comment-header"},S={class:"name dark-text"},V={class:"content"},P={class:"comment-info"},A={class:"date"},U={key:0,class:"comment-replies"},q=R(m({__name:"CommentItem",props:{comment:{},showReplyForm:{}},emits:["toggle-reply","add-reply"],setup(e,{emit:t}){const o=e,n=t,l=r(""),a=r(""),c=e=>{n("toggle-reply",e)},m=(e,t,o)=>{n("add-reply",e,t,o),l.value="",a.value=""},F=()=>{n("add-reply",o.comment.id,l.value,a.value)};let D=null;const _=()=>{let e;do{const t=Math.floor(Math.random()*s.systemMainColor.length);e=s.systemMainColor[t]}while(e===D);return D=e,e};return(e,t)=>{const o=i("CommentItem",!0);return u(),d("li",E,[p("div",I,[p("div",M,[p("div",{class:"avatar",style:h({background:_()})},y(e.comment.author.substring(0,1)),5),p("strong",S,y(e.comment.author),1)]),p("span",V,y(e.comment.content),1),p("div",P,[p("span",A,y((n=e.comment.timestamp,new Date(n).toLocaleString())),1),p("div",{class:"btn-text",onClick:t[0]||(t[0]=t=>c(e.comment.id))},"回复")])]),e.comment.replies.length>0?(u(),d("ul",U,[(u(!0),d(N,null,f(e.comment.replies,(t=>(u(),b(o,{key:t.id,comment:t,"show-reply-form":e.showReplyForm,onToggleReply:c,onAddReply:m},null,8,["comment","show-reply-form"])))),128))])):v("",!0),e.showReplyForm===e.comment.id?(u(),d("form",{key:1,onSubmit:F},[p("div",null,[g(p("input",{"onUpdate:modelValue":t[1]||(t[1]=e=>l.value=e),placeholder:"你的名称",required:""},null,512),[[w,l.value]]),g(p("textarea",{"onUpdate:modelValue":t[2]||(t[2]=e=>a.value=e),placeholder:"你的回复",required:""},null,512),[[w,a.value]]),t[3]||(t[3]=p("button",{class:"btn",type:"submit"},"发布",-1))])],32)):v("",!0)]);var n}}}),[["__scopeId","data-v-7500126b"]]),B=r([{id:1,author:"白夜",content:"黑神话悟空的打斗场面真的燃爆了!期待上线!",timestamp:"2024-09-04 09:00",replies:[{id:101,author:"星河",content:"是啊,特别是那些技能特效,简直帅炸!",timestamp:"2024-09-04 09:15",replies:[{id:201,author:"光芒",content:"希望优化能跟上,不然这么好的画面如果卡顿就可惜了。",timestamp:"2024-09-04 09:30",replies:[]}]}]},{id:2,author:"浮生",content:"据说黑神话悟空需要很高的配置,不知道我的电脑能不能跑起来。",timestamp:"2024-09-04 10:00",replies:[{id:102,author:"晨曦",content:"同担心啊,听说需要至少RTX 3070才能高效运行。",timestamp:"2024-09-04 10:20",replies:[{id:202,author:"流光",content:"我是打算升级配置,等这款游戏就是了。",timestamp:"2024-09-04 10:40",replies:[]}]}]},{id:3,author:"风铃",content:"130GB的存储要求有点夸张啊,不过画质这么好,也情有可原。",timestamp:"2024-09-04 11:00",replies:[{id:103,author:"云端",content:"确实有点高,不过为了这种品质的游戏,值得。",timestamp:"2024-09-04 11:15",replies:[{id:203,author:"梦境",content:"希望发售后能优化一下安装包体积。",timestamp:"2024-09-04 11:30",replies:[]}]}]}]),T={class:"comment-module"},G={class:"comment-header"},L=R(m({__name:"index",setup(e){const t=B,o=r({author:"",content:""}),n=r(null),l=()=>{o.value.author&&o.value.content?(t.value.push({id:Date.now(),author:o.value.author,content:o.value.content,timestamp:(new Date).toISOString(),replies:[]}),o.value.author="",o.value.content=""):alert("请填写完整的评论信息")},a=(e,o,l)=>{const a=s(t.value,e);a&&o&&l?(a.replies.push({id:Date.now(),author:o,content:l,timestamp:(new Date).toISOString(),replies:[]}),n.value=null):alert("请填写完整的回复信息")},c=e=>{n.value=n.value===e?null:e},s=(e,t)=>{for(const o of e){if(o.id===t)return o;const e=s(o.replies,t);if(e)return e}};return(e,s)=>(u(),d("div",T,[p("form",{onSubmit:F(l,["prevent"])},[p("div",null,[g(p("input",{"onUpdate:modelValue":s[0]||(s[0]=e=>o.value.author=e),placeholder:"你的名称",required:""},null,512),[[w,o.value.author]]),g(p("textarea",{"onUpdate:modelValue":s[1]||(s[1]=e=>o.value.content=e),placeholder:"简单说两句...",required:""},null,512),[[w,o.value.content]]),s[2]||(s[2]=p("button",{class:"btn",type:"submit"},"发布",-1))])],32),p("ul",null,[p("div",G,"评论 "+y(D(t).length),1),(u(!0),d(N,null,f(D(t).slice().reverse(),(e=>(u(),b(q,{class:"comment-item",key:e.id,comment:e,"show-reply-form":n.value,onToggleReply:c,onAddReply:a},null,8,["comment","show-reply-form"])))),128))])]))}}),[["__scopeId","data-v-2c6b9aa9"]]),X=_([{id:1,date:"2024-9-3",content:"发现了一个超级好用的工具,开心",collection:5,comment:8,userName:"匿名"},{id:2,date:"2024-9-3",content:"今天的代码写得很顺利!",collection:3,comment:2,userName:"Coder123"},{id:3,date:"2024-9-4",content:"遇到个bug,调试了一整天",collection:7,comment:10,userName:"DebugMaster"},{id:4,date:"2024-9-4",content:"学Node真的是一件很有趣的事",collection:9,comment:4,userName:"NodeLover"},{id:5,date:"2024-9-5",content:"今天的进度有点慢,需要加把劲了",collection:2,comment:3,userName:"努力中的小白"},{id:6,date:"2024-9-5",content:"太好了,终于解决了一个难题!",collection:11,comment:5,userName:"匿名"},{id:7,date:"2024-9-6",content:"学会了新的Node技巧,开心!",collection:4,comment:7,userName:"开心每一天"},{id:8,date:"2024-9-6",content:"代码优化真的是一个细致活",collection:6,comment:4,userName:"精益求精"},{id:9,date:"2024-9-7",content:"今天的工作太顺利了,完美!",collection:10,comment:9,userName:"完美主义者"},{id:10,date:"2024-9-7",content:"需要多练习,才能掌握更多技能",collection:5,comment:6,userName:"匿名"},{id:11,date:"2024-9-8",content:"每天进步一点点,终会成功",collection:8,comment:7,userName:"逐梦者"},{id:12,date:"2024-9-8",content:"与其抱怨,不如努力改变",collection:12,comment:10,userName:"改变命运"},{id:13,date:"2024-9-9",content:"今天尝试了新的库,感觉不错",collection:9,comment:8,userName:"新手尝试"},{id:14,date:"2024-9-9",content:"写代码也需要灵感,今天灵感不错",collection:6,comment:5,userName:"灵感源泉"},{id:15,date:"2024-9-10",content:"感谢社区的帮助,让我解决了问题",collection:7,comment:4,userName:"受益匪浅"},{id:16,date:"2024-9-10",content:"学习的路上要保持耐心和恒心",collection:3,comment:2,userName:"匿名"},{id:17,date:"2024-9-11",content:"今天学习了异步编程的知识,受益匪浅",collection:10,comment:9,userName:"异步学习者"},{id:18,date:"2024-9-11",content:"今天的代码质量提升了不少",collection:11,comment:6,userName:"代码匠人"},{id:19,date:"2024-9-12",content:"感觉学习编程真的很有成就感",collection:8,comment:7,userName:"成就感满满"},{id:20,date:"2024-9-12",content:"要加倍努力,才能超越昨天的自己",collection:5,comment:4,userName:"努力超越"},{id:21,date:"2024-9-13",content:"今天的代码写得很顺手,继续保持",collection:9,comment:8,userName:"顺风顺水"},{id:22,date:"2024-9-13",content:"写代码也需要创意,今天很有创意",collection:7,comment:5,userName:"创意无限"},{id:23,date:"2024-9-14",content:"遇到的难题解决了,感觉很有成就感",collection:10,comment:9,userName:"匿名"},{id:24,date:"2024-9-14",content:"今天的编程练习很有收获",collection:8,comment:7,userName:"收获满满"},{id:25,date:"2024-9-15",content:"学习编程的路上,有苦有甜",collection:6,comment:4,userName:"苦乐编程"},{id:26,date:"2024-9-15",content:"今天的代码写得特别流畅,开心!",collection:11,comment:6,userName:"流畅编程"},{id:27,date:"2024-9-16",content:"今天的编程练习让我更有信心",collection:9,comment:8,userName:"信心满满"},{id:28,date:"2024-9-16",content:"今天的编程学习让我收获很多",collection:7,comment:5,userName:"匿名"},{id:29,date:"2024-9-17",content:"编程是一门艺术,今天体会到了",collection:12,comment:10,userName:"编程艺术家"},{id:30,date:"2024-9-17",content:"今天的代码写得很顺利,继续加油!",collection:10,comment:9,userName:"匿名"}]),z={class:"page-content"},K={class:"list"},Q={class:"offset"},W=["onClick"],$={class:"date"},H={class:"content"},J={class:"bottom"},Y={class:"left"},Z={class:"right"},ee={class:"drawer-default"},te={class:"date"},oe={class:"content"},ne={class:"bottom"},le={class:"left"},ae={class:"right"},ce=m((se=((e,t)=>{for(var o in t||(t={}))l.call(t,o)&&c(e,o,t[o]);if(n)for(var o of n(t))a.call(t,o)&&c(e,o,t[o]);return e})({},{name:"ArticleComment"}),t(se,o({__name:"index",setup(e){const t=r(!1),o=_(["#D8F8FF","#FDDFD9","#FCE6F0","#D3F8F0","#FFEABC","#F5E1FF","#E1E6FE"]);let n=null;const l=()=>{let e;do{const t=Math.floor(Math.random()*o.length);e=o[t]}while(e===n);return n=e,e},a=r({id:1,date:"2024-9-3",content:"加油!学好Node 自己写个小Demo",collection:5,comment:8,userName:"匿名"});return(e,o)=>{const n=L,c=O;return u(),d("div",z,[o[7]||(o[7]=p("h1",{class:"title"},"留言墙",-1)),o[8]||(o[8]=p("p",{class:"desc"},"每一份留言都记录了您的想法,也为我们提供了珍贵的回忆",-1)),p("div",K,[p("ul",Q,[(u(!0),d(N,null,f(D(X),(e=>(u(),d("li",{class:"comment-box",key:e.id,style:h({background:l()}),onClick:o=>(e=>{t.value=!0,a.value=e})(e)},[p("p",$,y(e.date),1),p("p",H,y(e.content),1),p("div",J,[p("div",Y,[p("span",null,[o[1]||(o[1]=p("i",{class:"iconfont-sys"},"",-1)),C(y(e.collection),1)]),p("span",null,[o[2]||(o[2]=p("i",{class:"iconfont-sys"},"",-1)),C(y(e.comment),1)])]),p("div",Z,[p("span",null,y(e.userName),1)])])],12,W)))),128))])]),k(c,{lDrawer:"",modelValue:D(t),"onUpdate:modelValue":o[0]||(o[0]=e=>j(t)?t.value=e:null),"lock-scroll":!1,size:360,"modal-class":"comment-modal"},{header:x((()=>o[3]||(o[3]=[p("h4",null,"详情",-1)]))),default:x((()=>[p("div",ee,[p("div",{class:"comment-box",style:h({background:l()})},[p("p",te,y(D(a).date),1),p("p",oe,y(D(a).content),1),p("div",ne,[p("div",le,[p("span",null,[o[4]||(o[4]=p("i",{class:"iconfont-sys"},"",-1)),C(y(D(a).collection),1)]),p("span",null,[o[5]||(o[5]=p("i",{class:"iconfont-sys"},"",-1)),C(y(D(a).comment),1)])]),p("div",ae,[p("span",null,y(D(a).userName),1)])])],4),k(n)])])),footer:x((()=>o[6]||(o[6]=[p("div",null,null,-1)]))),_:1},8,["modelValue"])])}}}))));var se;const me=R(ce,[["__scopeId","data-v-921262a9"]]);export{me as default};
|