(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["subPackages/charging/charging/charging"],{"059b":function(t,e,i){"use strict";i.r(e);var n=i("943d"),o=i.n(n);for(var r in n)["default"].indexOf(r)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(r);e["default"]=o.a},"1a57":function(t,e,i){"use strict";i.r(e);var n=i("eb98"),o=i("059b");for(var r in o)["default"].indexOf(r)<0&&function(t){i.d(e,t,(function(){return o[t]}))}(r);i("921e");var a=i("828b"),c=Object(a["a"])(o["default"],n["b"],n["c"],!1,null,"2e3589b8",null,!1,n["a"],void 0);e["default"]=c.exports},"8e75":function(t,e,i){"use strict";(function(t,e){var n=i("47a9");i("5449");n(i("3240"));var o=n(i("1a57"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(o.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])},"921e":function(t,e,i){"use strict";var n=i("dcb6"),o=i.n(n);o.a},"943d":function(t,e,i){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=["2","3","5"],o={components:{CirclePercent:function(){i.e("components/qs-circle-percent/qs-circle-percent").then(function(){return resolve(i("0445"))}.bind(null,i)).catch(i.oe)}},onLoad:function(t){console.log("启动充值页面的参数：",t),this.orderInfo.id=t.orderId,this.deviceInfo.id=t.deviceId,this.chargeOrderNo=t.chargeOrderNo||"",this.getDeviceInfo(!0,t.chargeOrderNo)},onShow:function(){},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},chargeOrderNo:"",isShowBtn:!0,isStoppingCharge:!1}},destroyed:function(){console.log("关闭页面了......"),this.clearAllTimers()},methods:{clearAllTimers:function(){this.stopPolling(),this.timer.id&&(clearInterval(this.timer.id),this.timer.id=0)},isTerminalStatus:function(t){return n.includes(String(t))},handleTerminalRedirect:function(){t.hideLoading(),this.clearAllTimers(),this.isStoppingCharge=!1,this.$app.url.goto("/subPackages/order/order/order")},getDeviceInfo:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],i=arguments.length>1?arguments[1]:void 0;this.$api.base("get","/applet/v1/station/charging-cost",{orderNo:i||this.chargeOrderNo},{loading:e}).then((function(e){t.deviceInfo=e.data,t.isTerminalStatus(e.data.status)?t.handleTerminalRedirect():(2!=e.data.orderStatus||t.timer.isSatrt||t.startup(),t.checkShowEndBtn(e.data.startTime),t.startPolling())})).catch((function(e){console.error("获取充电信息失败:",e),t.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,e=this;this.isStoppingCharge=!0,this.$api.base("post","/applet/v1/charge/stopCharge",{chargeOrderNo:(null===(t=this.deviceInfo)||void 0===t?void 0:t.chargeOrderNo)||this.chargeOrderNo},{}).then((function(t){"00000"==t.code?(e.$app.popup.loading(!0,{title:"结算中，请稍候",timeout:12e4}),e.exiting.lock=!1):(e.isStoppingCharge=!1,e.exiting.lock=!1)})).catch((function(){e.isStoppingCharge=!1,e.exiting.lock=!1}))},submitExit:function(){this.exiting.lock=!1,this.exiting.visible=!1,this.exit()}}};e.default=o}).call(this,i("df3c")["default"])},dcb6:function(t,e,i){},eb98:function(t,e,i){"use strict";i.d(e,"b",(function(){return o})),i.d(e,"c",(function(){return r})),i.d(e,"a",(function(){return n}));var n={axBody:function(){return i.e("components/ax-body/ax-body").then(i.bind(null,"23fc"))}},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})},r=[]}},[["8e75","common/runtime","common/vendor"]]]);