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/Profile-61da1947.js

2 lines
12 KiB

import{_ as ze}from"./whisper-a9d35427.js";import{_ as Me,a as qe}from"./post-item.vue_vue_type_style_index_0_lang-e0ec20a9.js";import{_ as xe}from"./post-skeleton-052f18e8.js";import{_ as $e}from"./main-nav.vue_vue_type_style_index_0_lang-ff996869.js";import{d as Se,H as r,c as Ce,b as Le,E as Ne,r as Ue,f as i,k as u,bf as l,q as h,w as _,Y as f,e as a,j as m,x as O,A as E,y as ue,F as b,u as I,h as ie}from"./@vue-a481fc63.js";import{u as De}from"./vuex-44de225f.js";import{b as He,u as Be}from"./vue-router-e5a2430e.js";import{e as L,K as Ve,u as je,f as Re,_ as We}from"./index-16dc1f8e.js";import{p as G}from"./count-e2caa1c1.js";import{W as Ee}from"./v3-infinite-loading-2c58ec2f.js";import{k as Ge,a as Je}from"./@vicons-f0266f88.js";import{F as Ke,G as Qe,a as Ye,j as re,o as Xe,M as Ze,e as et,P as tt,f as at,g as st,J as ot,k as lt,H as nt}from"./naive-ui-eecf2ec3.js";import"./content-11ebede8.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 ut={class:"profile-baseinfo"},it={class:"avatar"},rt={class:"base-info"},ct={class:"username"},_t={class:"userinfo"},vt={class:"info-item"},dt={class:"info-item"},mt={class:"userinfo"},ft={class:"info-item"},pt={class:"info-item"},ht={class:"info-item"},gt={class:"user-opts"},wt={key:0,class:"skeleton-wrap"},kt={key:1},yt={key:0,class:"empty-wrap"},bt={key:1},It={key:0},Pt={key:1},Ot={key:2},Tt={key:3},At={key:4},Ft={key:2},zt={key:0},Mt={key:1},qt={key:2},xt={key:3},$t={key:4},St={class:"load-more-wrap"},Ct={class:"load-more-spinner"},Lt=Se({__name:"Profile",setup(Nt){const n=De(),T=He(),ce=Be(),_e=Ke(),d=r(!1),P=r(!1),o=r([]),A=r([]),F=r([]),z=r([]),M=r([]),q=r([]),p=r("post"),J=r(+T.query.p||1),K=r(1),Q=r(1),Y=r(1),X=r(1),s=r(+T.query.p||1),g=r(20),v=r(0),Z=r(0),ee=r(0),te=r(0),ae=r(0),se=r(0),U=r(!1),oe=r({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),ve=e=>()=>ie(re,null,{default:()=>ie(e)}),de=Ce(()=>[{label:"设置",key:"setting",icon:ve(Je)}]),me=e=>{switch(e){case"setting":ce.push({name:"setting",query:{t:new Date().getTime()}});break}},w=e=>{oe.value=e,U.value=!0},fe=()=>{U.value=!1},k=e=>{_e.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?je({user_id:e.user.id}).then(c=>{window.$message.success("操作成功"),le(e.user_id,!1)}).catch(c=>{}):Re({user_id:e.user.id}).then(c=>{window.$message.success("关注成功"),le(e.user_id,!0)}).catch(c=>{})}})};function le(e,c){x(A.value,e,c),x(F.value,e,c),x(z.value,e,c),x(M.value,e,c),x(q.value,e,c)}function x(e,c,W){if(e&&e.length>0)for(let N in e)e[N].user_id==c&&(e[N].user.is_following=W)}const D=()=>{switch(p.value){case"post":H();break;case"comment":B();break;case"highlight":V();break;case"media":j();break;case"star":R();break}},H=()=>{d.value=!0,L({username:n.state.userInfo.username,style:"post",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?o.value=o.value.concat(e.list):(o.value=e.list||[],window.scrollTo(0,0)),v.value=Math.ceil(e.pager.total_rows/g.value),A.value=o.value,Z.value=v.value}).catch(e=>{o.value=[],s.value>1&&s.value--,d.value=!1})},B=()=>{d.value=!0,L({username:n.state.userInfo.username,style:"comment",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?o.value=o.value.concat(e.list):(o.value=e.list||[],window.scro