Files
yuyueguahao/dist/pages/appointment/index.js
T
2026-07-05 14:43:34 +08:00

1 line
7.9 KiB
JavaScript

"use strict";(wx["webpackJsonp"]=wx["webpackJsonp"]||[]).push([[312],{5689:function(e,a,t){var n=t(8774),l=t(2688),s=t(5861),r=t(9439),o=t(7294),c=t(1515),i=t(2954),d=t.n(i),u={aptPage:"index-module__aptPage___fQPEd",cellAccess:"index-module__cellAccess___fKEw4",cellArrow:"index-module__cellArrow___ml9QE",input:"index-module__input___VJmUb",textareaRow:"index-module__textareaRow___LOZ3E",textarea:"index-module__textarea___FzlGD",textareaCounter:"index-module__textareaCounter___FQUmb",aptDeptGroup:"index-module__aptDeptGroup___yU9yI",aptDeptItem:"index-module__aptDeptItem___O6SEn",aptDeptItemActive:"index-module__aptDeptItemActive___vUzis",btnArea:"index-module__btnArea___cKIXR",aptFooter:"index-module__aptFooter___poHou",footerText:"index-module__footerText___JsS2L",aptHotline:"index-module__aptHotline___FhyxW",aptNotice:"index-module__aptNotice___cdSHH",fadeInUp:"index-module__fadeInUp___cBwGo",fadeIn:"index-module__fadeIn___mO7Wt",shimmer:"index-module__shimmer____xi8_",pulse:"index-module__pulse___gylow",slideInRight:"index-module__slideInRight___VAcYF"},m=t(2546),x=t(329),_=t(6),p=t(6931),h=t(5893),f="0512-65863999",v="\u6c5f\u82cf\u7701\u82cf\u5dde\u5e02\u59d1\u82cf\u533a\u5434\u4e2d\u897f\u8def 888 \u53f7",j=500,N=[{value:"\u809b\u80a0",label:"\u809b\u80a0\u4e2d\u5fc3",icon:"\ud83e\ude7a"},{value:"\u80c3\u80a0",label:"\u80c3\u80a0\u4e2d\u5fc3",icon:"\ud83e\uddec"}],b=["\u5468\u65e5","\u5468\u4e00","\u5468\u4e8c","\u5468\u4e09","\u5468\u56db","\u5468\u4e94","\u5468\u516d"];function G(e){if(!e)return"";var a=e.split("-").map(Number),t=(0,r.Z)(a,3),n=t[0],l=t[1],s=t[2],o=new Date(n,l-1,s);return"".concat(e," ").concat(b[o.getDay()])}var w=function(){var e=(0,m.O)(function(e){return e.submit}),a=(0,o.useState)(""),t=(0,r.Z)(a,2),n=t[0],i=t[1],b=(0,o.useState)(""),w=(0,r.Z)(b,2),g=w[0],I=w[1],k=(0,o.useState)(""),A=(0,r.Z)(k,2),D=A[0],S=A[1],T=(0,o.useState)(""),Z=(0,r.Z)(T,2),y=Z[0],C=Z[1],P=(0,o.useState)("\u809b\u80a0"),R=(0,r.Z)(P,2),F=R[0],H=R[1],E=(0,o.useState)(""),O=(0,r.Z)(E,2),U=O[0],B=O[1],q=(0,o.useState)(!1),J=(0,r.Z)(q,2),Q=J[0],W=J[1],z=(0,o.useState)(f),K=(0,r.Z)(z,2),L=K[0],V=K[1],Y=(0,o.useState)(v),X=(0,r.Z)(Y,2),$=X[0],M=X[1];(0,o.useEffect)(function(){var e=(0,_.N8)();e&&!D&&S(e),(0,p.o)().then(function(e){e.phone&&V(e.phone),e.address&&M(e.address)}).catch(function(){})},[]);var ee=function(){var e=L.replace(/[^\d+]/g,"");d().makePhoneCall({phoneNumber:e}).catch(function(e){console.error("[Appointment] call failed",e),d().showToast({title:"\u62e8\u53f7\u5931\u8d25",icon:"none"})})},ae=function(e){var a=e.detail.value;a&&C(a)},te=function(){var a=(0,s.Z)((0,l.Z)().m(function a(){var t,s;return(0,l.Z)().w(function(a){while(1)switch(a.p=a.n){case 0:if(n.trim()){a.n=1;break}return a.a(2,d().showToast({title:"\u8bf7\u8f93\u5165\u60a3\u8005\u59d3\u540d",icon:"none"}));case 1:if(g.trim()&&/^\d{1,3}$/.test(g)){a.n=2;break}return a.a(2,d().showToast({title:"\u8bf7\u8f93\u5165\u6709\u6548\u5e74\u9f84",icon:"none"}));case 2:if((0,x.kj)(D.trim())){a.n=3;break}return a.a(2,d().showToast({title:"\u8bf7\u8f93\u5165\u6709\u6548\u7684\u624b\u673a\u53f7\u7801",icon:"none"}));case 3:if(y){a.n=4;break}return a.a(2,d().showToast({title:"\u8bf7\u9009\u62e9\u9884\u7ea6\u65e5\u671f",icon:"none"}));case 4:return W(!0),a.p=5,a.n=6,e({patientName:n.trim(),patientAge:g.trim(),patientPhone:D.trim(),date:y,departmentName:F,symptom:U.trim()||void 0});case 6:t=a.v,d().navigateTo({url:"/pages/success/index?id=".concat(t.id)}),a.n=8;break;case 7:a.p=7,s=a.v,console.error("[Appointment] submit failed",{message:null===s||void 0===s?void 0:s.message,code:null===s||void 0===s?void 0:s.code,statusCode:null===s||void 0===s?void 0:s.statusCode,stack:null===s||void 0===s?void 0:s.stack}),d().showToast({title:"\u63d0\u4ea4\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5",icon:"none"});case 8:return a.p=8,W(!1),a.f(8);case 9:return a.a(2)}},a,null,[[5,7,8,9]])}));return function(){return a.apply(this,arguments)}}(),ne=!!(n&&g&&(0,x.kj)(D)&&y);return(0,h.jsx)(c.G7,{className:u.aptPage,children:(0,h.jsxs)(c.pf,{scrollY:!0,enhanced:!0,showScrollbar:!1,style:{height:"calc(100vh - 100rpx)"},children:[(0,h.jsx)(c.G7,{className:"section-title",children:"\u60a3\u8005\u4fe1\u606f"}),(0,h.jsxs)(c.G7,{className:"card",children:[(0,h.jsxs)(c.G7,{className:"form-row",children:[(0,h.jsx)(c.xv,{className:"form-label form-label--required",children:"\u59d3\u540d"}),(0,h.jsx)(c.G7,{className:"form-value",children:(0,h.jsx)(c.II,{className:u.input,value:n,placeholder:"\u8bf7\u8f93\u5165\u60a3\u8005\u7684\u59d3\u540d",maxlength:20,onInput:function(e){return i(e.detail.value)}})})]}),(0,h.jsxs)(c.G7,{className:"form-row",children:[(0,h.jsx)(c.xv,{className:"form-label form-label--required",children:"\u5e74\u9f84"}),(0,h.jsx)(c.G7,{className:"form-value",children:(0,h.jsx)(c.II,{className:u.input,value:g,type:"number",placeholder:"\u8bf7\u8f93\u5165\u5e74\u9f84\uff081-150\uff09",maxlength:3,onInput:function(e){return I(e.detail.value)}})})]}),(0,h.jsxs)(c.G7,{className:"form-row",children:[(0,h.jsx)(c.xv,{className:"form-label form-label--required",children:"\u624b\u673a\u53f7"}),(0,h.jsx)(c.G7,{className:"form-value",children:(0,h.jsx)(c.II,{className:u.input,value:D,type:"number",placeholder:"\u8bf7\u8f93\u5165\u6709\u6548\u7684\u624b\u673a\u53f7\u7801",maxlength:11,onInput:function(e){return S(e.detail.value)}})})]})]}),(0,h.jsx)(c.G7,{className:"section-title",children:"\u9884\u7ea6\u4fe1\u606f"}),(0,h.jsx)(c.G7,{className:"card",children:(0,h.jsxs)(c.G7,{className:"form-row ".concat(u.cellAccess),children:[(0,h.jsx)(c.xv,{className:"form-label form-label--required",children:"\u65e5\u671f"}),(0,h.jsx)(c.G7,{className:"form-value",children:(0,h.jsx)(c.cW,{mode:"date",value:y,onChange:ae,children:(0,h.jsx)(c.xv,{className:y?"":"form-placeholder",children:G(y)||"\u70b9\u51fb\u9009\u62e9\u9884\u7ea6\u65e5\u671f"})})}),(0,h.jsx)(c.G7,{className:u.cellArrow})]})}),(0,h.jsx)(c.G7,{className:"section-title",children:"\u5c31\u8bca\u79d1\u5ba4"}),(0,h.jsx)(c.G7,{className:u.aptDeptGroup,children:N.map(function(e){var a=F===e.value;return(0,h.jsx)(c.G7,{className:a?"".concat(u.aptDeptItem," ").concat(u.aptDeptItemActive):u.aptDeptItem,onClick:function(){return H(e.value)},children:(0,h.jsxs)(c.xv,{children:[e.icon," ",e.label]})},e.value)})}),(0,h.jsx)(c.G7,{className:"section-title",children:"\u75c5\u60c5\u63cf\u8ff0\uff08\u9009\u586b\uff09"}),(0,h.jsx)(c.G7,{className:"card",children:(0,h.jsx)(c.G7,{className:"form-row ".concat(u.textareaRow),children:(0,h.jsxs)(c.G7,{className:"form-value",children:[(0,h.jsx)(c.gx,{className:u.textarea,value:U,placeholder:"\u8bf7\u7b80\u8981\u63cf\u8ff0\u60a8\u7684\u75c7\u72b6\u3001\u75c5\u53f2\u3001\u5c31\u8bca\u7ecf\u5386\u7b49\u4fe1\u606f",maxlength:j,onInput:function(e){return B(e.detail.value)},style:{minHeight:"160rpx"}}),(0,h.jsx)(c.G7,{className:u.textareaCounter,children:(0,h.jsxs)(c.xv,{children:[U.length,"/",j]})})]})})}),(0,h.jsx)(c.G7,{className:u.btnArea,children:(0,h.jsx)(c.G7,{className:ne&&!Q?"btn btn--primary":"btn btn--default btn--disabled",onClick:te,children:(0,h.jsx)(c.xv,{children:Q?"\u63d0\u4ea4\u4e2d\u2026":"\u63d0\u4ea4\u9884\u7ea6"})})}),(0,h.jsxs)(c.G7,{className:"page-footer ".concat(u.aptFooter),children:[(0,h.jsxs)(c.G7,{className:u.footerText,children:[(0,h.jsx)(c.xv,{children:"\u5065\u5eb7\u54a8\u8be2\u70ed\u7ebf\uff1a"}),(0,h.jsx)(c.xv,{className:u.aptHotline,onClick:ee,children:L})]}),(0,h.jsx)(c.G7,{className:u.footerText,children:(0,h.jsxs)(c.xv,{children:["\ud83d\udccd ",$]})}),(0,h.jsx)(c.G7,{className:u.aptNotice,children:"\u63d0\u4ea4\u9884\u7ea6\u540e\u533b\u9662\u5c06\u53ca\u65f6\u4e0e\u60a8\u7535\u8bdd\u8054\u7cfb\uff0c\u8bf7\u4fdd\u6301\u624b\u673a\u7545\u901a"})]})]})})},g=w,I={navigationBarTitleText:"\u81ea\u52a9\u9884\u7ea6",navigationBarBackgroundColor:"#2b80f5",navigationBarTextStyle:"white",enablePullDownRefresh:!1},k=(0,n.R4)(g,"pages/appointment/index",{root:{cn:[]}},I||{});g&&g.behaviors&&(k.behaviors=(k.behaviors||[]).concat(g.behaviors));Page(k)}},function(e){var a=function(a){return e(e.s=a)};e.O(0,[107,216,592],function(){return a(5689)});e.O()}]);