Files
2026-07-05 14:43:34 +08:00

1 line
7.6 KiB
JavaScript

"use strict";(wx["webpackJsonp"]=wx["webpackJsonp"]||[]).push([[592],{6799:function(n,t,e){e.d(t,{l:function(){return u}});var r=e(2688),o=e(5861),a=e(2284),u=function(){var n=(0,o.Z)((0,r.Z)().m(function n(){var t;return(0,r.Z)().w(function(n){while(1)switch(n.n){case 0:return n.n=1,(0,a.W)({url:"/api/v1/centers?enabled=true"});case 1:return t=n.v,n.a(2,t.data||[])}},n)}));return function(){return n.apply(this,arguments)}}()},2284:function(n,t,e){e.d(t,{W:function(){return l}});var r=e(2688),o=e(1002),a=e(1413),u=e(5861),c=e(2954),i=e.n(c),s="https://y.szgtlive.com",l=function(){var n=(0,u.Z)((0,r.Z)().m(function n(t){var e,u,c,l,d,p,f,v,h;return(0,r.Z)().w(function(n){while(1)switch(n.p=n.n){case 0:return n.p=0,n.n=1,i().request({url:"".concat(s).concat(t.url),method:t.method||"GET",data:t.data,header:(0,a.Z)({"Content-Type":"application/json"},t.header),timeout:2e4});case 1:if(e=n.v,u=e.data,"string"===typeof u)try{u=JSON.parse(u)}catch(n){}if(!(e.statusCode>=200&&e.statusCode<300)){n.n=3;break}if(!u||"object"!==(0,o.Z)(u)||void 0===u.code||0===u.code){n.n=2;break}throw c=u.message||"\u4e1a\u52a1\u9519\u8bef code=".concat(u.code),l=new Error(c),l.code=u.code,l.data=u.data,l;case 2:return n.a(2,u);case 3:throw console.error("[Request] HTTP error",e),d=new Error("HTTP ".concat(e.statusCode)),d.statusCode=e.statusCode,d;case 4:throw n.p=4,h=n.v,p=h?Object.keys(h):[],f=function(){try{return JSON.stringify(h)}catch(n){return String(h)}}(),v={message:null===h||void 0===h?void 0:h.message,code:null===h||void 0===h?void 0:h.code,statusCode:null===h||void 0===h?void 0:h.statusCode,stack:null===h||void 0===h?void 0:h.stack,errKeys:p,errStringified:f,hint:'\u5982 errStringified="{}" \u63d0\u793a WeChat \u62e6\u622a\u4e86\u975e\u5408\u6cd5\u57df\u540d\u8bf7\u6c42\uff0c\u8bf7\u5728\u516c\u4f17\u5e73\u53f0\u914d\u7f6e https://y.szgtlive.com\uff0c\u6216\u5728\u5f00\u53d1\u8005\u5de5\u5177"\u8be6\u60c5\u2192\u672c\u5730\u8bbe\u7f6e"\u4e2d\u52fe\u9009"\u4e0d\u6821\u9a8c\u5408\u6cd5\u57df\u540d"'},console.error("[Request] failed",t.url,v),h;case 5:return n.a(2)}},n,null,[[0,4]])}));return function(t){return n.apply(this,arguments)}}()},6931:function(n,t,e){e.d(t,{o:function(){return u}});var r=e(2688),o=e(5861),a=e(2284),u=function(){var n=(0,o.Z)((0,r.Z)().m(function n(){var t,e;return(0,r.Z)().w(function(n){while(1)switch(n.p=n.n){case 0:return n.p=0,n.n=1,(0,a.W)({url:"/api/v1/config/site"});case 1:return t=n.v,n.a(2,t.data||{phone:"",address:"",workHours:"7\xd724"});case 2:return n.p=2,e=n.v,console.warn("[site] fetch failed, return empty phone",e),n.a(2,{phone:"",address:"",workHours:"7\xd724"})}},n,null,[[0,2]])}));return function(){return n.apply(this,arguments)}}()},6:function(n,t,e){e.d(t,{JG:function(){return v},N8:function(){return h},TV:function(){return d},oP:function(){return f}});var r=e(2688),o=e(5861),a=e(2954),u=e.n(a),c=e(2284),i="yygh_user_phone",s=null,l=function(){var n=(0,o.Z)((0,r.Z)().m(function n(){var t,e,o;return(0,r.Z)().w(function(n){while(1)switch(n.p=n.n){case 0:if(!s){n.n=1;break}return n.a(2,s);case 1:return n.p=1,n.n=2,(0,c.W)({url:"/api/v1/wechat/phone-required"});case 2:o=n.v,s={requirePhone:!0===(null===(t=o.data)||void 0===t?void 0:t.requirePhone),collectLocation:!0===(null===(e=o.data)||void 0===e?void 0:e.collectLocation)},n.n=4;break;case 3:n.p=3,n.v,s={requirePhone:!1,collectLocation:!1};case 4:return n.a(2,s)}},n,null,[[1,3]])}));return function(){return n.apply(this,arguments)}}(),d=function(){var n=(0,o.Z)((0,r.Z)().m(function n(){var t;return(0,r.Z)().w(function(n){while(1)switch(n.n){case 0:return n.n=1,l();case 1:return t=n.v,n.a(2,t.requirePhone)}},n)}));return function(){return n.apply(this,arguments)}}(),p=function(){var n=(0,o.Z)((0,r.Z)().m(function n(){var t,e,o;return(0,r.Z)().w(function(n){while(1)switch(n.p=n.n){case 0:return n.p=0,n.n=1,l();case 1:if(t=n.v,t.collectLocation){n.n=2;break}return n.a(2,null);case 2:return n.n=3,u().authorize({scope:"scope.userFuzzyLocation"});case 3:return n.n=4,u().getFuzzyLocation({type:"gcj02"});case 4:return e=n.v,n.a(2,{latitude:e.latitude,longitude:e.longitude,accuracy:0});case 5:return n.p=5,o=n.v,console.warn("[Wechat] getFuzzyLocation failed:",(null===o||void 0===o?void 0:o.errMsg)||(null===o||void 0===o?void 0:o.message)),n.a(2,null)}},n,null,[[0,5]])}));return function(){return n.apply(this,arguments)}}(),f=function(){var n=(0,o.Z)((0,r.Z)().m(function n(t){var e,o,a,u;return(0,r.Z)().w(function(n){while(1)switch(n.n){case 0:return n.n=1,p();case 1:return a=n.v,n.n=2,(0,c.W)({url:"/api/v1/wechat/phone",method:"POST",data:{code:t,location:a?{latitude:a.latitude,longitude:a.longitude,accuracy:a.accuracy}:null,authTime:(new Date).toISOString()}});case 2:return u=n.v,n.a(2,(null===(e=u.data)||void 0===e?void 0:e.purePhoneNumber)||(null===(o=u.data)||void 0===o?void 0:o.phoneNumber)||"")}},n)}));return function(t){return n.apply(this,arguments)}}(),v=function(n){n&&u().setStorageSync(i,n)},h=function(){return u().getStorageSync(i)||""}},2546:function(n,t,e){e.d(t,{O:function(){return p}});var r=e(1413),o=e(3433),a=e(2688),u=e(5861),c=e(270),i=e(2284),s=function(){var n=(0,u.Z)((0,a.Z)().m(function n(t){var e;return(0,a.Z)().w(function(n){while(1)switch(n.n){case 0:return console.log("[AppointmentService] createAppointment",t),n.n=1,(0,i.W)({url:"/api/v1/appointments",method:"POST",data:t});case 1:return e=n.v,n.a(2,e.data)}},n)}));return function(t){return n.apply(this,arguments)}}(),l=function(){var n=(0,u.Z)((0,a.Z)().m(function n(t){var e,r;return(0,a.Z)().w(function(n){while(1)switch(n.n){case 0:return console.log("[AppointmentService] fetchMyAppointments",t),e=t?"?phone=".concat(encodeURIComponent(t)):"",n.n=1,(0,i.W)({url:"/api/v1/appointments".concat(e)});case 1:return r=n.v,n.a(2,r.data)}},n)}));return function(t){return n.apply(this,arguments)}}(),d=function(){var n=(0,u.Z)((0,a.Z)().m(function n(t){return(0,a.Z)().w(function(n){while(1)switch(n.n){case 0:return console.log("[AppointmentService] cancelAppointment",t),n.n=1,(0,i.W)({url:"/api/v1/appointments/".concat(t,"/cancel"),method:"PUT"});case 1:return n.a(2,!0)}},n)}));return function(t){return n.apply(this,arguments)}}(),p=(0,c.Ue)(function(n,t){return{appointments:[],loading:!1,loadList:function(){var t=(0,u.Z)((0,a.Z)().m(function t(){var e,r;return(0,a.Z)().w(function(t){while(1)switch(t.p=t.n){case 0:return n({loading:!0}),t.p=1,t.n=2,l();case 2:e=t.v,n({appointments:e,loading:!1}),t.n=4;break;case 3:t.p=3,r=t.v,console.error("[AppointmentStore] loadList failed",{message:null===r||void 0===r?void 0:r.message,code:null===r||void 0===r?void 0:r.code,statusCode:null===r||void 0===r?void 0:r.statusCode,stack:null===r||void 0===r?void 0:r.stack}),n({loading:!1});case 4:return t.a(2)}},t,null,[[1,3]])}));function e(){return t.apply(this,arguments)}return e}(),submit:function(){var e=(0,u.Z)((0,a.Z)().m(function e(r){var u;return(0,a.Z)().w(function(e){while(1)switch(e.n){case 0:return e.n=1,s(r);case 1:return u=e.v,n({appointments:[u].concat((0,o.Z)(t().appointments))}),e.a(2,u)}},e)}));function r(n){return e.apply(this,arguments)}return r}(),cancel:function(){var e=(0,u.Z)((0,a.Z)().m(function e(o){var u;return(0,a.Z)().w(function(e){while(1)switch(e.n){case 0:return e.n=1,d(o);case 1:u=e.v,u&&n({appointments:t().appointments.map(function(n){return n.id===o?(0,r.Z)((0,r.Z)({},n),{},{status:"cancelled"}):n})});case 2:return e.a(2)}},e)}));function o(n){return e.apply(this,arguments)}return o}()}})},329:function(n,t,e){e.d(t,{kj:function(){return a},p6:function(){return u}});var r=e(7484),o=e.n(r),a=function(n){return/^1[3-9]\d{9}$/.test(n)},u=function(n){var t=o()(n),e=["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d"];return"".concat(t.format("MM\u6708DD\u65e5")," \u661f\u671f").concat(e[t.day()])}}}]);