(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/home/index"],{"3cf0":function(t,e,n){},"3eac":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n("a34a")),a=n("48c1"),o=n("5a6b");function r(t){return t&&t.__esModule?t:{default:t}}function c(t,e,n,i,a,o,r){try{var c=t[o](r),u=c.value}catch(s){return void n(s)}c.done?e(u):Promise.resolve(u).then(i,a)}function u(t){return function(){var e=this,n=arguments;return new Promise((function(i,a){var o=t.apply(e,n);function r(t){c(o,i,a,r,u,"next",t)}function u(t){c(o,i,a,r,u,"throw",t)}r(void 0)}))}}var s=function(){n.e("components/square/index").then(function(){return resolve(n("524e"))}.bind(null,n)).catch(n.oe)},f={components:{square:s},data:function(){return{dhfalg:!1,timeText:"00:00:00",timeTitle:"开始",info:[],infoData:{},unbindFlag:!1,timeStatus:0,timeFn:this.timeStart(),btnLoading:!1,loadingText:""}},mounted:function(){this.initInfo()},methods:{initInfo:function(){var e=this;return u(i.default.mark((function n(){var r,c,u;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return t.getStorageSync("time")&&(e.timeText=new Date(t.getStorageSync("time")).toJSON().slice(11,-5),e.timeTitle="继续"),n.next=3,(0,o.getInfo)();case 3:if(r=n.sent,!r.data.student.gzptUserId){n.next=15;break}return n.next=7,(0,a.getTimeInfo)();case 7:return c=n.sent,e.info=c.rows,n.next=11,(0,a.getTime)();case 11:u=n.sent,e.infoData=u.rows[0],n.next=16;break;case 15:e.unbindFlag=!0;case 16:case"end":return n.stop()}}),n)})))()},videoPlay:function(e){t.createVideoContext("myVideo2",this).pause()},videoPlay2:function(e){t.createVideoContext("myVideo",this).pause()},go:function(e){t.navigateTo({url:e})},timeBtn:function(e){var n=this,i=this.timeFn();if(console.log(i),1==i.timeStatus&&(this.dhfalg=!0,this.loadingText="计时中",this.btnLoading=!0,setTimeout((function(){n.btnLoading=!1,n.timeTitle="上传学时"}),1e3)),2==i.timeStatus){this.dhfalg=!1,this.loadingText="上传中",this.btnLoading=!0;try{var o=t.getStorageSync("sysInfo");(0,a.addTime)({beginTime:new Date(i.start).toISOString().slice(0,-5).replace("T"," "),endTime:new Date(i.end).toISOString().slice(0,-5).replace("T"," "),isSubmit:6,pxkm:this.infoData.km1>=this.info[5].ration?4:1,classid:"小程序",reason:"小程序&".concat(o.platform,"&").concat(o.model),source:1,trainType:"小程序",trainTime:~~(i.time/60/1e3)}).then((function(e){200==e.code?(n.btnLoading=!1,n.timeText="上传成功",t.removeStorageSync("timeStart"),t.removeStorageSync("time"),n.timeTitle="开始"):(n.btnLoading=!1,console.log("上传学时异常!!"),n.timeTitle="恢复")}),(function(t){n.btnLoading=!1,console.log("上传学时异常!!"),n.timeTitle="恢复"}))}catch(e){this.btnLoading=!1,this.timeTitle="恢复"}}},timeStart:function(){var e,n,i,a=this,o=0;return function(){if(o+=1,1==o)return t.getStorageSync("time")?n=t.getStorageSync("time"):(i=(new Date).getTime(),n=0,t.setStorageSync("timeStart",i)),e=setInterval((function(){n+=100,n%1e3==0&&t.setStorageSync("time",n),a.timeText=new Date(n).toJSON().slice(11,-5)}),100),{start:t.getStorageSync("timeStart"),time:n,timeStatus:o};if(o>=2){o=0;var r={start:t.getStorageSync("timeStart"),end:(new Date).getTime(),time:t.getStorageSync("time"),timeStatus:2};return clearInterval(e),r}}}}};e.default=f}).call(this,n("543d")["default"])},"56a4":function(t,e,n){"use strict";n.r(e);var i=n("dc88"),a=n("f15b");for(var o in a)"default"!==o&&function(t){n.d(e,t,(function(){return a[t]}))}(o);n("a83d");var r,c=n("f0c5"),u=Object(c["a"])(a["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],r);e["default"]=u.exports},a83d:function(t,e,n){"use strict";var i=n("3cf0"),a=n.n(i);a.a},dc88:function(t,e,n){"use strict";var i;n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return i}));var a=function(){var t=this,e=t.$createElement;t._self._c},o=[]},f15b:function(t,e,n){"use strict";n.r(e);var i=n("3eac"),a=n.n(i);for(var o in i)"default"!==o&&function(t){n.d(e,t,(function(){return i[t]}))}(o);e["default"]=a.a}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
    'components/home/index-create-component',
    {
        'components/home/index-create-component':(function(module, exports, __webpack_require__){
            __webpack_require__('543d')['createComponent'](__webpack_require__("56a4"))
        })
    },
    [['components/home/index-create-component']]
]);
