星油车管小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

10 lines
6.6 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/ChargingStationMap/ChargingStationMap"],{"19d8":function(t,e,n){"use strict";n.r(e);var i=n("ef0f"),a=n.n(i);for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);e["default"]=a.a},"29ee":function(t,e,n){"use strict";n.r(e);var i=n("640c"),a=n("19d8");for(var r in a)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(r);n("f548");var o=n("f0c5"),s=Object(o["a"])(a["default"],i["b"],i["c"],!1,null,"45f7f06c",null,!1,i["a"],void 0);e["default"]=s.exports},"640c":function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){}));var i=function(){var t=this,e=t.$createElement,n=(t._self._c,t.__map(t.markers,(function(e,n){var i=t.__get_orig(e),a=t.tool.getnum(e.totalFee);return{$orig:i,g0:a}})));t.$mp.data=Object.assign({},{$root:{l0:n}})},a=[]},"70f9":function(t,e,n){},ef0f:function(t,e,n){"use strict";(function(t){var i=n("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=i(n("2eee")),r=i(n("c973")),o=i(n("448a")),s=i(n("9523")),c=n("fdba"),u=i(n("2303")),l=i(n("9e2b"));function f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}var d={name:"ChargingStationMap",components:{stationItem:function(){n.e("components/stationItem/stationItem").then(function(){return resolve(n("6815"))}.bind(null,n)).catch(n.oe)}},props:{pageData:{type:Object,default:function(){return null}}},data:function(){return{showLabelLength:30,standbyMarkers:[],markersTimer:null,stationData:null,circles:[],getListTimer:null,location:null,markers:[],mapContext:null,isGetRegion:!1}},created:function(){this.init()},methods:{onshow:function(){var t=this;this.mapContext.getCenterLocation({success:function(e){var n=e.latitude,i=e.longitude;t.getRegion({detail:{centerLocation:{latitude:n,longitude:i}}})}})},mapTap:function(){this.stationData=null},getDetails:function(t){var e=this;u.default.getSiteDetails(t).then((function(t){t.data=[t.data],e.tool.difTags(t);var n=new e.tool.Anticorrosive(t,c.page);e.stationData=n.list[0]}))},callouttap:function(t){try{var e=this.standbyMarkers.find((function(e){return e.id==t.detail.markerId}))["siteId"];this.getDetails({id:e,stationLat:this.location.latitude,stationLng:this.location.longitude})}catch(t){}},filterMarks:function(t){if(this.markers.length){var e=this.markers.map((function(t){return t.siteId}));return this.markers.length>=t.length?t.filter((function(t){return!e.includes(t.id)})):t.filter((function(t){return e.includes(t.id)}))}return null},getRegion:function(t){var e=this,n=this;return new Promise((function(i,a){e.mapContext.getRegion({success:function(e){var a=l.default.getDistance(e.northeast.latitude,e.northeast.longitude,e.northeast.latitude,e.southwest.longitude);n.$emit("update:pageData",Object.assign(n.pageData,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(Object(n),!0).forEach((function(e){(0,s.default)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({ranger:a/2/1e3+5},t.detail.centerLocation))),i("success")},fail:function(t,e){a(JSON.stringify(t))}})}))},regionchange:function(t){var e=this;"end"==t.type&&this.getRegion(t).then((function(t){e.getList(1500)}))},markertap:function(t){console.log(t)},locationProcessing:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(e&&e.length){var n=e.map((function(n,i){var a=Number("".concat(n.id.substr(n.id.length-9,n.id.length))),r={siteId:n.id,id:a,width:20,height:20,latitude:n.stationLat,longitude:n.stationLng,iconPath:"../../static/tt.png",customCallout:{anchorY:0,anchorX:0,display:"ALWAYS"}},o=Object.assign(JSON.parse(JSON.stringify(n)),r);return e.length>t.showLabelLength&&delete o.customCallout,o}));return n}return[]},addMarkers:function(t){this.mapContext.addMarkers({markers:t,clear:!0,success:function(){console.log("添加成功")},fail:function(t){console.log(t,"添加失败")}})},WeightlessnessReduction:function(t){return(0,o.default)(new Set(t))},getList:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3;this.getListTimer&&(clearTimeout(this.getListTimer),this.getListTimer=null),this.getListTimer=setTimeout((function(){t.showLoading({title:"电站加载中",mask:!0}),u.default.getMapStations(e.pageData).then((function(n){console.log(n,"电站列表"),clearTimeout(e.markersTimer),e.markersTimer=null,e.markersTimer=setTimeout((function(){var i=e.locationProcessing(n.data);e.removeMarkers(i),e.standbyMarkers=i,e.standbyMarkers.length>e.showLabelLength?e.addMarkers(e.standbyMarkers):e.markers=e.standbyMarkers,t.hideLoading()}),500)}))}),n)},removeMarkers:function(t){var e=this.standbyMarkers.length?this.standbyMarkers.map((function(t){return String(t.id)})):[],n=t.length?t.map((function(t){return String(t.id)})):[],i=e.filter((function(t){return!n.includes(t)}));this.mapContext.removeMarkers({markerIds:i})},getPosition:function(){var e=this;return(0,r.default)(a.default.mark((function n(){var i;return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:console.log("位置更行"),i=t.getStorageSync("location"),e.location=i?t.getStorageSync("location"):{longitude:116.38,latitude:39.9};case 3:case"end":return n.stop()}}),n)})))()},moveToLocation:function(t,e){var n=this;setTimeout((function(){n.mapContext.moveToLocation({longitude:t,latitude:e,success:function(){console.log("移动成功")},fail:function(t){console.log(t,"移动失败")}})}),500)},init:function(){var e=this;return(0,r.default)(a.default.mark((function n(){return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:e,e.mapContext=t.createMapContext("map_Id",e),e.$nextTick((function(){e.onshow()}));case 3:case"end":return n.stop()}}),n)})))()}}};e.default=d}).call(this,n("543d")["default"])},f548:function(t,e,n){"use strict";var i=n("70f9"),a=n.n(i);a.a}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
'components/ChargingStationMap/ChargingStationMap-create-component',
{
'components/ChargingStationMap/ChargingStationMap-create-component':(function(module, exports, __webpack_require__){
__webpack_require__('543d')['createComponent'](__webpack_require__("29ee"))
})
},
[['components/ChargingStationMap/ChargingStationMap-create-component']]
]);