terminal.js 7.4 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/terminal/terminal"],{"05df":function(e,n,t){"use strict";t.r(n);var i=t("b844"),o=t("0c50");for(var c in o)["default"].indexOf(c)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(c);t("743d");var r=t("828b"),a=Object(r["a"])(o["default"],i["b"],i["c"],!1,null,"2826e100",null,!1,i["a"],void 0);n["default"]=a.exports},"0c50":function(e,n,t){"use strict";t.r(n);var i=t("f1f8"),o=t.n(i);for(var c in i)["default"].indexOf(c)<0&&function(e){t.d(n,e,(function(){return i[e]}))}(c);n["default"]=o.a},"743d":function(e,n,t){"use strict";var i=t("ead4"),o=t.n(i);o.a},"74b3":function(e,n,t){"use strict";(function(e,n){var i=t("47a9");t("2acb");i(t("3240"));var o=i(t("05df"));e.__webpack_require_UNI_MP_PLUGIN__=t,n(o.default)}).call(this,t("3223")["default"],t("df3c")["createPage"])},b844:function(e,n,t){"use strict";t.d(n,"b",(function(){return o})),t.d(n,"c",(function(){return c})),t.d(n,"a",(function(){return i}));var i={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"))},axPopup:function(){return t.e("components/ax-popup/ax-popup").then(t.bind(null,"4393"))}},o=function(){var e=this,n=e.$createElement,t=(e._self._c,e.getVolt()),i=1==e.personal&&e.nowPriceTime.price?parseFloat(e.nowPriceTime.price).toFixed(4):null,o=1!=e.personal&&e.nowPriceTime.price?parseFloat(e.nowPriceTime.price).toFixed(4):null,c=1!=e.personal?e.getCurrEcPrice():null,r=e.discountInfo&&1==e.personal&&e.discountInfo.discount?parseFloat(e.discountInfo.discount).toFixed(4):null,a=e.nowPriceTime.firmPrice||1===e.$app.storage.get("USER_INFO").firmType,s=a&&e.nowPriceTime.firmPrice?parseFloat(e.nowPriceTime.firmPrice).toFixed(4):null,u=e.getPriceLable(e.nowPriceTime.timeType),d=e.getDeviceStatusLable(e.deviceInfo.deviceStatus),f=null!=e.payment_msg?(e.payment_msg.maspAmount+e.payment_msg.maspRealAmount).toFixed(2):null;e._isMounted||(e.e0=function(n){return e.$app.url.goto("/pages/site-more/site-more?show=1&stationId="+e.stationInfo.id)},e.e1=function(n){return e.$refs.filter.close()},e.e2=function(n){return e.$app.url.goto("/pages/coupon-buy/coupon-buy")}),e.$mp.data=Object.assign({},{$root:{m0:t,g0:i,g1:o,m1:c,g2:r,g3:a,g4:s,m2:u,m3:d,g5:f}})},c=[]},ead4: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(){var e=this;this.get_paymentMsg(),setTimeout((function(){null!=e.payment_msg&&e.$refs.filter.open()}),500)},data:function(){return{payment_msg:null,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,"温馨提示")}))},get_paymentMsg:function(){var e=this;this.$api.base("post","/chargeApi/queryOrderList-arrearage",{},{}).then((function(n){e.payment_msg=n.data}))},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.get_subMessage();this.$app.popup.alert("该充电枪被占用或存在异常,请重新尝试或更换其他充电枪。","温馨提示")},get_subMessage:function(){var n=this;e.requestSubscribeMessage({tmplIds:["03bv7QSrzH4DSjmNsI9P0lq0Vj3sBwpN5mgfZln7Rc4"],success:function(e){n.startChangeAndOrder()}})},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 i=t.obj;200==i.code?1==i.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(i.msg,"温馨提示"))}else e.hideLoading()}))}}};n.default=t}).call(this,t("df3c")["default"])}},[["74b3","common/runtime","common/vendor"]]]);