| 1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-0fb789b6"],{"5cf7":function(e,t,s){"use strict";var a=s("9ab4"),i=s("0463"),r=s("1b40");let n=class extends r.e{constructor(){super(...arguments),this.options=i.a}get areaValue(){return[this.province,this.city,this.district]}set areaValue(e){this.$emit("update:province",e[0]),this.$emit("update:city",e[1]),this.$emit("update:district",e[2])}};Object(a.a)([Object(r.c)()],n.prototype,"province",void 0),Object(a.a)([Object(r.c)()],n.prototype,"city",void 0),Object(a.a)([Object(r.c)()],n.prototype,"district",void 0),Object(a.a)([Object(r.c)({default:"380px"})],n.prototype,"width",void 0),n=Object(a.a)([r.a],n);var o=n,c=s("2877"),l=Object(c.a)(o,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"area-select"},[s("el-cascader",{style:{width:e.width},attrs:{options:e.options},model:{value:e.areaValue,callback:function(t){e.areaValue=t},expression:"areaValue"}})],1)}),[],!1,null,null,null);t.a=l.exports},6146:function(e,t,s){"use strict";s.r(t);s("14d9"),s("0643"),s("4e3e"),s("a573");var a=s("9ab4"),i=s("1b40"),r=s("82fc"),n=s("5cf7"),o=s("b3ad"),c=s("4201"),l=s("6ddb");const d=e=>new Promise((t,s)=>{const a=document.getElementById(e);if(a)return t(a);try{const a=document.createElement("script");a.setAttribute("id",e),a.setAttribute("src",e),document.body.append(a);("onload"in a?function(e){return new Promise((t,s)=>{e.onload=function(){this.onerror=this.onload=null,t(e)},e.onerror=function(){this.onerror=this.onload=null,s()}})}:function(e){return new Promise((t,s)=>{e.onreadystatechange=function(){"loaded"!==this.readyState&&"complete"!==this.readyState||(this.onreadystatechange=null,t(e))}})})(a).then(()=>t(a)).catch(()=>s())}catch(e){s(e)}});var m=s("d142");let u=class extends i.e{constructor(){super(...arguments),this.mode=c.g.ADD,this.identity=null,this.form={name:"",image:"",contact:"",mobile:"",province:"",city:"",district:"",address:"",longitude:"",latitude:"",business_start_time:"",business_end_time:"",weekdays:"",status:1,remark:""},this.businessTime=[(new Date).setHours(6,0,0),(new Date).setHours(18,0,0)],this.weekdayChecked=[],this.weekdayList=[{key:1,label:"周一"},{key:2,label:"周二"},{key:3,label:"周三"},{key:4,label:"周四"},{key:5,label:"周五"},{key:6,label:"周六"},{key:7,label:"周天"}],this.rules={name:[{required:!0,message:"请输入门店名称",trigger:["blur","change"]}],image:[{required:!0,message:"请选择门店LOGO",trigger:["blur","change"]}],contact:[{required:!0,message:"请输入联系人",trigger:["blur","change"]}],mobile:[{required:!0,message:"请输入联系电话",trigger:["blur","change"]}],province:[{required:!0,message:"请选择门店地址",trigger:["blur","change"]}],address:[{required:!0,message:"请输入详细地址",trigger:["blur","change"]}],weekdays:[{required:!0,message:"请选择营业周天",trigger:["blur","change"]}],status:[{required:!0,message:"请选择门店状态",trigger:["blur","change"]}],business_start_time:[{required:!0,message:"请选择营业时段",trigger:["blur","change"]}]},this.tencentMap=void 0,this.markerLayer=void 0}get pageTitle(){switch(this.mode){case c.g.ADD:return"新增自提门店";case c.g.EDIT:return"编辑自提门店"}}onSubmit(e){this.$refs[e].validate(e=>{if(e)switch(this.mode){case c.g.ADD:return this.handleAdd();case c.g.EDIT:return this.handleEdit()}})}handleAdd(){const e=this.form;Object(r.b)(e).then(()=>{setTimeout(()=>this.$router.go(-1),500)})}handleEdit(){const e=this.form,t=this.identity;Object(r.e)({...e,id:t}).then(()=>{setTimeout(()=>this.$router.go(-1),500)})}initFormDataForEdit(){return new Promise((e,t)=>{Object(r.d)({id:this.identity}).then(t=>{Object.keys(t).map(e=>{this.$set(this.form,e,t[e])}),this.weekdayChecked=t.weekdays.split(",").map(e=>Number(e));const s=(new Date).toDateString(),a=Object(l.i)(Date.parse(s),"yyyy-mm-dd");this.businessTime=[new Date(a+" "+t.business_start_time),new Date(a+" "+t.business_end_time)],e(t)}).catch(e=>{this.$message.error("数据初始化失败,请刷新重载!"),t(e)})})}initTencentMap(){const e=window.TMap;this.mode===c.g.ADD&&(this.form.latitude="39.954104",this.form.longitude="116.357503",this.getCurrentLocation().then(t=>{this.form.latitude=t.lat,this.form.longitude=t.lng,this.tencentMap.setCenter({lat:t.lat,lng:t.lng}),this.markerLayer.updateGeometries([{styleId:"me",id:"1",position:new e.LatLng(t.lat,t.lng)}])}));const t={lat:this.form.latitude,lng:this.form.longitude},a=new e.LatLng(t.lat,t.lng);this.tencentMap=new e.Map(document.getElementById("tencent-map"),{center:a,zoom:17.2,pitch:43.5,rotation:45}),this.markerLayer=new e.MultiMarker({map:this.tencentMap,styles:{me:new e.MarkerStyle({width:34,height:34,src:s("b483"),anchor:{x:17,y:34}})},geometries:[{id:"1",styleId:"me",position:new e.LatLng(t.lat,t.lng)}]}),this.tencentMap.on("click",({latLng:t,poi:s})=>{this.markerLayer.updateGeometries([{styleId:"me",id:"1",position:new e.LatLng(t.lat,t.lng)}]),this.form.latitude=t.lat,this.form.longitude=t.lng})}loadTencentMapScript(){const e="https://map.qq.com/api/gljs?v=1.exp&key="+this.tencentMapKey;d(e).then(()=>this.initTencentMap())}getCurrentLocation(){return new Promise((e,t)=>{d("https://mapapi.qq.com/web/mapComponents/geoLocation/v/geolocation.min.js").then(()=>{const t=new window.qq.maps.Geolocation(this.tencentMapKey,"admin");t.watchPosition(s=>{t.clearWatch(),e(s)})}).catch(e=>t(e))})}onMapSearch(){var e;if(!this.tencentMap)return this.$message.error("地图未加载完成");Object(r.a)({keyword:encodeURI(this.form.address),boundary:`region(${null!==(e=this.form.district)&&void 0!==e?e:this.form.city}, 0)`,key:this.tencentMapKey}).then(({data:e})=>{if(!e.length)return this.$message.info(`没有找到“${this.form.address}”的相关地点`);const t=window.TMap,s=[];this.markerLayer.setGeometries([]),this.markerLayer.add([{id:"1",styleId:"me",position:new t.LatLng(this.form.latitude,this.form.longitude)}]),e.forEach(e=>{const{lat:a,lng:i}=e.location;s.push({id:e.id,styleId:"marker",position:new t.LatLng(a,i),properties:{title:e.title}})});const{lat:a,lng:i}=e[0].location;this.tencentMap.setCenter({lat:a,lng:i}),this.markerLayer.add(s)}).catch(e=>{})}async getMapKey(){return(await Object(m.a)()).tencent_map_key}async created(){const e=this.$route.query;e.mode&&(this.mode=e.mode),this.mode===c.g.EDIT&&(this.identity=1*e.id,await this.initFormDataForEdit()),this.tencentMapKey=await this.getMapKey(),this.loadTencentMapScript(),window.handleSearchMap=e=>{}}handleWeekdays(e){this.form.weekdays=e.join(",")}handleBusinessTime(e){this.form.business_start_time=Object(l.i)(Date.parse(e[0]),"hh:MM:ss"),this.form.business_end_time=Object(l.i)(Date.parse(e[1]),"hh:MM:ss")}};Object(a.a)([Object(i.f)("weekdayChecked")],u.prototype,"handleWeekdays",null),Object(a.a)([Object(i.f)("businessTime")],u.prototype,"handleBusinessTime",null),u=Object(a.a)([Object(i.a)({components:{AreaSelect:n.a,MaterialSelect:o.a}})],u);var h=u,f=(s("9806"),s("2877")),p=Object(f.a)(h,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{ref:"page",staticClass:"ls-add-admin"},[s("div",{staticClass:"ls-card"},[s("el-page-header",{attrs:{content:e.pageTitle},on:{back:function(t){return e.$router.go(-1)}}})],1),s("div",{staticClass:"ls-card m-t-16"},[s("el-form",{ref:"form",attrs:{rules:e.rules,model:e.form,"label-width":"120px",size:"small"}},[s("el-form-item",{attrs:{label:"门店名称",prop:"name"}},[s("el-input",{staticClass:"ls-input",attrs:{"show-word-limit":"",placeholder:"请输入门店名称"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),s("el-form-item",{attrs:{label:"门店LOGO",prop:"image"}},[s("material-select",{attrs:{limit:1},model:{value:e.form.image,callback:function(t){e.$set(e.form,"image",t)},expression:"form.image"}}),s("div",{staticClass:"muted xs m-r-16"},[e._v("建议尺寸:100*100像素,jpg,jpeg,png图片类型")])],1),s("el-form-item",{attrs:{label:"联系人",prop:"contact"}},[s("el-input",{staticClass:"ls-input",attrs:{"show-word-limit":"",placeholder:"请输入联系人"},model:{value:e.form.contact,callback:function(t){e.$set(e.form,"contact",t)},expression:"form.contact"}})],1),s("el-form-item",{attrs:{label:"联系电话",prop:"mobile"}},[s("el-input",{staticClass:"ls-input",attrs:{"show-word-limit":"",placeholder:"请输入联系电话"},model:{value:e.form.mobile,callback:function(t){e.$set(e.form,"mobile",t)},expression:"form.mobile"}})],1),s("el-form-item",{attrs:{label:"门店地址",prop:"province"}},[s("area-select",{attrs:{province:e.form.province,city:e.form.city,district:e.form.district},on:{"update:province":function(t){return e.$set(e.form,"province",t)},"update:city":function(t){return e.$set(e.form,"city",t)},"update:district":function(t){return e.$set(e.form,"district",t)}}})],1),s("el-form-item",{attrs:{label:"详情地址",prop:"address"}},[s("el-input",{staticClass:"ls-input",attrs:{"show-word-limit":"",placeholder:"请输入详情地址"},model:{value:e.form.address,callback:function(t){e.$set(e.form,"address",t)},expression:"form.address"}},[s("el-button",{attrs:{slot:"append"},on:{click:e.onMapSearch},slot:"append"},[e._v("搜索地图")])],1)],1),s("el-form-item",{attrs:{label:"地图定位",prop:"password_confirm"}},[s("div",{attrs:{id:"tencent-map"}})]),s("el-form-item",{attrs:{label:"营业周天",prop:"weekdays"}},[s("el-checkbox-group",{model:{value:e.weekdayChecked,callback:function(t){e.weekdayChecked=t},expression:"weekdayChecked"}},e._l(e.weekdayList,(function(t){return s("el-checkbox",{key:t.key,attrs:{label:t.key}},[e._v(e._s(t.label))])})),1)],1),s("el-form-item",{attrs:{label:"营业时段",prop:"business_start_time"}},[s("el-time-picker",{staticClass:"ls-input",attrs:{"is-range":"","range-separator":"至","start-placeholder":"开始时间","end-placeholder":"结束时间",placeholder:"选择时间范围"},model:{value:e.businessTime,callback:function(t){e.businessTime=t},expression:"businessTime"}})],1),s("el-form-item",{attrs:{label:"门店详情",prop:"remark"}},[s("el-input",{staticClass:"ls-input",attrs:{type:"textarea",autosize:{minRows:3,maxRows:6},"show-word-limit":""},model:{value:e.form.remark,callback:function(t){e.$set(e.form,"remark",t)},expression:"form.remark"}})],1),s("el-form-item",{attrs:{label:"门店状态",prop:"status"}},[s("el-radio-group",{model:{value:e.form.status,callback:function(t){e.$set(e.form,"status",t)},expression:"form.status"}},[s("el-radio",{attrs:{label:0}},[e._v("停用")]),s("el-radio",{attrs:{label:1}},[e._v("启用")])],1)],1)],1)],1),s("div",{staticClass:"bg-white ls-fixed-footer"},[s("div",{staticClass:"row-center flex",staticStyle:{height:"100%"}},[s("el-button",{attrs:{size:"small"},on:{click:function(t){return e.$router.go(-1)}}},[e._v("取消")]),s("el-button",{attrs:{size:"small",type:"primary"},on:{click:function(t){return e.onSubmit("form")}}},[e._v("保存")])],1)])])}),[],!1,null,"7dc8ec31",null);t.default=p.exports},"7daa":function(e,t,s){},"82fc":function(e,t,s){"use strict";s.d(t,"f",(function(){return i})),s.d(t,"b",(function(){return r})),s.d(t,"d",(function(){return n})),s.d(t,"e",(function(){return o})),s.d(t,"g",(function(){return c})),s.d(t,"c",(function(){return l})),s.d(t,"a",(function(){return d})),s.d(t,"o",(function(){return m})),s.d(t,"k",(function(){return u})),s.d(t,"m",(function(){return h})),s.d(t,"n",(function(){return f})),s.d(t,"p",(function(){return p})),s.d(t,"l",(function(){return g})),s.d(t,"h",(function(){return b})),s.d(t,"i",(function(){return A})),s.d(t,"j",(function(){return w}));var a=s("f175");const i=e=>a.a.get("/selffetch_shop.selffetch_shop/lists",{params:e}),r=e=>a.a.post("/selffetch_shop.selffetch_shop/add",e),n=e=>a.a.get("/selffetch_shop.selffetch_shop/detail",{params:e}),o=e=>a.a.post("/selffetch_shop.selffetch_shop/edit",e),c=e=>a.a.post("/selffetch_shop.selffetch_shop/status",e),l=e=>a.a.post("/selffetch_shop.selffetch_shop/del",e),d=e=>a.a.get("/selffetch_shop.selffetch_shop/regionSearch",{params:e}),m=e=>a.a.get("/selffetch_shop.selffetch_verifier/lists",{params:e}),u=e=>a.a.post("/selffetch_shop.selffetch_verifier/add",e),h=e=>a.a.get("/selffetch_shop.selffetch_verifier/detail",{params:e}),f=e=>a.a.post("/selffetch_shop.selffetch_verifier/edit",e),p=e=>a.a.post("/selffetch_shop.selffetch_verifier/status",e),g=e=>a.a.post("/selffetch_shop.selffetch_verifier/del",e),b=e=>a.a.post("/selffetch_shop.verification/verification",e),A=e=>a.a.get("selffetch_shop.verification/lists",{params:e}),w=e=>a.a.get("selffetch_shop.verification/verificationQuery",{params:e})},9806:function(e,t,s){"use strict";s("7daa")},b483:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGYAAABmCAMAAAAOARRQAAABOFBMVEUAAAAAAAACAgVoaGgAAAAAAAA4df8BAQIAAAAAAAAAAAAAAAABAQIAAAAAAAA4df8AAAA4df0AAAAAAAAAAAA4dP44df84df00besfQYw5eP85e+04dPw2cPQ5df83cfY0aug4dv8zbOg4dP04df41b+9ISEhdXV04dPw4c/YqVLc3cvY5c/sXLmUPHz0yaeIKFCkAAAA5cfY0duxmZmY6ce01be1mZmY1b/A5df84dPs3c/kyaeQyaeIxZ903c/k5d/8vYtM5d/8wY9ZRUVEuXcgyZtsqWLwuYM1nZ2cjSZ8jSZooU7ATK1Vqamo0beUNIjxmZmYwUJ84df////9mZmZ4ov/3+v/w9f/r8f/X4/+2zP+ivv+buf9Eff9Be/9iYmJeXl5ZWVlUVFRSUlL6+/85c/Y6ce3gepRkAAAAU3RSTlMABAeAChL9Gw8lDSEvFxX0HucpKyfv69u9Vy8J7tTLvrauq6eampaGem1tXU9BOjgxLRsT8e/Fxbi3srGxraainZKQkI6GenpwZlBJRzY1MSYZEEhVbFkAAANvSURBVGje7NbLisIwFIDhSaixCFpcWMGC4g0UBUE3XhaKCxEUFE/pXV35/q8wMDAwYxI8STowC/8X+Igxp+fj3bt/WGO4XdSrDnOq9cV22Pj4g7xR24Xfue2Rl/M5Ng6IcjaNHJE2A1msnRM0630hcqg3y0EZu/Aqd2ysDBi8jg3MEK8LuLqegTJtArbmVF+pAr6qruM1QaWm3u9GuqBWl+goA1BtQNSVMVNm2FjZmbmgnjtTPUwPdOoRNWXCtBg2IUrMEvRaEhXlJDnMPUiT+BEnaXCXHOdEFJg1iLplof9dmN1A1JrglYsDgoLI/1kUgCDnQtDMCARd/eeuIGhEsApdiRWUs6IEyVg14Ap8UQFw1SwsMxHcfiRkohtwTQhOoUPgynxxGXANKcExff69hBIm5N9PH8lYLfHNIG+nZeGYUh2eS6VMCs/VS0iGXwESKZPwSwGKIdTmZ0AsZWJ+DtiUYJgCPzcfUubBT88CkjE8DZYxvBssY/hPwzKG7wbLGE4BLLMzmmk7JGMfjSb00aYENQWKRt+bInbYlOcGX895GclYlb3BLrCvWDiGFs4Gm825QJGMXexo72mdos0x0ss5aG+dh3IJvdl8tmMvKwrDUBiABaltmqSEtEILCuLCQsHSgpeNCqIiCgoyzH5u6Pu/wZyEWVnEk4Awi/wrcfNxzp8sGo+mb3ZJqaeqwW7taPlFcETvTJ81OrRihlSfM/w4p56F0jvhh9HjcFpYfHsWlKthTMYhG2NmQ4yG0e0IOTBUBlLoZkzGCTmt+kZKv6I81MMYrm1s9GYzbqwMd0fB6eNnAUXdTFMGHEGqAbaXighQgDF3IkHqNep1cF0TEdko+hiAExe957eyiEHR9Vs5qh9ZLp+83C5LqXppKCb9+FSyLO08RtKMSeo3ejF0Ag6LY9niwav6ImOwMB5oxd5RBfk0iVm5T7t3RjfdlyxOqA+1NBTzggLuUyJrxrLdaja9XTvX23S22mWM1ZJQnweNWmwcBUUAJTJmjI1+VEbwK5YJIJFCEAoS8rgvgEpG3yqjBAjhcw+J4KEw8CKgtl8qWyAiLwiRCB4CCagwyD9V8iAEAgw8gpeUlX+o5CAgDHur/a7SBuGl+WPu/nWMYxzjGMc4xjGPc9DMofXiXCagTC6tV+c8n8zPLReX/5hf+wcnZOK2WB0AAAAASUVORK5CYII="},d142:function(e,t,s){"use strict";s.d(t,"a",(function(){return i})),s.d(t,"b",(function(){return r}));var a=s("f175");const i=()=>a.a.get("/settings.shop.shop_setting/getMapKey"),r=e=>a.a.post("/settings.shop.shop_setting/setMapKey",e)}}]);
|