You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
13 KiB
1 lines
13 KiB
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/exercises/index"],{"0a45":function(t,e,n){},"0bac":function(t,e,n){"use strict";n.r(e);var i=n("881d"),o=n.n(i);for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);e["default"]=o.a},"555a":function(t,e,n){"use strict";n.r(e);var i=n("98f6"),o=n("0bac");for(var r in o)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(r);n("5f26");var s=n("828b"),u=Object(s["a"])(o["default"],i["b"],i["c"],!1,null,"b627d902",null,!1,i["a"],void 0);e["default"]=u.exports},"5f26":function(t,e,n){"use strict";var i=n("0a45"),o=n.n(i);o.a},"881d":function(t,e,n){"use strict";(function(t){var i=n("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=i(n("7eb4")),r=i(n("ee10")),s={data:function(){return{playType:1,isShowCard:!1,start_time:1e5,answer:"",category_id:"",teamIndex:0,successNum:0,errorNum:0,type:0,count:-1,list:[],resultList:[],questionList:[],fontSize:30,fontSize1:26,fontWeight:!0,info:{question_info:[]},timeData:{},log_id:0,page:1,innerAudioContext:null,isPlay:!1,current_question_id:"",next_question_id:"",current_question_choice:"",safeBottom:"",correctArr:[],errorArr:[]}},onLoad:function(e){var n=t.getSystemInfoSync(),i=n.safeAreaInsets;this.safeBottom=null===i||void 0===i?void 0:i.bottom,this.category_id=e.id?e.id:"",this.innerAudioContext=t.createInnerAudioContext({useWebAudioImplement:!1}),this.type=e.type,0==this.type||1==this.type?this.getZhengTiList():3==this.type?this.getShunxiTiList():this.getMoniList()},methods:{updateFont:function(t){1==t?this.fontSize<70?this.fontSize++:this.fontSize:2==t?this.fontSize>20?this.fontSize--:this.fontSize:3==t&&(this.fontWeight=!this.fontWeight)},openPage:function(e){var n=this;2==e?n.teamIndex==n.count?t.showModal({title:"交卷确认",content:"你确定要交卷吗?",confirmText:"确认",cancelText:"取消",confirmColor:"#2080F9",success:function(e){e.confirm&&t.showModal({title:"再次确认",content:"你确定要交卷吗?",confirmText:"确认",cancelText:"取消",confirmColor:"#2080F9",success:function(t){t.confirm&&n.getInfo(2)}})}}):t.showModal({title:"请确认",content:"你确定要交卷吗?",confirmText:"继续答题",cancelText:"确认",confirmColor:"#2080F9",success:function(e){e.cancel&&t.showModal({title:"再次确认",content:"你确定要交卷吗?",confirmText:"确认",cancelText:"取消",confirmColor:"#2080F9",success:function(t){t.confirm&&n.getInfo(3)}})}}):t.navigateBack({delta:1})},onChange:function(e){this.timeData=e,this.count>0&&0==e.days&&0==e.hours&&0==e.milliseconds&&0==e.minutes&&0==e.seconds&&t.showModal({title:"温馨提示",content:"当前刷题时间已结束,请返回上一页",showCancel:!1,confirmColor:"#2080F9",success:function(e){e.confirm&&t.navigateBack({delta:1})}})},toPlayAudio:function(t){var e=this;console.log(t),0==this.isPlay?(1==this.playType?(this.innerAudioContext.src=t,this.innerAudioContext.play(),this.playType=2):this.innerAudioContext.play(),this.isPlay=!0):(this.isPlay=!1,this.innerAudioContext.pause()),this.innerAudioContext.onPlay((function(){console.log("开始播放")})),this.innerAudioContext.onEnded((function(){e.isPlay=!1}))},toSelect:function(t){if(1!=this.info.question_info.isDisable){this.info.question_info.isDisable=!0,this.info.question_info.choice.map((function(t){t.isSelect=!1}));var e=this.list[this.teamIndex-1];this.info.question_info.choice[t].name==this.info.question_info.correct?(this.info.question_info.choice[t].isSelect=!0,this.info.question_info.choice[t].isErrow=!1,this.successNum++,this.correctArr.push(e)):(this.info.question_info.choice[t].isSelect=!1,this.info.question_info.choice[t].isErrow=!0,this.errorNum++,this.errorArr.push(e)),this.info.question_info.value=this.info.question_info.choice[t],this.current_question_choice=this.info.question_info.choice[t].name}},toSumbit:function(){var e=this;return(0,r.default)(o.default.mark((function n(){var i,r,s;return o.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return e,[],n.next=4,e.$api.realSubPaper({log_id:e.log_id});case 4:i=n.sent,r=i.code,s=i.data,i.msg,200==r&&(t.showToast({title:"提交成功"}),setTimeout((function(){t.setStorageSync("shareImg1",s.img),t.redirectTo({url:"/pages/exercises/complete?score="+s.score+"&error_num="+s.error_num+"&correct_num="+e.successNum+"&use_time="+s.use_time+"&type="+e.type+"&logId="+e.log_id})}),2e3));case 9:case"end":return n.stop()}}),n)})))()},getZhengTiList:function(){var e=this;return(0,r.default)(o.default.mark((function n(){var i,r,s,u,c,a,l;return o.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,e.$api.realQuestionList({is_error:e.type,category_id:e.category_id,page:e.page});case 2:i=n.sent,r=i.code,s=i.data,u=i.msg,200==r?(e.list=s.list,e.log_id=s.log_id,e.count=s.count,e.start_time=1e3*s.start_time,e.successNum=s.correct_num?s.correct_num:0,e.errorNum=s.error_num?s.error_num:0,e.resultList=s.result,(null===(c=s.result)||void 0===c?void 0:c.length)>0&&(a=s.result.filter((function(t){return 1==t.is_correct})),l=s.result.filter((function(t){return 2==t.is_correct})),(null===a||void 0===a?void 0:a.length)>0&&(e.errorArr=a.map((function(t){return t.id+""}))),(null===l||void 0===l?void 0:l.length)>0&&(e.correctArr=l.map((function(t){return t.id+""})))),e.count>0&&(0==s.current_question_id?(e.teamIndex=0,e.next_question_id=s.list[0]):(e.next_question_id=s.current_question_id,s.list&&s.list.length>0&&s.list.map((function(t,n){t==s.current_question_id&&(e.teamIndex=n)}))),e.getInfo())):t.showToast({icon:"none",title:u});case 7:case"end":return n.stop()}}),n)})))()},getShunxiTiList:function(){var e=this;return(0,r.default)(o.default.mark((function n(){var i,r,s,u,c;return o.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return i=e,n.next=3,e.$api.orderQuestion({category_id:e.category_id,page:e.page});case 3:r=n.sent,s=r.code,u=r.data,c=r.msg,200==s?(e.list=u.list,e.log_id=u.log_id,e.count=u.count,e.start_time=1e3*u.start_time,e.successNum=u.correct_num?u.correct_num:0,e.errorNum=u.error_num?u.error_num:0,e.count>0&&(0==u.current_question_id?(i.teamIndex=0,e.next_question_id=u.list[0]):(e.next_question_id=u.current_question_id,u.list&&u.list.length>0&&u.list.map((function(t,e){t==u.current_question_id&&(i.teamIndex=e)}))),e.getInfo())):t.showToast({icon:"none",title:c});case 8:case"end":return n.stop()}}),n)})))()},getMoniList:function(){var e=this;return(0,r.default)(o.default.mark((function n(){var i,r,s,u,c,a,l,d;return o.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return i=e,n.next=3,e.$api.simulation({category_id:e.category_id,page:e.page});case 3:r=n.sent,s=r.code,u=r.data,c=r.msg,200==s?(e.list=u.list,e.count=u.count,e.log_id=u.log_id,e.start_time=1e3*u.start_time,e.successNum=u.correct_num?u.correct_num:0,e.errorNum=u.error_num?u.error_num:0,e.resultList=u.result,(null===(a=u.result)||void 0===a?void 0:a.length)>0&&(l=u.result.filter((function(t){return 1==t.is_correct})),d=u.result.filter((function(t){return 2==t.is_correct})),(null===l||void 0===l?void 0:l.length)>0&&(i.errorArr=l.map((function(t){return t.id+""}))),(null===d||void 0===d?void 0:d.length)>0&&(i.correctArr=d.map((function(t){return t.id+""})))),e.count>0&&(0==u.current_question_id?(i.teamIndex=0,e.next_question_id=u.list[0]):(e.next_question_id=u.current_question_id,u.list&&u.list.length>0&&u.list.map((function(t,e){t==u.current_question_id&&(i.teamIndex=e)}))),e.getInfo())):t.showToast({icon:"none",title:c});case 8:case"end":return n.stop()}}),n)})))()},getInfo:function(e){var n=this;return(0,r.default)(o.default.mark((function i(){var r,s,u,c,a,l,d,f,_,m;return o.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(r=n,1!=e){i.next=14;break}if(r.current_question_choice){i.next=5;break}return t.showToast({icon:"none",title:"请选择答案!"}),i.abrupt("return");case 5:if(!(r.teamIndex>=r.count)){i.next=7;break}return i.abrupt("return");case 7:r.current_question_id=r.teamIndex>r.count?"":r.list[r.teamIndex-1],r.next_question_id=r.teamIndex>r.count?"":r.list[r.teamIndex],r.isPlay=!1,r.playType=1,r.innerAudioContext.pause(),i.next=39;break;case 14:if(0!=e){i.next=23;break}if(!(r.teamIndex<=1)){i.next=17;break}return i.abrupt("return");case 17:r.next_question_id=r.teamIndex>r.count?"":r.list[r.teamIndex-2],r.isPlay=!1,r.playType=1,r.innerAudioContext.pause(),i.next=39;break;case 23:if(2!=e){i.next=28;break}r.next_question_id=0,r.current_question_id=r.list[r.list.length-1],i.next=39;break;case 28:if(3!=e){i.next=39;break}if(!r.current_question_choice){i.next=37;break}r.current_question_id=r.teamIndex>r.count?"":r.list[r.teamIndex-1],r.next_question_id=r.teamIndex>r.count?"":r.list[r.teamIndex],r.isPlay=!1,r.playType=1,r.innerAudioContext.pause(),i.next=39;break;case 37:return n.toSumbit(),i.abrupt("return");case 39:return t.showLoading({title:"加载中"}),s=0==e?{next_question_id:n.next_question_id}:{next_question_id:n.next_question_id,current_question_id:n.current_question_id,current_question_choice:n.current_question_choice,is_error:1==n.type?1:0,log_id:n.log_id?n.log_id:0},i.next=43,n.$api.realQuestionInfo(s);case 43:if(u=i.sent,c=u.code,a=u.data,l=u.msg,200!=c){i.next=57;break}if(t.hideLoading(),2!=e&&3!=e){i.next=54;break}return n.toSumbit(),i.abrupt("return");case 54:0!=e&&1!=e&&"undefined"!=typeof e||(d=r.resultList&&r.resultList.find((function(t){return t.id==r.next_question_id})),d&&d.your_answer?(f=a,f.question_info.value={},f.question_info.isDisable=!0,f.question_info&&f.question_info.choice&&f.question_info.choice.map((function(t){t.isSelect=2==d.is_correct&&t.name.toLowerCase()==d.your_answer,t.isErrow=1==d.is_correct&&t.name.toLowerCase()==d.your_answer})),0==e&&r.teamIndex--,0!=e&&r.teamIndex++,r.current_question_choice=d.your_answer,r.info=f):((null===(_=r.resultList)||void 0===_?void 0:_.length)>0&&r.resultList.forEach((function(t){t.id==r.current_question_id&&(t.your_answer=r.current_question_choice.toLowerCase(),t.is_correct=a.current_question_is_correct?2:1)})),m=a,m.question_info.value={},m.question_info.isDisable=!1,m.question_info&&m.question_info.choice&&m.question_info.choice.map((function(t){t.isSelect=!1,t.isErrow=!1})),r.teamIndex++,r.current_question_choice="",r.info=m));case 55:i.next=59;break;case 57:t.hideLoading(),t.showToast({icon:"none",title:l});case 59:case"end":return i.stop()}}),i)})))()},showCardClick:function(){0!=this.type&&2!=this.type||(this.isShowCard=!0)}},onUnload:function(){this.innerAudioContext.src="",this.innerAudioContext.stop(),this.innerAudioContext.destroy()},destroyed:function(){this.innerAudioContext.src="",this.innerAudioContext.stop(),this.innerAudioContext.destroy()}};e.default=s}).call(this,n("df3c")["default"])},"8b16":function(t,e,n){"use strict";(function(t,e){var i=n("47a9");n("482e");i(n("3240"));var o=i(n("555a"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(o.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])},"98f6":function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return i}));var i={uCountDown:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-count-down/u-count-down")]).then(n.bind(null,"869e"))},uDivider:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-divider/u-divider")]).then(n.bind(null,"8f21"))},uEmpty:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-empty/u-empty")]).then(n.bind(null,"1623"))},uButton:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-button/u-button")]).then(n.bind(null,"95c6"))},uPopup:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-popup/u-popup")]).then(n.bind(null,"2911"))}},o=function(){var t=this,e=t.$createElement,n=(t._self._c,t.info.question_info.title&&1!=t.type?t.staticUrl("/static/icon-clock.png"):null),i=t.info.question_info.title?t.__map(t.info.question_info.choice,(function(e,n){var i=t.__get_orig(e),o=e.isSelect?t.staticUrl("/static/icon-study-right.png"):null,r=!e.isSelect&&e.isErrow?t.staticUrl("/static/icon-study-wrong.png"):null,s=!e.isSelect&&t.current_question_choice&&t.info.question_info.correct==e.name?t.staticUrl("/static/icon-study-right.png"):null;return{$orig:i,m1:o,m2:r,m3:s}})):null,o=0==t.info.question_info.length&&t.count>=0,r=t.info.question_info.title?t.staticUrl("/static/icon-study-yes.png"):null,s=t.info.question_info.title?t.staticUrl("/static/icon-study-no.png"):null,u=t.info.question_info.title&&t.info.question_info.speech&&0==t.isPlay?t.staticUrl("/static/icon-listen.png"):null,c=t.info.question_info.title&&t.info.question_info.speech&&0!=t.isPlay?t.staticUrl("/static/icon-listen-on.png"):null,a=t.staticUrl("/static/icon-study-yes.png"),l=t.staticUrl("/static/icon-study-no.png"),d=t.__map(t.list,(function(e,n){var i=t.__get_orig(e),o=t.correctArr.indexOf(e),r=t.errorArr.indexOf(e);return{$orig:i,g1:o,g2:r}}));t._isMounted||(t.e0=function(e){t.isShowCard=!1}),t.$mp.data=Object.assign({},{$root:{m0:n,l0:i,g0:o,m4:r,m5:s,m6:u,m7:c,m8:a,m9:l,l1:d}})},r=[]}},[["8b16","common/runtime","common/vendor"]]]); |