(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["ChargingStation/pages/placeOrder/index"],{"28cb":function(e,n,t){"use strict";(function(e,n){var a=t("4ea4");t("9773");a(t("66fd"));var o=a(t("ea2a"));e.__webpack_require_UNI_MP_PLUGIN__=t,n(o.default)}).call(this,t("bc2e")["default"],t("543d")["createPage"])},"3a7a":function(e,n,t){"use strict";t.r(n);var a=t("a4ff"),o=t.n(a);for(var i in a)["default"].indexOf(i)<0&&function(e){t.d(n,e,(function(){return a[e]}))}(i);n["default"]=o.a},"581e":function(e,n,t){},a4ff:function(e,n,t){"use strict";(function(e){var a=t("4ea4");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=a(t("2303")),i=a(t("c781")),c=t("1eac"),l={components:{selectLicense:function(){t.e("ChargingStation/pages/placeOrder/components/selectLicense/selectLicense").then(function(){return resolve(t("0046"))}.bind(null,t)).catch(t.oe)},platItem:function(){t.e("ChargingStation/pages/placeOrder/components/accountItem/index").then(function(){return resolve(t("0a02"))}.bind(null,t)).catch(t.oe)}},data:function(){return{accountIndex:0,plateNum:"",accountList:[],isShow:{licenseDialog:!1},pageIndex:{plateNumberIndex:0},checkPage:{qrcode:{tacitly:"",WrongText:"参数qrcode错误"},connectorId:{tacitly:"",WrongText:"参数connectorId错误"},licensePlate:{tacitly:"",WrongText:"车牌号输入错误"},payMoneyPreFreeze:{tacitly:"",WrongText:"参数payMoneyPreFreeze错误"},payMoneyPreAvailable:{tacitly:"",WrongText:"充电金额不能为空"}},payMoneyPreAvailable:"",selectPriceOptionValue:"",priceOptions:[{label:"10元",value:10},{label:"30元",value:30},{label:"60元",value:60},{label:"80元",value:80},{label:"100元",value:100},{label:"120元",value:120}],pageData:null}},created:function(){this.getAccountList()},onLoad:function(e){console.log(e,"====="),this.getStationData(e)},filters:{price:function(e){var n=Number(e.stationPrice.businessElectricityFee)+Number(e.stationPrice.businessServiceFee);return n.toFixed(2)}},watch:{"isShow.licenseDialog":function(e){e?this.$refs.licenseDialog.open("bottom"):this.$refs.licenseDialog.close()},selectPriceOptionValue:function(e){this.payMoneyPreAvailable=e}},methods:{getAccountList:function(){var e=this;o.default.getAccountList().then((function(n){e.accountList=n.data}))},accountChange:function(){},getPlateNum:function(e){e.value&&(this.pageData["plateNumberList"].push(e.value),this.pageIndex.plateNumberIndex=this.pageData["plateNumberList"].length-1)},tipFn:function(){e.showModal({title:"支付阈值说明",showCancel:!1,content:"为避免金额预估不准导致电未充满,以及防止超充导致订单金额差异。该部分金额,将于订单结算后会根据实际系统结算,自动退回。",success:function(e){e.confirm?console.log("用户点击确定"):e.cancel&&console.log("用户点击取消")}})},licenseConfirm:function(e){this.pageIndex.plateNumberIndex=e,this.isShow.licenseDialog=!1},licenseChange:function(e){e.show||(this.isShow.licenseDialog=!1)},showSb:function(){this.showLicenseDialog=!0},priceOptionClick:function(e){this.selectPriceOptionValue=e.value},getStationData:function(n){var t=this;(n.type="qrCode")&&o.default[n.pointTo?n.pointTo:"scanCode"](Object.assign(n,{qrCode:decodeURIComponent(n.qrCode)})).then((function(n){2e4==n.code?t.pageData=new t.tool.Anticorrosive(n.data,c.indexPage):e.showModal({title:"提示",content:n.msg,showCancel:!1,success:function(n){e.navigateBack()}})}))},goPlay:function(){var n=this,t=JSON.parse(JSON.stringify(this.pageData));delete t.stationPrice,t=Object.assign(t,{payMoneyPreAvailable:this.payMoneyPreAvailable,licensePlate:t.plateNumberList[this.pageIndex.plateNumberIndex]});var a=this.tool.checkFn(t,[],this.checkPage);if(a.result){var o=this.accountList[this.accountIndex],c=o.companyId,l=o.accountCardCode;o.payMoneyPreAvailable,o.payMoneyPreFreeze;i.default.createOrder(Object.assign(t,{companyId:c,accountId:l})).then((function(a){setTimeout((function(){e.navigateTo({url:"/ChargingStation/pages/placeOrder/result/index?price=".concat(n.tool.getnum(Number(t.payMoneyPreAvailable)+Number(t.payMoneyPreFreeze),2),"&id=").concat(a.data.id)})}),1e3)}))}else e.showToast({title:a.WrongText,icon:"none"})}}};n.default=l}).call(this,t("543d")["default"])},bfc0:function(e,n,t){"use strict";var a=t("581e"),o=t.n(a);o.a},ea2a:function(e,n,t){"use strict";t.r(n);var a=t("eb23"),o=t("3a7a");for(var i in o)["default"].indexOf(i)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(i);t("bfc0");var c=t("f0c5"),l=Object(c["a"])(o["default"],a["b"],a["c"],!1,null,"52b42182",null,!1,a["a"],void 0);n["default"]=l.exports},eb23:function(e,n,t){"use strict";t.d(n,"b",(function(){return o})),t.d(n,"c",(function(){return i})),t.d(n,"a",(function(){return a}));var a={uniIcons:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/uni-icons/components/uni-icons/uni-icons")]).then(t.bind(null,"e4f7"))},keyboardPlate:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/keyboard-plate/components/keyboard-plate/keyboard-plate")]).then(t.bind(null,"a759"))},uniPopup:function(){return t.e("uni_modules/uni-popup/components/uni-popup/uni-popup").then(t.bind(null,"cc5a"))}},o=function(){var e=this,n=e.$createElement,t=(e._self._c,e.pageData?e._f("price")(e.pageData):null),a=e.pageData?e.tool.getnum(e.accountList[e.accountIndex]["balance"],3):null,o=e.pageData?e.pageData.plateNumberList.length:null;e._isMounted||(e.e0=function(n){return e.$refs.accountDialog.open("bottom")},e.e1=function(n){e.selectPriceOptionValue=""},e.e2=function(n){e.isShow.licenseDialog=!0},e.e3=function(n){e.isShow.licenseDialog=!1,e.$refs.plateNumber.open()}),e.$mp.data=Object.assign({},{$root:{f0:t,g0:a,g1:o}})},i=[]}},[["28cb","common/runtime","common/vendor"]]]);