1 |
- require('../../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["mine/pages/files/map"],{"0d1e":function(t,e,a){"use strict";var i=a("31ba"),n=a.n(i);n.a},"2be2":function(t,a,i){"use strict";(function(t){var n=i("4ea4");Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var s=n(i("dd84")),o=n(i("be45")),c={data:function(){return{serimg:i("0a84"),adrimg:i("2118"),mapimg:i("acbe"),center:{lng:"",lat:""},mapflag:!1,address:"",searchtxt:"",type:"add",placeSearchComponent:"",autoCompleteComponent:"",map:"",covers:[{id:0,latitude:"",longitude:"",width:68,height:68,iconPath:i("acbe"),anchor:{x:.5,y:.5}}],mapheight:0,mapContext:"",searchList:[],focus:!1,location:"",setflag:!1}},onReady:function(){this.getcreateMap()},onLoad:function(t){"update"==t.type||t.address?(this.type="update",this.center.lng=t.lng,this.center.lat=t.lat,this.address=t.address):this.type="add",t.fromurl&&(this.fromurl=t.fromurl)},onShow:function(){this.setflag&&(this.setflag=!1,this.getlocationadr())},mounted:function(){if(this.getinfo(),"add"==this.type)this.getlocationadr();else{var t=this.center.lng,e=this.center.lat;this.covers=[],this.covers=[{id:1,latitude:e,longitude:t,width:68,height:68,iconPath:this.mapimg,anchor:{x:.5,y:.5}}],this.getCity(e,t)}},methods:{getlocationadr:function(){var t=this;o.default.getLocation((function(e){if(-1==e)t.setflag=!0;else{t.center.lng=e.lng,t.center.lat=e.lat,t.address=e.address,t.covers=[],t.covers=[{id:4,width:68,height:68,latitude:e.lat,longitude:e.lng,iconPath:t.mapimg,anchor:{x:.5,y:.5}}];var a={lng:e.lng,lat:e.lat,address:e.address};o.default.setUxLocation(a)}}))},getSureFn:function(){var e={address:this.address,lng:this.center.lng,lat:this.center.lat};t.$emit("refreshaddr",e),t.navigateBack({delta:1})},searchKeyword:function(){var t=this;this.searchtxt&&s.default.getInputtips({keywords:t.searchtxt,city:"全国",citylimit:!0,success:function(e){if(console.log(e,124),e.tips.length>0){var a=[],i=e.tips;for(var n in i)if(i[n].location&&i[n].location.length>0){var s=i[n].location.split(","),o={name:i[n].name,addr:i[n].district+i[n].address,lng:s[0],lat:s[1]};a.push(o)}t.searchList=a}else t.searchList=[]},fail:function(e){t.searchList=[],console.log("fail-search",e)}})},handleAddrClick:function(t){var e=t.lng,a=t.lat;this.center.lng=e,this.center.lat=a,this.covers=[],this.covers=[{id:2,width:68,height:68,latitude:t.lat,longitude:t.lng,iconPath:this.mapimg,anchor:{x:.5,y:.5}}],this.address=t.addr+t.name,this.searchList=[],this.getCity(a,e)},richNodes:function(t){return[{children:[{type:"text",attrs:{class:"wrap_text"},text:t.name.substring(0,t.name.indexOf(this.searchtxt))},{type:"text",attrs:{class:"wrap_texts"},text:this.searchtxt},{type:"text",attrs:{class:"wrap_text"},text:t.name.substring(t.name.indexOf(this.searchtxt)+this.searchtxt.length)}]}]},getinfo:function(){var e=this;t.getSystemInfo({success:function(t){e.mapheight=t.windowHeight}})},getcreateMap:function(){this.mapContext=t.createMapContext("container",this)},onClcikImgMap:function(t){var e=t.detail.longitude,a=t.detail.latitude;this.center.lng=e,this.center.lat=a,this.covers=[],this.covers=[{id:3,width:68,height:68,latitude:t.detail.latitude,longitude:t.detail.longitude,iconPath:this.mapimg,anchor:{x:.5,y:.5}}],this.getCity(a,e)},getCenterLanLat:function(){var t=this;this.mapContext.getCenterLocation({type:"gcj02",success:function(a){t.center.lng=a.longitude,t.center.lat=a.latitude,t.covers=[],t.covers=[{id:4,width:68,height:68,latitude:e.detail.latitude,longitude:e.detail.longitude,iconPath:t.mapimg,anchor:{x:.5,y:.5}}],t.getCity(a.latitude,a.longitude)},fail:function(t){console.log("获取当前地图中心的经纬度2",t)}})},getCity:function(t,e,a){var i=this;i.location="".concat(e,",").concat(t),s.default.getRegeo({location:i.location,success:function(n){if(i.address="",i.address=n[0].regeocodeData.formatted_address,a&&1==a){var s={lng:e,lat:t,address:i.address};o.default.setUxLocation(s)}},fail:function(t){console.log(t)}})},getlocation:function(){var e=this;t.getLocation({type:"gcj02",geocode:!0,success:function(t){e.center.lng=t.longitude,e.center.lat=t.latitude,e.covers=[],e.covers=[{id:4,width:68,height:68,latitude:t.latitude,longitude:t.longitude,iconPath:e.mapimg,anchor:{x:.5,y:.5}}],e.getCity(t.latitude,t.longitude,1)},fail:function(e){t.showToast({title:"获取定位失败"})}})},refresh:function(t){this.getlocation()}}};a.default=c}).call(this,i("543d")["default"])},"31ba":function(t,e,a){},"47a6":function(t,e,a){"use strict";(function(t,e){var i=a("4ea4");a("11d3"),a("5c17");i(a("66fd"));var n=i(a("c91d"));t.__webpack_require_UNI_MP_PLUGIN__=a,e(n.default)}).call(this,a("bc2e")["default"],a("543d")["createPage"])},a98a:function(t,e,a){"use strict";a.d(e,"b",(function(){return i})),a.d(e,"c",(function(){return n})),a.d(e,"a",(function(){}));var i=function(){var t=this,e=t.$createElement,a=(t._self._c,t.__map(t.searchList,(function(e,a){var i=t.__get_orig(e),n=t.richNodes(e);return{$orig:i,m0:n}})));t.$mp.data=Object.assign({},{$root:{l0:a}})},n=[]},c91d:function(t,e,a){"use strict";a.r(e);var i=a("a98a"),n=a("fe31");for(var s in n)["default"].indexOf(s)<0&&function(t){a.d(e,t,(function(){return n[t]}))}(s);a("0d1e");var o=a("f0c5"),c=Object(o["a"])(n["default"],i["b"],i["c"],!1,null,"019a4410",null,!1,i["a"],void 0);e["default"]=c.exports},fe31:function(t,e,a){"use strict";a.r(e);var i=a("2be2"),n=a.n(i);for(var s in i)["default"].indexOf(s)<0&&function(t){a.d(e,t,(function(){return i[t]}))}(s);e["default"]=n.a}},[["47a6","common/runtime","common/vendor","mine/common/vendor"]]]);
|