1 line
19 KiB
JavaScript
1 line
19 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6b0fdb10"],{"311ac":function(t,e,i){"use strict";i.r(e);var a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{attrs:{id:"make_appointment"}},[t.showProjects?t._e():i("c-title",{attrs:{hide:!1,text:"预约"}}),i("div",{staticClass:"top_main"},[i("div",{staticClass:"goods"},[i("div",{staticClass:"img"},[i("img",{attrs:{src:t.project.project_thumb,alt:""}})]),i("div",{staticClass:"info"},[t._v(" "+t._s(t.project.project_title)+" ")])]),i("div",{staticClass:"cell"},[i("van-cell",{attrs:{title:"预约门店","is-link":"",value:t.AStore.store_name||"选择门店"},on:{click:t.getStore}}),i("van-cell",{attrs:{title:"预约时间","is-link":"",value:t.start_time},on:{click:t.toTime}}),t.chooseTechnician.name?i("van-cell",{attrs:{title:"预约"+t.appointmentLang.worker,value:t.chooseTechnician.name}}):t._e()],1)]),i("div",{staticClass:"bottom_main"},[i("p",{staticClass:"title"},[t._v("您的姓名")]),i("input",{directives:[{name:"model",rawName:"v-model",value:t.applyModel.customer_name,expression:"applyModel.customer_name"}],attrs:{type:"text",placeholder:"填写预约人的姓名"},domProps:{value:t.applyModel.customer_name},on:{input:function(e){e.target.composing||t.$set(t.applyModel,"customer_name",e.target.value)}}}),i("p",{staticClass:"title"},[t._v("您的电话")]),i("input",{directives:[{name:"model",rawName:"v-model",value:t.applyModel.customer_tel,expression:"applyModel.customer_tel"}],attrs:{type:"number",placeholder:"填写预约人的电话"},domProps:{value:t.applyModel.customer_tel},on:{input:function(e){e.target.composing||t.$set(t.applyModel,"customer_tel",e.target.value)}}}),i("p",{staticClass:"title"},[t._v("备注")]),i("input",{directives:[{name:"model",rawName:"v-model",value:t.applyModel.remark,expression:"applyModel.remark"}],attrs:{type:"text",placeholder:"填写备注"},domProps:{value:t.applyModel.remark},on:{input:function(e){e.target.composing||t.$set(t.applyModel,"remark",e.target.value)}}})]),i("div",{attrs:{id:"submitBtn"}},[i("span",{staticClass:"btn",on:{click:t.makeAppointment}},[t._v("预 约")])]),t.showProjects?[i("van-popup",{staticStyle:{height:"100%",width:"100%"},attrs:{position:"right"},model:{value:t.showProjects,callback:function(e){t.showProjects=e},expression:"showProjects"}},[i("van-nav-bar",{attrs:{title:"预约时间"},scopedSlots:t._u([{key:"left",fn:function(){return[i("span",[i("van-icon",{attrs:{name:"arrow-left",size:"18",color:"#333"},nativeOn:{click:function(e){t.showProjects=!1}}})],1)]},proxy:!0},{key:"right",fn:function(){return[i("p",{staticStyle:{color:"#f4a82e"},attrs:{slot:"right"},on:{click:t.Sure},slot:"right"},[t._v("确定")])]},proxy:!0}],null,!1,4246447117)}),i("div",{attrs:{id:"appointment_time"}},[i("c-calendar",{ref:"calendar",attrs:{events:t.calendarEvents},on:{select:t.selectedDay,monthChanged:t.monthChanged}}),t.isRest||t.times.length<=0?i("div",{staticClass:"main"},[i("p",{staticClass:"tips"},[t._v("暂无可预约时间")])]):t._e(),!t.isRest&&t.work_date&&t.times.length>0?i("van-collapse",{model:{value:t.activeNames,callback:function(e){t.activeNames=e},expression:"activeNames"}},[i("van-collapse-item",{attrs:{title:"请选择时间",name:"1",value:t.start_time}},[i("div",{staticClass:"box-warp"},t._l(t.times,(function(e,a){return i("p",{key:a,staticClass:"time-item",class:{active:t.start_time===e},on:{click:function(i){return t.selectedTime(e)}}},[t._v(t._s(e))])})),0)])],1):t._e(),!t.isRest&&t.start_time?i("div",{staticClass:"main"},[t.technician.length<=0?i("p",{staticClass:"tips"},[t._v("暂无"+t._s(t.appointmentLang.worker)+"可预约")]):i("p",{staticClass:"tips"},[t._v("选择"+t._s(t.appointmentLang.worker))]),i("div",{staticClass:"technician-list"},[i("van-radio-group",{attrs:{"checked-color":"#f4a82e"},model:{value:t.result,callback:function(e){t.result=e},expression:"result"}},[t._l(t.technician,(function(e){return[1!=e.status?i("van-radio",{key:e.id,attrs:{name:e.id},on:{click:function(i){return t.clickTechnician(e)}}},[i("div",{staticClass:"technician-item"},[i("div",{staticClass:"pic"},[i("img",{attrs:{src:e.thumb,alt:""}})]),i("div",{staticClass:"technician-right"},[i("div",{staticClass:"top"},[i("p",[t._v(t._s(e.name))]),i("div",{staticClass:"star"},[i("van-rate",{attrs:{size:"14",readonly:""},model:{value:e.score,callback:function(i){t.$set(e,"score",i)},expression:"item.score"}})],1)]),i("div",{staticClass:"describe1 text-over",staticStyle:{"-webkit-box-orient":"vertical"}},[i("span",{staticClass:"blue"},[t._v("简介")]),i("span",{staticClass:"gray"},[t._v(t._s(e.description||"暂无"))])])])])]):t._e(),1==e.status?i("div",{key:e.id,staticClass:"technician-item"},[i("p",{staticClass:"number"},[t._v("已约")]),i("div",{staticClass:"pic"},[i("img",{attrs:{src:e.thumb,alt:""}})]),i("div",{staticClass:"technician-right"},[i("div",{staticClass:"top"},[i("p",[t._v(t._s(e.name))]),i("div",{staticClass:"star"},[i("van-rate",{attrs:{size:"14",readonly:""},model:{value:e.score,callback:function(i){t.$set(e,"score",i)},expression:"item.score"}})],1)]),i("div",{staticClass:"describe1 text-over",staticStyle:{"-webkit-box-orient":"vertical"}},[i("span",{staticClass:"blue"},[t._v("简介")]),i("span",{staticClass:"gray"},[t._v(t._s(e.description||"暂无"))])])])]):t._e()]}))],2)],1)]):t._e()],1)],1)]:t._e(),t.show1?[i("van-popup",{style:{width:"100%",height:"100%"},attrs:{position:"right",closeable:"","close-icon":"close"},model:{value:t.show1,callback:function(e){t.show1=e},expression:"show1"}},[i("div",{staticClass:"header"},[t._v("选择门店")]),i("div",{staticStyle:{margin:"0.5rem 1rem",height:"90%","overflow-y":"scroll"}},t._l(t.store,(function(e){return i("div",{key:e.id,staticClass:"project_list",on:{click:function(i){return t.chooseStore(e)}}},[i("div",{staticStyle:{width:"5rem",height:"5rem"}},[i("img",{attrs:{src:e.thumb,alt:""}})]),i("div",{staticClass:"list_title"},[i("div",{staticClass:"list_title_top"},[i("span",{staticClass:"title"},[t._v(t._s(e.store_name))]),i("span",{staticClass:"distance-num"},[t._v(t._s(e.distance)+t._s(e.unit))])]),i("div",{staticClass:"list_title_bottom"},[i("span",{staticClass:"time"},[t._v("营业时间:"+t._s(e.business_hours_start)+"-"+t._s(e.business_hours_end))]),i("div",[i("i",{staticClass:"iconfont icon-order_locate",staticStyle:{color:"#ccc"}}),i("span",{staticClass:"distance"},[t._v(t._s(e.address))])])])])])})),0)])]:t._e()],2)},o=[],n=(i("e7e5"),i("d399")),s=(i("b0c0"),i("d81d"),i("6968")),r=i("3dc5"),l={data:function(){return{showProjects:!1,show1:!1,id:0,project_id:0,project:{},store:[],AStore:{},chooseTechnician:{name:""},activeNames:["1"],times:[],calendarEvents:[],technician:[],result:"",isRest:!1,work_date:"",start_time:"",applyModel:{order_id:"",store_id:"",worker_id:"",customer_name:"",customer_tel:"",begin_time:""},point:{}}},activated:function(){this.id=this.$route.params.id,this.project_id=this.$route.query.project_id,this.init(),this.getData(),this.today=(new Date).getFullYear()+"-"+((new Date).getMonth()+1>=10?(new Date).getMonth()+1:"0"+((new Date).getMonth()+1))+"-"+((new Date).getDate()>=10?(new Date).getDate():"0"+(new Date).getDate()),this.work_date=this.today},computed:{appointmentLang:function(){return this.$store.state.shopLanguage.appointment?this.$store.state.shopLanguage.appointment:{worker:"技师",project:"项目",service:"服务"}}},methods:{init:function(){this.show1=!1,this.start_time="",this.AStore={},this.times=[],this.calendarEvents=[],this.technician=[],this.result="",this.chooseTechnician={name:""},this.applyModel={order_id:"",store_id:"",worker_id:"",customer_name:"",customer_tel:"",remark:"",begin_time:""}},Sure:function(){this.showProjects=!1},clickTechnician:function(t){this.chooseTechnician=t},toTime:function(){this.applyModel.store_id?(this.activeNames=["1"],this.getDate(),this.getTime()):Object(n["a"])("请先选择门店")},chooseStore:function(t){this.AStore=t,this.applyModel.store_id=this.AStore.id,this.show1=!1,this.start_time="",this.chooseTechnician.name=""},getData:function(){var t=this;$http.get("plugin.appointment.frontend.appointment-order.detail",{project_id:this.id},"获取中").then((function(e){1===e.result?(e.data.default_customer&&(t.applyModel.customer_tel=e.data.default_customer.tel,t.applyModel.customer_name=e.data.default_customer.name),t.project=e.data.project):Object(n["a"])(e.msg)})).catch((function(t){}))},getStore:function(){var t=this;this.point.lng?$http.get("plugin.appointment.frontend.store.get-list-by-project-id",{lng:this.point.lng,lat:this.point.lat,project_id:this.project_id},"获取中").then((function(e){1===e.result?(t.store=e.data,t.show1=!0):Object(n["a"])(e.msg)})).catch((function(t){})):this.ready()},makeAppointment:function(){var t=this;this.start_time?this.start_time?this.chooseTechnician.name?this.applyModel.customer_name?this.applyModel.customer_tel?(this.applyModel.order_id=this.id,this.applyModel.worker_id=this.chooseTechnician.id,this.applyModel.begin_time=this.work_date+" "+this.start_time,$http.post("plugin.appointment.frontend.appointment-service.create-service",this.applyModel,"获取中").then((function(e){1===e.result?t.$dialog.alert({message:e.msg}).then((function(){t.$router.go(-1)})).catch((function(){})):Object(n["a"])(e.msg)})).catch((function(t){}))):Object(n["a"])("请填写电话"):Object(n["a"])("请填写姓名"):Object(n["a"])("请选择"+this.appointmentLang.worker):Object(n["a"])("请填写电话"):Object(n["a"])("请选择时间")},selectedDay:function(t){var e="";t.length>=3&&(e=t[0]+"-"+t[1]+"-"+t[2]),t.length>=4&&t[3].eventName?this.isRest=!1:this.isRest=!0,this.work_date=e,this.start_time=""},selectedTime:function(t){this.start_time=t,this.getTechnician()},monthChanged:function(t){},getDate:function(){var t=this,e=this;$http.get("plugin.appointment.frontend.work-time.get-work-dates",{store_id:this.applyModel.store_id},"获取中").then((function(i){1===i.result?(t.showProjects=!0,t.calendarEvents=i.data.map((function(t){return t.work_date_format==e.today&&(1==t.work_sattus?e.isRest=!0:e.isRest=!1),1==t.work_status?t.work_date_format+"-休":t.work_date_format})),i.data.length<=0&&(t.isRest=!0)):Object(n["a"])(i.msg)})).catch((function(t){}))},getTime:function(){var t=this;$http.get("plugin.appointment.frontend.work-time.get-start-times",{store_id:this.applyModel.store_id},"获取中").then((function(e){1===e.result?t.times=e.data:Object(n["a"])(e.msg)})).catch((function(t){}))},getTechnician:function(){var t=this;$http.get("plugin.appointment.frontend.worker.get-appointment-workers",{store_id:this.applyModel.store_id,project_id:this.project_id,work_date:this.work_date,start_time:this.start_time},"获取中").then((function(e){t.activeNames=[],1===e.result?t.technician=e.data:Object(n["a"])(e.msg)})).catch((function(t){}))},ready:function(){var t=this;this.fun.getLocation().then((function(e){t.point=e.point,t.address=e.title,t.city=e.city,t.getStore()})).catch((function(t){}))}},components:{cTitle:s["a"],cCalendar:r["a"]}},c=l,d=c,p=(i("5ad6"),i("2877")),m=Object(p["a"])(d,a,o,!1,null,"3d377e69",null);e["default"]=m.exports},"59f4":function(t,e,i){var a=i("24fb");e=a(!1),e.push([t.i,"#make_appointment[data-v-3d377e69]{text-align:left;color:#000}#make_appointment .top_main[data-v-3d377e69]{background:#fff;padding-top:.625rem;margin-bottom:.938rem}#make_appointment .top_main .goods[data-v-3d377e69]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:90%;margin:0 5% .875rem;padding:.825rem;-webkit-box-shadow:0 0 18px 0 hsla(0,0%,66.3%,.24);box-shadow:0 0 18px 0 hsla(0,0%,66.3%,.24);border-radius:5px}#make_appointment .top_main .goods .img[data-v-3d377e69]{width:4.625rem;height:4.625rem;margin-right:.6rem;border-radius:.156rem;overflow:hidden}#make_appointment .top_main .goods .img img[data-v-3d377e69]{width:100%;height:100%}#make_appointment .top_main .goods .info[data-v-3d377e69]{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;line-height:1.125rem;max-height:4.5rem;font-size:.875rem;padding:.5rem}#make_appointment .top_main[data-v-3d377e69] .cell .van-cell__title{font-weight:700}#make_appointment .bottom_main[data-v-3d377e69]{padding:0 .78rem;background:#fff;padding-bottom:.875rem}#make_appointment .bottom_main .title[data-v-3d377e69]{height:2.5rem;line-height:2.5rem;font-weight:700}#make_appointment .bottom_main input[data-v-3d377e69]{background:#f7f7f7;border-radius:.375rem;height:2.5rem;line-height:2.5rem;width:100%;border:none;padding:.625rem}#make_appointment #submitBtn[data-v-3d377e69]{background:#fff;width:100%;height:3.719rem;line-height:3.719rem;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;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}#make_appointment #submitBtn .btn[data-v-3d377e69]{width:90%;height:2.5rem;background-color:#f4a82e;border-radius:1.25rem;line-height:2.5rem;text-align:center;font-size:1rem;font-weight:700;display:block;color:#fff}.project_list[data-v-3d377e69]{display:-webkit-box;display:-ms-flexbox;display:flex;display:-webkit-flex;background:#fff;padding:1rem .5rem;border-bottom:1px solid #f2f2f2}.project_list img[data-v-3d377e69]{width:5rem;height:5rem;border-radius:5px}.list_title[data-v-3d377e69]{display:-webkit-box;display:-ms-flexbox;display:flex;display:-webkit-flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;padding:0 .5rem;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;text-align:left;line-height:1.5rem}.list_title .title[data-v-3d377e69]{font-size:14px;width:10rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#000}.list_title span[data-v-3d377e69]{font-size:.8rem;color:#ccc}.list_title div[data-v-3d377e69],.list_title span[data-v-3d377e69]{-webkit-align-content:space-between;-ms-flex-line-pack:justify;align-content:space-between}.list_title_top[data-v-3d377e69]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row}.distance-num[data-v-3d377e69]{width:4rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.distance[data-v-3d377e69]{color:#ccc}.list_title_bottom div[data-v-3d377e69]{display:-webkit-box;display:-ms-flexbox;display:flex;display:-webkit-flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row}.list_title_bottom .time[data-v-3d377e69]{color:#666}.blue[data-v-3d377e69]{padding:0 .1rem;border-radius:2.5px;background-color:#6eabff;color:#fff}.blue[data-v-3d377e69],.tag[data-v-3d377e69]{display:inline-block}.tag[data-v-3d377e69]{border-radius:12px;border:.5px solid #f4a82e;padding:.1rem .3rem;color:#f4a82e;font-size:12px}.header[data-v-3d377e69]{font-size:16px;font-weight:700;text-align:center;margin:1rem}#appointment_time[data-v-3d377e69]{background:#fff;text-align:left}#appointment_time .main[data-v-3d377e69]{padding:1rem}#appointment_time .tips[data-v-3d377e69]{text-align:left;font-weight:700;font-size:15px}#appointment_time .times[data-v-3d377e69]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-top:1rem}#appointment_time .times span[data-v-3d377e69]{position:relative;display:inline-block;background-color:#fe753e;border-radius:5px;color:#fff;padding:.8rem 1rem;font-size:14px;margin-right:.5rem}#appointment_time .times em[data-v-3d377e69]{position:absolute;right:0;top:0;background-color:#fff;border-radius:0 5px 0 5px;opacity:.57;font-size:10px;color:#999;padding:.2rem}#appointment_time .times .checked[data-v-3d377e69]{background-color:#e1e1e1}#appointment_time .blue[data-v-3d377e69]{display:inline-block;padding:0 .1rem;border-radius:2.5px;background-color:#6eabff;color:#fff;margin-right:.3rem}#appointment_time .technician-list[data-v-3d377e69]{background-color:#fff;padding:1rem 0}#appointment_time .tag[data-v-3d377e69]{display:inline-block;border-radius:12px;border:.5px solid #f4a82e;padding:.1rem .3rem;color:#f4a82e;font-size:12px}#appointment_time .technician-item[data-v-3d377e69]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;padding:.5rem 0;border-bottom:1px solid #f2f2f7}#appointment_time .technician-item .number[data-v-3d377e69]{font-size:14px;color:#999;line-height:4rem;-webkit-box-flex:0;-webkit-flex:0 0 2rem;-ms-flex:0 0 2rem;flex:0 0 2rem}#appointment_time .technician-item .pic[data-v-3d377e69]{width:3rem;height:3rem;-webkit-box-flex:0;-webkit-flex:0 0 3rem;-ms-flex:0 0 3rem;flex:0 0 3rem;margin:.5rem}#appointment_time .technician-item .pic img[data-v-3d377e69]{width:100%;height:100%;border-radius:50%}#appointment_time .technician-item .technician-right[data-v-3d377e69]{padding:.3rem;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}#appointment_time .technician-item .technician-right .gray[data-v-3d377e69]{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}#appointment_time .technician-item .technician-right .address[data-v-3d377e69]{color:#ccc}#appointment_time .technician-item .top[data-v-3d377e69]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}#appointment_time .technician-item .top p[data-v-3d377e69]{font-weight:700;line-height:1.3rem;margin-right:.5rem}#appointment_time .technician-item .top .star[data-v-3d377e69]{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;text-align:right}#appointment_time .technician-item .gray[data-v-3d377e69]{font-size:12px;color:#b0b0b0;text-align:left}#appointment_time .technician-item .describe1[data-v-3d377e69]{font-size:12px;color:#ccc;text-align:left;padding-top:.3rem;width:15rem}#appointment_time .box-warp[data-v-3d377e69]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}#appointment_time .box-warp .time-item[data-v-3d377e69]{width:4rem;height:2.5rem;line-height:2.5rem;text-align:center;background-color:#fffaf1;border-radius:.5rem;color:#333;margin:.5rem}#appointment_time .box-warp .active[data-v-3d377e69]{background-color:#f49f19;color:#fff}#appointment_time .box-warp .disabled[data-v-3d377e69]{background-color:#e1e1e1;color:#fff}#appointment_time .text-over[data-v-3d377e69]{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2}",""]),t.exports=e},"5ad6":function(t,e,i){"use strict";i("f40f")},f40f:function(t,e,i){var a=i("59f4");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var o=i("499e").default;o("3f03d013",a,!0,{sourceMap:!1,shadowMode:!1})}}]); |