(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/index"],{"137f":function(t,e,n){"use strict";n.r(e);var i=n("dc40"),o=n("70d2");for(var a in o)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(a);n("8eed");var r=n("828b"),s=Object(r["a"])(o["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],void 0);e["default"]=s.exports},"55fb":function(t,e,n){"use strict";(function(t,e){var i=n("47a9");n("2acb");i(n("3240"));var o=i(n("137f"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(o.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])},"6f38":function(t,e,n){},"70d2":function(t,e,n){"use strict";n.r(e);var i=n("a412"),o=n.n(i);for(var a in i)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(a);e["default"]=o.a},"8eed":function(t,e,n){"use strict";var i=n("6f38"),o=n.n(i);o.a},a412:function(t,e,n){"use strict";(function(t){var i=n("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=i(n("7eb4")),a=i(n("34cf")),r=i(n("ee10")),s=n("b03f"),c={onLoad:function(t){var e=this;return(0,r.default)(o.default.mark((function n(){var i,a,r;return o.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,e.queryPermit();case 2:i=n.sent,i.privacy?e.privacy.visible=!0:!0===i.location?e.updateLocation():!1===i.location?(e.location.visible=!0,e.updateLocation()):void 0===i.location&&e.updateLocation(),t.hasOwnProperty("q")&&t.q&&(a=decodeURIComponent(t.q),console.log("url:"+a),r=e.getQueryParams(a,"connectorCode"),console.log("device_no:"+r),r&&e.getDeviceInfo(r)),e.closeAdvertising&&e.getAdswiper();case 6:case"end":return n.stop()}}),n)})))()},mounted:function(){this.adBanner.length>0&&!this.$app.storage.get("AD_STATUS")&&this.$refs.filter.open(),this.setListHeight(),this.setAppNavigationHeight(),this.get_frimid(),this.get_userinfo(),this.get_paymentMsg(),this.getBanners()},data:function(){return{payment_msg:null,user_info:{},appNavigationHeight:0,scrollLock:!0,sorts:{index:0,data:[{name:"离我最近",code:"range"},{name:"空闲最多",code:"device"},{name:"电费最低",code:"price"}]},list:{height:0,data:[]},banners:[],adBanner:[],location:{visible:!1,value:""},privacy:{visible:!1},city:{index:0,data:[{text:"贵阳",areaCode:"5201"},{text:"六盘水",areaCode:"5202"},{text:"遵义",areaCode:"5203"},{text:"安顺",areaCode:"5204"},{text:"毕节",areaCode:"5205"},{text:"铜仁",areaCode:"5206"},{text:"黔东南",areaCode:"5226"},{text:"黔南",areaCode:"5227"},{text:"黔西南",areaCode:"5223"}]},discountInfo:null,closeAdvertising:!1}},onShow:function(){this.getAdswiper()},onHide:function(){this.$app.storage.remove("AD_STATUS")},computed:{StyleSheet:function(){return{"--app-navigation-heiht":"".concat(this.appNavigationHeight,"px"),"--list-heiht":"".concat(this.list.height,"px")}}},onShareAppMessage:function(t){return"button"===t.from&&console.log(t.target),{title:"用券充天天都享会员价",path:"/pages/index/index",imageUrl:"../../static/img/share.jpg",desc:"用券充天天都享会员价"}},onShareTimeline:function(){return{title:"用券充天天都享会员价",path:"/pages/index/index",imageUrl:"../../static/img/share.jpg"}},methods:{closeAd:function(){this.closeAdvertising=!0,this.$refs.filter.close(),this.$app.storage.set("AD_STATUS",this.closeAdvertising)},get_userinfo:function(){var t=this;this.$api.base("post","/userApi/getUserAccount",{},{error:!1}).then((function(e){t.user_info=e.accountInfo,t.$app.storage.set("USER_INFO",e.accountInfo)}))},get_frimid:function(){var e=this;this.$app.storage.get("FRIM_ID")&&(this.$app.storage.get("USER_TOKEN")?this.$api.base("post","/userApi/add-firm-user?firmId="+parseInt(this.$app.storage.get("FRIM_ID")),{},{error:!1}).then((function(t){e.get_userinfo(),setTimeout((function(){e.$app.storage.remove("FRIM_ID")}),500),e.$app.popup.alert(t.msg)})).catch((function(t){setTimeout((function(){e.$app.storage.remove("FRIM_ID")}),500)})):t.showModal({title:"未登录",content:"你还未进行登录,请去登录",showCancel:!1,success:function(e){e.confirm&&t.navigateTo({url:"/pages/login/login"})}}))},getDeviceInfo:function(t){var e=this;this.$api.base("post","/chargeApi/checkDevicesBySn",{sn:t},{}).then((function(t){var n=t.device;0!=n.deviceStatus&&255!=n.deviceStatus&&e.$app.url.goto("/pages/terminal/terminal?deviceId="+n.id+"&deviceStatus="+n.deviceStatus)}))},getQueryParams:function(t,e){var n=t.split("?")[1]||"",i={},o=n.split("&");return o.forEach((function(t){var e=t.split("="),n=(0,a.default)(e,2),o=n[0],r=n[1];i[decodeURIComponent(o)]=decodeURIComponent(r||"")})),i[e]},showImg:function(t){return this.$config.url.request+t},goImgLink:function(t){this.$app.url.goto(t.skipUrl)},customerService:function(){var t=this,e=this.$config.customerService;this.$app.act.customerService(e.id,e.url).catch((function(e){console.log(e),t.$app.popup.alert("客服中心失联啦,请联系管理员!")}))},queryPermit:function(){return new Promise((function(e,n){var i={},o=function(){2==Object.keys(i).length&&e(i)};t.getPrivacySetting?t.getPrivacySetting({success:function(t){i.privacy=t.needAuthorization},complete:function(){"boolean"!=typeof i.privacy&&"undefined"!=typeof i.privacy&&(i.privacy=null),o()}}):i.privacy=!1,t.getSetting({success:function(e){i.location=t.getLocation?e.authSetting["scope.userLocation"]:void 0},complete:function(){"boolean"!=typeof i.location&&"undefined"!=typeof i.location&&(i.location=null),o()}})}))},updateLocation:function(){var t=this;this.getLocation().then((function(e){return t.location.value=[e.longitude,e.latitude].join(","),t.getStations(e.longitude,e.latitude),t.$app.storage.set("USER_LOCATION",t.location.value),t.reverseGeocoder([e.latitude,e.longitude].join(","))}))},getLocation:function(){var e=this;return new Promise((function(n,i){t.getLocation?t.getLocation({success:function(t){return n(t)},fail:function(t){console.log(t),console.log("定位失败"),e.getStations("","")},complete:function(){}}):(console.log("微信版本太低,无定位接口可用"),n({longitude:"",latitude:""}))}))},reverseGeocoder:function(t){var e=this;console.log(t);var n=t.split(",")[0],i=t.split(",")[1],o=this.convertGcj02ToBd09(i,n);return t=o.lat+","+o.lng,console.log(t),new Promise((function(n,i){var o=new s.BMapWX({ak:"vtQgaPzonb3H4qeUOWGr53ePcNCsmdMj"});o.regeocoding({location:t,success:function(t){for(var n=t.originalData.result.addressComponent.adcode.substr(0,4),i=0;i0?t.__map(t.banners,(function(e,n){var i=t.__get_orig(e),o=t.showImg(e.pic);return{$orig:i,m0:o}})):null,r=t.__map(t.list.data,(function(e,n){var i=t.__get_orig(e),o=0!==t.user_info.firmType&&null!==t.user_info.firmId&&null!==t.user_info||!e.params.nowPrice?null:e.params.nowPrice.toFixed(4),a=0!==t.user_info.firmType&&null!==t.user_info.firmId&&null!==t.user_info?e.params.firmPrice.toFixed(4):null,r=0!==t.user_info.firmType&&null!==t.user_info.firmId&&null!==t.user_info&&e.params.nowPrice?e.params.nowPrice.toFixed(4):null;return{$orig:i,g2:o,g3:a,g4:r}})),s=t.__map(t.adBanner,(function(e,n){var i=t.__get_orig(e),o=t.showImg(e.picture);return{$orig:i,m1:o}}));t._isMounted||(t.e0=function(e){return t.$app.url.goto("/pages/search/search")},t.e1=function(e){t.scrollLock=!0},t.e2=function(e){t.scrollLock=!1},t.e3=function(e){return t.$app.url.goto("/pages/order/order")},t.e4=function(e){return t.$app.url.goto("/pages/coupon-buy/coupon-buy")},t.e5=function(e){return t.$app.url.goto("/pages/feedback/feedback")},t.e6=function(e,n){var i=arguments[arguments.length-1].currentTarget.dataset,o=i.eventParams||i["event-params"];n=o.item;return t.$app.url.goto(n.jumpPage)},t.e7=function(e){return t.$app.url.goto("/pages/map/map",!1)}),t.$mp.data=Object.assign({},{$root:{s0:n,g0:i,g1:o,l0:a,l1:r,l2:s}})},a=[]}},[["55fb","common/runtime","common/vendor"]]]);