appointment_system/miniprogram/dist/build/h5/assets/pages-appointment-visa-consultation-page.87cb2a6f.js
2025-12-19 00:37:31 +08:00

2 lines
7.8 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{_ as e,m as t,L as l,M as s,l as r,k as a,N as i,O as o,G as n,H as c,o as d,c as u,w as h,i as p,P as m,a4 as f,e as x,f as g,t as y,A as E,g as w,h as b}from"./index-a09151d6.js";import{_}from"./aure-country-picker.01cea584.js";import{A as k}from"./AppServer.888fd24d.js";import{_ as A}from"./ic_back.5440bd15.js";const V=new k;const F=e({data:()=>({serviceId:"",serviceTitle:"",userName:"",userWechat:"",userPhone:"",userWhats:"",remark:"",specificRequirements:"",submitting:!1,flashingField:"",selectedDialCode:"86"}),onLoad(e){e.id&&(this.serviceId=e.id),e.title&&(this.serviceTitle=decodeURIComponent(e.title))},methods:{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:"specificRequirements",selector:"#fieldSpecificRequirements",check:()=>!this.specificRequirements.trim(),message:"请输入具体需求"}];for(const l of e)if(l.check())return t({title:l.message,icon:"none"}),this.scrollToElement(l.selector),this.flashingField=l.field,void setTimeout(()=>{this.flashingField=""},1500);this.submitAppointment()},async submitAppointment(){var e;if(!this.submitting){this.submitting=!0,l({title:"提交中...",mask:!0});try{const l={hotServiceId:parseInt(this.serviceId)||null,serviceType:"visa_consultation",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,specificRequirements:this.specificRequirements.trim()},a=await V.CreateAppointment(l);s(),a.success||0===a.code?(t({title:"预约提交成功",icon:"success"}),setTimeout(()=>{r({delta:1})},1500)):t({title:(null==(e=a.error)?void 0:e.message)||"提交失败,请重试",icon:"none"})}catch(a){s(),console.error("提交预约失败:",a),t({title:"网络错误,请重试",icon:"none"})}finally{this.submitting=!1}}},scrollToElement(e){const t=a().windowHeight,l=i().in(this);l.select(e).boundingClientRect(),l.selectViewport().scrollOffset(),l.exec(e=>{if(e[0]&&e[1]){const l=e[0],s=e[1].scrollTop+l.top-t/2+l.height/2;o({scrollTop:Math.max(0,s),duration:300})}})},back(){r({delta:1})}}},[["render",function(e,t,l,s,r,a){const i=w,o=p,k=b,V=n(c("up-input"),m),F=n(c("aure-country-picker"),_),$=n(c("up-textarea"),f);return d(),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:a.back,style:{width:"48rpx",height:"48rpx"},mode:""},null,8,["onClick"])]),_:1}),x(k,{style:{"font-size":"30rpx"}},{default:h(()=>[g(y(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(()=>[g(y(e.$t("infoEntry.personalInfo")),1)]),_:1}),x(o,{class:E(["column",{"flash-animation":"userName"===r.flashingField}]),style:{width:"680rpx","margin-top":"38rpx"},id:"fieldUserName"},{default:h(()=>[x(k,{style:{"font-size":"30rpx"}},{default:h(()=>[x(k,{style:{color:"#FF0000"}},{default:h(()=>[g("*")]),_:1}),g(y(e.$t("infoEntry.realName")),1)]),_:1}),x(V,{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:E(["column",{"flash-animation":"contact"===r.flashingField}]),style:{width:"680rpx","margin-top":"14rpx"},id:"fieldContact"},{default:h(()=>[x(k,{style:{"font-size":"30rpx"}},{default:h(()=>[x(k,{style:{color:"#FF0000"}},{default:h(()=>[g("*")]),_:1}),g(y(e.$t("infoEntry.wechat"))+" ("+y(e.$t("infoEntry.contactMethod"))+")",1)]),_:1}),x(V,{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:E(["column",{"flash-animation":"contact"===r.flashingField}]),style:{width:"680rpx","margin-top":"14rpx"}},{default:h(()=>[x(k,{style:{"font-size":"30rpx"}},{default:h(()=>[x(k,{style:{color:"#FF0000"}},{default:h(()=>[g("*")]),_:1}),g(y(e.$t("infoEntry.phone"))+" ("+y(e.$t("infoEntry.contactMethod"))+")",1)]),_:1}),x(o,{class:"row",style:{"margin-top":"10rpx","margin-bottom":"10rpx"}},{default:h(()=>[x(F,{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(V,{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:E(["column",{"flash-animation":"contact"===r.flashingField}]),style:{width:"680rpx","margin-top":"14rpx"}},{default:h(()=>[x(k,{style:{"font-size":"30rpx"}},{default:h(()=>[x(k,{style:{color:"#FF0000"}},{default:h(()=>[g("*")]),_:1}),g(y(e.$t("infoEntry.whatsapp"))+" ("+y(e.$t("infoEntry.contactMethod"))+")",1)]),_:1}),x(V,{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(k,{style:{"font-size":"30rpx"}},{default:h(()=>[g(y(e.$t("infoEntry.remark")),1)]),_:1}),x(V,{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(()=>[g(y(e.$t("infoEntry.serviceInfo")),1)]),_:1}),x(o,{class:E(["column",{"flash-animation":"specificRequirements"===r.flashingField}]),style:{width:"680rpx","margin-top":"14rpx"},id:"fieldSpecificRequirements"},{default:h(()=>[x(k,{style:{"font-size":"30rpx"}},{default:h(()=>[x(k,{style:{color:"#FF0000"}},{default:h(()=>[g("*")]),_:1}),g("具体需求")]),_:1}),x($,{modelValue:r.specificRequirements,"onUpdate:modelValue":t[6]||(t[6]=e=>r.specificRequirements=e),placeholder:"请详细描述您的签证咨询需求,如:签证类型、目的国家、出行时间等",maxlength:1e3,count:!0,height:"200",border:"surround"},null,8,["modelValue"])]),_:1},8,["class"]),x(o,{class:"",style:{width:"680rpx",height:"2rpx","background-color":"#EAEAEA"}}),x(o,{class:"center",onClick:t[7]||(t[7]=e=>a.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(()=>[g(y(e.$t("common.submit")),1)]),_:1})]),_:1})]),_:1})]),_:1})}],["__scopeId","data-v-749747de"]]);export{F as default};