(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["subPackages/charging/charging/charging"],{1674:function(t,i,e){"use strict";e.r(i);var n=e("27ba"),o=e("ade9");for(var r in o)["default"].indexOf(r)<0&&function(t){e.d(i,t,(function(){return o[t]}))}(r);e("89bd");var a=e("828b"),c=Object(a["a"])(o["default"],n["b"],n["c"],!1,null,"32b7656e",null,!1,n["a"],void 0);i["default"]=c.exports},"27ba":function(t,i,e){"use strict";e.d(i,"b",(function(){return o})),e.d(i,"c",(function(){return r})),e.d(i,"a",(function(){return n}));var n={axBody:function(){return e.e("components/ax-body/ax-body").then(e.bind(null,"e199"))}},o=function(){var t=this,i=t.$createElement;t._self._c;t._isMounted||(t.e0=function(i){t.exiting.lock=!0},t.e1=function(i){t.exiting.lock=!1},t.e2=function(i){t.exiting.visible=!1},t.e3=function(i){t.exiting.visible=!1},t.e4=function(i){t.exiting.visible=!0})},r=[]},4475:function(t,i,e){"use strict";(function(t){Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var e=["2","3","5"],n={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 e.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,i=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1?arguments[1]:void 0;this.$api.base("get","/applet/v1/station/charging-cost",{orderNo:e||this.chargeOrderNo},{loading:i}).then((function(i){t.deviceInfo=i.data,t.isTerminalStatus(i.data.status)?t.handleTerminalRedirect():(2!=i.data.orderStatus||t.timer.isSatrt||t.startup(),t.checkShowEndBtn(i.data.startTime),t.startPolling())})).catch((function(i){console.error("获取充电信息失败:",i),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 i=new Date(t.replace(/-/g,"/")).getTime(),e=Date.now(),n=(e-i)/1e3;(n>=60||2==this.deviceInfo.orderStatus)&&(this.isShowBtn=!0)}},startup:function(){var t=this,i=new Date(this.deviceInfo.startTime),e={hour:0,minute:0,second:0},n=function(){t.timer.isSatrt=!0;var n=Date.now()-i.getTime();e.hour=Math.floor(n/1e3/60/60),e.minute=Math.floor(n/1e3/60%60),e.second=Math.floor(n/1e3%60),t.timer.text="".concat(String(e.hour).padStart(2,"0"),"：").concat(String(e.minute).padStart(2,"0"),"：").concat(String(e.second).padStart(2,"0"))};clearInterval(this.timer.id),this.timer.id=setInterval(n,1e3),n()},exit:function(){var t,i=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?(i.$app.popup.loading(!0,{title:"结算中，请稍候",timeout:12e4}),i.exiting.lock=!1):(i.isStoppingCharge=!1,i.exiting.lock=!1)})).catch((function(){i.isStoppingCharge=!1,i.exiting.lock=!1}))},submitExit:function(){this.exiting.lock=!1,this.exiting.visible=!1,this.exit()}}};i.default=n}).call(this,e("df3c")["default"])},8415:function(t,i,e){},"89bd":function(t,i,e){"use strict";var n=e("8415"),o=e.n(n);o.a},ade9:function(t,i,e){"use strict";e.r(i);var n=e("4475"),o=e.n(n);for(var r in n)["default"].indexOf(r)<0&&function(t){e.d(i,t,(function(){return n[t]}))}(r);i["default"]=o.a},aefc:function(t,i,e){"use strict";(function(t,i){var n=e("47a9");e("6a42");n(e("3240"));var o=n(e("1674"));t.__webpack_require_UNI_MP_PLUGIN__=e,i(o.default)}).call(this,e("3223")["default"],e("df3c")["createPage"])}},[["aefc","common/runtime","common/vendor"]]]);