mirror of https://github.com/rocboss/paopao-ce
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.
2 lines
11 KiB
2 lines
11 KiB
1 year ago
|
import{_ as ye}from"./whisper-473502c7.js";import{_ as be,a as Ie}from"./post-item.vue_vue_type_style_index_0_lang-bce56e3e.js";import{_ as Pe}from"./post-skeleton-df8e8b0e.js";import{_ as Oe}from"./main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js";import{d as Te,H as i,b as Ae,E as Fe,r as xe,f as u,k as r,bf as n,q as h,w as v,Y as m,e as a,j as f,x as O,A as R,y as ue,F as b,u as I}from"./@vue-a481fc63.js";import{u as Me}from"./vuex-44de225f.js";import{b as ze}from"./vue-router-e5a2430e.js";import{e as L,K as qe,u as $e,f as Ce,_ as Se}from"./index-3489d7cc.js";import{p as G}from"./count-e2caa1c1.js";import{W as Le}from"./v3-infinite-loading-2c58ec2f.js";import{F as Ne,G as Ue,a as Be,o as De,M as He,f as Ve,g as We,J as je,k as Ee,H as Re}from"./naive-ui-eecf2ec3.js";import"./content-23ae3d74.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 Ge={class:"profile-baseinfo"},Je={class:"avatar"},Ke={class:"base-info"},Qe={class:"username"},Ye={class:"userinfo"},Xe={class:"info-item"},Ze={class:"info-item"},et={class:"userinfo"},tt={class:"info-item"},at={class:"info-item"},st={class:"info-item"},lt={key:0,class:"skeleton-wrap"},ot={key:1},nt={key:0,class:"empty-wrap"},ut={key:1},it={key:0},rt={key:1},ct={key:2},_t={key:3},vt={key:4},dt={key:2},mt={key:0},ft={key:1},pt={key:2},ht={key:3},gt={key:4},wt={class:"load-more-wrap"},kt={class:"load-more-spinner"},yt=Te({__name:"Profile",setup(bt){const o=Me(),T=ze(),ie=Ne(),d=i(!1),P=i(!1),l=i([]),A=i([]),F=i([]),x=i([]),M=i([]),z=i([]),p=i("post"),J=i(+T.query.p||1),K=i(1),Q=i(1),Y=i(1),X=i(1),s=i(+T.query.p||1),g=i(20),_=i(0),Z=i(0),ee=i(0),te=i(0),ae=i(0),se=i(0),U=i(!1),le=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=>{le.value=e,U.value=!0},re=()=>{U.value=!1},k=e=>{ie.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?$e({user_id:e.user.id}).then(c=>{window.$message.success("操作成功"),oe(e.user_id,!1)}).catch(c=>{}):Ce({user_id:e.user.id}).then(c=>{window.$message.success("关注成功"),oe(e.user_id,!0)}).catch(c=>{})}})};function oe(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 N in e)e[N].user_id==c&&(e[N].user.is_following=E)}const B=()=>{switch(p.value){case"post":D();break;case"comment":H();break;case"highlight":V();break;case"media":W();break;case"star":j();break}},D=()=>{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,Z.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},H=()=>{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,ee.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&&
|