PageSourceSearch

https://app.sanqin.com/sxrbs/site9/h/article/5546/assets/sub-packages-memberInfo-followFans.B9mPHJiM.js

js sanqin.com collected 2026-10-02 16:21:17 UTC 5,250 bytes, 1 lines download raw bytes

1import{aj as e,c0 as a,cR as l,cM as s,bG as o,cd as n,a7 as t,v as u,a9 as f,cV as i,c7 as r,U as c,bO as d,ah as v,b9 as m,ab as w,F as g,c1 as h,by as y,ag as p,cx as b,N as I,H as k,M as _,bb as C,cH as x,aa as N,aQ as F,co as M,cl as j,b6 as D,X as z}from"./index-D6dIpJUT.js";import{i as A,a as R}from"./memberDeregister.BBG5LPS8.js";import{u as S}from"./usePageShare.DaqIUXaI.js";import{r as H}from"./routeQueryAliases.D7S4uHCQ.js";const O=z(e({__name:"followFans",setup(e){S({useAppDefaultOnShow:!0});const z=a(!0),O=a(!1),P=a(""),Q=a(""),U=a(0),$=a([]),q=a([]),G=a(new Set),{siteId:L}=l(),{isLoggedIn:T,userInfo:V,loginIn:X}=s(),B=[{index:0,key:"follow",zh:"关注"},{index:1,key:"fan",zh:"粉丝"}],E=a({follow:{page:0,finished:!1,loading:!1,hasMore:!0},fan:{page:0,finished:!1,loading:!1,hasMore:!0}});o(e=>{const a=H(e,c.memberFollowFans,"memberId");P.value=a.memberId||a.a||"",Q.value=function(e){try{return decodeURIComponent(e)}catch{return e}}(a.nickname||a.tn||"");const l=a.tab||"";U.value="fan"===l?1:0,Q.value&&n({title:Q.value}),P.value&&K(0===U.value?"follow":"fan",!1)});const J=t(()=>T.value&&V.value&&(V.value.id||V.value.userID||V.value.userId)||0);async function K(e,a){const l=E.value[e];if(l&&!l.finished&&!l.loading){l.loading=!0,z.value=!a&&!0;try{let s=[];s="follow"===e?await u.myFollow({page:l.page,siteId:L.value,userID:P.value}):await u.myFan({page:l.page,siteId:L.value,userID:P.value});const o=Array.isArray(s)?s:[];o.length>0?(a?"follow"===e?$.value=$.value.concat(o):q.value=q.value.concat(o):"follow"===e?$.value=o:q.value=o,l.page=l.page+1):(a||("follow"===e?$.value=[]:q.value=[]),l.finished=!0,l.hasMore=!1)}catch{a||("follow"===e?$.value=[]:q.value=[])}finally{l.loading=!1,z.value=!1}}}async function W(){O.value=!0;const e=0===U.value?"follow":"fan",a=E.value[e];a&&(a.page=0,a.finished=!1,a.hasMore=!0,a.loading=!1,"follow"===e?$.value=[]:q.value=[]);try{await K(e,!1)}finally{O.value=!1}}function Y(){const e=0===U.value?"follow":"fan",a=E.value[e];!a||a.finished||a.loading||K(e,!0)}function Z(e){if(0===U.value)return!0;const a=e.fanId||0;return G.value.has(a)}function ee(e){return 0===U.value?e.followedName||"":e.fanName||""}function ae(e){return e.userType||0}function le(e){return e.userIcon||""}function se(e){if(!J.value)return!1;const a=0===U.value?e.followedId:e.fanId;return Number(a)===Number(J.value)}const oe=t(()=>0===U.value?$.value:q.value),ne=t(()=>E.value[0===U.value?"follow":"fan"]);return(e,a)=>{const l=m,s=C,o=k,n=r("PageContainer");return d(),f(n,{"default-class":"member-follow-fans-page"},{default:i(()=>[v(l,{class:"follow-fans-page"},{default:i(()=>[v(l,{class:"follow-fans-tabs yq-theme-tabs"},{default:i(()=>[(d(),w(g,null,h(B,(e,a)=>v(l,{key:e.key,class:y(["tab-item",{active:U.value===a}]),onClick:e=>function(e){U.value=e;const a=0===e?"follow":"fan",l=E.value[a];l&&0===l.page&&!l.loading&&K(a,!1)}(a)},{default:i(()=>[p(b(e.zh),1)]),_:2},1032,["class","onClick"])),64))]),_:1}),z.value||oe.value.length?(d(),f(o,{key:1,class:"follow-fans-scroll","scroll-y":"","refresher-enabled":!0,"refresher-triggered":O.value,onRefresherrefresh:W,onScrolltolower:Y},{default:i(()=>[v(l,{class:"follow-fans-list"},{default:i(()=>{var e,a;return[!z.value||oe.value.length?(d(!0),w(g,{key:0},h(oe.value,(e,a)=>(d(),f(l,{key:`${U.value}_${e.fanId||e.followedId||a}`,class:"follow-fans-item"},{default:i(()=>[v(l,{class:"follow-fans-item-left",onClick:a=>function(e){let a=0;a=0===U.value?e.followedId||0:e.fanId||0,a&&F(a)}(e)},{default:i(()=>[v(_,{src:le(e),"member-type":ae(e),size:80,"member-id":0===U.value?e.followedId:e.fanId,clickable:!0,preset:"card"},null,8,["src","member-type","member-id"]),v(s,{class:"follow-fans-item-name"},{default:i(()=>[p(b(ee(e)||"用户"),1)]),_:2},1024)]),_:2},1032,["onClick"]),se(e)?N("",!0):(d(),f(l,{key:0,class:y(["follow-fans-item-btn",{following:Z(e),disabled:x(A)(e)}]),onClick:l=>async function(e,a){if(!R(e))return;if(!T.value)return void X();const l=J.value;if(!l)return void M({title:"用户信息异常",icon:"none"});let s=0;if(s=0===U.value?e.followedId||0:e.fanId||0,!s)return void M({title:"用户信息异常",icon:"none"});const o=Z(e),n=o?1:0;j({title:"处理中...",mask:!0}
1);try{await u.follow({site:L.value,fanId:Number(l),followedId:Number(s),status:n})?(0===U.value&&o?$.value.splice(a,1):1!==U.value||o||G.value.add(s),M({title:0===n?"关注成功":"已取消关注",icon:"success"})):M({title:"操作失败",icon:"none"})}catch(t){M({title:"操作失败,请重试",icon:"none"})}finally{D()}}(e,a)},{default:i(()=>[v(s,{class:"follow-fans-item-btn-text"},{default:i(()=>[p(b(Z(e)?"已关注":"关注"),1)]),_:2},1024)]),_:2},1032,["class","onClick"]))]),_:2},1024))),128)):N("",!0),(null==(e=ne.value)?void 0:e.loading)?(d(),f(l,{key:1,class:"list-tip"},{default:i(()=>[p(" 加载中... ")]),_:1})):(null==(a=ne.value)?void 0:a.finished)&&oe.value.length?(d(),f(l,{key:2,class:"list-tip"},{default:i(()=>[p(" 没有更多数据了 ")]),_:1})):N("",!0)]}),_:1})]),_:1},8,["refresher-triggered"])):(d(),f(l,{key:0,class:"empty-wrap"},{default:i(()=>[v(I,{text:"暂无内容","show-refresh":!0,"custom-style-image":"",onRefresh:W})]),_:1}))]),_:1})]),_:1})}}}),[["__scopeId","data-v-099135fe"]]);export{O as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.