shop-php/public/static/js/pages-select_address-select_address_n.00a35054.js

1 line
16 KiB
JavaScript
Raw Normal View History

2024-03-07 11:01:32 +08:00
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-select_address-select_address_n"],{"77c0":function(t,n,e){var a=e("e97c");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var i=e("4f06").default;i("1b435b95",a,!0,{sourceMap:!1,shadowMode:!1})},9842:function(t,n,e){"use strict";e("7a82");var a=e("4ea4").default;Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;a(e("5530"));e("4e82"),e("b64b"),e("d401"),e("d3b7"),e("25f0"),e("159b"),e("14d9");var i=e("a126"),o=e("7a69"),r=e("f89e"),u=(e("28e0"),{data:function(){return{tabsList:[{name:"地图定位"},{name:"泸州区县"}],current:0,latitude:"28.87",longitude:"105.44",markers:{id:1,longitude:"28.87",latitude:"105.44",iconPath:"https://lihai001.oss-cn-chengdu.aliyuncs.com/def/cbbd5202311241523412538.png",width:28,height:28},locationInfo:{},town:"",street_id:"",street:"",areaList:[],streetList:[],mapList:{},area_change:"",street_change:""}},onLoad:function(t){this.getLoaction(),this.loadArea()},onShow:function(){},computed:{mapKey:function(){return Object.keys(this.mapList).sort()}},methods:{changeCurrent:function(t){this.current=t.index},getLoaction:function(){var t=this;this.street="定位中",this.locationInfo={},this.locationInfo.formatted_addresses={},this.locationInfo.formatted_addresses.recommend="定位中",uni.setStorageSync("RejectTarget",!1),uni.getLocation({type:"gcj02",success:function(n){var e,a;e=n.latitude.toString(),a=n.longitude.toString(),t.latitude=n.latitude.toFixed(6),t.longitude=n.longitude.toFixed(6),t.$store.commit("setLocation",{lat:n.latitude.toFixed(6),long:n.longitude.toFixed(6)}),(0,i.getGeocoder)({lat:e,long:a}).then((function(n){t.locationInfo=n.data,t.town=n.data.address_reference.town.title,t.street_id=n.data.address_reference.town.id,t.street=n.data.address_reference.town.title})).catch((function(n){uni.showToast({title:n,icon:"none"}),t.street="定位失败"}))},fail:function(n){t.isshow=!1,(0,r.Toast)("定位失败,请检查定位权限是否开启"),t.street="定位失败",t.locationInfo.formatted_addresses.recommend="定位失败"}})},reGetLocation:function(){this.getLoaction()},loadArea:function(){var t=this;(0,o.getArea)({city_code:510500}).then((function(n){t.areaList=n.data,t.changeArea(t.areaList[0])}))},loadStreet:function(t){var n=this;this.street_change="",(0,o.getStreet)({area_code:t}).then((function(t){n.streetList=t.data,n.initPinyin()}))},initPinyin:function(){var t=this;this.mapList={},this.streetList.forEach((function(n){var e,a=null===(e=n.pinyin)||void 0===e?void 0:e.toUpperCase();a=a||"#",t.mapList[a]||(t.mapList[a]=[]),t.mapList[a].push(n)}))},changeArea:function(t){this.area_change=t.code,this.loadStreet(this.area_change)},changeStreet:function(t){var n=this;uni.navigateBack({success:function(){uni.$emit("changeAddress",{area:n.area_change,street:t})}})},handleMapTap:function(t){return(0,r.Toast)("H5暂不支持选择坐标")},submitAddress:function(){try{this.town=this.locationInfo.address_reference.town.title,this.street_id=this.locationInfo.address_reference.town.id,this.street=this.locationInfo.address_reference.town.title;var t={area:this.locationInfo.ad_info.adcode,street:{name:this.street,code:this.street_id},latitude:this.latitude,longitude:this.longitude};uni.navigateBack({success:function(){uni.$emit("changeAddress",t)}})}catch(n){return(0,r.Toast)("地址有误,请重新选择")}},searchMap:function(){uni.request({url:"https://restapi.amap.com/v3/place/text?keywords=北京大学&city=beijing&offset=20&page=1&key=0799f37420c0784f1e6cba230a68bdb1&extensions=all",success:function(t){},fail:function(t){}})}},onPullDownRefresh:function(){uni.stopPullDownRefresh()}});n.default=u},a126:function(t,n,e){"use strict";e("7a82");var a=e("4ea4").default;Object.defineProperty(n,"__esModule",{value:!0}),n.addCartApi=function(t){return o.default.post("v2/micropay/addCart",t)},n.agreeiness=function(t){return o.default.get("business/agree",t,{noAuth:!0})},n.arrivalNoticeApi=function(t){return o.default.post("store/product/increase_take",t)},n.b