(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/charging/charging"],{"0aeb":function(t,e,i){"use strict";(function(t,e){var n=i("47a9");i("6a42");n(i("3240"));var o=n(i("b6bf"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(o.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])},"3b92":function(t,e,i){"use strict";i.r(e);var n=i("cc69"),o=i.n(n);for(var a in n)["default"].indexOf(a)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(a);e["default"]=o.a},b6bf:function(t,e,i){"use strict";i.r(e);var n=i("fa96"),o=i("3b92");for(var a in o)["default"].indexOf(a)<0&&function(t){i.d(e,t,(function(){return o[t]}))}(a);i("be5c");var r=i("828b"),c=Object(r["a"])(o["default"],n["b"],n["c"],!1,null,"1d23aac4",null,!1,n["a"],void 0);e["default"]=c.exports},badc:function(t,e,i){},be5c:function(t,e,i){"use strict";var n=i("badc"),o=i.n(n);o.a},cc69:function(t,e,i){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i={onLoad:function(t){console.log("启动充值页面的参数：",t),this.orderInfo.id=t.orderId,this.deviceInfo.id=t.deviceId},onShow:function(){this.getDeviceInfo()},data:function(){return{exiting:{visible:!1,lock:!1},timer:{id:0,start:"2024/08/07 09:00:00",text:"00：00：00",isSatrt:!1},pollingTimer:null,deviceInfo:{},orderInfo:{id:1},isShowBtn:!0}},destroyed:function(){console.log("关闭页面了。。。。。。"),this.stopPolling(),clearInterval(this.timer.id)},methods:{getDeviceInfo:function(){var e=this,i=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.$api.base("get","/applet/v1/station/charging-cost",{},{loading:i}).then((function(i){if(e.deviceInfo=i.data,4==i.data.orderStatus||5==i.data.orderStatus)return t.hideLoading(),e.stopPolling(),clearInterval(e.timer.id),void e.$app.url.goto("/pages/order-detail/order-detail?orderId="+i.data.chargeOrderId,!1);2!=i.data.orderStatus||e.timer.isSatrt||e.startup(),e.checkShowEndBtn(i.data.startTime),e.startPolling()}))},startPolling:function(){var t=this;this.pollingTimer||(this.pollingTimer=setInterval((function(){t.getDeviceInfo(!1)}),5e3))},stopPolling:function(){this.pollingTimer&&(clearInterval(this.pollingTimer),this.pollingTimer=null)},checkShowEndBtn:function(t){if(t){var e=new Date(t.replace(/-/g,"/")).getTime(),i=Date.now(),n=(i-e)/1e3;(n>=60||2==this.deviceInfo.orderStatus)&&(this.isShowBtn=!0)}},startup:function(){var t=this,e=new Date(this.deviceInfo.startTime),i={hour:0,minute:0,second:0},n=function(){t.timer.isSatrt=!0;var n=Date.now()-e.getTime();i.hour=Math.floor(n/1e3/60/60),i.minute=Math.floor(n/1e3/60%60),i.second=Math.floor(n/1e3%60),t.timer.text="".concat(String(i.hour).padStart(2,"0"),"：").concat(String(i.minute).padStart(2,"0"),"：").concat(String(i.second).padStart(2,"0"))};clearInterval(this.timer.id),this.timer.id=setInterval(n,1e3),n()},exit:function(){var t=this;this.$api.base("post","/applet/v1/charge/stopCharge",{chargeOrderNo:this.deviceInfo.chargeOrderNo},{}).then((function(e){t.exiting.lock=!1,t.stopPolling(),t.$app.popup.loading(!0,{title:"结算中，请稍候",timeout:12e4}),setTimeout((function(){t.getDeviceInfo(!1)}),2e3)})).catch((function(){t.exiting.lock=!1}))},submitExit:function(){this.exiting.lock=!1,this.exiting.visible=!1,this.exit()}}};e.default=i}).call(this,i("df3c")["default"])},fa96:function(t,e,i){"use strict";i.d(e,"b",(function(){return o})),i.d(e,"c",(function(){return a})),i.d(e,"a",(function(){return n}));var n={axBody:function(){return i.e("components/ax-body/ax-body").then(i.bind(null,"e199"))}},o=function(){var t=this,e=t.$createElement;t._self._c;t._isMounted||(t.e0=function(e){t.exiting.lock=!0},t.e1=function(e){t.exiting.lock=!1},t.e2=function(e){t.exiting.visible=!1},t.e3=function(e){t.exiting.visible=!1},t.e4=function(e){t.exiting.visible=!0})},a=[]}},[["0aeb","common/runtime","common/vendor"]]]);