"use strict";(wx["webpackJsonp"]=wx["webpackJsonp"]||[]).push([[158],{6925:function(n,s,e){var a=e(8870),c=e(9379),t=e(1212),r=e(467),o=e(5544),l=e(6540),i=e(758),u=e.n(i),d=e(118),h=e(374),f=e(3401),_=e(7745),m=e(326),v=e(3810),p=e(4848),x=[{key:"friends",label:"\u6c6a\u53cb"},{key:"following",label:"\u5173\u6ce8"},{key:"followers",label:"\u7c89\u4e1d"},{key:"discover",label:"\u53d1\u73b0"}],w=["friends","following","followers","discover"];function j(){var n=(0,h.v)(),s=n.statusBarHeight,e=(0,i.useRouter)(),a=w.includes(e.params.tab)?e.params.tab:"friends",j=(0,l.useState)(a),b=(0,o.A)(j,2),g=b[0],N=b[1],A=(0,l.useState)(""),S=(0,o.A)(A,2),k=S[0],y=S[1],C=(0,l.useState)([]),E=(0,o.A)(C,2),F=E[0],Y=E[1],U=(0,l.useState)(!1),T=(0,o.A)(U,2),z=T[0],B=T[1],I=function(){var n=(0,r.A)((0,t.A)().m(function n(s){var e,a,c,r=arguments;return(0,t.A)().w(function(n){while(1)switch(n.p=n.n){case 0:if(e=r.length>1&&void 0!==r[1]?r[1]:"",B(!0),n.p=1,"discover"!==s){n.n=3;break}return c=Y,n.n=2,(0,v.Cr)(e);case 2:c(n.v),n.n=5;break;case 3:return n.n=4,(0,v.wA)(s);case 4:a=n.v,Y(a.list);case 5:return n.p=5,B(!1),n.f(5);case 6:return n.a(2)}},n,null,[[1,,5,6]])}));return function(s){return n.apply(this,arguments)}}();(0,l.useEffect)(function(){I(g,k)},[g]);var J=function(){var n=(0,r.A)((0,t.A)().m(function n(s){var e;return(0,t.A)().w(function(n){while(1)switch(n.p=n.n){case 0:return e=!s.isFollowing,Y(function(n){return n.map(function(n){return n.id===s.id?(0,c.A)((0,c.A)({},n),{},{isFollowing:e}):n})}),n.p=1,n.n=2,(0,v.So)(s.id,e);case 2:n.n=4;break;case 3:n.p=3,n.v,Y(function(n){return n.map(function(n){return n.id===s.id?(0,c.A)((0,c.A)({},n),{},{isFollowing:!e}):n})}),u().showToast({title:"\u64cd\u4f5c\u5931\u8d25",icon:"none"});case 4:return n.a(2)}},n,null,[[1,3]])}));return function(s){return n.apply(this,arguments)}}(),K=function(n){u().navigateTo({url:"/pages/chat/index?targetUserId=".concat(n.id,"&title=").concat(encodeURIComponent(n.name))})},O="friends"===g?"\u8fd8\u6ca1\u6709\u6c6a\u53cb\u3002\u4e92\u76f8\u5173\u6ce8\u5373\u6210\u4e3a\u6c6a\u53cb":"following"===g?"\u8fd8\u6ca1\u6709\u5173\u6ce8\u4efb\u4f55\u4eba\uff0c\u53bb\u300c\u53d1\u73b0\u300d\u770b\u770b\u5427":"followers"===g?"\u8fd8\u6ca1\u6709\u7c89\u4e1d":"\u6ca1\u6709\u627e\u5230\u7528\u6237";return(0,p.jsxs)(d.Ss,{className:"contacts",children:[(0,p.jsx)(d.Ss,{className:"contacts__nav",style:{paddingTop:"".concat(s,"px")},children:(0,p.jsxs)(d.Ss,{className:"contacts__nav-row",children:[(0,p.jsx)(d.Ss,{className:"contacts__back",onClick:function(){return u().navigateBack()},children:(0,p.jsx)(f.A,{name:"chev",size:22,className:"contacts__back-icon"})}),(0,p.jsx)(d.EY,{className:"contacts__title",children:"\u6c6a\u53cb"}),(0,p.jsx)(d.Ss,{className:"contacts__nav-spacer"})]})}),(0,p.jsx)(m.A,{items:x,value:g,onChange:function(n){return N(n)}}),"discover"===g?(0,p.jsxs)(d.Ss,{className:"contacts__search",children:[(0,p.jsx)(f.A,{name:"search",size:16,className:"contacts__search-icon"}),(0,p.jsx)(d.pd,{className:"contacts__search-input",value:k,placeholder:"\u641c\u7d22\u6635\u79f0",placeholderClass:"contacts__search-ph",confirmType:"search",onInput:function(n){return y(n.detail.value)},onConfirm:function(){return I("discover",k)}})]}):null,(0,p.jsx)(d.BM,{scrollY:!0,className:"contacts__scroll",enhanced:!0,showScrollbar:!1,children:(0,p.jsxs)(d.Ss,{className:"contacts__list",children:[F.map(function(n){return(0,p.jsxs)(d.Ss,{className:"contacts__item",children:[(0,p.jsxs)(d.Ss,{className:"contacts__left",onClick:function(){return K(n)},children:[(0,p.jsx)(_.A,{avatarKey:n.avatarKey,avatarUrl:n.avatarUrl,size:"lg",label:n.name}),(0,p.jsxs)(d.Ss,{className:"contacts__meta",children:[(0,p.jsx)(d.EY,{className:"contacts__name",children:n.name}),(0,p.jsx)(d.EY,{className:"contacts__bio",children:n.bio||n.handle||"\u8fd9\u4f4d\u6c6a\u53cb\u5f88\u795e\u79d8"})]})]}),(0,p.jsxs)(d.Ss,{className:"contacts__actions",children:[n.isFriend?(0,p.jsx)(d.EY,{className:"contacts__friend-tag",children:"\u6c6a\u53cb"}):null,(0,p.jsx)(d.Ss,{className:"contacts__follow ".concat(n.isFollowing?"contacts__follow--on":""),onClick:function(){return J(n)},children:n.isFollowing?"\u5df2\u5173\u6ce8":"\u5173\u6ce8"})]})]},n.id)}),z||0!==F.length?null:(0,p.jsx)(d.EY,{className:"contacts__empty",children:O})]})})]})}var b={},g=(0,a.eU)(j,"pages/contacts/index",{root:{cn:[]}},b||{});j&&j.behaviors&&(g.behaviors=(g.behaviors||[]).concat(j.behaviors));Page(g)}},function(n){var s=function(s){return n(n.s=s)};n.O(0,[907,96,76],function(){return s(6925)});n.O()}]);