generated from liutk/owl-admin-base
111 lines
6.4 KiB
JavaScript
111 lines
6.4 KiB
JavaScript
import { _ as __nuxt_component_0 } from './HeaderImage-92nFA80c.mjs';
|
||
import { _ as __nuxt_component_1 } from './TabsHeader-C0yMA2hS.mjs';
|
||
import { defineComponent, ref, withAsyncContext, computed, watchEffect, mergeProps, isRef, unref, useSSRContext } from 'vue';
|
||
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate, ssrRenderList, ssrRenderClass, ssrRenderAttr } from 'vue/server-renderer';
|
||
import { u as useRequest } from './useRequest-pSRZvR3u.mjs';
|
||
import { b as useRouter } from './server.mjs';
|
||
import { u as useAsyncData } from './asyncData-D5wEK86T.mjs';
|
||
import './virtual_public-Ch4_18y6.mjs';
|
||
import '../routes/renderer.mjs';
|
||
import 'vue-bundle-renderer/runtime';
|
||
import '../nitro/nitro.mjs';
|
||
import 'node:http';
|
||
import 'node:https';
|
||
import 'node:events';
|
||
import 'node:buffer';
|
||
import 'node:fs';
|
||
import 'node:path';
|
||
import 'node:crypto';
|
||
import 'node:url';
|
||
import 'unhead/server';
|
||
import 'devalue';
|
||
import 'unhead/plugins';
|
||
import 'unhead/utils';
|
||
import 'vue-router';
|
||
import 'axios';
|
||
import 'perfect-debounce';
|
||
|
||
const _sfc_main = /* @__PURE__ */ defineComponent({
|
||
__name: "index",
|
||
__ssrInlineRender: true,
|
||
async setup(__props) {
|
||
let __temp, __restore;
|
||
useRouter();
|
||
const request = useRequest();
|
||
const activeTab = ref("");
|
||
const { data: tagsRes } = ([__temp, __restore] = withAsyncContext(async () => useAsyncData(
|
||
"case-study-tags",
|
||
async () => await request.get("/api/case_study_tags")
|
||
)), __temp = await __temp, __restore(), __temp);
|
||
const tabList = computed(() => {
|
||
const res = tagsRes.value;
|
||
if (!res || res.code !== 200 || !Array.isArray(res.data)) return [];
|
||
return res.data.map((t) => ({ id: String(t.id), name: t.name }));
|
||
});
|
||
watchEffect(() => {
|
||
if (!activeTab.value && tabList.value.length > 0) {
|
||
const first = tabList.value[0];
|
||
if (first) activeTab.value = first.id;
|
||
}
|
||
});
|
||
const { data: caseRes } = ([__temp, __restore] = withAsyncContext(async () => useAsyncData(
|
||
() => `case-studies-${activeTab.value || "empty"}`,
|
||
async () => {
|
||
if (!activeTab.value) return null;
|
||
return await request.get("/api/case_studies", {
|
||
params: { t_ids: activeTab.value }
|
||
});
|
||
},
|
||
{ watch: [activeTab] }
|
||
)), __temp = await __temp, __restore(), __temp);
|
||
const currentTabInfoData = computed(() => {
|
||
const headText = "我们深耕行业,已累计承接各类环境服务项目35+,与众多行业标杆客户建立起长期信赖的合作关系。以下是我们按业务领域分类的部分实践成果。";
|
||
const res = caseRes.value;
|
||
const list = res?.code === 200 && Array.isArray(res.data) ? res.data : [];
|
||
return {
|
||
title: headText,
|
||
list: list.map((item) => ({
|
||
id: String(item.id),
|
||
title: item.title,
|
||
keyWords: Array.isArray(item.tags) ? item.tags.map((t) => t.name) : [],
|
||
desc: item.description,
|
||
url: item.cover
|
||
}))
|
||
};
|
||
});
|
||
return (_ctx, _push, _parent, _attrs) => {
|
||
const _component_HeaderImage = __nuxt_component_0;
|
||
const _component_TabsHeader = __nuxt_component_1;
|
||
_push(`<div${ssrRenderAttrs(mergeProps({ class: "w-full" }, _attrs))}>`);
|
||
_push(ssrRenderComponent(_component_HeaderImage, {
|
||
title: "服务案例",
|
||
img: "/images/服务案例/服务案例.png"
|
||
}, null, _parent));
|
||
_push(ssrRenderComponent(_component_TabsHeader, {
|
||
tabs: unref(tabList),
|
||
activeTab: unref(activeTab),
|
||
"onUpdate:activeTab": ($event) => isRef(activeTab) ? activeTab.value = $event : null,
|
||
title: "服务案例"
|
||
}, null, _parent));
|
||
_push(`<div class="w-full pb-[20px] sm:pb-[24px] md:pb-[30px] lg:pb-[38px] xl:pb-[45px]"><div class="w-full layout pt-[28px] sm:pt-[34px] md:pt-[44px] lg:pt-[54px] xl:pt-[64px]"><div class="flex flex-col items-center w-full"><p class="mt-[18px] sm:mt-[18px] md:mt-[20px] lg:mt-[22px] xl:mt-[24px] max-w-[800px] text-center text-[12px] sm:text-[14px] md:text-[16px] lg:text-[18px] xl:text-[20px] text-[#333333] leading-relaxed">${ssrInterpolate(unref(currentTabInfoData).title)}</p></div><div class="w-full mt-[28px] sm:mt-[32px] md:mt-[36px] lg:mt-[40px] xl:mt-[44px] flex flex-col items-center gap-[40px] sm:gap-[36px] md:gap-[40px] lg:gap-[44px] xl:gap-[48px]"><!--[-->`);
|
||
ssrRenderList(unref(currentTabInfoData).list, (item, index) => {
|
||
_push(`<div class="w-full bg-[#FFFFFF] overflow-hidden transition-all duration-300 ease-out hover:-translate-y-1 hover:shadow-[0_12px_24px_rgba(0,0,0,0.12)]"><div class="${ssrRenderClass([{ "md:flex-row-reverse": index % 2 === 1 }, "flex flex-col md:flex-row"])}"><div class="w-full md:w-1/2"><img class="w-full h-[220px] sm:h-[240px] md:h-[100%] object-cover"${ssrRenderAttr("src", item.url)}${ssrRenderAttr("alt", item.title)}></div><div class="flex items-start w-full md:w-1/2"><div class="px-[18px] sm:px-[20px] md:px-[24px] lg:px-[28px] xl:px-[32px] py-[18px] sm:py-[20px] md:py-[22px] lg:py-[24px] xl:py-[26px]"><h2 class="text-left text-[#333333] font-bold text-[18px] sm:text-[18px] md:text-[20px] lg:text-[22px] xl:text-[24px]">${ssrInterpolate(item.title)}</h2><div class="mt-[10px] flex flex-wrap gap-[8px] sm:gap-[6px] md:gap-[8px] lg:gap-[10px] xl:gap-[12px] text-[12px] sm:text-[12px] md:text-[13px] lg:text-[14px] xl:text-[14px] text-[#2D75B5]"><!--[-->`);
|
||
ssrRenderList(item.keyWords, (keyWord) => {
|
||
_push(`<span> #${ssrInterpolate(keyWord)}</span>`);
|
||
});
|
||
_push(`<!--]--></div><p class="mt-[12px] text-[#333333] text-[12px] sm:text-[13px] md:text-[14px] lg:text-[15px] xl:text-[16px] leading-relaxed">${ssrInterpolate(item.desc)}</p><div class="mt-[14px]"><button class="px-[18px] sm:px-[18px] md:px-[20px] lg:px-[22px] xl:px-[24px] py-[6px] sm:py-[6px] md:py-[8px] lg:py-[8px] xl:py-[10px] border border-[#1364AF] rounded-full text-[12px] sm:text-[12px] md:text-[13px] lg:text-[14px] xl:text-[14px] text-[#2D75B5] bg-white hover:bg-[#1364AF] hover:text-white transition-colors duration-300"> 了解更多 >> </button></div></div></div></div></div>`);
|
||
});
|
||
_push(`<!--]--></div></div></div></div>`);
|
||
};
|
||
}
|
||
});
|
||
const _sfc_setup = _sfc_main.setup;
|
||
_sfc_main.setup = (props, ctx) => {
|
||
const ssrContext = useSSRContext();
|
||
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/service/index.vue");
|
||
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
||
};
|
||
|
||
export { _sfc_main as default };
|
||
//# sourceMappingURL=index-DDtxt1bx.mjs.map
|