王总上门按摩后台代码
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 line
10 KiB

2 months ago
webpackJsonp([86],{"+CCe":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=r("mvHQ"),a=r.n(s),o=r("Xxa5"),i=r.n(o),n=r("exGp"),l=r.n(n),u=r("PJh5"),m=r.n(u),c={data:function(){var e=this;return{navTitle:"",showMap:!1,base_agent:[],subForm:{id:0,cover:[],title:"",attestation:"",phone:"",star:"",order_num:"",order_rate:"",positive_rate:"",business_license:[],text:"",admin_id:"",start_time:"00:00",end_time:"23:59",address:"",lat:"",lng:""},subFormRules:{cover:{required:!0,type:"array",message:"请上传门店头像",trigger:["blur","change"]},title:{required:!0,validator:this.$reg.isNotNull,text:"门店名称",reg_type:2,trigger:"blur"},attestation:{required:!0,type:"string",message:"请输入门店认证名称",trigger:"blur"},star:{required:!0,validator:function(e,t,r){""===t||!/^(([0-5]*)|(([0]\.\d{1}|[1-5]*\.\d{1})))$/.test(t)||1*t>5?r(new Error(""===t?"请输入评分":"请输入正确的评分,取值0至5,最多保留1位小数")):r()},trigger:["blur","change"]},order_num:{required:!0,validator:this.$reg.isNum,text:"服务次数",trigger:"blur"},order_rate:{required:!0,validator:this.$reg.isPercent,text:"接单率",trigger:"blur"},positive_rate:{required:!0,validator:this.$reg.isPercent,text:"好评率",trigger:"blur"},business_license:{required:!0,type:"array",message:"请上传营业执照",trigger:["blur","change"]},admin_id:{required:!0,type:"number",message:"请选择代理商",trigger:"blur"},time:{required:!0,validator:function(t,r,s){var a=e.subForm,o=a.start_time,i=a.end_time;o&&i?s():s(new Error(o?"请选择结束时间":"请选择开始时间"))},trigger:"blur"},address:{required:!0,validator:function(t,r,s){var a=e.subForm,o=a.address,i=a.lat,n=a.lng;(o=o?o.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)?i&&/^[\-\+]?((0|([1-8]\d?))(\.\d{1,15})?|90(\.0{1,15})?)$/.test(i)?s():s(new Error(i?"请输入正确的纬度":"请输入门店纬度")):s(new Error(n?"请输入正确的经度":"请输入门店经度")):s(new Error("请输入门店地址"))},trigger:["blur","change"]}}}},created:function(){var e=this;return l()(i.a.mark(function t(){var r;return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.$route.query.id,t.next=3,e.getBaseInfo();case 3:r&&(e.subForm.id=r,e.getDetail(r)),e.navTitle=e.$t(r?"menu.StoreEdit":"menu.StoreAdd");case 5:case"end":return t.stop()}},t,e)}))()},methods:{getBaseInfo:function(){var e=this;return l()(i.a.mark(function t(){var r,s,a;return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$api.agent.adminSelect();case 2:if(r=t.sent,s=r.code,a=r.data,200===s){t.next=7;break}return t.abrupt("return");case 7:e.base_agent=a;case 8:case"end":return t.stop()}},t,e)}))()},getDetail:function(e){var t=this;return l()(i.a.mark(function r(){var s,a,o,n;return i.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,a=s.code,o=s.data,200===a){r.next=7;break}return r.abrupt("return");case 7:for(n in o.cover=[{url:o.cover}],o.business_license=[{url:o.business_license}],t.subForm)t.subForm[n]=o[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(a()(this.subForm));r.cover=r.cover[0].url,r.business_license=r.business_license[0].url;if(r.phone&&!/((^400)-([0-9]{7})$)|(^1[3-9]\d{9}$)|((^0\d{2,3})-(\d{7,8})$)/.test(r.phone))return void this.$message.error("请输入有效的联系电话");var s=r.start_time,o=r.end_time,i=r.lat,n=void 0===i?"":i,l=r.lng,u=void 0===l?"":l;if(s&&!o||!s&&o)return void this.$message.error(s?"请选择营业结束时间":"请选择营业开始时间");var m=/^[\-\+]?(0(\.\d{1,15})?|([1-9](\d)?)(\.\d{1,15})?|1[0-7]\d{1}(\.\d{1,15})?|180\.0{1,15})$/;if(u&&!m.test(u)||n&&!/^[\-\+]?((0|([1-8]\d?))(\.\d{1,15})?|90(\.0{1,15})?