index.46e5048d.js 7.5 KB

1
  1. import{R as E,_ as w,u as I,r as h,o as b,e as n,f as c,h as e,g as m,w as z,F as k,k as $,x as _,l as f,i as r,bu as M,bv as N,b as G,S as q,G as x,n as U,B as S,C as L,y as C}from"./index.f884e450.js";import{m as W}from"./comment.34cdc6c6.js";import{l as F}from"./gather.2fe58cbe.js";import{l as H}from"./private.41b91cff.js";const R=i=>E({params:i,method:"GET",url:"notification"}),D=i=>E({params:i,method:"GET",url:"/notification/type-count"});const P={class:""},j={style:{display:"flex","align-items":"center"}},A={class:"title"},J={class:"data"},K={class:"content"},O={key:0,class:"read"},Q=["src"],X={style:{"margin-left":"10px"}},Y={class:"title"},Z={class:"data"},ee={class:"order"},te={key:0,class:"read"},se={__name:"inform",setup(i){I();const u=h("system"),y=l=>{l.index==0?u.value="system":l.index==1?u.value="like":u.value="collect",v()};let p=h([]);const v=async()=>{try{const{data:l}=await R({is_page:0,code:u.value});p.value=l}catch{}};b(v);const a=h("first");return b(()=>{}),(l,t)=>{const s=M,o=N;return n(),c(k,null,[e("div",P,[m(o,{modelValue:a.value,"onUpdate:modelValue":t[0]||(t[0]=d=>a.value=d),class:"demo-tabs",onTabClick:y},{default:z(()=>[m(s,{label:"\u5168\u90E8\u901A\u77E5",name:"first"}),m(s,{label:"\u70B9\u8D5E",name:"second"}),m(s,{label:"\u6536\u85CF",name:"third"})]),_:1},8,["modelValue"])]),e("div",null,[u.value=="system"?(n(!0),c(k,{key:0},$(r(p),(d,g)=>(n(),c("div",{class:"box",key:g},[e("div",j,[e("div",A,_(d.title),1),e("div",J,_(d.updated_at),1)]),e("div",K,_(d.content),1),d.is_read==0?(n(),c("div",O)):f("",!0)]))),128)):(n(!0),c(k,{key:1},$(r(p),(d,g)=>(n(),c("div",{class:"box",style:{display:"flex"},key:g},[e("div",null,[e("img",{src:d.image,style:{width:"48px",height:"48px","border-radius":"50%"},alt:""},null,8,Q)]),e("div",X,[e("div",null,[e("span",Y,_(d.title),1),e("span",Z,_(d.updated_at),1)]),e("div",ee,_(d.content),1)]),d.is_read==0?(n(),c("div",te)):f("",!0)]))),128))])],64)}}};var oe=w(se,[["__scopeId","data-v-6ba49b58"]]);const V=i=>(S("data-v-7813ed30"),i=i(),L(),i),ae={style:{display:"flex"}},ne=["src"],ie={style:{"margin-left":"14px"}},le={style:{width:"775px"}},ce={style:{display:"flex"}},re={class:"title"},de=V(()=>e("div",{class:"ping",style:{"margin-left":"8px"}},"\u8BC4\u8BBA\u4E86\u6211\u7684\u6587\u7AE0",-1)),_e={class:"date"},ue={class:"content"},pe={style:{display:"flex","margin-top":"19px"}},ve=["onClick"],he=["onClick"],ye=V(()=>e("span",null,"\u56DE\u590D",-1)),fe=["onClick"],xe=["src"],ge={style:{"margin-left":"13px"}},me={class:"title"},be=["innerHTML"],ke={__name:"comment",setup(i){const u=G();let y=h([]);const p=async()=>{try{const{data:t}=await W({is_page:0});y.value=t}catch{}},v=I(),a=(t,s)=>{s=="article"?v.push({name:"articles",query:{id:t,type:s}}):s=="info"?v.push({name:"news",query:{id:t,type:s}}):s=="integral_goods"?v.push({path:"/store/pointshoping/:id",query:{id:t,type:s}}):s=="post"?v.push({name:"post",query:{id:t,type:s}}):s=="video"&&v.push({name:"videos",query:{id:t,type:s}})},l=async(t,s)=>{try{const{msg:o}=await F({source_type:"comment",source_id:t});U({message:o,type:"success"}),p()}catch(o){console.log("error",o)}};return b(p),(t,s)=>(n(!0),c(k,null,$(r(y),(o,d)=>(n(),c("div",{class:"box",key:d,style:{"margin-bottom":"20px","border-bottom":"1px solid #f0f0f0","padding-bottom":"24px"}},[e("div",ae,[e("div",null,[e("img",{src:r(u).avatar,style:{width:"48px",height:"48px","border-radius":"50%"},alt:""},null,8,ne)]),e("div",ie,[e("div",le,[e("div",null,[e("div",ce,[e("div",re,_(o.user.username),1),de])]),e("div",_e,_(o.created_at),1)]),e("div",null,[e("div",ue,_(o.content),1),e("div",pe,[e("div",{style:{cursor:"pointer"},onClick:g=>l(o.id,o.source_type)},[m(q,{name:"like",size:16,rgap:2,color:o.is_like==1?"#00b0b0":"#999999"},null,8,["color"]),e("span",{style:x({color:o.is_like==1?"#00b0b0":"#999999"})},"\u8D5E",4)],8,ve),e("div",{onClick:g=>a(o.source_id,o.source_type),style:{"margin-left":"26px",cursor:"pointer"}},[m(q,{name:"message",size:16,rgap:2}),ye],8,he)])]),e("div",{onClick:g=>a(o.source_id,o.source_type),class:"back",style:{display:"flex","margin-top":"19px"}},[e("div",null,[e("img",{src:o.source.image,style:{width:"48px",height:"48px","border-radius":"50%"},alt:""},null,8,xe)]),e("div",ge,[e("div",me,_(o.source.title),1),e("div",{class:"contena",innerHTML:o.source.content},null,8,be)])],8,fe)])])]))),128))}};var $e=w(ke,[["__scopeId","data-v-7813ed30"]]);const B=i=>(S("data-v-9bce6658"),i=i(),L(),i),we=B(()=>e("div",null,"\u5168\u90E8\u79C1\u4FE1",-1)),Ce=["onClick"],Ie={style:{position:"relative"}},Se=["src"],Le={key:0,style:{color:"#fff","font-size":"10px","text-align":"center","line-height":"16px",position:"absolute",left:"-5px",top:"3px",width:"16px",height:"16px","border-radius":"50%",background:"red"}},Te={class:"right"},qe={class:"title"},Ee=B(()=>e("span",{class:"si"},"\u4E0E\u4F60\u7684\u79C1\u4FE1",-1)),Ve={class:"date"},Be={class:"content"},ze={__name:"private",setup(i){const u=I(),y=(a,l)=>{u.push({path:"chat",query:{id:a,username:l}})},p=h();return b(async a=>{try{const{data:l}=await H({is_page:0});p.value=l}catch{}}),h("first"),b(()=>{}),(a,l)=>(n(),c("div",null,[we,(n(!0),c(k,null,$(p.value,(t,s)=>(n(),c("div",{class:"box",onClick:o=>y(t.chat_user_id,t.chat_user.username),key:s,style:{display:"flex"}},[e("div",Ie,[e("img",{src:t.chat_user.avatar,style:{width:"48px",height:"48px","border-radius":"50%"},alt:""},null,8,Se),t.is_read==0?(n(),c("div",Le,_(t.unread_count),1)):f("",!0)]),e("div",Te,[e("div",null,[e("span",qe,_(t.chat_user.username),1),Ee,e("span",Ve,_(t.updated_at),1)]),e("div",Be,_(t.content),1)])],8,Ce))),128))]))}};var Me=w(ze,[["__scopeId","data-v-9bce6658"]]);const T=i=>(S("data-v-2966bcc7"),i=i(),L(),i),Ne={class:"articles-container"},Ge={class:"left"},Ue=T(()=>e("span",{style:{"margin-left":"20px"}},"\u901A\u77E5",-1)),We={key:0,style:{position:"absolute",top:"0px",left:"60px",background:"red",width:"10px",height:"10px","border-radius":"50%"}},Fe=T(()=>e("span",{style:{"margin-left":"20px"}},"\u8BC4\u8BBA",-1)),He={key:0,style:{position:"absolute",top:"0px",left:"60px",background:"red",width:"10px",height:"10px","border-radius":"50%"}},Re=T(()=>e("span",{style:{"margin-left":"20px"}}," \u79C1\u4FE1",-1)),De={key:0,style:{position:"absolute",top:"0px",left:"60px",background:"red",width:"10px",height:"10px","border-radius":"50%"}},Pe={class:"right"},je={__name:"index",setup(i){const u=h(""),y=h(""),p=h("");b(async()=>{try{const{data:t}=await D({});u.value=t.comment,y.value=t.notification,p.value=t.chat}catch{}});let a=h("0");const l=t=>{a.value=t};return(t,s)=>(n(),c("div",Ne,[e("div",Ge,[e("div",{style:x([{color:r(a)==0?"#333333":"#555555",fontWeight:r(a)==0?"600":""},{position:"relative"}]),class:"tong",onClick:s[0]||(s[0]=o=>l(0))},[e("div",{style:x({background:r(a)==0?"#00b0b0":"#fff"}),class:"som"},null,4),Ue,y.value!=0?(n(),c("div",We)):f("",!0)],4),e("div",{style:x([{color:r(a)==1?"#333333":"#555555",fontWeight:r(a)==1?"600":""},{margin:"45px 0",position:"relative"}]),class:"tong",onClick:s[1]||(s[1]=o=>l(1))},[e("span",{style:x({background:r(a)==1?"#00b0b0":"#fff"}),class:"som"},null,4),Fe,u.value!=0?(n(),c("div",He)):f("",!0)],4),e("div",{style:x([{color:r(a)==2?"#333333":"#555555",fontWeight:r(a)==2?"600":""},{position:"relative"}]),class:"tong",onClick:s[2]||(s[2]=o=>l(2))},[e("span",{style:x({background:r(a)==2?"#00b0b0":"#fff"}),class:"som"},null,4),Re,p.value!=0?(n(),c("div",De)):f("",!0)],4)]),e("div",Pe,[r(a)==0?(n(),C(oe,{key:0})):f("",!0),r(a)==1?(n(),C($e,{key:1})):f("",!0),r(a)==2?(n(),C(Me,{key:2})):f("",!0)])]))}};var Qe=w(je,[["__scopeId","data-v-2966bcc7"]]);export{Qe as default};