2024-11-18 07:34:57 +00:00
|
|
|
import{_ as e}from"./page-meta.6bd66ef8.js";import{d as t,z as a,L as s,M as l,c as o,A as i,o as n,b as u,w as r,E as d,f as c,j as f,n as h,N as v,p,C as b,O as g,e as m,G as y,P as x,r as _,a as w,g as k,F as C,h as S,x as T,l as z,t as F,Q as O,R as I,T as j,U as $,V as X,I as B,i as Y}from"./index-97dc0e87.js";import{_ as N}from"./u-search.e6f6de6e.js";import{_ as R}from"./_plugin-vue_export-helper.1b428a4d.js";import{_ as H}from"./u-badge.9a4bd895.js";import{_ as W}from"./tabbar.vue_vue_type_script_setup_true_lang.f37ef74e.js";import{_ as M}from"./news-card.7e60e21a.js";import{_ as V}from"./z-paging.a15b466f.js";import{g as U,a as A}from"./news.439dcf33.js";import"./u-icon.0d1f3a20.js";import"./u-image.04b3b3fb.js";import"./icon_visit.713e13e8.js";const E=R(t({__name:"tab",props:{dot:{type:[Boolean,String],default:!1},name:{type:[Boolean,String],default:""},info:null},setup(e){const t=e,b=a(!1),g=a(!1),m=a(!1),y=a(void 0),x=s("updateTabs"),_=s("handleChange"),w=()=>{x&&x()},k=v();console.log(k),_(null==k?void 0:k.props,(e=>{y.value=y.value||e,b.value=e,m.value=y.value,g.value=e})),l((()=>{w()}));const C=o((()=>{const{dot:e,info:a}=t;return{dot:e,info:a}}));return i((()=>C.value),(()=>{w()})),i((()=>t.name),(e=>{w()})),(e,t)=>{const a=p;return n(),u(a,{class:f({active:b.value,inactive:!b.value,tab:!0}),style:h(g.value?"":"display: none;")},{default:r((()=>[m.value?d(e.$slots,"default",{key:0},void 0,!0):c("",!0)])),_:3},8,["class","style"])}}}),[["__scopeId","data-v-a5e2333b"]]);const G=R({name:"u-sticky",emits:["fixed","unfixed"],props:{offsetTop:{type:[Number,String],default:0},index:{type:[Number,String],default:""},enable:{type:Boolean,default:!0},h5NavHeight:{type:[Number,String],default:44},bgColor:{type:String,default:"#ffffff"},zIndex:{type:[Number,String],default:""}},data(){return{fixed:!1,height:"auto",stickyTop:0,elClass:this.$u.guid(),left:0,width:"auto"}},watch:{offsetTop(e){this.initObserver()},enable(e){0==e?(this.fixed=!1,this.disconnectObserver("contentObserver")):this.initObserver()}},computed:{uZIndex(){return this.zIndex?this.zIndex:this.$u.zIndex.sticky}},mounted(){this.initObserver()},methods:{initObserver(){this.enable&&(this.stickyTop=0!=this.offsetTop?b(this.offsetTop)+this.h5NavHeight:this.h5NavHeight,this.disconnectObserver("contentObserver"),this.$uGetRect("."+this.elClass).then((e=>{this.height=e.height,this.left=e.left,this.width=e.width,this.$nextTick((()=>{this.observeContent()}))})))},observeContent(){this.disconnectObserver("contentObserver");const e=g(this,{thresholds:[.95,.98,1]});e.relativeToViewport({top:-this.stickyTop}),e.observe("."+this.elClass,(e=>{this.enable&&this.setFixed(e.boundingClientRect.top)})),this.contentObserver=e},setFixed(e){const t=e<this.stickyTop;t?this.$emit("fixed",this.index):this.fixed&&this.$emit("unfixed",this.index),this.fixed=t},disconnectObserver(e){const t=this[e];t&&t.disconnect()}},beforeUnmount(){this.disconnectObserver("contentObserver")}},[["render",function(e,t,a,s,l,o){const i=p;return n(),u(i,{class:""},{default:r((()=>[m(i,{class:f(["u-sticky-wrap",[l.elClass]]),style:h({height:l.fixed?l.height+"px":"auto",backgroundColor:a.bgColor})},{default:r((()=>[m(i,{class:"u-sticky",style:h({position:l.fixed?"fixed":"static",top:l.stickyTop+"px",left:l.left+"px",width:"auto"==l.width?"auto":l.width+"px",zIndex:o.uZIndex})},{default:r((()=>[d(e.$slots,"default",{},void 0,!0)])),_:3},8,["style"])])),_:3},8,["class","style"])])),_:3})}],["__scopeId","data-v-74e1f11e"]]);const Q=R(t({__name:"tabs",props:{isScroll:{type:Boolean,default:!0},current:{default:0},height:{default:80},fontSize:{default:28},duration:{default:.3},activeColor:{default:"var(--color-primary)"},inactiveColor:{default:"#333"},barWidth:{default:40},barHeight:{default:4},gutter:{default:30},bgColor:{default:"#FFFFFF"},name:{default:"name"},count:{default:"count"},offset:{default:[5,20]},bold:{type:Boolean,default:!0},activeItemStyle:{default:{}},showBar:{type:Boolean,default:!0},barStyle:{default:{}},itemWidth:{default:"auto"},isFixed:{type:Boolean,default:!1},top:{default:0},sticky
|