terminal.js 5.7 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/terminal/terminal"],{2534:function(e,t,n){"use strict";n.r(t);var o=n("639b"),i=n.n(o);for(var c in o)["default"].indexOf(c)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(c);t["default"]=i.a},"41a4":function(e,t,n){"use strict";(function(e,t){var o=n("47a9");n("6a42");o(n("3240"));var i=o(n("e602"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(i.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])},"639b":function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={onLoad:function(e){console.log("参数信息:",e),this.deviceId=e.deviceId,this.deviceStatus=e.deviceStatus},onShow:function(){this.queryInChange(this.deviceId,this.deviceStatus),this.userInfo=this.$app.storage.get(this.$config.keyname.userInfo),console.log(this.userInfo,"获取到的用户信息"),this.userInfo.phone||this.$app.url.goto("/pages/login/login")},mounted:function(){var e=this;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,t){3!=t&&4!=t||(this.visit=!0),this.getDeviceInfo(e),this.checkedStartStatus()},getDeviceInfo:function(e){var t=this;this.$api.base("get","/applet/v1/station/connector/detail",{connectorCode:e},{}).then((function(e){t.deviceInfo=e.data,t.nowPriceTime=e.nowPriceTime,t.stationInfo=e.stationInfo,e.discountInfo&&(t.discountInfo=e.discountInfo),1==t.deviceInfo.tipsStatus&&t.$app.popup.alert(t.deviceInfo.tipsContent,"温馨提示")}))},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 t=this.nowPriceTime.servicePrice;this.stationInfo.contractServicePrice&&(t=this.stationInfo.contractServicePrice),e=this.nowPriceTime.electrovalence+t+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},startup:function(){var e=this;if(!this.visit)return this.deviceInfo.availableBalance<=3?this.$app.popup.confirm("无法启动充电,抵扣余量需大于3元,请先购买充电券!","温馨提示!",{confirmText:"立即购券"}).then((function(t){t&&e.$app.url.goto("/pages/coupon-buy/coupon-buy",!0)})):void this.get_subMessage();this.$app.popup.alert("该充电枪被占用或存在异常,请重新尝试或更换其他充电枪。","温馨提示")},get_subMessage:function(){var t=this;e.requestSubscribeMessage({tmplIds:["03bv7QSrzH4DSjmNsI9P0lq0Vj3sBwpN5mgfZln7Rc4"],success:function(e){t.startChangeAndOrder()}})},gotoCouponBuy:function(){this.$app.url.goto("/pages/coupon-buy/coupon-buy",!0)},startChangeAndOrder:function(){var e=this,t={orderType:this.deviceInfo.isEcUser?1:0,equipmentId:this.deviceInfo.equipmentId,stationId:this.deviceInfo.stationId,couponId:null,connectorId:this.deviceInfo.connectorCode};this.$api.base("post","/applet/v1/charge/invokeCharge",t,{}).then((function(t){console.log(t,"返回数据"),e.orderInfo=t.data,"00000"==t.code?e.$app.url.goto("/pages/charging/charging?chargeOrderNo="+t.data.chargeOrderNo+"&deviceId="+e.deviceInfo.id,!1):e.$app.popup.alert(t.msg,"温馨提示")}))},checkedStartStatus:function(){var e=this;this.$api.base("get","/applet/v1/station/charging-cost",{},{}).then((function(t){2==t.data.orderStatus&&e.$app.popup.confirm("您有一个进行中充电订单,不可再次启动。",null,{showCancel:!1,confirmText:"查看订单"}).then((function(n){e.$app.url.goto("/pages/charging/charging?chargeOrderNo="+t.data.chargeOrderNo+"&deviceId="+e.deviceInfo.id,!1)}))}))}}};t.default=n}).call(this,n("df3c")["default"])},a768:function(e,t,n){},bd00:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return c})),n.d(t,"a",(function(){return o}));var o={axBody:function(){return n.e("components/ax-body/ax-body").then(n.bind(null,"e199"))},axIosIndicator:function(){return n.e("components/ax-ios-indicator/ax-ios-indicator").then(n.bind(null,"6075"))},axPopup:function(){return n.e("components/ax-popup/ax-popup").then(n.bind(null,"49c3"))}},i=function(){var e=this,t=e.$createElement,n=(e._self._c,1!=e.personal?e.getCurrEcPrice():null),o=e.discountInfo&&1==e.personal&&e.discountInfo.discount?parseFloat(e.discountInfo.discount).toFixed(4):null,i=null!=e.payment_msg?(e.payment_msg.maspAmount+e.payment_msg.maspRealAmount).toFixed(2):null;e._isMounted||(e.e0=function(t){return e.$app.url.goto("/pages/site-more/site-more?show=1&stationId="+e.stationInfo.id)},e.e1=function(t){return e.$refs.filter.close()},e.e2=function(t){return e.$app.url.goto("/pages/coupon-buy/coupon-buy")}),e.$mp.data=Object.assign({},{$root:{m0:n,g0:o,g1:i}})},c=[]},df3f:function(e,t,n){"use strict";var o=n("a768"),i=n.n(o);i.a},e602:function(e,t,n){"use strict";n.r(t);var o=n("bd00"),i=n("2534");for(var c in i)["default"].indexOf(c)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(c);n("df3f");var a=n("828b"),s=Object(a["a"])(i["default"],o["b"],o["c"],!1,null,"211da8af",null,!1,o["a"],void 0);t["default"]=s.exports}},[["41a4","common/runtime","common/vendor"]]]);