edu/h5/assets/pages-news-news.e71c4738.js

2 lines
9.7 KiB
JavaScript
Raw Normal View History

2022-09-16 10:54:32 +00:00
import{_ as e}from"./u-search.939c3f7f.js";import{d as t,A as a,O as s,P as l,B as i,Q as o,o as n,c as u,w as r,G as d,h as c,p as f,q as h,R as v,k as p,T as b,U as m,b as g,m as y,V as x,K as w,W as _,r as k,a as C,e as S,f as T,g as F,l as O,t as z,F as I,X,Y as $,Z as j,i as B}from"./index.5ddae38f.js";import{_ as Y}from"./plugin-vue_export-helper.21dcd24c.js";import{a as N,_ as R}from"./tabbar.3ac4b4ec.js";import{g as W}from"./util.4ba637ba.js";import{_ as H}from"./news-card.cacc1bdf.js";import{_ as V}from"./z-paging.34848bf3.js";import{g as M,a as U}from"./news.7d996083.js";import"./u-icon.947d1557.js";import"./u-image.f03d2bad.js";import"./icon_visit.5f8ba9a3.js";var Z=Y(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),m=a(!1),g=a(!1),y=a(void 0),x=s("updateTabs"),w=s("handleChange"),_=()=>{x&&x()},k=v();console.log(k),w(null==k?void 0:k.props,(e=>{y.value=y.value||e,b.value=e,g.value=y.value,m.value=e})),l((()=>{_()}));const C=i((()=>{const{dot:e,info:a}=t;return{dot:e,info:a}}));return o((()=>C.value),(()=>{_()})),o((()=>t.name),(e=>{_()})),(e,t)=>{const a=p;return n(),u(a,{class:f({active:b.value,inactive:!b.value,tab:!0}),style:h(m.value?"":"display: none;")},{default:r((()=>[g.value?d(e.$slots,"default",{key:0},void 0,!0):c("v-if",!0)])),_:3},8,["class","style"])}}}),[["__scopeId","data-v-9df85c86"]]);var G=Y({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=m(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,i){const o=p;return n(),u(o,{class:""},{default:r((()=>[g(o,{class:f(["u-sticky-wrap",[l.elClass]]),style:h({height:l.fixed?l.height+"px":"auto",backgroundColor:a.bgColor})},{default:r((()=>[g(o,{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:i.uZIndex})},{default:r((()=>[d(e.$slots,"default",{},void 0,!0)])),_:3},8,["style"])])),_:3},8,["class","style"])])),_:3})}],["__scopeId","data-v-9059106a"]]);var Q=Y(t({__name:"tabs",props:{isScroll:{type:Boolean,default:!0},current:{default:0},height:{default:80},fontSize:{default:28},duration:{default:.3},activeColor:{default:"#2073F4"},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},stickyBgColor:{default:"#FFFFFF"},swipeable:{type:Boolean,default:!0}},emits:["change"],setup(e,{emit:t})