search.4fa9026e.js 6.1 KB

1
  1. import{_ as z,b as A,u as D,a as G,r as _,o as p,a6 as H,e as s,f as c,h as n,i as o,F as y,k as h,l as v,y as k,x as S,v as J,B as K,C as P,bF as Q,n as T}from"./index.f884e450.js";/* empty css *//* empty css */import{a as W}from"./gather.2fe58cbe.js";/* empty css *//* empty css *//* empty css *//* empty css */import{_ as O}from"./index.2b8822ec.js";import{I as F}from"./index.a5accea8.js";import{l as X}from"./news.b621e126.js";import{l as Y}from"./article.c01b4a44.js";import{l as Z}from"./video.c430579b.js";import{l as tt}from"./forum.c125424a.js";import"./formatTime.53deef2b.js";import"./link.9c4c1dc9.js";const m=g=>(K("data-v-716b3f16"),g=g(),P(),g),et={class:"index-follow-container flex-row flex-jc-sb"},ot={class:"context",style:{"margin-top":"40px"}},st={key:0},nt=m(()=>n("div",null,"\u8D44\u8BAF",-1)),at={class:"content-list flex-row",style:{"margin-top":"14px","margin-bottom":"10px"}},ct={key:1},lt=m(()=>n("div",null,"\u6587\u7AE0",-1)),it={class:"content-list content-list--c2 flex-row",style:{"margin-top":"14px"}},rt={key:2},ut=m(()=>n("div",null,"\u89C6\u9891",-1)),_t={class:"content-list content-list--c2 flex-row",style:{"margin-top":"14px"}},dt={key:3},pt=m(()=>n("div",null,"\u5E16\u5B50",-1)),yt={class:"content-list flex-row",style:{"margin-top":"14px","margin-bottom":"10px"}},ht={key:4},vt=m(()=>n("div",null,"\u7528\u6237",-1)),mt={class:"content-lista flex-row",style:{"margin-top":"14px","margin-bottom":"10px","column-gap":"65px"}},gt=["onClick","src"],kt=["onClick"],ft={__name:"search",setup(g){const E=A(),d=D(),a=G(),u=_();a.query&&(u.value=a.query.keyword);let f=_([]);const L=async()=>{try{const{data:e}=await X({is_page:0,status:"normal",title:u.value});f.value=e}catch{}};p(L);let w=_([]);const x=async()=>{try{const{data:e}=await Y({is_page:0,status:"normal",title:u.value});w.value=e}catch{}};p(x);let q=_([]);const b=async()=>{try{const{data:e}=await Z({is_page:0,status:"normal",title:u.value});q.value=e}catch{}};p(b);let $=_([]);const B=async()=>{try{const{data:e}=await tt({is_page:0,status:"normal",content:u.value});$.value=e}catch{}};p(B);let U=_([]);const C=async()=>{try{const{data:e}=await W({is_page:0,source_type:"user",type:"single",title:u.value});U.value=e}catch{}};p(C);const M=e=>{d.push({name:"news",query:{id:e}})},N=e=>{d.push({name:"post",query:{id:e}})},R=e=>{d.push({name:"articles",query:{id:e}})},V=(e,l)=>{d.push({name:"videos",query:{id:e,type:l}})};H(()=>a.query,e=>{console.log(e),u.value=e.keyword,L(),C(),B(),x(),b()});const j=async e=>{try{const{msg:l}=await Q({id:e});T.success({message:l,type:"success"}),C(),E.getUser()}catch{}},I=e=>{d.push({path:"/rest",query:{id:e}})};return(e,l)=>(s(),c("div",et,[n("div",ot,[o(f).length>0&&(o(a).query.type=="first"||o(a).query.type=="second")?(s(),c("div",st,[nt,n("div",at,[(s(!0),c(y,null,h(o(f),(t,i)=>(s(),k(O,{key:i,onUpdate:r=>M(t.id),title:t.title,"time-ago":t.original_published_at,"like-count":t.like_count||"0","comment-count":t.comment_count||"0",image:t.image,is_like:t.is_like,is_collect:t.is_collect},null,8,["onUpdate","title","time-ago","like-count","comment-count","image","is_like","is_collect"]))),128))])])):v("",!0),o(w).length>0&&(o(a).query.type=="first"||o(a).query.type=="fourth")?(s(),c("div",ct,[lt,n("div",it,[(s(!0),c(y,null,h(o(w),(t,i)=>(s(),k(F,{key:i,onArticle:l[0]||(l[0]=r=>x()),onUpdate:r=>R(t.id),onOther:r=>I(t.user_id),type:t.image?"common":"article",title:t.title,"time-ago":t.original_published_at,descs:t.description,"topic-name":t.topic?.title,author:t.user?.username,"author-avatar":t.user?.avatar,view_count:t.view_count||0,comment_count:t.comment_count||0,collect_count:t.collect_count||0,share_count:t.share_count||0,like_count:t.like_count,image:t.image,is_like:t.is_like,is_collect:t.is_collect,source_id:t.id,source_type:"article"},null,8,["onUpdate","onOther","type","title","time-ago","descs","topic-name","author","author-avatar","view_count","comment_count","collect_count","share_count","like_count","image","is_like","is_collect","source_id"]))),128))])])):v("",!0),o(q).length>0&&(o(a).query.type=="first"||o(a).query.type=="third")?(s(),c("div",rt,[ut,n("div",_t,[(s(!0),c(y,null,h(o(q),(t,i)=>(s(),k(F,{key:i,onVideo:l[1]||(l[1]=r=>b()),onUpdate:r=>V(t.id,"common"),onOther:r=>I(t.user_id),type:t.image?"common":"article",title:t?.title,"time-ago":t.original_published_at,descs:t.description,"topic-name":t.topic?.title,author:t.user?.username,"author-avatar":t.user?.avatar,view_count:t.view_count||0,comment_count:t.comment_count||0,collect_count:t.collect_count||0,share_count:t.share_count||0,image:t.image,is_like:t.is_like,is_collect:t.is_collect,source_id:t.id,source_type:"video",like_count:t.like_count},null,8,["onUpdate","onOther","type","title","time-ago","descs","topic-name","author","author-avatar","view_count","comment_count","collect_count","share_count","image","is_like","is_collect","source_id","like_count"]))),128))])])):v("",!0),o($).length>0&&(o(a).query.type=="first"||o(a).query.type=="firse")?(s(),c("div",dt,[pt,n("div",yt,[(s(!0),c(y,null,h(o($),(t,i)=>(s(),k(O,{key:i,onUpdate:r=>N(t.id),"time-ago":t.original_published_at,"like-count":t.like_count||"0","comment-count":t.comment_count||"0",image:t.images?t.images[0]:"",is_like:t.is_like,title:t.content,is_collect:t.is_collect},null,8,["onUpdate","time-ago","like-count","comment-count","image","is_like","title","is_collect"]))),128))])])):v("",!0),o(U).length>0&&(o(a).query.type=="first"||o(a).query.type=="six")?(s(),c("div",ht,[vt,n("div",mt,[(s(!0),c(y,null,h(o(U),(t,i)=>(s(),c("div",{key:i,class:"usebox"},[n("div",null,[n("img",{onClick:r=>I(t.id),src:t.avatar,style:{width:"40px",height:"40px","border-radius":"50%",cursor:"pointer"},alt:""},null,8,gt),n("span",null,S(t.username),1)]),n("div",{class:J(t.is_follow==0?"abt":"about"),onClick:r=>j(t.id)},S(t.is_follow==0?"\u5173\u6CE8":"\u5DF2\u5173\u6CE8"),11,kt)]))),128))])])):v("",!0)])]))}};var Rt=z(ft,[["__scopeId","data-v-716b3f16"]]);export{Rt as default};