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-30dd2016.js

2 lines
11 KiB

import{_ as ke}from"./whisper-6e97e8e3.js";import{_ as ye,a as be}from"./post-item.vue_vue_type_style_index_0_lang-299dc5b6.js";import{_ as Ie}from"./post-skeleton-dd55abe8.js";import{_ as Pe}from"./main-nav.vue_vue_type_style_index_0_lang-52234344.js";import{d as Oe,H as i,b as Te,E as Ae,r as Fe,f as n,k as r,bf as u,q as p,w as v,Y as m,e as t,j as h,x as O,A as R,y as ne,F as b,u as I}from"./@vue-a481fc63.js";import{u as xe}from"./vuex-44de225f.js";import{b as Me}from"./vue-router-e5a2430e.js";import{e as L,K as ze,u as qe,f as $e,_ as Ce}from"./index-7d4ab953.js";import{W as Se}from"./v3-infinite-loading-2c58ec2f.js";import{F as Le,G as Ue,a as Be,o as De,M as He,f as Ne,g as Ve,J as We,k as je,H as Ee}from"./naive-ui-eecf2ec3.js";import"./content-aad6a645.js";import"./@vicons-f0266f88.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 Re={class:"profile-baseinfo"},Ge={class:"avatar"},Je={class:"base-info"},Ke={class:"username"},Ye={class:"userinfo"},Qe={class:"info-item"},Xe={class:"info-item"},Ze={class:"userinfo"},ea={class:"info-item"},aa={class:"info-item"},ta={key:0,class:"skeleton-wrap"},sa={key:1},la={key:0,class:"empty-wrap"},oa={key:1},na={key:0},ua={key:1},ia={key:2},ra={key:3},ca={key:4},_a={key:2},va={key:0},da={key:1},ma={key:2},fa={key:3},pa={key:4},ha={class:"load-more-wrap"},ga={class:"load-more-spinner"},wa=Oe({__name:"Profile",setup(ka){const o=xe(),T=Me(),ue=Le(),d=i(!1),P=i(!1),l=i([]),A=i([]),F=i([]),x=i([]),M=i([]),z=i([]),f=i("post"),G=i(+T.query.p||1),J=i(1),K=i(1),Y=i(1),Q=i(1),s=i(+T.query.p||1),g=i(20),_=i(0),X=i(0),Z=i(0),ee=i(0),ae=i(0),te=i(0),B=i(!1),se=i({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),w=e=>{se.value=e,B.value=!0},ie=()=>{B.value=!1},k=e=>{ue.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?qe({user_id:e.user.id}).then(c=>{window.$message.success("操作成功"),le(e.user_id,!1)}).catch(c=>{}):$e({user_id:e.user.id}).then(c=>{window.$message.success("关注成功"),le(e.user_id,!0)}).catch(c=>{})}})};function le(e,c){q(A.value,e,c),q(F.value,e,c),q(x.value,e,c),q(M.value,e,c),q(z.value,e,c)}function q(e,c,E){if(e&&e.length>0)for(let U in e)e[U].user_id==c&&(e[U].user.is_following=E)}const D=()=>{switch(f.value){case"post":H();break;case"comment":N();break;case"highlight":V();break;case"media":W();break;case"star":j();break}},H=()=>{d.value=!0,L({username:o.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?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),A.value=l.value,X.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},N=()=>{d.value=!0,L({username:o.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?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),F.value=l.value,Z.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},V=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"highlight",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.