| 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 d,b as p,d as u,w as g,A as f,_ as m,i as y,e as _,x as v,y as x,F as I,z as b,u as k,f as C,g as $,j as h,n as U,k as j,l as F}from"./index-rA9LQu-Z.js";import{_ as S}from"./s-empty.DeUWkR30.js";import{_ as A}from"./uni-load-more.DxBzzO3U.js";import{_ as w}from"./s-tabbar.DG8GxPLd.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=d(p("s-empty"),S),r=d(p("uni-load-more"),A),c=d(p("s-tabbar"),w);return _(),u(i,{class:"page-body",style:{background:"#f6f6f6"}},{default:g((()=>[L.pagination.total>0&&"activityCard"==N.value?(_(),u(i,{key:0},{default:g((()=>[(_(!0),v(I,null,x(L.pagination.list,(t=>(_(),u(i,{class:"article ss-r-10",onClick:a=>{k(e).$router.go("/pages/public/richtext",{title:t.title})}},{default:g((()=>[C(i,{class:"title"},{default:g((()=>[$(h(t.title),1)])),_:2},1024),C(i,{class:"content"},{default:g((()=>[t.picUrl.trim()?(_(),u(i,{key:0,class:"image"},{default:g((()=>[C(o,{src:t.picUrl,mode:"aspectFit",class:"image-content"},null,8,["src"])])),_:2},1024)):b("",!0),C(i,{class:"desc"},{default:g((()=>[$(h(t.introduction),1)])),_:2},1024)])),_:2},1024)])),_:2},1032,["onClick"])))),256))])),_:1})):b("",!0),L.pagination.total>0&&"articleCard"==N.value?(_(),u(i,{key:1},{default:g((()=>[(_(!0),v(I,null,x(L.pagination.list,(t=>(_(),u(i,{class:"activity ss-r-10",style:U({backgroundImage:`url(${t.picUrl})`}),onClick:a=>{k(e).$router.go("/pages/public/richtext",{title:t.title})}},{default:g((()=>[C(i,{class:"activity-bottom"},{default:g((()=>[C(l,null,{default:g((()=>[$(h(t.title),1)])),_:2},1024),C(i,{class:""},{default:g((()=>[C(o,{src:z,mode:"aspectFit"})])),_:1})])),_:2},1024)])),_:2},1032,["style","onClick"])))),256))])),_:1})):b("",!0),0===L.pagination.total?(_(),u(n,{key:2,icon:"/static/data-empty.png",text:k(s)("common.no_data")},null,8,["text"])):b("",!0),L.pagination.total>0?(_(),u(r,{key:3,status:L.loadStatus,"content-text":{contentdown:"上拉加载更多"},onClick:t.loadmore},null,8,["status","onClick"])):b("",!0),C(c,{path:"/pages/index/FirstIndex",tabbar:T.value},null,8,["tabbar"])])),_:1})}}},[["__scopeId","data-v-eb79d777"]]);export{q as default};
|