王总上门按摩后台代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

1 lines
6.9 KiB

webpackJsonp([35],{fCq8:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=r("mvHQ"),i=r.n(s),a=r("Xxa5"),o=r.n(a),n=r("exGp"),l=r.n(n),u=r("PJh5"),c=r.n(u),m={data:function(){var e=this;return{showMap:!1,subForm:{id:0,cover:[],title:"",attestation:"",phone:"",text:"",business_license:[],start_time:"00:00",end_time:"23:59",address:"",lat:"",lng:""},subFormRules:{cover:{required:!0,type:"array",message:"请上传门店头像",trigger:["blur","change"]},title:{required:!0,type:"string",message:"请输入门店名称",trigger:"blur"},attestation:{required:!0,type:"string",message:"请输入门店认证名称",trigger:"blur"},phone:{required:!0,validator:this.$reg.isAllPhone,text:"联系电话",trigger:"blur"},text:{required:!0,type:"string",message:"请输入商家简介",trigger:"blur"},business_license:{required:!0,type:"array",message:"请上传营业执照",trigger:["blur","change"]},time:{required:!0,validator:function(t,r,s){var i=e.subForm,a=i.start_time,o=i.end_time;a&&o?s():s(new Error(a?"请选择结束时间":"请选择开始时间"))},trigger:"blur"},address:{required:!0,validator:function(t,r,s){var i=e.subForm,a=i.address,o=i.lat,n=i.lng;(a=a?a.replace(/(^\s*)|(\s*$)/g,""):"")?n&&/^[\-\+]?(0(\.\d{1,15})?|([1-9](\d)?)(\.\d{1,15})?|1[0-7]\d{1}(\.\d{1,15})?|180\.0{1,15})$/.test(n)?o&&/^[\-\+]?((0|([1-8]\d?))(\.\d{1,15})?|90(\.0{1,15})?)$/.test(o)?s():s(new Error(o?"请输入正确的纬度":"请输入门店纬度")):s(new Error(n?"请输入正确的经度":"请输入门店经度")):s(new Error("请输入门店地址"))},trigger:["blur","change"]}}}},created:function(){var e=this.$route.query.id;e&&(this.subForm.id=e,this.getDetail(e))},methods:{getDetail:function(e){var t=this;return l()(o.a.mark(function r(){var s,i,a,n;return o.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.$api.store.storeInfo({id:e});case 2:if(s=r.sent,i=s.code,a=s.data,200===i){r.next=7;break}return r.abrupt("return");case 7:for(n in a.cover=[{url:a.cover}],a.business_license=[{url:a.business_license}],t.subForm)t.subForm[n]=a[n];case 10:case"end":return r.stop()}},r,t)}))()},getCover:function(e,t){this.subForm[t]=e},getLatLng:function(e){this.subForm.lat=e.lat,this.subForm.lng=e.lng},submitForm:function(){var e=this,t=!0;if(this.$refs.subForm.validate(function(e){e||(t=!1)}),t){var r=JSON.parse(i()(this.subForm));r.cover=r.cover[0].url,r.business_license=r.business_license[0].url,this.$api.store.storeUpdate(r).then(function(t){200===t.code&&(e.$message.success(e.$t(r.id?"tips.successRev":"tips.successSub")),e.$router.back(-1))})}}},filters:{handleStartEndTime:function(e){var t="",r=e.start_time,s=e.end_time,i=c()(Date.now()).format("YYYY-MM-DD");return r&&s&&c()(i+" "+s).unix()<c()(i+" "+r).unix()&&(t="次日"),t}}},b={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"lb-store-list-edit"},[r("top-nav",{attrs:{isBack:!0}}),e._v(" "),r("div",{staticClass:"page-main"},[r("el-form",{ref:"subForm",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"130px"},nativeOn:{submit:function(e){e.preventDefault()}}},[r("el-form-item",{attrs:{label:"门店头像",prop:"cover"}},[r("lb-cover",{attrs:{fileList:e.subForm.cover},on:{selectedFiles:function(t){return e.getCover(t,"cover")}}}),e._v(" "),r("lb-tool-tips",[e._v("图片建议尺寸: 160 * 143")])],1),e._v(" "),r("el-form-item",{attrs:{label:"门店名称",prop:"title"}},[r("el-input",{attrs:{maxlength:"15","show-word-limit":"",placeholder:"请输入门店名称"},model:{value:e.subForm.title,callback:function(t){e.$set(e.subForm,"title",t)},expression:"subForm.title"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"门店认证名称",prop:"attestation"}},[r("el-input",{attrs:{maxlength:"20","show-word-limit":"",placeholder:"请输入门店认证名称"},model:{value:e.subForm.attestation,callback:function(t){e.$set(e.subForm,"attestation",t)},expression:"subForm.attestation"}}),e._v(" "),r("lb-tool-tips",[e._v("营业执照上的企业名称")])],1),e._v(" "),r("el-form-item",{attrs:{label:"联系电话",prop:"phone"}},[r("el-input",{attrs:{placeholder:"请输入联系电话"},model:{value:e.subForm.phone,callback:function(t){e.$set(e.subForm,"phone",t)},expression:"subForm.phone"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"营业执照",prop:"business_license"}},[r("lb-cover",{attrs:{fileList:e.subForm.business_license},on:{selectedFiles:function(t){return e.getCover(t,"business_license")}}})],1),e._v(" "),r("el-form-item",{attrs:{label:"商家简介",prop:"text"}},[r("el-input",{attrs:{type:"textarea",rows:10,maxlength:"300","show-word-limit":"",resize:"none",placeholder:"请输入商家简介"},model:{value:e.subForm.text,callback:function(t){e.$set(e.subForm,"text",t)},expression:"subForm.text"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"营业时间",prop:"time"}},[r("el-time-select",{staticStyle:{width:"150px"},attrs:{placeholder:"开始时间","picker-options":{start:"00:00",step:"00:01",end:"24:00"}},model:{value:e.subForm.start_time,callback:function(t){e.$set(e.subForm,"start_time",t)},expression:"subForm.start_time"}}),e._v(" "),r("block",[e._v("至"+e._s(e._f("handleStartEndTime")(e.subForm)))]),e._v(" "),r("el-time-select",{staticStyle:{width:"150px"},attrs:{placeholder:"结束时间","picker-options":{start:"00:00",step:"00:01",end:"24:00"}},model:{value:e.subForm.end_time,callback:function(t){e.$set(e.subForm,"end_time",t)},expression:"subForm.end_time"}}),e._v(" "),r("lb-tool-tips",[e._v("营业时间和入驻"+e._s(e.$t("action.attendantName"))+"的工作时间设置一致")])],1),e._v(" "),r("el-form-item",{attrs:{label:"门店地址",prop:"address"}},[r("el-input",{attrs:{placeholder:"请输入门店地址"},model:{value:e.subForm.address,callback:function(t){e.$set(e.subForm,"address",t)},expression:"subForm.address"}}),e._v(" "),r("div",{staticClass:"mt-md mb-md"},[r("el-input",{attrs:{placeholder:"请输入门店经度"},model:{value:e.subForm.lng,callback:function(t){e.$set(e.subForm,"lng",t)},expression:"subForm.lng"}})],1),e._v(" "),r("div",[r("el-input",{attrs:{placeholder:"请输入门店纬度"},model:{value:e.subForm.lat,callback:function(t){e.$set(e.subForm,"lat",t)},expression:"subForm.lat"}}),e._v(" "),r("lb-button",{staticClass:"getLocation",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",plain:""},on:{click:function(t){e.showMap=!0}}},[e._v("获取经纬度")])],1)],1),e._v(" "),r("el-form-item",[r("lb-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:e.submitForm}},[e._v(e._s(e.$t("action.submit")))]),e._v(" "),r("lb-button",{on:{click:function(t){return e.$router.back(-1)}}},[e._v(e._s(e.$t("action.back")))])],1)],1),e._v(" "),r("lb-map",{attrs:{dialogVisible:e.showMap},on:{"update:dialogVisible":function(t){e.showMap=t},"update:dialog-visible":function(t){e.showMap=t},selectedLatLng:e.getLatLng}})],1)],1)},staticRenderFns:[]};var d=r("VU/8")(m,b,!1,function(e){r("fZ/4")},"data-v-b3c1e192",null);t.default=d.exports},"fZ/4":function(e,t){}});