You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
paopao-ce/web/dist/assets/User-1707706d.js

2 lines
14 KiB

import{_ as Ne,a as Re}from"./post-item.vue_vue_type_style_index_0_lang-299dc5b6.js";import{_ as Ve}from"./post-skeleton-dd55abe8.js";import{_ as je}from"./whisper-6e97e8e3.js";import{_ as Ee}from"./main-nav.vue_vue_type_style_index_0_lang-52234344.js";import{d as Ge,H as i,R as Je,c as Ke,b as Ye,E as Qe,r as Xe,f as u,k as o,w as r,q as g,Y as m,e as s,j as w,x as A,bf as c,A as H,y as me,F,u as T,h as fe}from"./@vue-a481fc63.js";import{u as Ze}from"./vuex-44de225f.js";import{b as ea}from"./vue-router-e5a2430e.js";import{L as aa,K as sa,e as N,h as ta,u as pe,f as he,M as la,_ as na}from"./index-7d4ab953.js";import{W as oa}from"./whisper-add-friend-fde59c3d.js";import{W as ua}from"./v3-infinite-loading-2c58ec2f.js";import{k as ia,r as ra,G as ge,s as ca,t as va,J as _a,R as da}from"./@vicons-f0266f88.js";import{F as ma,G as fa,a as pa,j as we,o as ha,M as ga,e as wa,P as ka,k as ya,f as ba,g as Pa,J as Oa,H as Fa}from"./naive-ui-eecf2ec3.js";import"./content-aad6a645.js";import"./paopao-video-player-2fe58954.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const Ta={key:0,class:"profile-baseinfo"},Ia={class:"avatar"},xa={class:"base-info"},Aa={class:"username"},$a={class:"userinfo"},za={class:"info-item"},Ua={class:"info-item"},qa={class:"userinfo"},Ca={class:"info-item"},Ma={class:"info-item"},Sa={key:0,class:"user-opts"},Wa={key:0,class:"skeleton-wrap"},La={key:1},Ba={key:0,class:"empty-wrap"},Da={key:1},Ha={key:0},Na={key:1},Ra={key:2},Va={key:3},ja={key:4},Ea={key:2},Ga={key:0},Ja={key:1},Ka={key:2},Ya={key:3},Qa={key:4},Xa={class:"load-more-wrap"},Za={class:"load-more-spinner"},es=Ge({__name:"User",setup(as){const R=ma(),d=Ze(),$=ea(),ce="true".toLowerCase()==="true",f=i(!1),y=i(!1),a=Je({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),h=i(!1),V=i(!1),G=i(!1),l=i([]),z=i([]),U=i([]),q=i([]),C=i([]),M=i([]),I=i($.query.s||""),n=i(+$.query.p||1),p=i("post"),J=i(+$.query.p||1),K=i(1),Y=i(1),Q=i(1),X=i(1),k=i(20),_=i(0),Z=i(0),ee=i(0),ae=i(0),se=i(0),te=i(0),b=e=>{a.id=e.id,a.username=e.username,a.nickname=e.nickname,a.avatar=e.avatar,V.value=!0},P=e=>{R.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?pe({user_id:e.user.id}).then(v=>{window.$message.success("操作成功"),ve(e.user_id,!1)}).catch(v=>{}):he({user_id:e.user.id}).then(v=>{window.$message.success("关注成功"),ve(e.user_id,!0)}).catch(v=>{})}})};function ve(e,v){S(z,e,v),S(U,e,v),S(q,e,v),S(C,e,v),S(M,e,v)}function S(e,v,ie){if(e.value&&e.value.length>0)for(let E in e.value)e.value[E].user_id==v&&(e.value[E].user.is_following=ie)}const ke=()=>{y.value=!1,l.value=[],z.value=[],U.value=[],q.value=[],C.value=[],M.value=[],p.value="post",n.value=1,J.value=1,K.value=1,Y.value=1,Q.value=1,X.value=1,_.value=0,Z.value=0,ee.value=0,ae.value=0,se.value=0,te.value=0},ye=()=>{switch(p.value){case"post":j();break;case"comment":le();break;case"highlight":ne();break;case"media":oe();break;case"star":ue();break}},j=()=>{f.value=!0,N({username:I.value,style:"post",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/k.value),z.value=l.value,Z.value=_.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},le=()=>{f.value=!0,N({username:I.value,style:"comme