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