sequential.js 6.4 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/question/sequential"],{"6aab":function(e,t,n){"use strict";var i;n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return u})),n.d(t,"a",(function(){return i}));var s=function(){var e=this,t=e.$createElement,n=(e._self._c,e.__map(e.questionList,(function(t,n){var i=e.__get_orig(t),s=e.questionType(t.type),u=t.videoUrl?encodeURI(t.mediaUrl):null,a=2==t.type?e.__map(e.choiceList,(function(n,i){var s=e.__get_orig(n),u=t.answerTrue.includes(i+1),a=t.answerTrue.includes(i+1);return{$orig:s,g0:u,g1:a}})):null,r=1==t.type?e.__map(2,(function(n,i){var s=e.__get_orig(n),u=t.answerTrue.includes(i+1),a=t.answerTrue.includes(i+1);return{$orig:s,g2:u,g3:a}})):null,o=1!=t.type&&3==t.type?e.__map(e.choiceList,(function(n,i){var s=e.__get_orig(n),u=t.answerTrue.includes(i+1),a=t.answerTrue.includes(i+1);return{$orig:s,g4:u,g5:a}})):null,c=2!=t.type&&1!=t.type&&3==t.type?t.answerTrue.split("").map((function(n){return t[e.choiceList[n-1]]})):null;return{$orig:i,m0:s,m1:u,l0:a,l1:r,l2:o,g6:c}})));e._isMounted||(e.e0=function(t){e.show=!0},e.e1=function(t){e.show=!1},e.e2=function(t){e.answerflag=!e.answerflag},e.e3=function(t){e.answerjump=!e.answerjump},e.e4=function(t){e.checked=!e.checked},e.e5=function(t){e.nightFlag=!e.nightFlag}),e.$mp.data=Object.assign({},{$root:{l3:n}})},u=[]},"6e80":function(e,t,n){"use strict";n.r(t);var i=n("6aab"),s=n("c465");for(var u in s)"default"!==u&&function(e){n.d(t,e,(function(){return s[e]}))}(u);n("92c5");var a,r=n("f0c5"),o=Object(r["a"])(s["default"],i["b"],i["c"],!1,null,"2cb38294",null,!1,i["a"],a);t["default"]=o.exports},"92c5":function(e,t,n){"use strict";var i=n("a4c0"),s=n.n(i);s.a},"9b98":function(e,t,n){"use strict";(function(e){n("63d7");i(n("66fd"));var t=i(n("6e80"));function i(e){return e&&e.__esModule?e:{default:e}}e(t.default)}).call(this,n("543d")["createPage"])},a4c0:function(e,t,n){},bbd4:function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=u(n("a34a")),s=n("cfae");function u(e){return e&&e.__esModule?e:{default:e}}function a(e,t,n,i,s,u,a){try{var r=e[u](a),o=r.value}catch(c){return void n(c)}r.done?t(o):Promise.resolve(o).then(i,s)}function r(e){return function(){var t=this,n=arguments;return new Promise((function(i,s){var u=e.apply(t,n);function r(e){a(u,i,s,r,o,"next",e)}function o(e){a(u,i,s,r,o,"throw",e)}r(void 0)}))}}var o=function(){n.e("components/xuan-switch/xuan-switch").then(function(){return resolve(n("51c8"))}.bind(null,n)).catch(n.oe)},c={components:{selectSwitch:o},data:function(){return{loading:!0,answerflag:!1,answerjump:!0,nightFlag:!1,kemu:e.getStorageSync("kemu")||1,completeAnswer:{},show:!1,checked:!0,radio:null,result:[],userAnswer:{},questionList:{},choiceList:["an1","an2","an3","an4","an5","an6","an7"],swiperIndex:0,shakeIndex:0,pageNum:e.getStorageSync("pageNum")||1,shake:0}},watch:{kemu:function(t){e.setStorageSync("kemu",t),this.pageNum=1,this.listInit()}},mounted:function(){this.listInit()},methods:{listInit:function(){var e=this;return r(i.default.mark((function t(){return i.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,t.next=3,(0,s.questionList)({pageNum:e.pageNum,pageSize:10,kemu:e.kemu}).then((function(t){e.questionList=t.rows,e.$nextTick((function(){e.loading=!1}))}));case 3:return t.next=5,(0,s.questionList)({pageNum:e.pageNum+1,pageSize:10,kemu:e.kemu}).then((function(t){e.questionList=e.questionList.concat(t.rows)}));case 5:return t.next=7,(0,s.questionList)({orderByClause:e.pageNum-2>0?"asc":"desc",pageNum:e.pageNum-2>0?e.pageNum-2:Math.abs(e.pageNum-3),pageSize:10,kemu:e.kemu}).then((function(t){e.pageNum-2>0||t.rows.reverse(),e.questionList=e.questionList.concat(t.rows)}));case 7:return t.next=9,(0,s.questionList)({orderByClause:e.pageNum-1>0?"asc":"desc",pageNum:e.pageNum-1>0?e.pageNum-1:Math.abs(e.pageNum-2),pageSize:10,kemu:e.kemu}).then((function(t){e.pageNum-1>0||t.rows.reverse(),e.questionList=e.questionList.concat(t.rows)}));case 9:case"end":return t.stop()}}),t)})))()},questionType:function(e){switch(e){case 1:return"判断";case 2:return"单选";case 3:return"多选"}},swiperChange:function(t){var n=this,i=t.detail.current-this.shakeIndex;if(this.shake+=1!=Math.pow(i,2)?-i/Math.abs(i):i,this.swiperIndex=t.detail.current,this.shakeIndex=t.detail.current,t.detail.current%10==0){if(Math.abs(this.shake)<10)return void(this.shake=0);var u=this.shake/Math.abs(this.shake);this.pageNum+=u,(0,s.questionList)({orderByClause:this.pageNum+u>0?"asc":"desc",pageNum:this.pageNum+u>0?this.pageNum+u:Math.abs(this.pageNum+u-1),pageSize:10,kemu:this.kemu}).then((function(i){e.setStorageSync("pageNum",n.pageNum),n.shake=0,u>0?(30==t.detail.current&&(n.questionList=i.rows.concat(n.questionList.slice(10))),20==t.detail.current&&(n.questionList=n.questionList.slice(0,30).concat(i.rows)),10==t.detail.current&&(n.questionList=n.questionList.slice(0,20).concat(i.rows).concat(n.questionList.slice(30))),0==t.detail.current&&(n.questionList=n.questionList.slice(0,10).concat(i.rows).concat(n.questionList.slice(20)))):(n.pageNum+u>0||i.rows.reverse(),0==t.detail.current&&(n.questionList=n.questionList.slice(0,20).concat(i.rows).concat(n.questionList.slice(30))),30==t.detail.current&&(n.questionList=n.questionList.slice(0,10).concat(i.rows).concat(n.questionList.slice(20))),20==t.detail.current&&(n.questionList=i.rows.concat(n.questionList.slice(10))),10==t.detail.current&&(n.questionList=n.questionList.slice(0,30).concat(i.rows)))}))}},onChange:function(e,t){this.completeAnswer[t.id]||this.answerflag||this.$set(this.userAnswer,t.id,e.detail)},singleToggle:function(e,t){var n=this;if(!this.completeAnswer[t.id]&&!this.answerflag){var i=e.currentTarget.dataset.index;this.$set(this.userAnswer,t.id,i),setTimeout((function(){n.submit(t)}),0)}},toggle:function(e,t){var n=e.currentTarget.dataset.index,i=this.$refs["checkboxes".concat(t.id)][n];i.toggle()},noop:function(){},submit:function(e){this.$set(this.completeAnswer,e.id,!0);var t=(this.userAnswer[e.id]+"").split(",").sort().join("")==e.answerTrue.split("").sort().join("");if(t){if(wx.vibrateShort(),this.answerjump){var n=this.swiperIndex;this.swiperIndex=++n%40}}else wx.vibrateLong()},changeSwitch:function(e){this.kemu=e?1:4}}};t.default=c}).call(this,n("543d")["default"])},c465:function(e,t,n){"use strict";n.r(t);var i=n("bbd4"),s=n.n(i);for(var u in i)"default"!==u&&function(e){n.d(t,e,(function(){return i[e]}))}(u);t["default"]=s.a}},[["9b98","common/runtime","common/vendor"]]]);