Files
mini-yu/unpackage/dist/build/web/assets/pages-index-index.DbD4HGdN.js
lingxiao865 c5af079d8c first commit
2026-02-10 08:05:03 +08:00

2 lines
10 KiB
JavaScript

import{o as t,c as a,w as o,r as e,n as s,a as n,b as i,i as r,d as l,e as u,f as c,g as p,h as d,j as h,k as m,l as g,m as b,p as y,F as v,s as D,q as f,S as T,t as x,u as S,v as k,x as C,y as _,z as w}from"./index-CJxdOECQ.js";import{u as B,p as $,t as z,g as M,a as P,_ as I,b as E,c as L,r as A}from"./button.BC3KjxGU.js";import{u as F}from"./using-custom-navbar.D_-3PoX-.js";const G=`${$}-draggable`;const j=I(B({name:G,options:{styleIsolation:"shared"},props:{...{direction:{type:String,value:"all"},tClass:{type:String,default:""},tClassButton:{type:String,default:""},customStyle:{type:[String,Object],default:""}}},emits:["move","start","end"],data:()=>({prefix:$,classPrefix:G,tools:z,systemInfo:M()}),mounted(){this.computedRect()},methods:{onTouchStart(t){const{systemInfo:a}=this;"none"!==this.direction&&(this.startX=t.touches[0].clientX+a.windowWidth-this.rect.right,this.startY=t.touches[0].clientY+a.windowHeight-this.rect.bottom,this.$emit("start",{startX:this.startX,startY:this.startY,rect:this.rect,e:t}))},onTouchMove(t){const{systemInfo:a}=this;if("none"===this.direction)return;let o=this.startX-t.touches[0].clientX,e=this.startY-t.touches[0].clientY;"vertical"===this.direction&&(o=a.windowWidth-this.rect.right),"horizontal"===this.direction&&(e=a.windowHeight-this.rect.bottom),this.$emit("move",{x:o,y:e,rect:this.rect,e:t})},async onTouchEnd(t){"none"!==this.direction&&(await this.computedRect(),this.$emit("end",{rect:this.rect,e:t}))},async computedRect(){this.rect={right:0,bottom:0,width:0,height:0};try{this.rect=await P(this,`.${this.classPrefix}`)}catch(t){}}}}),[["render",function(l,u,c,p,d,h){const m=r;return t(),a(m,{class:s([l.classPrefix,l.tClass]),style:n(l.tools._style([l.customStyle])),onTouchstart:l.onTouchStart,onTouchmove:i(l.onTouchMove,["stop","prevent"]),onTouchend:l.onTouchEnd},{default:o((()=>[e(l.$slots,"default",{},void 0,!0)])),_:3},8,["class","style","onTouchstart","onTouchmove","onTouchend"])}],["__scopeId","data-v-74d90c49"]]),O={buttonProps:{type:Object},draggable:{type:[String,Boolean],default:!1},icon:{type:String,default:""},style:{type:String,default:"right: 16px; bottom: 32px;"},text:{type:String,default:""},usingCustomNavbar:Boolean,yBounds:{type:Array},onClick:{type:Function,default:()=>({})},onDragEnd:{type:Function,default:()=>({})},onDragStart:{type:Function,default:()=>({})}},X=`${$}-fab`,Y={size:"large",shape:"circle",theme:"primary",tClass:`${$}-fab__button`};const R=I(B({name:X,options:{styleIsolation:"shared"},externalClasses:[`${$}-class`,`${$}-class-button`],mixins:[F],components:{TButton:E,TDraggable:j},props:{...O},emits:["move","start","end"],data:()=>({prefix:$,classPrefix:X,moveStyle:null,tools:z,systemInfo:M()}),computed:{buttonData(){return{...Y,shape:this.text?"round":"circle",...this.buttonProps,icon:this.icon,content:this.text,ariaLabel:this.ariaLabel}}},watch:{icon:"computedSize",ariaLabel:"computedSize",yBounds:"computedSize",buttonProps:"computedSize",text:{handler(t){this.content=t,this.computedSize()},immediate:!0}},methods:{onTplButtonTap(t){this.$emit("click",{e:t})},onStart(t){this.$emit("drag-start",t)},onMove(t){const{yBounds:a=[],distanceTop:o,systemInfo:e}=this,{x:s,y:n,rect:i}=t,r=e.windowWidth-i.width,l=e.windowHeight-Math.max(o,L(a[0]))-i.height,u=Math.max(0,Math.min(s,r)),c=Math.max(0,L(a[1]),Math.min(n,l));this.moveStyle=`right: ${u}px; bottom: ${c}px;`},onEnd(t){this.$emit("drag-end",t)},computedSize(){this.draggable&&setTimeout((()=>{var t,a,o;const e=null==(a=null==(t=this.$refs.draggableTemplate)?void 0:t.$refs)?void 0:a.draggable;(null==(o=null==this?void 0:this.yBounds)?void 0:o[1])?(this.moveStyle=`bottom: ${L(this.yBounds[1])}px`,null==e||e.computedRect()):null==e||e.computedRect()}))},getActionClass:(t,a)=>`${t}-${a}`}}),[["render",function(i,u,c,p,d,h){const m=A(l("t-button"),E),g=A(l("t-draggable"),j),b=r;return i.draggable?(t(),a(g,{key:0,ref:"draggable","custom-style":i.tools._style(["right: 16px; bottom: 32px;",i.customStyle,i.moveStyle]),direction:!0===i.draggable?"all":i.draggable,"t-class":i.tClass,onStart:i.onStart,onMove:i.onMove,onEnd:i.onEnd},{default:o((()=>[i.buttonData.content||i.buttonData.icon?(t(),a(m,{key:1,"t-id":i.buttonData.tId,"custom-style":i.buttonData.style||"",block:i.buttonData.block,class:s(i.getActionClass(i.classPrefix,i.buttonData.buttonLayout)||""),"t-class":i.buttonData.tClass,disabled:i.buttonData.disabled,"data-type":"action","data-extra":i.buttonData.index,"custom-dataset":i.buttonData.customDataset,content:i.buttonData.content,icon:i.buttonData.icon,loading:i.buttonData.loading,"loading-props":i.buttonData.loadingProps,theme:i.buttonData.theme,ghost:i.buttonData.ghost,shape:i.buttonData.shape,size:i.buttonData.size,variant:i.buttonData.variant,"open-type":i.buttonData.openType,"hover-class":i.buttonData.hoverClass,"hover-stop-propagation":i.buttonData.hoverStopPropagation,"hover-start-time":i.buttonData.hoverStartTime,"hover-stay-time":i.buttonData.hoverStayTime,lang:i.buttonData.lang,"session-from":i.buttonData.sessionFrom,"send-message-title":i.buttonData.sendMessageTitle,"send-message-path":i.buttonData.sendMessagePath,"send-message-img":i.buttonData.sendMessageImg,"app-parameter":i.buttonData.appParameter,"show-message-card":i.buttonData.showMessageCard,"aria-label":i.buttonData.ariaLabel,onClick:i.onTplButtonTap,onGetuserinfo:i.onTplButtonTap,onContact:i.onTplButtonTap,onGetphonenumber:i.onTplButtonTap,onError:i.onTplButtonTap,onOpensetting:i.onTplButtonTap,onLaunchapp:i.onTplButtonTap,onAgreeprivacyauthorization:i.onTplButtonTap},{default:o((()=>[e(i.$slots,"default",{key:0},void 0,!0)])),_:3},8,["t-id","custom-style","block","class","t-class","disabled","data-extra","custom-dataset","content","icon","loading","loading-props","theme","ghost","shape","size","variant","open-type","hover-class","hover-stop-propagation","hover-start-time","hover-stay-time","lang","session-from","send-message-title","send-message-path","send-message-img","app-parameter","show-message-card","aria-label","onClick","onGetuserinfo","onContact","onGetphonenumber","onError","onOpensetting","onLaunchapp","onAgreeprivacyauthorization"])):e(i.$slots,"default",{key:0},void 0,!0)])),_:3},8,["custom-style","direction","t-class","onStart","onMove","onEnd"])):(t(),a(b,{key:1,class:s([i.classPrefix,i.tClass]),style:n(i.tools._style(["right: 16px; bottom: 32px;",i.customStyle]))},{default:o((()=>[i.buttonData&&(i.buttonData.content||i.buttonData.icon)?(t(),a(m,{key:1,"t-id":i.buttonData.tId,"custom-style":i.buttonData.style||"",block:i.buttonData.block,class:s(i.getActionClass(i.classPrefix,i.buttonData.buttonLayout)||""),"t-class":i.buttonData.tClass,disabled:i.buttonData.disabled,"data-type":"action","data-extra":i.buttonData.index,"custom-dataset":i.buttonData.customDataset,content:i.buttonData.content,icon:i.buttonData.icon,loading:i.buttonData.loading,"loading-props":i.buttonData.loadingProps,theme:i.buttonData.theme,ghost:i.buttonData.ghost,shape:i.buttonData.shape,size:i.buttonData.size,variant:i.buttonData.variant,"open-type":i.buttonData.openType,"hover-class":i.buttonData.hoverClass,"hover-stop-propagation":i.buttonData.hoverStopPropagation,"hover-start-time":i.buttonData.hoverStartTime,"hover-stay-time":i.buttonData.hoverStayTime,lang:i.buttonData.lang,"session-from":i.buttonData.sessionFrom,"send-message-title":i.buttonData.sendMessageTitle,"send-message-path":i.buttonData.sendMessagePath,"send-message-img":i.buttonData.sendMessageImg,"app-parameter":i.buttonData.appParameter,"show-message-card":i.buttonData.showMessageCard,"aria-label":i.buttonData.ariaLabel,onClick:i.onTplButtonTap,onGetuserinfo:i.onTplButtonTap,onContact:i.onTplButtonTap,onGetphonenumber:i.onTplButtonTap,onError:i.onTplButtonTap,onOpensetting:i.onTplButtonTap,onLaunchapp:i.onTplButtonTap,onAgreeprivacyauthorization:i.onTplButtonTap},{default:o((()=>[e(i.$slots,"default",{},void 0,!0)])),_:3},8,["t-id","custom-style","block","class","t-class","disabled","data-extra","custom-dataset","content","icon","loading","loading-props","theme","ghost","shape","size","variant","open-type","hover-class","hover-stop-propagation","hover-start-time","hover-stay-time","lang","session-from","send-message-title","send-message-path","send-message-img","app-parameter","show-message-card","aria-label","onClick","onGetuserinfo","onContact","onGetphonenumber","onError","onOpensetting","onLaunchapp","onAgreeprivacyauthorization"])):e(i.$slots,"default",{key:0},void 0,!0)])),_:3},8,["class","style"]))}],["__scopeId","data-v-e2150818"]]),H=I(c({__name:"index",setup(e){const s=p(null),n=p([{image:"https://picsum.photos/800/400?random=1",title:"专业美容服务"},{image:"https://picsum.photos/800/400?random=2",title:"预约更便捷"},{image:"https://picsum.photos/800/400?random=3",title:"优惠活动"}]),i=p([{icon:"📅",text:"我要预约",path:"/pages/booking/booking"},{icon:"📋",text:"我的预约",path:"/pages/appointments/appointments"}]);d((()=>{h("token")?s.value=h("user"):m({url:"/pages/login/login"})}));const u=()=>{D({title:"提示",content:"确定要退出登录吗?",success:t=>{t.confirm&&(f("token"),f("user"),m({url:"/pages/login/login"}))}})};return(e,s)=>{const c=C,p=_,d=T,h=r,m=w,D=A(l("t-fab"),R);return t(),a(h,{class:"container"},{default:o((()=>[g(h,{class:"swiper-container"},{default:o((()=>[g(d,{class:"swiper","indicator-dots":!0,autoplay:!0,interval:3e3,duration:500,"indicator-color":"rgba(255, 255, 255, 0.5)","indicator-active-color":"#FF7A00"},{default:o((()=>[(t(!0),b(v,null,y(n.value,((e,s)=>(t(),a(p,{key:s,class:"swiper-item"},{default:o((()=>[g(c,{src:e.image,class:"banner-image",mode:"aspectFill","lazy-load":""},null,8,["src"])])),_:2},1024)))),128))])),_:1})])),_:1}),g(h,{class:"grid-scroll"},{default:o((()=>[g(h,{class:"grid-container"},{default:o((()=>[(t(!0),b(v,null,y(i.value,((e,s)=>(t(),a(h,{key:e.path,class:"grid-item",onClick:t=>{return a=e.path,void k({url:a});var a}},{default:o((()=>[g(h,{class:"grid-icon"},{default:o((()=>[x(S(e.icon),1)])),_:2},1024),g(m,{class:"grid-text"},{default:o((()=>[x(S(e.text),1)])),_:2},1024)])),_:2},1032,["onClick"])))),128))])),_:1})])),_:1}),g(D,{icon:"caret-right","aria-label":"退出",onClick:u})])),_:1})}}}),[["__scopeId","data-v-4a80eaa6"]]);export{H as default};