index.js 10 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/index"],{"400b":function(t,e,n){},7135:function(t,e,n){"use strict";n.r(e);var o=n("b73f"),a=n.n(o);for(var i in o)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(i);e["default"]=a.a},"7efc":function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return o}));var o={axBody:function(){return n.e("components/ax-body/ax-body").then(n.bind(null,"e199"))},axPopup:function(){return n.e("components/ax-popup/ax-popup").then(n.bind(null,"49c3"))},appNavigation:function(){return Promise.all([n.e("common/vendor"),n.e("components/app-navigation/app-navigation")]).then(n.bind(null,"bb86"))}},a=function(){var t=this,e=t.$createElement,n=(t._self._c,t.__get_style([t.StyleSheet])),o=null!=t.payment_msg?(t.payment_msg.maspAmount+t.payment_msg.maspRealAmount).toFixed(2):null,a=t.banners.length;t._isMounted||(t.e0=function(e){return t.$app.url.goto("/subPackages/other/search/search")},t.e1=function(e){return t.$app.url.goto("/pages/map/map",!1)},t.e2=function(e){t.scrollLock=!0},t.e3=function(e){t.scrollLock=!1},t.e4=function(e){return t.$app.url.goto("/subPackages/coupon/coupon-buy/coupon-buy")},t.e5=function(e){return t.$app.url.goto("/subPackages/order/order/order")},t.e6=function(e){return t.$app.url.goto("/subPackages/other/feedback/feedback")},t.e7=function(e,n){var o=arguments[arguments.length-1].currentTarget.dataset,a=o.eventParams||o["event-params"];n=a.item;return t.$app.url.goto(n.jumpPage)}),t.$mp.data=Object.assign({},{$root:{s0:n,g0:o,g1:a}})},i=[]},b353:function(t,e,n){"use strict";var o=n("400b"),a=n.n(o);a.a},b73f:function(t,e,n){"use strict";(function(t){var o=n("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=o(n("7eb4")),i=o(n("34cf")),s=o(n("ee10")),r=n("7907"),c={onLoad:function(t){var e=this;return(0,s.default)(a.default.mark((function n(){var o,i,s;return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,e.queryPermit();case 2:o=n.sent,o.privacy?e.privacy.visible=!0:!0===o.location?e.updateLocation():!1===o.location?(e.location.visible=!0,e.updateLocation()):void 0===o.location&&e.updateLocation(),t.hasOwnProperty("q")&&t.q&&(i=decodeURIComponent(t.q),console.log("url:"+i),s=e.getQueryParams(i,"connectorCode"),console.log("connectorCode:"+s),s&&e.getDeviceInfo(s)),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.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,pageNum: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:"https://national-motion.oss-cn-beijing.aliyuncs.com/20251230/7eda17a802dd49e39f8c6bb3d0f1aa4e.jpg",desc:"用券充天天都享会员价"}},onShareTimeline:function(){return{title:"用券充天天都享会员价",path:"/pages/index/index",imageUrl:"https://national-motion.oss-cn-beijing.aliyuncs.com/20251230/7eda17a802dd49e39f8c6bb3d0f1aa4e.jpg"}},methods:{closeAd:function(){this.closeAdvertising=!0,this.$refs.filter.close(),this.$app.storage.set("AD_STATUS",this.closeAdvertising)},get_frimid:function(){var e=this;this.$app.storage.get("FRIM_ID")&&(this.$app.storage.get("USER_INFO")?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("get","/applet/v1/station/connector/detail",{connectorCode:t},{}).then((function(t){0!=t.data.status&&255!=t.data.status&&e.$app.url.goto("/subPackages/charging/terminal/terminal?deviceId="+t.data.connectorCode+"&deviceStatus="+t.data.status)}))},getQueryParams:function(t,e){var n=t.split("?")[1]||"",o={},a=n.split("&");return a.forEach((function(t){var e=t.split("="),n=(0,i.default)(e,2),a=n[0],s=n[1];o[decodeURIComponent(a)]=decodeURIComponent(s||"")})),o[e]},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 o={},a=function(){2==Object.keys(o).length&&e(o)};t.getPrivacySetting?t.getPrivacySetting({success:function(t){o.privacy=t.needAuthorization},complete:function(){"boolean"!=typeof o.privacy&&"undefined"!=typeof o.privacy&&(o.privacy=null),a()}}):o.privacy=!1,t.getSetting({success:function(e){o.location=t.getLocation?e.authSetting["scope.userLocation"]:void 0},complete:function(){"boolean"!=typeof o.location&&"undefined"!=typeof o.location&&(o.location=null),a()}})}))},updateLocation:function(){var t=this;this.getLocation().then((function(e){return t.location.value=[e.longitude,e.latitude].join(","),t.get_userinfo(),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,o){t.getLocation?t.getLocation({success:function(t){return n(t)},fail:function(t){console.log(t),console.log("定位失败"),e.getStations("",""),e.get_userinfo()}}):(console.log("微信版本太低,无定位接口可用"),n({longitude:"",latitude:""}))}))},reverseGeocoder:function(t){var e=this;console.log(t);var n=t.split(",")[0],o=t.split(",")[1],a=this.convertGcj02ToBd09(o,n);return t=a.lat+","+a.lng,console.log(t),new Promise((function(n,o){var a=new r.BMapWX({ak:"vtQgaPzonb3H4qeUOWGr53ePcNCsmdMj"});a.regeocoding({location:t,success:function(t){for(var n=t.originalData.result.addressComponent.adcode.substr(0,4),o=0;o<e.city.data.length;o++)if(e.city.data[o].areaCode==n){e.city.index=o;break}console.log(t)},fail:function(t){console.log(t)}})}))},getBanners:function(){var t=this;this.$api.base("get","/applet/v1/homePage/getBannerList/1",{},{}).then((function(e){t.banners=e.data}))},getAdswiper:function(){var t=this;this.$api.base("get","/applet/v1/homePage/getAdvertisingList",{},{}).then((function(e){t.adBanner=e.data}))},convertBdToTx:function(t,e){var n=52.35987755982988,o=t-.0065,a=e-.006,i=Math.sqrt(o*o+a*a)-2e-5*Math.sin(a*n),s=Math.atan2(a,o)-3e-6*Math.cos(o*n),r=i*Math.cos(s),c=i*Math.sin(s);return{lng:r,lat:c}},getStations:function(t,e){var n=this;this.$api.base("post","/applet/v1/homePage/getStationInfoPage",{pageNum:this.pageNum,pageSize:10,sortType:this.sorts.index+1,longitude:t,latitude:e,userId:this.$app.storage.get("USER_INFO")?parseInt(this.$app.storage.get("USER_INFO").appletUserId):0},{}).then((function(t){1==n.pageNum?n.list.data=t.data.list:n.list.data=n.list.data.concat(t.data.list)}))},get_userinfo:function(){var t=this;this.$api.base("get","/applet/v1/user/getUserInfo",{},{error:!1}).then((function(e){t.user_info=e.data,t.$app.storage.set("USER_INFO",e.data)}))},setAppNavigationHeight:function(){var e=this;this.$nextTick((function(){t.createSelectorQuery().in(e).select("#app-navigation").boundingClientRect((function(t){e.appNavigationHeight=t.height})).exec()}))},setListHeight:function(){var e=this;this.$app.act.selectorQuery(this,"#list-box,#roller",!0).then((function(n){var o=t.getWindowInfo(),a=n.find((function(t){return"roller"==t.id})),i=n.find((function(t){return"list-box"==t.id}));e.list.height=o.windowHeight-i.top-e.appNavigationHeight+a.height}))},bannerLoadCompleted:function(){this.setListHeight()},changeSort:function(t){this.sorts.index=t,this.pageNum=1,this.getStations(this.location.value.split(",")[0],this.location.value.split(",")[1])},scrolltolower:function(){console.log("到底"),this.pageNum++,this.getStations(this.location.value.split(",")[0],this.location.value.split(",")[1])},gotoSiteDetail:function(t){this.$app.url.goto("/subPackages/charging/new-site/new-site?item="+JSON.stringify(t))},topage_coupon:function(){var t=this.payment_msg.realPredictServiceCost+this.payment_msg.maspAmount;this.$app.url.goto("/subPackages/coupon/coupon-buy/coupon-buy?payment="+t)},agreePrivacyAuthorization:function(){this.privacy.visible=!1,this.updateLocation()},openPrivacyContract:function(){t.openPrivacyContract()},refusePrivacy:function(){this.privacy.visible=!1},convertGcj02ToBd09:function(t,e){var n=52.35987755982988,o=Math.sqrt(t*t+e*e)+2e-5*Math.sin(e*n),a=Math.atan2(e,t)+3e-6*Math.cos(t*n),i=o*Math.cos(a)+.0065,s=o*Math.sin(a)+.006;return{lng:i,lat:s}}}};e.default=c}).call(this,n("df3c")["default"])},c7f0:function(t,e,n){"use strict";(function(t,e){var o=n("47a9");n("6a42");o(n("3240"));var a=o(n("e213"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(a.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])},e213:function(t,e,n){"use strict";n.r(e);var o=n("7efc"),a=n("7135");for(var i in a)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(i);n("b353");var s=n("828b"),r=Object(s["a"])(a["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);e["default"]=r.exports}},[["c7f0","common/runtime","common/vendor"]]]);