(this["webpackJsonpmr-julyedu"]=this["webpackJsonpmr-julyedu"]||[]).push([[69],{1118:function(e,t,a){},1179:function(e,t,a){"use strict";a.r(t);a(40);var n=a(6),s=a.n(n),o=a(0),c=a.n(o),r=(a(1118),a(20)),i=a(1),l=a(11);class m extends o.Component{constructor(...e){super(...e),this.state={isShowAnswer:!1,isShowCaptcha:!1,instance:null,problem:{}},this.onVerify=e=>{i.f.post("".concat(API.home,"/m/safety"),e).then(e=>{200===e.data.code?(this.setState({isShowCaptcha:!1}),this.getProblem()):this.state.instance&&this.state.instance.reset()})},this.getInstance=e=>{this.setState({instance:e})},this.getProblem=()=>{i.f.get("".concat(API.home,"/m/question/").concat(this.props.match.params.id)).then(e=>{const t=e.data,a=t.code,n=t.msg,o=t.data;200===a?this.setState({problem:o}):1===a?this.setState({isShowCaptcha:!0}):s.a.info(n)})},this.goBack=()=>{if(document.referrer.includes(API.www))history.go(-1);else{const e=this.props.location,t=e.state;if(e.hash.includes("goback"))return window.history.go(-1);i.b.isWeixin&&Object(i.c)("code")&&Object(i.c)("state")&&window.history.go(-2),t.records&&t.records.length>1?window.history.go(-1):t.from&&t.from.pathname?location.replace("".concat(t.from.pathname).concat(t.from.search)):window.location.href=window.location.origin}}}componentDidMount(){this.getProblem()}componentDidUpdate(e,t){e.match.params.id!==this.props.match.params.id&&(this.setState({problem:{},isShowAnswer:!1}),this.getProblem())}render(){const e=this.state,t=e.isShowAnswer,a=e.problem,n=a.quesInfo,s=a.between,o=e.isShowCaptcha;return n||o?c.a.createElement("article",{id:"problems"},o?c.a.createElement("div",{className:"captcha-container"},c.a.createElement("div",null,"\u4eb2\uff0c\u7cfb\u7edf\u6b63\u5fd9\uff0c\u6ed1\u52a8\u4e00\u4e0b\u9a6c\u4e0a\u56de\u6765"),c.a.createElement(r.b,{getInstance:this.getInstance,onVerify:this.onVerify})):c.a.createElement(c.a.Fragment,null,c.a.createElement(r.e,{title:n&&n.category,arrow:!0,cart:!1,goBack:this.goBack}),c.a.createElement("div",{className:"topic"},c.a.createElement("span",null,n&&n.order_id,"."),c.a.createElement("span",{dangerouslySetInnerHTML:{__html:n&&n.ques}})),!t&&c.a.createElement("div",{className:"btn",onClick:()=>{this.setState({isShowAnswer:!0})}},c.a.createElement("button",null,"\u67e5\u770b\u89e3\u6790 ",c.a.createElement("i",{className:"iconfont iconiconfront-69"}))),t&&c.a.createElement("div",{className:"content"},c.a.createElement("div",{className:"title"},"\u89e3\u6790"),c.a.createElement("span",{dangerouslySetInnerHTML:{__html:n.analysis}})),c.a.createElement("footer",null,c.a.createElement("div",{className:"app"},"\u66f4\u591a\u9898\u76ee\u8bf7 ",c.a.createElement(r.a,{text:"\u524d\u5f80APP"})),c.a.createElement("div",{className:"op"},s&&!!s.up&&c.a.createElement(l.b,{to:"/problems/".concat(s.up),replace:!0,className:"nav"},"\u4e0a\u4e00\u9898"),s&&!!s.down&&c.a.createElement(l.b,{to:"/problems/".concat(s.down),replace:!0,className:"nav"},"\u4e0b\u4e00\u9898"))))):null}}t.default=m}}]);
//# sourceMappingURL=69.a218a77a.chunk.js.map