2 lines
6.1 KiB
JavaScript
2 lines
6.1 KiB
JavaScript
import{c as Z,d as N,l as S,o as P,D as $,b as n,e as t,t as r,p as d,k as h,i as g,B as V,F as w,h as z,m as B,z as C,R as I,r as p,g as s,j as T,y as O,_ as x}from"./index-eVF4AHSu.js";import{a as D}from"./news-Bx-JnXBe.js";import{r as L}from"./media-BgGGvhcR.js";import"./pagination-BgSlm-mj.js";const j=Z();function F(l){return{id:Number(l.id??0),titleZh:String(l.titleZh??l.title??""),coverImage:typeof l.coverImage=="string"?l.coverImage:typeof l.image=="string"?l.image:null,type:l.type!==void 0?String(l.type):void 0}}async function U(l){const o=l==null?void 0:l.trim();try{const i=await j.get("/portal/honor/list",{params:o?{type:o}:{}});return Array.isArray(i)?i.map(u=>F(u&&typeof u=="object"?u:{})):[]}catch(i){console.warn("[portal/honor/list] fallback:",i);const u=["certificate","award","patent"];return Array.from({length:9}).map((b,y)=>({id:600+y,titleZh:["ISO 质量管理体系 · 占位","年度创新奖 · 占位","实用新型专利证书 · 占位"][y%3],coverImage:null,type:u[y%u.length]}))}}const M=Z();async function R(l){try{const o=await M.get("/portal/page/blocks",{params:{pageCode:l}});if(!o||typeof o!="object")return{};const i={};for(const[u,b]of Object.entries(o))i[u]=b==null?"":typeof b=="string"?b:String(b);return i}catch(o){return console.warn("[portal/page/blocks] fallback:",o),{story_title_zh:"",factory_title_zh:"",honors_title_zh:"",news_intro_zh:""}}}const G={class:"about-page"},E={class:"about-banner"},Y={class:"container"},q={class:"title-lg"},J={class:"banner-slogan"},K={key:0,class:"banner-meta"},Q={key:0},W={class:"container about-main"},X={class:"about-tabs"},H={key:0,class:"tab-pane surface"},tt={class:"story-layout"},et={class:"story-content"},st={class:"tab-title"},ot={class:"story-body"},at={key:1,class:"tab-pane surface"},nt={class:"tab-title"},rt={class:"factory-body"},lt={key:2,class:"tab-pane surface"},it={class:"tab-title"},ct={key:0,class:"honor-grid"},dt={class:"honor-image"},ut=["src","alt"],vt={key:1,class:"placeholder-cover"},bt={class:"honor-info"},_t={class:"honor-name"},yt={key:0,class:"honor-org muted"},ht={key:1,class:"muted"},pt={key:3,class:"tab-pane surface"},mt={class:"news-header"},ft={class:"tab-title"},gt={key:0,class:"about-news-grid"},kt={class:"news-cover"},wt=["src","alt"],zt={key:1,class:"placeholder-cover"},Ct={class:"news-info"},It={class:"news-title"},Zt={class:"news-date muted"},At={key:1,class:"muted"},Nt=N({__name:"AboutView",setup(l){const{t:o}=S(),i=p(null),u=p({}),b=p([]),y=p([]),c=p("story");function m(...v){for(const e of v){const _=u.value[e];if(typeof _=="string"&&_.trim())return _}return""}function k(v){return L(v??void 0)}function A(v){if(!v)return"";const e=new Date(v);return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}return P(async()=>{try{const[v,e,_,f]=await Promise.all([$(),R("about"),U(),D({page:1,size:6})]);i.value=v,u.value=e,b.value=_,y.value=f.records}catch(v){console.error("[AboutView] mount",v)}}),(v,e)=>{var _,f;return s(),n("div",G,[t("section",E,[t("div",Y,[e[4]||(e[4]=t("div",{class:"kicker-en"},"ABOUT CHUANGGAO",-1)),t("h1",q,r(((_=i.value)==null?void 0:_.brandNameZh)||"关于创高"),1),t("p",J,r(((f=i.value)==null?void 0:f.sloganZh)||d(o)("about.subtitle")),1),i.value?(s(),n("div",K,[t("span",null,r(d(o)("common.hotlineLabel"))+": "+r(i.value.hotline),1),i.value.email?(s(),n("span",Q," | "+r(i.value.email),1)):h("",!0)])):h("",!0)])]),t("div",W,[t("div",X,[t("button",{type:"button",class:g(["tab-btn",{active:c.value==="story"}]),onClick:e[0]||(e[0]=a=>c.value="story")},r(d(o)("about.tabStory")),3),t("button",{type:"button",class:g(["tab-btn",{active:c.value==="factory"}]),onClick:e[1]||(e[1]=a=>c.value="factory")},r(d(o)("about.tabFactory")),3),t("button",{type:"button",class:g(["tab-btn",{active:c.value==="honors"}]),onClick:e[2]||(e[2]=a=>c.value="honors")},r(d(o)("about.tabHonors")),3),t("button",{type:"button",class:g(["tab-btn",{active:c.value==="news"}]),onClick:e[3]||(e[3]=a=>c.value="news")},r(d(o)("about.tabNews")),3)]),c.value==="story"?(s(),n("div",H,[t("div",tt,[t("div",et,[t("h2",st,r(m("story_title_zh","storyTitle")||"品牌故事"),1),t("div",ot,r(m("story_body_zh")||d(o)("about.storyCopy")),1)]),e[5]||(e[5]=t("div",{class:"story-image"},[t("div",{class:"placeholder-cover story-ph"})],-1))])])):h("",!0),c.value==="factory"?(s(),n("div",at,[t("h2",nt,r(m("factory_title_zh")||"工厂实力"),1),t("div",rt,r(m("factory_body_zh")||d(o)("about.factoryCopy")),1),e[6]||(e[6]=V('<div class="factory-grid" data-v-618501bb><div class="factory-item" data-v-618501bb><div class="placeholder-cover" data-v-618501bb></div><p class="item-label muted" data-v-618501bb>现代化生产基地</p></div><div class="factory-item" data-v-618501bb><div class="placeholder-cover" data-v-618501bb></div><p class="item-label muted" data-v-618501bb>精密加工设备</p></div><div class="factory-item" data-v-618501bb><div class="placeholder-cover" data-v-618501bb></div><p class="item-label muted" data-v-618501bb>品质检测中心</p></div></div>',1))])):h("",!0),c.value==="honors"?(s(),n("div",lt,[t("h2",it,r(d(o)("about.honorsTitle")),1),b.value.length?(s(),n("div",ct,[(s(!0),n(w,null,z(b.value,a=>(s(),n("div",{key:a.id,class:"honor-card"},[t("div",dt,[a.coverImage?(s(),n("img",{key:0,src:k(a.coverImage),alt:a.titleZh,loading:"lazy"},null,8,ut)):(s(),n("div",vt))]),t("div",bt,[t("div",_t,r(a.titleZh),1),a.issueOrgZh?(s(),n("div",yt,r(a.issueOrgZh),1)):h("",!0)])]))),128))])):(s(),n("p",ht,"暂无荣誉资质数据"))])):h("",!0),c.value==="news"?(s(),n("div",pt,[t("div",mt,[t("h2",ft,r(d(o)("about.newsTitle")),1),B(d(I),{class:"news-more",to:"/news"},{default:C(()=>[...e[7]||(e[7]=[T("查看全部",-1)])]),_:1})]),y.value.length?(s(),n("div",gt,[(s(!0),n(w,null,z(y.value,a=>(s(),O(d(I),{key:a.id,class:"about-news-card",to:`/news/${a.id}`},{default:C(()=>[t("div",kt,[a.coverImage?(s(),n("img",{key:0,src:k(a.coverImage),alt:a.titleZh,loading:"lazy"},null,8,wt)):(s(),n("div",zt))]),t("div",Ct,[t("div",It,r(a.titleZh),1),t("div",Zt,r(A(a.publishedAt)),1)])]),_:2},1032,["to"]))),128))])):(s(),n("p",At,"暂无新闻资讯"))])):h("",!0)])])}}}),Bt=x(Nt,[["__scopeId","data-v-618501bb"]]);export{Bt as default};
|