2 lines
13 KiB
JavaScript
2 lines
13 KiB
JavaScript
import{_ as e,m as t,L as a,M as l,l as r,k as s,N as i,O as o,G as n,H as d,o as c,c as u,w as h,i as p,P as m,Q as f,R as g,e as x,f as y,t as w,A as _,g as C,h as E}from"./index-a09151d6.js";import{_ as k}from"./aure-country-picker.01cea584.js";import{A as b}from"./AppServer.888fd24d.js";import{_ as A}from"./ic_back.5440bd15.js";import{_ as D}from"./arrow_right2.8bd5bd0f.js";import{_ as F}from"./arrow_down.807172e3.js";const N=new b;const V=e({data:()=>({serviceId:"",serviceTitle:"",userName:"",userWechat:"",userPhone:"",userWhats:"",remark:"",origin:"",destination:"",flightNo:"",departureDate:"",petType:"",petName:"",hasQuarantineCert:!0,quarantineIndex:0,quarantineColumns:[[{label:"是",value:!0},{label:"否",value:!1}]],submitting:!1,flashingField:"",selectedDialCode:"86",showCalendar:!1,showQuarantinePicker:!1,minDate:"",maxDate:""}),computed:{quarantineCertText(){const e=this.quarantineColumns[0].find(e=>e.value===this.hasQuarantineCert);return e?e.label:"是"}},onLoad(e){this.initDateRange(),e.id&&(this.serviceId=e.id),e.title&&(this.serviceTitle=decodeURIComponent(e.title))},methods:{initDateRange(){const e=new Date,t=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),l=String(e.getDate()).padStart(2,"0");this.minDate=`${t}-${a}-${l}`,this.maxDate=`${t+2}-12-31`},openCalendar(){this.initDateRange(),this.$nextTick(()=>{this.showCalendar=!0})},closeCalendar(){this.showCalendar=!1},onCalendarConfirm(e){e&&e.length>0&&(this.departureDate=e[0]),this.showCalendar=!1},onQuarantineConfirm(e){const t=e.value[0];this.hasQuarantineCert=t.value,this.quarantineIndex=this.quarantineColumns[0].findIndex(e=>e.value===t.value),this.showQuarantinePicker=!1},checkData(){const e=[{field:"userName",selector:"#fieldUserName",check:()=>!this.userName.trim(),message:"请输入真实姓名"},{field:"contact",selector:"#fieldContact",check:()=>!this.userWechat.trim()&&!this.userPhone.trim()&&!this.userWhats.trim(),message:"请至少填写一种联系方式(微信号/手机号/WhatsApp)"},{field:"origin",selector:"#fieldOrigin",check:()=>!this.origin.trim(),message:"请输入出发地"},{field:"destination",selector:"#fieldDestination",check:()=>!this.destination.trim(),message:"请输入目的地"},{field:"flightNo",selector:"#fieldFlightNo",check:()=>!this.flightNo.trim(),message:"请输入航班号"},{field:"departureDate",selector:"#fieldDepartureDate",check:()=>!this.departureDate,message:"请选择出发日期"},{field:"petType",selector:"#fieldPetType",check:()=>!this.petType.trim(),message:"请输入宠物类型"},{field:"petName",selector:"#fieldPetName",check:()=>!this.petName.trim(),message:"请输入宠物名称"}];for(const a of e)if(a.check())return t({title:a.message,icon:"none"}),this.scrollToElement(a.selector),this.flashingField=a.field,void setTimeout(()=>{this.flashingField=""},1500);this.submitAppointment()},async submitAppointment(){var e;if(!this.submitting){this.submitting=!0,a({title:"提交中...",mask:!0});try{const a={hotServiceId:parseInt(this.serviceId)||null,serviceType:"pet_transportation",realName:this.userName.trim(),wechatId:this.userWechat.trim()||null,phone:this.userPhone.trim()||null,phoneCountryCode:this.userPhone.trim()?this.selectedDialCode:null,whatsapp:this.userWhats.trim()||null,notes:this.remark.trim()||null,origin:this.origin.trim(),destination:this.destination.trim(),flightNo:this.flightNo.trim(),departureDate:this.departureDate,petType:this.petType.trim(),petName:this.petName.trim(),hasQuarantineCert:this.hasQuarantineCert},s=await N.CreateAppointment(a);l(),s.success||0===s.code?(t({title:"预约提交成功",icon:"success"}),setTimeout(()=>{r({delta:1})},1500)):t({title:(null==(e=s.error)?void 0:e.message)||"提交失败,请重试",icon:"none"})}catch(s){l(),console.error("提交预约失败:",s),t({title:"网络错误,请重试",icon:"none"})}finally{this.submitting=!1}}},scrollToElement(e){const t=s().windowHeight,a=i().in(this);a.select(e).boundingClientRect(),a.selectViewport().scrollOffset(),a.exec(e=>{if(e[0]&&e[1]){const a=e[0],l=e[1].scrollTop+a.top-t/2+a.height/2;o({scrollTop:Math.max(0,l),duration:300})}})},back(){r({delta:1})}}},[["render",function(e,t,a,l,r,s){const i=C,o=p,b=E,N=n(d("up-input"),m),V=n(d("aure-country-picker"),k),T=n(d("up-picker"),f),$=n(d("up-calendar"),g);return c(),u(o,{class:"page"},{default:h(()=>[x(o,{class:"header"},{default:h(()=>[x(o,{class:"center",style:{width:"50rpx",height:"50rpx","margin-left":"32rpx"}},{default:h(()=>[x(i,{src:A,onClick:s.back,style:{width:"48rpx",height:"48rpx"},mode:""},null,8,["onClick"])]),_:1}),x(b,{style:{"font-size":"30rpx"}},{default:h(()=>[y(w(e.$t("infoEntry.title")),1)]),_:1}),x(o,{style:{width:"50rpx","margin-right":"32rpx"}})]),_:1}),x(o,{class:"scroll-content"},{default:h(()=>[x(o,{class:"content"},{default:h(()=>[x(o,{class:"",style:{width:"680rpx",height:"396rpx","background-image":"linear-gradient(-45deg, #60D7FF, #68BBD7)","margin-top":"32rpx","border-radius":"20rpx","box-shadow":"0 0 10rpx 10rpx rgba(0, 0, 0, 0.1)"}}),x(o,{class:"",style:{width:"100%","font-size":"40rpx","padding-left":"54rpx","margin-top":"38rpx"}},{default:h(()=>[y(w(e.$t("infoEntry.personalInfo")),1)]),_:1}),x(o,{class:_(["column",{"flash-animation":"userName"===r.flashingField}]),style:{width:"680rpx","margin-top":"38rpx"},id:"fieldUserName"},{default:h(()=>[x(b,{style:{"font-size":"30rpx"}},{default:h(()=>[x(b,{style:{color:"#FF0000"}},{default:h(()=>[y("*")]),_:1}),y(w(e.$t("infoEntry.realName")),1)]),_:1}),x(N,{placeholder:e.$t("infoEntry.realNamePlaceholder"),border:"surround",modelValue:r.userName,"onUpdate:modelValue":t[0]||(t[0]=e=>r.userName=e)},null,8,["placeholder","modelValue"])]),_:1},8,["class"]),x(o,{class:"",style:{width:"680rpx",height:"2rpx","background-color":"#EAEAEA"}}),x(o,{class:_(["column",{"flash-animation":"contact"===r.flashingField}]),style:{width:"680rpx","margin-top":"14rpx"},id:"fieldContact"},{default:h(()=>[x(b,{style:{"font-size":"30rpx"}},{default:h(()=>[x(b,{style:{color:"#FF0000"}},{default:h(()=>[y("*")]),_:1}),y(w(e.$t("infoEntry.wechat"))+" ("+w(e.$t("infoEntry.contactMethod"))+")",1)]),_:1}),x(N,{placeholder:e.$t("infoEntry.wechatPlaceholder"),border:"surround",modelValue:r.userWechat,"onUpdate:modelValue":t[1]||(t[1]=e=>r.userWechat=e)},null,8,["placeholder","modelValue"])]),_:1},8,["class"]),x(o,{class:"",style:{width:"680rpx",height:"2rpx","background-color":"#EAEAEA"}}),x(o,{class:_(["column",{"flash-animation":"contact"===r.flashingField}]),style:{width:"680rpx","margin-top":"14rpx"}},{default:h(()=>[x(b,{style:{"font-size":"30rpx"}},{default:h(()=>[x(b,{style:{color:"#FF0000"}},{default:h(()=>[y("*")]),_:1}),y(w(e.$t("infoEntry.phone"))+" ("+w(e.$t("infoEntry.contactMethod"))+")",1)]),_:1}),x(o,{class:"row",style:{"margin-top":"10rpx","margin-bottom":"10rpx"}},{default:h(()=>[x(V,{modelValue:r.selectedDialCode,"onUpdate:modelValue":t[2]||(t[2]=e=>r.selectedDialCode=e),title:e.$t("infoEntry.selectCountry"),height:"70%",width:"60vw",duration:350,position:"bottom",round:!0,radius:"24rpx","mask-closable":!0},null,8,["modelValue","title"]),x(N,{placeholder:e.$t("infoEntry.phonePlaceholder"),border:"surround",modelValue:r.userPhone,"onUpdate:modelValue":t[3]||(t[3]=e=>r.userPhone=e)},null,8,["placeholder","modelValue"])]),_:1})]),_:1},8,["class"]),x(o,{class:"",style:{width:"680rpx",height:"2rpx","background-color":"#EAEAEA"}}),x(o,{class:_(["column",{"flash-animation":"contact"===r.flashingField}]),style:{width:"680rpx","margin-top":"14rpx"}},{default:h(()=>[x(b,{style:{"font-size":"30rpx"}},{default:h(()=>[x(b,{style:{color:"#FF0000"}},{default:h(()=>[y("*")]),_:1}),y(w(e.$t("infoEntry.whatsapp"))+" ("+w(e.$t("infoEntry.contactMethod"))+")",1)]),_:1}),x(N,{placeholder:e.$t("infoEntry.whatsappPlaceholder"),border:"surround",modelValue:r.userWhats,"onUpdate:modelValue":t[4]||(t[4]=e=>r.userWhats=e)},null,8,["placeholder","modelValue"])]),_:1},8,["class"]),x(o,{class:"",style:{width:"680rpx",height:"2rpx","background-color":"#EAEAEA"}}),x(o,{class:"column",style:{width:"680rpx","margin-top":"14rpx"}},{default:h(()=>[x(b,{style:{"font-size":"30rpx"}},{default:h(()=>[y(w(e.$t("infoEntry.remark")),1)]),_:1}),x(N,{placeholder:e.$t("infoEntry.remarkPlaceholder"),border:"surround",modelValue:r.remark,"onUpdate:modelValue":t[5]||(t[5]=e=>r.remark=e)},null,8,["placeholder","modelValue"])]),_:1}),x(o,{class:"",style:{width:"680rpx",height:"2rpx","background-color":"#EAEAEA"}}),x(o,{class:"",style:{width:"100%","font-size":"40rpx","padding-left":"54rpx","margin-top":"38rpx"}},{default:h(()=>[y(w(e.$t("infoEntry.serviceInfo")),1)]),_:1}),x(o,{class:_(["column",{"flash-animation":"origin"===r.flashingField}]),style:{width:"680rpx","margin-top":"14rpx"},id:"fieldOrigin"},{default:h(()=>[x(b,{style:{"font-size":"30rpx"}},{default:h(()=>[x(b,{style:{color:"#FF0000"}},{default:h(()=>[y("*")]),_:1}),y("出发地")]),_:1}),x(N,{placeholder:"请输入出发地",border:"surround",modelValue:r.origin,"onUpdate:modelValue":t[6]||(t[6]=e=>r.origin=e)},null,8,["modelValue"])]),_:1},8,["class"]),x(o,{class:"",style:{width:"680rpx",height:"2rpx","background-color":"#EAEAEA"}}),x(o,{class:_(["column",{"flash-animation":"destination"===r.flashingField}]),style:{width:"680rpx","margin-top":"14rpx"},id:"fieldDestination"},{default:h(()=>[x(b,{style:{"font-size":"30rpx"}},{default:h(()=>[x(b,{style:{color:"#FF0000"}},{default:h(()=>[y("*")]),_:1}),y("目的地")]),_:1}),x(N,{placeholder:"请输入目的地",border:"surround",modelValue:r.destination,"onUpdate:modelValue":t[7]||(t[7]=e=>r.destination=e)},null,8,["modelValue"])]),_:1},8,["class"]),x(o,{class:"",style:{width:"680rpx",height:"2rpx","background-color":"#EAEAEA"}}),x(o,{class:_(["column",{"flash-animation":"flightNo"===r.flashingField}]),style:{width:"680rpx","margin-top":"14rpx"},id:"fieldFlightNo"},{default:h(()=>[x(b,{style:{"font-size":"30rpx"}},{default:h(()=>[x(b,{style:{color:"#FF0000"}},{default:h(()=>[y("*")]),_:1}),y("航班号")]),_:1}),x(N,{placeholder:"请输入航班号",border:"surround",modelValue:r.flightNo,"onUpdate:modelValue":t[8]||(t[8]=e=>r.flightNo=e)},null,8,["modelValue"])]),_:1},8,["class"]),x(o,{class:"",style:{width:"680rpx",height:"2rpx","background-color":"#EAEAEA"}}),x(o,{class:_(["column",{"flash-animation":"departureDate"===r.flashingField}]),style:{width:"680rpx","margin-top":"14rpx"},id:"fieldDepartureDate"},{default:h(()=>[x(b,{style:{"font-size":"30rpx"}},{default:h(()=>[x(b,{style:{color:"#FF0000"}},{default:h(()=>[y("*")]),_:1}),y("出发日期")]),_:1}),x(o,{class:"date-item",onClick:s.openCalendar},{default:h(()=>[x(b,{class:_(["date-text",{"date-placeholder":!r.departureDate}])},{default:h(()=>[y(w(r.departureDate||"请选择出发日期"),1)]),_:1},8,["class"]),x(i,{src:D,style:{width:"32rpx",height:"32rpx"},mode:"aspectFit"})]),_:1},8,["onClick"])]),_:1},8,["class"]),x(o,{class:"",style:{width:"680rpx",height:"2rpx","background-color":"#EAEAEA"}}),x(o,{class:_(["column",{"flash-animation":"petType"===r.flashingField}]),style:{width:"680rpx","margin-top":"14rpx"},id:"fieldPetType"},{default:h(()=>[x(b,{style:{"font-size":"30rpx"}},{default:h(()=>[x(b,{style:{color:"#FF0000"}},{default:h(()=>[y("*")]),_:1}),y("宠物类型")]),_:1}),x(N,{placeholder:"请输入宠物类型(如:狗、猫等)",border:"surround",modelValue:r.petType,"onUpdate:modelValue":t[9]||(t[9]=e=>r.petType=e)},null,8,["modelValue"])]),_:1},8,["class"]),x(o,{class:"",style:{width:"680rpx",height:"2rpx","background-color":"#EAEAEA"}}),x(o,{class:_(["column",{"flash-animation":"petName"===r.flashingField}]),style:{width:"680rpx","margin-top":"14rpx"},id:"fieldPetName"},{default:h(()=>[x(b,{style:{"font-size":"30rpx"}},{default:h(()=>[x(b,{style:{color:"#FF0000"}},{default:h(()=>[y("*")]),_:1}),y("宠物名称")]),_:1}),x(N,{placeholder:"请输入宠物名称",border:"surround",modelValue:r.petName,"onUpdate:modelValue":t[10]||(t[10]=e=>r.petName=e)},null,8,["modelValue"])]),_:1},8,["class"]),x(o,{class:"",style:{width:"680rpx",height:"2rpx","background-color":"#EAEAEA"}}),x(o,{class:_(["column",{"flash-animation":"hasQuarantineCert"===r.flashingField}]),style:{width:"680rpx","margin-top":"14rpx"},id:"fieldHasQuarantineCert"},{default:h(()=>[x(b,{style:{"font-size":"30rpx"}},{default:h(()=>[x(b,{style:{color:"#FF0000"}},{default:h(()=>[y("*")]),_:1}),y("是否有检疫证明")]),_:1}),x(o,{class:"date-item",onClick:t[11]||(t[11]=e=>r.showQuarantinePicker=!0)},{default:h(()=>[x(b,{class:"date-text"},{default:h(()=>[y(w(s.quarantineCertText),1)]),_:1}),x(i,{src:F,style:{width:"32rpx",height:"32rpx"},mode:"aspectFit"})]),_:1})]),_:1},8,["class"]),x(o,{class:"",style:{width:"680rpx",height:"2rpx","background-color":"#EAEAEA"}}),x(o,{class:"center",onClick:t[12]||(t[12]=e=>s.checkData()),style:{width:"642rpx",height:"72rpx","background-color":"#57C9DD","border-radius":"16rpx","box-shadow":"0 0 10rpx 10rpx rgba(0, 0, 0, 0.1)","margin-top":"50rpx","margin-bottom":"100rpx"}},{default:h(()=>[y(w(e.$t("common.submit")),1)]),_:1})]),_:1})]),_:1}),x(T,{show:r.showQuarantinePicker,columns:r.quarantineColumns,onConfirm:s.onQuarantineConfirm,onCancel:t[13]||(t[13]=e=>r.showQuarantinePicker=!1),onClose:t[14]||(t[14]=e=>r.showQuarantinePicker=!1),defaultIndex:[r.quarantineIndex],keyName:"label"},null,8,["show","columns","onConfirm","defaultIndex"]),x($,{show:r.showCalendar,mode:"single",minDate:r.minDate,maxDate:r.maxDate,onConfirm:s.onCalendarConfirm,onClose:s.closeCalendar,confirmText:e.$t("common.confirm"),color:"#57C9DD"},null,8,["show","minDate","maxDate","onConfirm","onClose","confirmText"])]),_:1})}],["__scopeId","data-v-5b1bc6dd"]]);export{V as default};
|