1 |
- require('../../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["mine/pages/files/maps"],{"4cf5":function(t,a,i){"use strict";(function(t){var n=i("4ea4");Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var c=n(i("dd84")),s=(n(i("6c08")),n(i("be45"))),o={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()},onShow:function(){this.setflag&&(this.setflag=!1,this.getlocationadr())},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)},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}}]}},methods:{getBlur:function(){},getSureFn:function(){var e={address:this.address,lng:this.center.lng,lat:this.center.lat};t.$emit("refreshaddr",e),t.navigateBack({delta:1})},getNextFn: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&&c.default.getInputtips({keywords:t.searchtxt,city:"全国",citylimit:!0,success:function(e){if(e.tips.length>0){var a=[],i=e.tips;for(var n in i)if(i[n].location&&i[n].location.length>0){var c=i[n].location.split(","),s={name:i[n].name,addr:i[n].district+i[n].address,lng:c[0],lat:c[1]};a.push(s)}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}}]},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}}]},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}}]},fail:function(t){console.log("获取当前地图中心的经纬度2",t)}})},getCity:function(t,e,a){var i=this;i.location="".concat(e,",").concat(t),c.default.getRegeo({location:i.location,success:function(n){if(i.address="",i.address=n[0].regeocodeData.formatted_address,a&&1==a){var c={lng:e,lat:t,address:i.address};s.default.setUxLocation(c)}},fail:function(t){console.log(t)}})},getlocationadr:function(){var t=this;s.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};s.default.setUxLocation(a)}}))},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=o}).call(this,i("543d")["default"])},6172:function(t,e,a){},"83b5":function(t,e,a){"use strict";(function(t,e){var i=a("4ea4");a("11d3"),a("5c17");i(a("66fd"));var n=i(a("9250"));t.__webpack_require_UNI_MP_PLUGIN__=a,e(n.default)}).call(this,a("bc2e")["default"],a("543d")["createPage"])},"853c":function(t,e,a){"use strict";var i=a("afd4"),n=a.n(i);n.a},9250:function(t,e,a){"use strict";a.r(e);var i=a("d4c1"),n=a("e3fb");for(var c in n)["default"].indexOf(c)<0&&function(t){a.d(e,t,(function(){return n[t]}))}(c);a("853c"),a("be3c");var s=a("f0c5"),o=Object(s["a"])(n["default"],i["b"],i["c"],!1,null,"655ee830",null,!1,i["a"],void 0);e["default"]=o.exports},afd4:function(t,e,a){},be3c:function(t,e,a){"use strict";var i=a("6172"),n=a.n(i);n.a},d4c1: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=[]},e3fb:function(t,e,a){"use strict";a.r(e);var i=a("4cf5"),n=a.n(i);for(var c in i)["default"].indexOf(c)<0&&function(t){a.d(e,t,(function(){return i[t]}))}(c);e["default"]=n.a}},[["83b5","common/runtime","common/vendor","mine/common/vendor"]]]);
|