{"version":3,"sources":["../../../src/components/CommentList/index.js"],"names":["CommentList","props","state","filterSpeak","app","sGetComment","page","list","total","pageType","limit","isNoMoreComment","onPageChange","onGetMoreBtnClick","length","intl","get","p","loading","isSpeak","spinning","Boolean","sCommentFavor","sReplyFavor","e","setState","target","checked","map","item","user_id","id","renderPagination","Component","propTypes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;AAEA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;IAEMA,W;;;AACJ,uBAAYC,KAAZ,EAAmB;AAAA;;AAAA,0HACXA,KADW;;AAEjB,UAAKC,KAAL,GAAa;AACXC,mBAAa;AADF,KAAb;AAFiB;AAKlB;;;;yCAEoB;AACnB,WAAKF,KAAL,CAAWG,GAAX,CAAeC,WAAf,CAA2B,EAAEC,MAAM,KAAKL,KAAL,CAAWG,GAAX,CAAeE,IAAvB,EAA3B;AACD;;;uCAEkB;AAAA,uBAWb,KAAKL,KAAL,CAAWG,GAXE;AAAA,UAEfG,IAFe,cAEfA,IAFe;AAAA,UAGfC,KAHe,cAGfA,KAHe;AAAA,UAIfF,IAJe,cAIfA,IAJe;AAAA,UAKfG,QALe,cAKfA,QALe;AAAA,UAMfC,KANe,cAMfA,KANe;AAAA,UAOfC,eAPe,cAOfA,eAPe;AAAA,UAQfN,WARe,cAQfA,WARe;AAAA,UASfO,YATe,cASfA,YATe;AAAA,UAUfC,iBAVe,cAUfA,iBAVe;AAAA,UAYTV,WAZS,GAYO,KAAKD,KAZZ,CAYTC,WAZS;;AAajB,UAAIM,aAAa,OAAjB,EAA0B;AACxB;AACA,eACE;AAAA;AAAA,YAAK,WAAU,wBAAf,EAAwC,SAASI,iBAAjD;AACE;AAAA;AAAA;AAAA;AAAA;AADF,SADF;AAKD,OAPD,MAOO,IAAIJ,aAAa,MAAjB,EAAyB;AAC9B,YAAI,CAACE,eAAD,IAAoBJ,KAAKO,MAAL,KAAgBN,KAAxC,EAA+C;AAC7C,iBACE;AAAA;AAAA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AAM,CADI;AAEVH,iCAAaqB,EAAEE,MAAF,CAASC,OAAT,GAAmB,CAAnB,GAAuB;AAF1B,mBAAZ;AAIAf,+BAAa,CAAb;AACD;AAXH;AAaGG,2CAAKC,GAAL,CAAS,qBAAT;AAbH;AAHJ,WAFF;AAsBGT,eAAKqB,GAAL,CAAS,UAACC,IAAD;AAAA,mBACR,8BAAC,oBAAD;AACE,uBAASA,IADX;AAEE,uBAASA,KAAKC,OAFhB;AAGE,mBAAKD,KAAKE,EAHZ;AAIE,yBAAWF,KAAKE;AAJlB,cADQ;AAAA,WAAT,CAtBH;AA8BG,eAAKC,gBAAL;AA9BH;AADF,OADF;AAoCD;;;;EAlHuBC,gB;;AAqH1BjC,YAAYkC,SAAZ,GAAwB,EAAxB;;kBAEe,uBAAQlC,WAAR,C","file":"index.js","sourcesContent":["import React, { Component } from \"react\";\nimport { Spin, Pagination, Checkbox } from \"antd\";\nimport intl from \"react-intl-universal\";\nimport Comment from \"../../Comment\";\nimport CommentBox from \"../CommentBox\";\nimport \"./index.css\";\n\nclass CommentList extends Component {\n constructor(props) {\n super(props);\n this.state = {\n filterSpeak: 0,\n };\n }\n\n componentWillMount() {\n this.props.app.sGetComment({ page: this.props.app.page });\n }\n\n renderPagination() {\n const {\n list,\n total,\n page,\n pageType,\n limit,\n isNoMoreComment,\n sGetComment,\n onPageChange,\n onGetMoreBtnClick,\n } = this.props.app;\n const { filterSpeak } = this.state;\n if (pageType === \"slice\") {\n // 截断多余评论,通过点击查看更多跳转\n return (\n
\n 查看更多\n
\n );\n } else if (pageType === \"more\") {\n if (!isNoMoreComment && list.length !== total) {\n return (\n {\n sGetComment({ page: page + 1, filterSpeak });\n onPageChange(page + 1);\n }}\n >\n {intl.get(\"comment.moreComment\")}\n \n );\n } else {\n return null;\n }\n } else if (pageType === \"pagination\") {\n return (\n
\n {\n sGetComment({ page: p, filterSpeak });\n onPageChange(p);\n }}\n />\n
\n );\n }\n }\n\n render() {\n const {\n list,\n total,\n loading,\n isSpeak,\n sGetComment,\n onPageChange,\n } = this.props.app;\n\n const spinning = Boolean(\n loading.sGetComment || loading.sCommentFavor || loading.sReplyFavor\n );\n return (\n
\n \n {/*
共 {total} 条评论
*/}\n
\n {intl.get(\"comment.totalComment\", { total })}\n {isSpeak && (\n {\n this.setState({\n filterSpeak: e.target.checked ? 1 : 0,\n });\n sGetComment({\n page: 1,\n filterSpeak: e.target.checked ? 1 : 0,\n });\n onPageChange(1);\n }}\n >\n {intl.get(\"comment.filterSpeak\")}\n \n )}\n
\n {list.map((item) => (\n \n ))}\n {this.renderPagination()}\n
\n
\n );\n }\n}\n\nCommentList.propTypes = {};\n\nexport default Comment(CommentList);\n"]}