pages-index-FirstList.CN9Eewop.js 4.3 KB

1
  1. import{h as t,c as a,s as e,r as i,t as s,v as o,o as l,m as n,p as r,q as c,a as p,b as d,d as u,w as g,A as f,_ as m,i as y,e as _,g as v,j as x,x as I,y as b,F as k,z as C,u as $,f as h,n as U,k as j,l as F}from"./index-B06NhMHz.js";import{_ as S}from"./s-empty.D5pwX64R.js";import{_ as A}from"./uni-load-more.DiMUgNcM.js";import{_ as w}from"./s-tabbar.DmlmXQ31.js";import{_ as z}from"./youjiantou.DF0dutcV.js";import{_ as M}from"./_plugin-vue_export-helper.BCo6x5W8.js";/* empty css */const q=M({__name:"FirstList",props:{tabbar:{type:Boolean,default:!0},categoryId:{type:Number,default:0},type:{type:String,default:"articleCard"}},setup(M){t(),a((()=>e.$store("app").info));const{safeArea:q}=e.$platform.device;a((()=>q.height-45));const B=M,N=i("articleCard");B.type&&(N.value=B.type);const T=i({theme:"red",style:{bgType:"color",bgColor:"#ffffff",color:"#3c3c3c",activeColor:"#1fa380"},items:[{text:s("common.home"),url:"/pages/index/FirstIndex",iconUrl:e.$url.static("/static/firstIndex/index.svg"),activeIconUrl:e.$url.static("/static/firstIndex/index-active.svg")},{text:s("common.activities"),url:"/pages/index/FirstActivity",iconUrl:e.$url.static("/static/firstIndex/activity.svg"),activeIconUrl:e.$url.static("/static/firstIndex/activity-active.svg")},{text:s("common.videos"),url:"/pages/index/FirstVideo",iconUrl:e.$url.static("/static/firstIndex/video.svg"),activeIconUrl:e.$url.static("/static/firstIndex/video-active.svg")},{text:s("common.mall"),url:"/pages/index/index",iconUrl:e.$url.static("/static/firstIndex/shop.svg"),activeIconUrl:e.$url.static("/static/firstIndex/shop-active.svg")}]}),L=o({categoryId:0,pagination:{list:[],current_page:1,total:1,last_page:1},loadStatus:""});async function V(t=1,a=5){L.loadStatus="loading";let{code:e,data:i}=await f.getArticleByCategory({pageNo:t,pageSize:a,categoryId:L.categoryId});if(0!==e)return;let s=m.concat(L.pagination.list,i.list);L.pagination.list=s,L.pagination.total=i.total,L.pagination.last_page=Math.ceil(i.total/5),L.pagination.current_page<L.pagination.last_page?L.loadStatus="more":L.loadStatus="noMore",console.log(L.pagination.list,L.pagination.total)}return l((async t=>{t&&t.categoryId?L.categoryId=t.categoryId:L.categoryId=B.categoryId,await V()})),n((()=>{"noMore"!==L.loadStatus&&(L.pagination.current_page+=1,V(L.pagination.current_page))})),r((()=>{L.pagination.list=[],L.pagination.current_page=1,L.pagination.total=1,L.pagination.last_page=1,V(),setTimeout((function(){c()}),800)})),(t,a)=>{const i=y,o=j,l=F,n=p(d("s-empty"),S),r=p(d("uni-load-more"),A),c=p(d("s-tabbar"),w);return _(),u(i,{class:"page-body",style:{background:"#f6f6f6"}},{default:g((()=>[v(x(N.value)+" ",1),L.pagination.total>0&&"activityCard"==N.value?(_(),u(i,{key:0},{default:g((()=>[(_(!0),I(k,null,b(L.pagination.list,(t=>(_(),u(i,{class:"article ss-r-10",onClick:a=>{$(e).$router.go("/pages/public/richtext",{title:t.title})}},{default:g((()=>[h(i,{class:"title"},{default:g((()=>[v(x(t.title),1)])),_:2},1024),h(i,{class:"content"},{default:g((()=>[t.picUrl.trim()?(_(),u(i,{key:0,class:"image"},{default:g((()=>[h(o,{src:t.picUrl,mode:"aspectFit",class:"image-content"},null,8,["src"])])),_:2},1024)):C("",!0),h(i,{class:"desc"},{default:g((()=>[v(x(t.introduction),1)])),_:2},1024)])),_:2},1024)])),_:2},1032,["onClick"])))),256))])),_:1})):C("",!0),L.pagination.total>0&&"articleCard"==N.value?(_(),u(i,{key:1},{default:g((()=>[(_(!0),I(k,null,b(L.pagination.list,(t=>(_(),u(i,{class:"activity ss-r-10",style:U({backgroundImage:`url(${t.picUrl})`}),onClick:a=>{$(e).$router.go("/pages/public/richtext",{title:t.title})}},{default:g((()=>[h(i,{class:"activity-bottom"},{default:g((()=>[h(l,null,{default:g((()=>[v(x(t.title),1)])),_:2},1024),h(i,{class:""},{default:g((()=>[h(o,{src:z,mode:"aspectFit"})])),_:1})])),_:2},1024)])),_:2},1032,["style","onClick"])))),256))])),_:1})):C("",!0),0===L.pagination.total?(_(),u(n,{key:2,icon:"/static/data-empty.png",text:$(s)("common.no_data")},null,8,["text"])):C("",!0),L.pagination.total>0?(_(),u(r,{key:3,status:L.loadStatus,"content-text":{contentdown:"上拉加载更多"},onClick:t.loadmore},null,8,["status","onClick"])):C("",!0),h(c,{path:"/pages/index/FirstIndex",tabbar:T.value},null,8,["tabbar"])])),_:1})}}},[["__scopeId","data-v-1209b259"]]);export{q as default};