1 |
- import{t as e,d as t,Q as o,aY as n,y as a,v as l,a as s,C as i,D as c,E as r,H as u,G as d,c as m,ag as f,B as g,aZ as B,w as b,aq as p,N as h,a_ as w,r as C,J as v,ay as y,z as x,P as k,a$ as S,b0 as T,b1 as D,b2 as E,A as P,ao as A,a4 as O,b3 as H,b4 as N,p as z,g as M,b5 as U,s as F}from"./index-81a4e71e.js";const[I,j]=e("action-bar"),q=Symbol(I),G=i(t({name:I,props:{placeholder:Boolean,safeAreaInsetBottom:l},setup(e,{slots:t}){const l=o(),i=n(l,j),{linkChildren:c}=a(q);c();const r=()=>{var o;return s("div",{ref:l,"class":[j(),{"van-safe-area-bottom":e.safeAreaInsetBottom}]},[null==(o=t["default"])?void 0:o.call(t)])};return()=>e.placeholder?i(r):r()}})),[J,K]=e("action-bar-button"),L=i(t({name:J,props:c({},r,{type:String,text:String,icon:String,color:String,loading:Boolean,disabled:Boolean}),setup(e,{slots:t}){const o=u(),{parent:n,index:a}=d(q),l=m((()=>{if(n){const e=n.children[a.value-1];return!(e&&"isButton"in e)}})),i=m((()=>{if(n){const e=n.children[a.value+1];return!(e&&"isButton"in e)}}));return f({isButton:!0}),()=>{const{type:n,icon:a,text:c,color:r,loading:u,disabled:d}=e;return s(g,{"class":K([n,{last:i.value,first:l.value}]),size:"large",type:n,icon:a,color:r,loading:u,disabled:d,onClick:o},{"default":()=>[t["default"]?t["default"]():c]})}}})),[Q,R,V]=e("dialog"),W=c({},B,{title:String,theme:String,width:b,message:[String,Function],callback:Function,allowHtml:Boolean,className:p,transition:h("van-dialog-bounce"),messageAlign:String,closeOnPopstate:l,showCancelButton:Boolean,cancelButtonText:String,cancelButtonColor:String,cancelButtonDisabled:Boolean,confirmButtonText:String,confirmButtonColor:String,confirmButtonDisabled:Boolean,showConfirmButton:l,closeOnClickOverlay:Boolean}),Y=[...w,"transition","closeOnPopstate"];var Z=t({name:Q,props:W,emits:["confirm","cancel","keydown","update:show"],setup(e,{emit:t,slots:n}){const a=o(),l=C({confirm:!1,cancel:!1}),i=e=>t("update:show",e),c=t=>{var o;i(!1),null==(o=e.callback)||o.call(e,t)},r=o=>()=>{e.show&&(t(o),e.beforeClose?(l[o]=!0,A(e.beforeClose,{args:[o],done(){c(o),l[o]=!1},canceled(){l[o]=!1}})):c(o))},u=r("cancel"),d=r("confirm"),m=S((o=>{var n,l;o.target===(null==(l=null==(n=a.value)?void 0:n.popupRef)?void 0:l.value)&&({Enter:e.showConfirmButton?d:T,Escape:e.showCancelButton?u:T}[o.key](),t("keydown",o))}),["enter","esc"]),f=()=>{const t=n.title?n.title():e.title;if(t)return s("div",{"class":R("header",{isolated:!e.message&&!n["default"]})},[t])},B=t=>{const{message:o,allowHtml:n,messageAlign:a}=e,l=R("message",{"has-title":t,[a]:a}),i=D(o)?o():o;return n&&"string"==typeof i?s("div",{"class":l,innerHTML:i},null):s("div",{"class":l},[i])},b=()=>{if(n["default"])return s("div",{"class":R("content")},[n["default"]()]);const{title:t,message:o,allowHtml:a}=e;if(o){const e=!(!t&&!n.title);return s("div",{key:a?1:0,"class":R("content",{isolated:!e})},[B(e)])}};return()=>{const{width:t,title:o,theme:c,message:r,className:B}=e;return s(k,v({ref:a,role:"dialog","class":[R([c]),B],style:{width:x(t)},tabindex:0,"aria-labelledby":o||r,onKeydown:m,"onUpdate:show":i},y(e,Y)),{"default":()=>[f(),b(),n.footer?n.footer():"round-button"===e.theme?s(G,{"class":R("footer")},{"default":()=>[e.showCancelButton&&s(L,{type:"warning",text:e.cancelButtonText||V("cancel"),"class":R("cancel"),color:e.cancelButtonColor,loading:l.cancel,disabled:e.cancelButtonDisabled,onClick:u},null),e.showConfirmButton&&s(L,{type:"danger",text:e.confirmButtonText||V("confirm"),"class":R("confirm"),color:e.confirmButtonColor,loading:l.confirm,disabled:e.confirmButtonDisabled,onClick:d},null)]}):s("div",{"class":[P,R("footer")]},[e.showCancelButton&&s(g,{size:"large",text:e.cancelButtonText||V("cancel"),"class":R("cancel"),style:{color:e.cancelButtonColor},loading:l.cancel,disabled:e.cancelButtonDisabled,onClick:u},null),e.showConfirmButton&&s(g,{size:"large",text:e.confirmButtonText||V("confirm"),"class":[R("confirm"),{[E]:e.showCancelButton}],style:{color:e.confirmButtonColor},loading:l.confirm,disabled:e.confirmButtonDisabled,onClick:d},null)])]})}}});let $,_=c({},{title:"",width:"",theme:null,message:"",overlay:!0,callback:null,teleport:"body",className:"",allowHtml:!1,lockScroll:!0,transition:void 0,beforeClose:null,overlayClass:"",overlayStyle:void 0,messageAlign:"",cancelButtonText:"",cancelButtonColor:null,cancelButtonDisabled:!1,confirmButtonText:"",confirmButtonColor:null,confirmButtonDisabled:!1,showConfirmButton:!0,showCancelButton:!1,closeOnPopstate:!0,closeOnClickOverlay:!1});function X(e){return O?new Promise(((t,o)=>{$||function(){const e={setup(){const{state:e,toggle:t}=N();return()=>s(Z,v(e,{"onUpdate:show":t}),null)}};({instance:$}=H(e))}(),$.open(c({},_,e,{callback:e=>{("confirm"===e?t:o)(e)}}))})):Promise.resolve(void 0)}const ee=e=>X(c({showCancelButton:!0},e));i(Z);const te=()=>{z({api:"back"});const e=M();let t="/";if((/gym.lexiaoya.cn/.test(location.origin)||/test.gym.lexiaoya.cn/.test(location.origin))&&(t="/mdaya/"),e.isApp){const e=window.location.origin+t+"#/member";z({api:"openWebView",content:{url:e,orientation:1}})}else location.href=window.location.origin+t+"#/member"},oe=()=>!(!U().isBefore(U(F.user.data.student.membershipEndTime))&&!F.user.data.isExistPendingMember),ne=()=>!("STUDENT"==F.platformType&&!U().isBefore(U(F.user.data.student.membershipEndTime))&&!F.user.data.isExistPendingMember&&(X({title:"温馨提示",message:"您暂未开通云练习,请开通后使用"}).then((()=>{te()})),1));export{ne as a,X as b,te as g,oe as h,ee as s};
|