Files
console-dev/app/layouts/public-order.vue
T

229 lines
7.2 KiB
Vue

<script>
/**
* 公开订购布局:为未登录商品流程提供站点配置、主题与登录入口。配置器通过 provide 注册带镜像选择的续接地址,路由变化或旧注销回调不会清除新续接信息。
*/
import "~/assets/styles/ConsoleLegalFooter.DAYWmXIB.css";
import "~/assets/styles/public-order.0RThfr7m.css";
import { provide } from "vue";
import { toDisplayString } from "vue";
import { onMounted } from "vue";
import { normalizeClass } from "vue";
import { renderSlot } from "vue";
import { watch } from "vue";
import { ref } from "vue";
import { withCtx } from "vue";
import { createCommentVNode } from "vue";
import { computed } from "vue";
import { createElementBlock } from "vue";
import { createElementVNode } from "vue";
import { createTextVNode } from "vue";
import { unref } from "vue";
import { defineComponent } from "vue";
import { createVNode } from "vue";
import { openBlock } from "vue";
import { useRoute } from "#app";
import { useHead } from "#app";
import { NuxtLink } from "#components";
import { t as useSiteConfig_t } from "~/lib/useSiteConfig.js";
import { t as _plugin_vue_export_helper_t } from "~/lib/_plugin-vue_export-helper.js";
import { t as useTheme_t } from "~/lib/useTheme.js";
import { t as auth_redirect_t } from "~/lib/auth-redirect.js";
import ConsoleLegalFooter from "~/components/ConsoleLegalFooter.vue";
import { t as order_image_continuation_t } from "~/lib/order-image-continuation.js";
import { logoUrl } from "~/utils/brand.js";
var D = {
class: `public-order-layout`,
},
O = {
class: `public-order-header`,
},
k = {
href: `https://www.crash.work/`,
class: `public-order-brand`,
},
A = [`alt`],
j = {
"aria-label": `产品导航`,
},
M = {
class: `public-order-account`,
},
N = [`aria-label`],
P = {
key: 0,
class: `public-order-maintenance`,
role: `status`,
},
F = {
id: `main-content`,
class: `public-order-content`,
tabindex: `-1`,
},
I = _plugin_vue_export_helper_t(
defineComponent({
__name: `public-order`,
setup(m) {
let x = useRoute(),
I = useTheme_t(),
L = useSiteConfig_t(),
R = ref(``),
z = 0;
(provide(order_image_continuation_t, (e) => {
let t = ++z;
return (
(R.value = e),
() => {
t === z && (R.value = ``);
}
);
}),
watch(
() => x.fullPath,
() => {
(z++, (R.value = ``));
},
));
let B = computed(() =>
auth_redirect_t(`/login`, R.value || x.fullPath),
);
return (
onMounted(() => {
L.load();
}),
useHead(() => ({
title: `产品选购 - ${L.siteName.value}`,
})),
// 公开订购页保留跳转主内容链接及登录入口,登录地址优先使用配置器登记的完整续接地址。
(e, n) => {
let a = NuxtLink,
o = ConsoleLegalFooter;
return (
openBlock(),
createElementBlock(`div`, D, [
(n[5] ||= createElementVNode(
`a`,
{
href: `#main-content`,
class: `skip-link`,
},
`跳转到主要内容`,
-1,
)),
createElementVNode(`header`, O, [
createElementVNode(`a`, k, [
createElementVNode(
`img`,
{
src: logoUrl,
alt: unref(L).siteName.value,
},
null,
8,
A,
),
]),
createElementVNode(`nav`, j, [
createVNode(
a,
{
to: `/products/cloud-server`,
},
{
default: withCtx(() => [
...(n[1] ||= [createTextVNode(`云服务器`, -1)]),
]),
_: 1,
},
),
createVNode(
a,
{
to: `/products/dedicated-server`,
},
{
default: withCtx(() => [
...(n[2] ||= [createTextVNode(`物理服务器`, -1)]),
]),
_: 1,
},
),
createVNode(
a,
{
to: `/products`,
},
{
default: withCtx(() => [
...(n[3] ||= [createTextVNode(`全部产品`, -1)]),
]),
_: 1,
},
),
]),
createElementVNode(`div`, M, [
createElementVNode(
`button`,
{
type: `button`,
"aria-label": `切换主题,当前${unref(I).label.value}`,
onClick: (n[0] ||= (e) => unref(I).cycle()),
},
[
createElementVNode(
`i`,
{
class: normalizeClass(unref(I).icon.value),
"aria-hidden": `true`,
},
null,
2,
),
],
8,
N,
),
createVNode(
a,
{
to: unref(B),
class: `public-order-login`,
},
{
default: withCtx(() => [
...(n[4] ||= [createTextVNode(`登录`, -1)]),
]),
_: 1,
},
8,
[`to`],
),
]),
]),
unref(L).maintenance.value
? (openBlock(),
createElementBlock(
`div`,
P,
toDisplayString(
unref(L).config.value?.maintenance_mode_message ||
`站点维护中,部分功能可能不可用。`,
),
1,
))
: createCommentVNode(``, !0),
createElementVNode(`main`, F, [
renderSlot(e.$slots, `default`, {}, void 0, !0),
]),
createVNode(o),
])
);
}
);
},
}),
[[`__scopeId`, `data-v-f882e304`]],
);
export {};
export default I;
</script>