"use strict";(wx["webpackJsonp"]=wx["webpackJsonp"]||[]).push([[407],{4761:function(e,a,n){var s=n(8870),t=n(1212),r=n(9379),c=n(467),i=n(5544),l=n(6540),o=n(758),u=n.n(o),d=n(118),p=n(7797),f=n(8324),h=n(6503),x=n(7377),_=n(326),m=n(7032),v=n(7896),A=n(4848);function j(){return(0,A.jsxs)(d.Ss,{className:"feed-ad-card",children:[(0,A.jsx)(d.Ss,{className:"feed-ad-card__mark",children:"\u6c6a"}),(0,A.jsxs)(d.Ss,{className:"feed-ad-card__text",children:[(0,A.jsx)(d.EY,{className:"feed-ad-card__title",children:"\u5468\u672b\u5ba0\u7269\u6d3e\u5bf9 \xb7 \u6ee8\u6c5f\u7eff\u5730"}),(0,A.jsx)(d.EY,{className:"feed-ad-card__sub",children:"\u672c\u5468\u516d 14:00 \xb7 \u540d\u989d\u5269 12 \u4e2a"})]}),(0,A.jsx)(d.Ss,{className:"feed-ad-card__cta",children:"\u62a5\u540d"})]})}var k=j,b=n(3972),g=n(4149),S=n(994),y=[{key:"feed",label:"\u63a8\u8350"},{key:"nearby",label:"\u9644\u8fd1"},{key:"follow",label:"\u5173\u6ce8"}],w=["\u5168\u90e8","\u6ee8\u6c5f\u516c\u56ed","\u91d1\u6bdb\u65e5\u5e38","\u732b\u54aa","\u5468\u672b\u805a\u4f1a","\u65b0\u624b\u517b\u5ba0"];function N(){var e=(0,l.useState)("feed"),a=(0,i.A)(e,2),n=a[0],s=a[1],j=(0,l.useState)("\u5168\u90e8"),N=(0,i.A)(j,2),z=N[0],B=N[1],E=(0,l.useState)([]),M=(0,i.A)(E,2),Y=M[0],O=M[1],T=(0,l.useState)(!0),C=(0,i.A)(T,2),J=C[0],D=C[1],I=(0,S.d)(480),L=(0,l.useRef)(!0),P=function(){D(!0),(0,g.lr)(n,"\u5168\u90e8"===z?void 0:z).then(O).finally(function(){return D(!1)})};(0,l.useEffect)(function(){P()},[n,z]),(0,o.useDidShow)(function(){L.current?L.current=!1:P()});var R=function(){var e=(0,c.A)((0,t.A)().m(function e(a){var n,s,c,i;return(0,t.A)().w(function(e){while(1)switch(e.p=e.n){case 0:if(n=Y,s=Y.map(function(e){if(e._id!==a)return e;var n=!e.likedByMe;return n&&I.show(),(0,r.A)((0,r.A)({},e),{},{likedByMe:n,counts:(0,r.A)((0,r.A)({},e.counts),{},{likes:Math.max(0,e.counts.likes+(n?1:-1))})})}),O(s),c=s.find(function(e){return e._id===a}),c){e.n=1;break}return e.a(2);case 1:return e.p=1,e.n=2,(0,g.O$)(a,c.likedByMe);case 2:i=e.v,O(function(e){return e.map(function(e){return e._id===a?(0,r.A)((0,r.A)({},e),{},{likedByMe:i.liked,counts:(0,r.A)((0,r.A)({},e.counts),{},{likes:i.likes})}):e})}),e.n=4;break;case 3:e.p=3,e.v,O(n),u().showToast({title:"\u70b9\u8d5e\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5",icon:"none"});case 4:return e.a(2)}},e,null,[[1,3]])}));return function(a){return e.apply(this,arguments)}}(),U=function(e){u().navigateTo({url:"/pages/post-detail/index?postId=".concat(e)})};return(0,A.jsxs)(f.A,{className:"plaza-page",children:[(0,A.jsx)(p.A,{title:"\u5e7f\u573a"}),(0,A.jsx)(x.A,{placeholder:"\u641c\u7d22\u8bdd\u9898\u3001\u5ba0\u7269\u3001\u9644\u8fd1\u6d3b\u52a8"}),(0,A.jsx)(_.A,{items:y,value:n,onChange:s}),(0,A.jsx)(d.BM,{scrollX:!0,className:"plaza-page__chips",showScrollbar:!1,children:(0,A.jsx)(d.Ss,{className:"plaza-page__chips-inner",children:w.map(function(e){return(0,A.jsx)(m.A,{active:z===e,onClick:function(){return B(e)},children:e},e)})})}),(0,A.jsxs)(d.Ss,{className:"plaza-page__feed",children:[Y.map(function(e,a){return(0,A.jsxs)(d.Ss,{children:[(0,A.jsx)(b.A,{post:e,onLike:R,onOpen:U}),0===a?(0,A.jsx)(k,{}):null]},e._id)}),J&&0===Y.length?(0,A.jsx)(d.EY,{className:"plaza-page__empty",children:"\u52a0\u8f7d\u4e2d\u2026"}):J||0!==Y.length?(0,A.jsx)(d.EY,{className:"plaza-page__empty",children:"\u6682\u65f6\u6ca1\u6709\u66f4\u591a\u4e86\uff0c\u7a0d\u540e\u518d\u6765\u770b\u770b\u5427"}):(0,A.jsx)(d.EY,{className:"plaza-page__empty",children:"follow"===n?"\u5173\u6ce8\u7684\u4eba\u8fd8\u6ca1\u6709\u53d1\u5e03\u52a8\u6001\uff0c\u53bb\u53d1\u73b0\u66f4\u591a\u6c6a\u53cb\u5427":"\u8fd8\u6ca1\u6709\u52a8\u6001\uff0c\u70b9\u51fb + \u53d1\u5e03\u7b2c\u4e00\u6761\u5427"})]}),(0,A.jsx)(v.A,{visible:I.visible}),(0,A.jsx)(h.A,{active:"plaza"})]})}var z={navigationBarTitleText:"\u5e7f\u573a",navigationStyle:"custom",disableScroll:!0},B=(0,s.eU)(N,"pages/plaza/index",{root:{cn:[]}},z||{});N&&N.behaviors&&(B.behaviors=(B.behaviors||[]).concat(N.behaviors));Page(B)}},function(e){var a=function(a){return e(e.s=a)};e.O(0,[907,96,76],function(){return a(4761)});e.O()}]);