|
|
import{d as E,e,f as l,F as i,u as k,k as r,w as s,bf as c,j as C,y,x as I,q as g,Y as m,H as j,A as D,h}from"./@vue-a481fc63.js";import{$ as N,a0 as U}from"./@vicons-f0266f88.js";import{j as $,V as A,W as V,m as R,X as L,e as P,i as T}from"./naive-ui-eecf2ec3.js";import{_ as B,V as M,W as O}from"./index-5d57cf15.js";import{e as W}from"./paopao-video-player-2fe58954.js";const Z={class:"link-wrap"},q={class:"link-txt-wrap"},z=["href"],F={class:"link-txt"},H=E({__name:"post-link",props:{links:{default:()=>[]}},setup(f){const o=f;return(u,a)=>{const x=$;return e(),l("div",Z,[(e(!0),l(i,null,k(o.links,n=>(e(),l("div",{class:"link-item",key:n.id},[r(x,{class:"hash-link"},{default:s(()=>[r(c(N))]),_:1}),C("div",q,[C("a",{href:n.content,class:"hash-link",target:"_blank",onClick:a[0]||(a[0]=y(()=>{},["stop"]))},[C("span",F,I(n.content),1)],8,z)])]))),128))])}}});const st=B(H,[["__scopeId","data-v-36eef76b"]]),X={key:0},rt=E({__name:"post-video",props:{videos:{default:()=>[]},full:{type:Boolean,default:!1}},setup(f){const o=f;return(u,a)=>{const x=A,n=V;return o.videos.length>0?(e(),l("div",X,[r(n,{"x-gap":4,"y-gap":4,cols:u.full?1:5},{default:s(()=>[r(x,{span:u.full?1:3},{default:s(()=>[(e(!0),l(i,null,k(o.videos,v=>(e(),g(c(W),{onClick:a[0]||(a[0]=y(()=>{},["stop"])),key:v.id,src:v.content,colors:["#18a058","#2aca75"],hoverable:!0,theme:"gradient"},null,8,["src"]))),128))]),_:1},8,["span"])]),_:1},8,["cols"])])):m("",!0)}}}),Y={class:"images-wrap"},ot=E({__name:"post-image",props:{imgs:{default:()=>[]}},setup(f){const o=f,u="https://paopao-assets.oss-cn-shanghai.aliyuncs.com/public/404.png",a="?x-oss-process=image/resize,m_fill,w_300,h_300,limit_0/auto-orient,1/format,png";return(x,n)=>{const v=R,_=A,p=V,w=L;return e(),l("div",Y,[[1].includes(o.imgs.length)?(e(),g(w,{key:0},{default:s(()=>[r(p,{"x-gap":4,"y-gap":4,cols:2},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,t=>(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[0]||(n[0]=y(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):m("",!0),[2,3].includes(o.imgs.length)?(e(),g(w,{key:1},{default:s(()=>[r(p,{"x-gap":4,"y-gap":4,cols:3},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,t=>(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[1]||(n[1]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):m("",!0),[4].includes(o.imgs.length)?(e(),g(w,{key:2},{default:s(()=>[r(p,{"x-gap":4,"y-gap":4,cols:4},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,t=>(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[2]||(n[2]=y(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):m("",!0),[5].includes(o.imgs.length)?(e(),g(w,{key:3},{default:s(()=>[r(p,{"x-gap":4,"y-gap":4,cols:3},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,{key:t.id},[d<3?(e(),g(_,{key:0},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[3]||(n[3]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),128))]),_:1}),r(p,{"x-gap":4,"y-gap":4,cols:2,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,{key:t.id},[d>=3?(e(),g(_,{key:0},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[4]||(n[4]=y(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),128))]),_:1})]),_:1})):m("",!0),[6].includes(o.imgs.length)?(e(),g(w,{key:4},{default:s(()=>[r(p,{"x-gap":4,"y-gap":4,cols:3},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,{key:t.id},[d<3?(e(),g(_,{key:0},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[5]||(n[5]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),128))]),_:1}),r(p,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,{key:t.id},[d>=3?(e(),g(_,{key:0},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[6]||(n[6]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),128))]),_:1})]),_:1})):m("",!0),o.imgs.length===7?(e(),g(w,{key:5},{default:s(()=>[r(p,{"x-gap":4,"y-gap":4,cols:4},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,null,[d<4?(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[7]||(n[7]=y(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1}),r(p,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,null,[d>=4?(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[8]||(n[8]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1})]),_:1})):m("",!0),o.imgs.length===8?(e(),g(w,{key:6},{default:s(()=>[r(p,{"x-gap":4,"y-gap":4,cols:4},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,null,[d<4?(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[9]||(n[9]=y(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1}),r(p,{"x-gap":4,"y-gap":4,cols:4,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,null,[d>=4?(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[10]||(n[10]=y(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1})]),_:1})):m("",!0),o.imgs.length===9?(e(),g(w,{key:7},{default:s(()=>[r(p,{"x-gap":4,"y-gap":4,cols:3},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,null,[d<3?(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[11]||(n[11]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1}),r(p,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,null,[d>=3&&d<6?(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[12]||(n[12]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1}),r(p,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,null,[d>=6?(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[13]||(n[13]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1})]),_:1})):m("",!0)])}}});const G={class:"attachment-wrap"},J=E({__name:"post-attachment",props:{attachments:{default:()=>[]},price:{default:0}},setup(f){const o=f,u=j(!1),a=j(""),x=j(0),n=_=>{u.value=!0,x.value=_.id,a.value="这是一个免费附件,您可以直接下载?",_.type===8&&(a.value=()=>h("div",{},[h("p",{},"这是一个收费附件,下载将收取"+(o.price/100).toFixed(2)+"元")]),M({id:x.value}).then(p=>{p.paid&&(a.value=()=>h("div",{},[h("p",{},"此次下载您已支付或无需付费,请确认下载")]))}).catch(p=>{u.value=!1}))},v=()=>{O({id:x.value}).then(_=>{window.open(_.signed_url.replace("http://","https://"),"_blank")}).catch(_=>{console.log(_)})};return(_,p)=>{const w=$,t=P,d=T;return e(),l("div",G,[(e(!0),l(i,null,k(_.attachments,b=>(e(),l("div",{class:"attach-item",key:b.id},[r(t,{onClick:y(K=>n(b),["stop"]),type:"primary",size:"tiny",dashed:""},{icon:s(()=>[r(w,null,{default:s(()=>[r(c(U))]),_:1})]),default:s(()=>[D(" "+I(b.type===8?"收费":"免费")+"附件 ",1)]),_:2},1032,["onClick"])]))),128)),r(d,{show:u.value,"onUpdate:show":p[0]||(p[0]=b=>u.value=b),"mask-closable":!1,preset:"dialog",title:"下载提示",content:a.value,"positive-text":"确认下载","negative-text":"取消","icon-placement":"top",onPositiveClick:v},null,8,["show","content"])])}}});const lt=B(J,[["__scopeId","data-v-22563084"]]),at=f=>{const o=[],u=[];var a=/(#|#)([^#@\s])+?\s+?/g,x=/@([a-zA-Z0-9])+?\s+?/g;return f=f.replace(/<[^>]*?>/gi,"").replace(/(.*?)<\/[^>]*?>/gi,"").replace(a,n=>(o.push(n.substr(1).trim()),'<a class="hash-link" data-detail="tag:'+encodeURIComponent(n.substr(1).trim())+'">'+n.trim()+"</a> ")).replace(x,n=>(u.push(n.substr(1).trim()),'<a class="hash-link" data-detail="user:'+encodeURIComponent(n.substr(1).trim())+'">'+n.trim()+"</a> ")),{content:f,tags:o,users:u}},ct=(f,o,u,a,x=!0)=>{const n=f.length>a;if(x&&n){f=f.substring(0,a);let p=f.charAt(a-1);(p=="#"||p=="#"||p=="@")&&(f=f.substring(0,a-1))}const v=/(#|#)([^#@\s])+?\s+?/g,_=/@([a-zA-Z0-9])+?\s+?/g;return f=f.replace(/<[^>]*?>/gi,"").replace(/(.*?)<\/[^>]*?>/gi,"").replace(v,p=>'<a class="hash-link" data-detail="tag:'+encodeURIComponent(p.substring(1).trim())+'">'+p.trim()+"</a> ").replace(_,p=>'<a class="hash-link" data-detail="user:'+encodeURIComponent(p.substring(1).trim())+'">'+p.trim()+"</a> "),n&&(f=f.trimEnd()+(x?"... ":" ")+'<a class="hash-link" data-detail="post">'+(x?o:u)+"</a> "),f};export{ot as _,lt as a,rt as b,st as c,ct as d,at as p};
|