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
12 KiB
2 lines
12 KiB
1 year ago
|
import{_ as ze}from"./whisper-a090f673.js";import{_ as Me,a as qe}from"./post-item.vue_vue_type_style_index_0_lang-229a49b5.js";import{_ as xe}from"./post-skeleton-4a65c483.js";import{_ as $e}from"./main-nav.vue_vue_type_style_index_0_lang-8791d5c4.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 o,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-e04968a0.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 lt,k as ot,H as nt}from"./naive-ui-eecf2ec3.js";import"./content-17b86479.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),l=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),le=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=>{le.value=e,U.value=!0},fe=()=>{U.value=!1},k=e=>{_e.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注 @":"关注 @")+e.user.username+" 吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?je({user_id:e.user.id}).then(c=>{window.$message.success("操作成功"),oe(e.user_id,!1)}).catch(c=>{}):Re({user_id:e.user.id}).then(c=>{window.$message.success("关注成功"),oe(e.user_id,!0)}).catch(c=>{})}})};function oe(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?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),v.value=Math.ceil(e.pager.total_rows/g.value),A.value=l.value,Z.value=v.value}).catch(e=>{l.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?l.value=l.value.concat(e.list):(l.value=e.list||[]
|