bztang-admin/addons/yun_shop/static/app/js/chunk-696802d8.03f9c169.js

1 line
4.2 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-696802d8"],{"448c7":function(e,t,i){var a=i("24fb");t=a(!1),t.push([e.i,".delivery_info .detail_a[data-v-b518dcc4]{padding:1.25rem 0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;font-size:1rem;font-weight:700}.delivery_info .detail_a icon[data-v-b518dcc4]{margin-right:.3125rem}",""]),e.exports=t},"55b2":function(e,t,i){"use strict";i.r(t);var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"delivery_info"},[i("c-title",{attrs:{hide:!1,text:"配送范围"}}),i("div",{staticClass:"detail_a"},[i("icon",{staticClass:"iconfont icon-service_o"}),i("div",{staticClass:"span"},[e._v("配送范围")])],1),i("div",{directives:[{name:"show",rawName:"v-show",value:e.shopList.length>0,expression:"shopList.length > 0"}]},[i("div",{staticStyle:{width:"100%",height:"18.75rem"},attrs:{id:"shopMap"}})]),i("div",{directives:[{name:"show",rawName:"v-show",value:"1"===e.shipAreaType||1===e.shipAreaType,expression:"shipAreaType === '1' || shipAreaType === 1"}]},[i("div",{staticStyle:{width:"100%",height:"18.75rem"},attrs:{id:"deliveryMap"}})])],1)},o=[],s=(i("a9e3"),i("a630"),i("3ca3"),i("a4d3"),i("e01a"),i("b64b"),i("d81d"),i("14d9"),i("6968")),n=i("024c"),r=i.n(n),d={components:{cTitle:s["a"]},data:function(){return{goodsId:"",shipAreaType:"",city:"",longitude:"",latitude:"",distance:0,shopList:[],geoJSON:[],centerPath:[],shipAreas:[]}},activated:function(){this.goodsId=Number(this.$route.query.goodsId),this.city=this.$route.query.city},created:function(){},mounted:function(){this.getRule()},methods:{setshopMap:function(){var e=Array.from(this.centerPath),t=new r.a.Map("shopMap",{center:e,zoom:14}),i=new r.a.Marker({icon:"//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png",position:e});i.setMap(t);var a=new r.a.Circle({center:new r.a.LngLat(e[0],e[1]),radius:this.distance,strokeColor:"#F33",strokeOpacity:1,strokeWeight:3,fillColor:"#ee2200",fillOpacity:.35});t.add(a),t.setFitView([a])},setDeliveryMap:function(){var e=new r.a.Map("deliveryMap",{center:[this.longitude,this.latitude],zoom:10}),t=new r.a.GeoJSON({geoJSON:Array.from(this.geoJSON),getPolygon:function(e,t){return new r.a.Polygon({path:t,fillOpacity:.35,strokeColor:"white",fillColor:"#ee2200"})}});e.add(t)},getRule:function(){var e=this,t={city:this.$route.query.city,goods_id:this.$route.query.goodsId};$http.get("plugin.yz-supply-cake.frontend.index.index.getRule",t,"正在获取").then((function(t){if(1==t.result){var i=t.data;if(200!==i.code)return Toast(i.data.msg),void(e.description=i.data.msg);var a=i.data;e.description=null===a||void 0===a?void 0:a.description,e.shipAreaType=null===a||void 0===a?void 0:a.ship_area_type;var o=(null===a||void 0===a?void 0:a.shop)||[];if("1"===e.shipAreaType||1===e.shipAreaType){var s,n,r=JSON.parse(null===a||void 0===a?void 0:a.ship_areas)||{},d=r.areas||[];e.geoJSON=e.ForDataChange(d),e.shipAreas=r,e.latitude=null===(s=d[0])||void 0===s||null===(s=s.points[0])||void 0===s?void 0:s.lat,e.longitude=null===(n=d[0])||void 0===n||null===(n=n.points[0])||void 0===n?void 0:n.lng,e.setDeliveryMap()}if("2"===e.shipAreaType||2===e.shipAreaType){var l,p,c=JSON.parse(null===a||void 0===a?void 0:a.ship_rule)||{},u=c.non_default||{},h="";for(var v in u)h=u[v].distance;e.distance=1e3*h,e.shopList=o,e.centerPath[0]=null===(l=o[0])||void 0===l?void 0:l.lng,e.centerPath[1]=null===(p=o[0])||void 0===p?void 0:p.lat,e.shopList.length>0&&e.setshopMap()}}else e.$dialog.alert({message:t.msg})}),(function(e){}))},ForDataChange:function(e){var t=[],i=[];return e.map((function(e,a){var o=e.points;for(var s in i.push([]),o)o[s].lng&&i[a].push([o[s].lng,o[s].lat]);t.push({type:"Feature",properties:{name:"",risk:"",landType:"",landId:""},geometry:{type:"Polygon",coordinates:[i[a]]}})})),t}}},l=d,p=l,c=(i("9726"),i("2877")),u=Object(c["a"])(p,a,o,!1,null,"b518dcc4",null);t["default"]=u.exports},"7f0d":function(e,t,i){var a=i("448c7");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);var o=i("499e").default;o("6cbb6edb",a,!0,{sourceMap:!1,shadowMode:!1})},9726:function(e,t,i){"use strict";i("7f0d")}}]);