"use strict";const t=require("../../common/vendor.js"),e=require("../../common/assets.js"),a=require("../../api/api.js"),s=require("../../utils/fun.js"),o=require("../../store/index.js"),r={__name:"recharge",setup(r){let n=t.ref("");t.ref(""),t.onLoad((async t=>{if(n.value=t.transactionNo,t.type){let e=await a.realtimeInfo({transactionNo:t.transactionNo});o.store.commit("setDataObj",e)}}));const u=e=>{t.index.showModal({title:"提示",content:1==e?"是否确认结束充电？":"结束充电失败，请重试！",success:function(e){e.confirm?a.stopCharging({transactionNo:n.value}).then((e=>{t.index.showLoading({title:"停止充电中..."}),o.store.commit("setSokStatus",0),i(n.value)})):e.cancel&&console.log("用户点击取消")}})},i=e=>{setTimeout((async()=>{if(1!=o.store.state.sokStatus){let s=await a.ordersInfo({transactionNo:e});o.store.commit("setDataObj",s),3!=s.status&&4!=s.status||(t.index.hideLoading(),u(2)),5!=s.status&&6!=s.status||(t.index.hideLoading(),t.index.navigateBack(),o.store.commit("setSokStatus",0))}}),3e4)};return(a,r)=>({a:t.t(t.unref(o.store).state.dataObj.orderNo),b:e._imports_0$7,c:t.o((e=>t.unref(s.copy)(t.unref(o.store).state.dataObj.orderNo))),d:t.t(t.unref(o.store).state.dataObj.currentAmount||0),e:t.t(t.unref(o.store).state.dataObj.cumulativeTime||0),f:t.t(t.unref(o.store).state.dataObj.chargingDegree||0),g:t.t(t.unref(o.store).state.dataObj.cumulativeTime||0),h:t.t(t.unref(o.store).state.dataObj.currentAmount||0),i:t.t(t.unref(o.store).state.dataObj.outputVoltage||0),j:t.t(t.unref(o.store).state.dataObj.outputCurrent||0),k:t.t(t.unref(o.store).state.dataObj.power||0),l:t.t(t.unref(o.store).state.dataObj.gunNo),m:t.t(t.unref(o.store).state.dataObj.deviceNo||""),n:t.o((t=>u(1)))})}},n=t._export_sfc(r,[["__scopeId","data-v-3c0c9951"]]);wx.createPage(n);
