1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/terminal/terminal"],{"05df":function(e,n,t){"use strict";t.r(n);var o=t("a233"),i=t("0c50");for(var c in i)["default"].indexOf(c)<0&&function(e){t.d(n,e,(function(){return i[e]}))}(c);t("832d");var a=t("828b"),r=Object(a["a"])(i["default"],o["b"],o["c"],!1,null,"6c96bc9a",null,!1,o["a"],void 0);n["default"]=r.exports},"0c50":function(e,n,t){"use strict";t.r(n);var o=t("f1f8"),i=t.n(o);for(var c in o)["default"].indexOf(c)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(c);n["default"]=i.a},"74b3":function(e,n,t){"use strict";(function(e,n){var o=t("47a9");t("2acb");o(t("3240"));var i=o(t("05df"));e.__webpack_require_UNI_MP_PLUGIN__=t,n(i.default)}).call(this,t("3223")["default"],t("df3c")["createPage"])},"832d":function(e,n,t){"use strict";var o=t("dcf3"),i=t.n(o);i.a},a233:function(e,n,t){"use strict";t.d(n,"b",(function(){return i})),t.d(n,"c",(function(){return c})),t.d(n,"a",(function(){return o}));var o={axBody:function(){return t.e("components/ax-body/ax-body").then(t.bind(null,"8839"))},axIosIndicator:function(){return t.e("components/ax-ios-indicator/ax-ios-indicator").then(t.bind(null,"2348"))}},i=function(){var e=this,n=e.$createElement,t=(e._self._c,e.getVolt()),o=1==e.personal&&e.nowPriceTime.price?parseFloat(e.nowPriceTime.price).toFixed(4):null,i=1!=e.personal&&e.nowPriceTime.price?parseFloat(e.nowPriceTime.price).toFixed(4):null,c=1!=e.personal?e.getCurrEcPrice():null,a=e.discountInfo&&1==e.personal&&e.discountInfo.discount?parseFloat(e.discountInfo.discount).toFixed(4):null,r=e.getPriceLable(e.nowPriceTime.timeType),s=e.getDeviceStatusLable(e.deviceInfo.deviceStatus);e._isMounted||(e.e0=function(n){return e.$app.url.goto("/pages/site-more/site-more?show=1&stationId="+e.stationInfo.id)}),e.$mp.data=Object.assign({},{$root:{m0:t,g0:o,g1:i,m1:c,g2:a,m2:r,m3:s}})},c=[]},dcf3:function(e,n,t){},f1f8:function(e,n,t){"use strict";(function(e){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var t={onLoad:function(e){console.log("参数信息:",e),this.deviceId=e.deviceId,this.deviceStatus=e.deviceStatus},onShow:function(){var e=this;this.queryInChange(this.deviceId,this.deviceStatus),this.userInfo=this.$app.storage.get(this.$config.keyname.userInfo),this.userInfo.phone?this.$api.login({checkStatus:1}).then((function(){e.userInfo=e.$app.storage.get(e.$config.keyname.userInfo),e.userInfo.ecId&&e.$api.base("post","/chargeApi/queryEcInfo",{ecId:e.userInfo.ecId},{}).then((function(n){n.ecInfo&&1==n.ecInfo.ecStatus&&(e.isEc=!0)}))})):this.$app.url.goto("/pages/login/login")},mounted:function(){},data:function(){return{deviceId:0,deviceStatus:0,visit:"",personal:1,isEc:!1,nowPriceTime:{},deviceInfo:{},accountInfo:{balance:0},userInfo:{},stationInfo:{},orderInfo:{},checkNum:0,ecInfo:{},discountInfo:null,selectedImg:"https://hyxhsh.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/AwQTRxpEMqOG50293e26d86888b3e0f7324c429d2019.png/1.png",defaultImg:"https://hyxhsh.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/SPh1u3KAqte830a107b2e3c5033b1d1027516d84d780.png/1.png"}},methods:{queryInChange:function(e,n){3!=n&&4!=n||(this.visit=!0),this.getDeviceInfo(e),this.getAccountInfo()},getDeviceInfo:function(e){var n=this;this.$api.base("post","/chargeApi/getDevicesDetial",{deviceId:e},{}).then((function(e){n.deviceInfo=e.device,n.nowPriceTime=e.nowPriceTime,n.stationInfo=e.stationInfo,e.discountInfo&&(n.discountInfo=e.discountInfo),1==n.deviceInfo.tipsStatus&&n.$app.popup.alert(n.deviceInfo.tipsContent,"温馨提示")}))},getAccountInfo:function(){var e=this;1==this.personal?this.$api.base("post","/chargeApi/getUserAccount",{},{}).then((function(n){e.accountInfo.balance=n.userAccount.balance})):this.$api.base("post","/chargeApi/getEcUserAccount",{},{error:!1}).then((function(n){e.ecInfo=n.ecInfo,e.accountInfo.balance=n.ecUserAccount.balance})).catch((function(n){e.accountInfo.balance=0,e.$app.popup.alert(n.msg,"温馨提示")}))},changeAccount:function(e){this.personal!=e&&(this.personal=e,this.getAccountInfo())},getCurrEcPrice:function(){if(!this.nowPriceTime)return 0;var e=this.nowPriceTime.price;if(this.ecInfo&&this.ecInfo.ecDiscount){var n=this.nowPriceTime.servicePrice;this.stationInfo.contractServicePrice&&(n=this.stationInfo.contractServicePrice),e=this.nowPriceTime.electrovalence+n+this.nowPriceTime.addServicePrice*this.ecInfo.ecDiscount/100}return console.log("dddd",e),e&&(e=e.toFixed(2)),Number(e).toFixed(4)},getVolt:function(){if(!this.deviceInfo.power)return 0;var e=this.deviceInfo.power/this.deviceInfo.current*1e3;return e},getPriceLable:function(e){var n="";switch(e){case 1:n="谷";break;case 2:n="平";break;case 3:n="峰";break}return n},getDeviceStatusLable:function(e){var n="";switch(e){case 0:n="离网";break;case 1:n="空闲";break;case 2:n="占用";break;case 3:n="占用";break;case 4:n="占用";break;case 255:n="故障";break}return n},startup:function(){var e=this;if(!this.visit)return this.accountInfo.balance-3<=0?this.$app.popup.confirm("无法启动充电,抵扣余量需大于3元,请先购买充电券!","温馨提示!",{confirmText:"立即购券"}).then((function(n){n&&e.$app.url.goto("/pages/coupon-buy/coupon-buy",!0)})):void this.startChangeAndOrder();this.$app.popup.alert("该充电枪被占用或存在异常,请重新尝试或更换其他充电枪。","温馨提示")},gotoCouponBuy:function(){this.$app.url.goto("/pages/coupon-buy/coupon-buy",!0)},startChangeAndOrder:function(){var e=this,n={userId:this.userInfo.id,deviceId:this.deviceInfo.id,orderType:2==this.personal?2:1};this.$api.base("post","/chargeApi/startChangeAndOrder",n,{}).then((function(n){e.orderInfo=n.orderInfo,n.flg&&1==n.flg?e.$app.popup.confirm("您有一个进行中充电订单,不可再次启动。",null,{showCancel:!1,confirmText:"查看订单"}).then((function(n){e.$app.url.goto("/pages/charging/charging?orderId="+e.orderInfo.id+"&deviceId="+e.deviceInfo.id,!1)})):e.$app.url.goto("/pages/charging/charging?orderId="+e.orderInfo.id+"&deviceId="+e.deviceInfo.id,!1)}))},checkedStartStatus:function(){var n=this;this.$api.base("post","/chargeApi/checkedStartStatus",{id:this.orderInfo.id},{}).then((function(t){if(0==t.code){var o=t.obj;200==o.code?1==o.status?(e.hideLoading(),n.$app.url.goto("/pages/charging/charging?orderId="+n.orderInfo.id+"&deviceId="+n.deviceInfo.id,!1)):n.checkNum<20&&(n.checkNum=n.checkNum+1,setTimeout((function(){return n.checkedStartStatus()}),2e3)):(e.hideLoading(),n.$app.popup.alert(o.msg,"温馨提示"))}else e.hideLoading()}))}}};n.default=t}).call(this,t("df3c")["default"])}},[["74b3","common/runtime","common/vendor"]]]);
|