2 lines
9.2 KiB
JavaScript
2 lines
9.2 KiB
JavaScript
|
|
import{d as V,u as j,m as G,p as M,c as d,b as e,e as b,w as r,q as U,f as t,t as a,F as g,r as y,s as v,i as E,h as S,j as z,o,k as I,v as W,g as q}from"./index-DopNG1aC.js";import{p as k,_ as Y}from"./index-DGfZijDv.js";import{u as T}from"./uploadUrl-CyxyoWKj.js";const J="/assets/image6-e_NR8C7k.jpeg",Q={class:"home-page"},X={class:"hero-section"},ee={class:"hero-content container"},se={class:"stats-section section"},te={class:"container stats-inner"},oe={class:"home-section-head home-section-head--on-dark"},ae={class:"home-section-head__en"},ne={class:"home-section-head__title"},ce={class:"stats-grid"},le={class:"stat-number"},ie={class:"stat-label"},de={class:"about-section section"},re={class:"container"},he={class:"home-section-head"},_e={class:"home-section-head__title"},ue={class:"about-content"},me={class:"about-desc"},ve={class:"products-section section",style:{background:"@gray-50"}},pe={class:"container"},ge={class:"home-section-head"},ye={class:"home-section-head__title"},fe={class:"home-triple-row"},be={class:"home-tile-card__media"},ke=["src","alt"],we={key:1,class:"home-tile-card__placeholder"},Ee={class:"home-tile-card__body"},Ce={class:"home-tile-card__title"},ze={class:"home-tile-card__excerpt"},Ie={class:"home-tile-card__meta home-tile-card__meta--link"},Se={key:1,class:"products-grid"},xe={class:"product-card-icon"},Ze={class:"home-section-footer"},Le={class:"tech-section section"},Ne={class:"container"},Te={class:"home-section-head"},Pe={class:"home-section-head__title"},Re={class:"tech-grid"},Ae={class:"cases-section section",style:{background:"@gray-50"}},$e={class:"container"},Be={class:"home-section-head"},Ue={class:"home-section-head__title"},He={class:"home-slide-card home-slide-card--case card"},Oe={class:"home-slide-card__body"},De={class:"home-section-footer"},Ke={class:"news-section section"},Fe={class:"container"},Ve={class:"home-section-head"},je={class:"home-section-head__title"},Ge={class:"home-triple-row"},Me={class:"home-tile-card__media"},We=["src","alt"],qe={key:1,class:"home-tile-card__placeholder"},Ye={class:"home-tile-card__body"},Je={class:"home-tile-card__title"},Qe={class:"home-tile-card__excerpt"},Xe={class:"home-tile-card__meta"},es=["datetime"],ss={key:0,class:"home-tile-card__cat"},ts={class:"home-section-footer"},os=V({__name:"HomePage",setup(as){const{t:l,locale:u}=j(),P=E([]),R=E([]),x=E([]),A=E([]),Z=E([]),L=E([]),C=E(3);function $(i,n){if(n<1)return[i];const m=[];for(let h=0;h<i.length;h+=n)m.push(i.slice(h,h+n));return m}const H=S(()=>$(x.value,C.value)),O=S(()=>$(L.value,C.value)),B=S(()=>C.value===1?"440px":"510px");function N(){C.value=typeof window<"u"&&window.innerWidth<768?1:3}function D(i){const n=u.value==="zh",m=n?i.excerptZh:i.excerptEn,h=n?i.descriptionZh:i.descriptionEn,_=(m||h||"").trim();return _.length>160?`${_.slice(0,160)}…`:_}function K(i){const n=u.value==="zh",m=n?i.excerptZh:i.excerptEn,h=n?i.contentZh:i.contentEn,_=h?h.replace(/<[^>]+>/g,"").trim():"",w=(m||_||"").trim();return w.length>160?`${w.slice(0,160)}…`:w}const F=S(()=>[{labelKey:"lines",value:l("home.stats.lines"),label:l("home.stats.linesLabel")},{labelKey:"galvanizing",value:l("home.stats.galvanizing"),label:l("home.stats.galvanizingLabel")},{labelKey:"overseas",value:l("home.stats.overseas"),label:l("home.stats.overseasLabel")},{labelKey:"heating",value:l("home.stats.heating"),label:l("home.stats.heatingLabel")}]);return G(async()=>{N(),window.addEventListener("resize",N);try{const[i,n,m,h,_,w]=await Promise.all([k.getBanners(),k.getProductCategories(),k.getProductLines({isFeatured:1}),k.getTechnologies(),k.getCases({isFeatured:1}),k.getNewsList({})]);P.value=i.data||[],R.value=(n.data||[]).filter(p=>!p.parentId),A.value=h.data||[];let f=m.data||[];if(f.length)f=f.slice(0,12);else try{f=((await k.getProductLines({})).data||[]).slice(0,10)}catch(p){console.error("首页整线机组备选列表失败",p)}x.value=f;let s=_.data||[];if(s.length)s=s.slice(0,12);else try{s=((await k.getCases({})).data||[]).slice(0,12)}catch(p){console.error("首页成功案例备选列表失败",p)}Z
|