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 ke}from"./whisper-694050d3.js";import{_ as ye,a as be}from"./post-item.vue_vue_type_style_index_0_lang-b0fbffc8.js";import{_ as Ie}from"./post-skeleton-d9166350.js";import{_ as Pe}from"./main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js";import{d as Oe,H as i,b as Te,E as Ae,r as Fe,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 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-2af3a836.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-845a2453.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"},et={class:"info-item"},tt={class:"info-item"},at={class:"info-item"},st={key:0,class:"skeleton-wrap"},lt={key:1},ot={key:0,class:"empty-wrap"},nt={key:1},ut={key:0},it={key:1},rt={key:2},ct={key:3},_t={key:4},vt={key:2},dt={key:0},mt={key:1},ft={key:2},pt={key:3},ht={key:4},gt={class:"load-more-wrap"},wt={class:"load-more-spinner"},kt=Oe({__name:"Profile",setup(yt){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([]),p=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),te=i(0),ae=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(p.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.con
|