16 changed files with 429 additions and 245 deletions
@ -1,20 +1,27 @@ |
|||||
<template> |
<template> |
||||
<el-breadcrumb v-if="data" class="sm:py-4 sm:px-0 px-3 py-2" :separator-icon="ArrowRight"> |
|
||||
<el-breadcrumb-item :to="{ path: '/' }"><el-icon><ElIconHouse /></el-icon></el-breadcrumb-item> |
|
||||
<el-breadcrumb-item v-if="data.parentName" :to="{ path: data.parentStatus == 0 ? data.parentPath : ''}">{{ data.parentName }}</el-breadcrumb-item> |
|
||||
<el-breadcrumb-item v-if="data.categoryName" :to="{ path: data.categoryPath }">{{ data.categoryName }}</el-breadcrumb-item> |
|
||||
<el-breadcrumb-item>{{ data.title }}</el-breadcrumb-item> |
|
||||
</el-breadcrumb> |
|
||||
|
<div class="sm:py-4 sm:px-0 mx-3 py-2"> |
||||
|
<el-breadcrumb :separator-icon="ArrowRight"> |
||||
|
<el-breadcrumb-item :to="{ path: '/' }"><el-icon><ElIconHouse /></el-icon></el-breadcrumb-item> |
||||
|
<el-breadcrumb-item v-if="data?.parentName" :to="{ path: data.parentStatus == 0 ? data.parentPath : ''}">{{ data.parentName }}</el-breadcrumb-item> |
||||
|
<el-breadcrumb-item v-if="data?.categoryName" :to="{ path: data.categoryPath }">{{ data.categoryName }}</el-breadcrumb-item> |
||||
|
<el-breadcrumb-item>{{ title || data?.title }}</el-breadcrumb-item> |
||||
|
</el-breadcrumb> |
||||
|
</div> |
||||
</template> |
</template> |
||||
|
|
||||
<script setup lang="ts"> |
<script setup lang="ts"> |
||||
import { ArrowRight } from '@element-plus/icons-vue' |
import { ArrowRight } from '@element-plus/icons-vue' |
||||
import type {Navigation} from "~/api/cms/navigation/model"; |
import type {Navigation} from "~/api/cms/navigation/model"; |
||||
|
|
||||
|
const route = useRoute(); |
||||
|
|
||||
withDefaults( |
withDefaults( |
||||
defineProps<{ |
defineProps<{ |
||||
// 选中的角色 |
// 选中的角色 |
||||
data?: Navigation; |
data?: Navigation; |
||||
|
title?: string; |
||||
}>(), |
}>(), |
||||
{} |
{} |
||||
); |
); |
||||
|
|
||||
</script> |
</script> |
||||
|
@ -0,0 +1,39 @@ |
|||||
|
<template> |
||||
|
<el-card class="m-5"> |
||||
|
<!-- 维护中 --> |
||||
|
<el-result |
||||
|
v-if="website.status == 1" |
||||
|
:icon="'warning'" |
||||
|
:title="status" |
||||
|
:sub-title="website.statusText" |
||||
|
> |
||||
|
<template #extra> |
||||
|
<el-button @click="navigateTo(`https://${website.tenantId}.wsdns.cn`)">网站首页</el-button> |
||||
|
<el-button @click="navigateTo(`https://${website.tenantId}.websoft.top`)">管理后台</el-button> |
||||
|
</template> |
||||
|
</el-result> |
||||
|
<!-- 已关闭 --> |
||||
|
<el-result |
||||
|
v-if="website.status == 2" |
||||
|
:icon="'error'" |
||||
|
:title="status" |
||||
|
:sub-title="website.statusClose || '网站功能未开通或管理员操作关闭'" |
||||
|
> |
||||
|
<template #extra> |
||||
|
<el-button type="primary" v-if="!website.statusClose" @click="navigateTo(`https://www.websoft.top/product/124`)">{{ website.statusClose }}去开通</el-button> |
||||
|
</template> |
||||
|
</el-result> |
||||
|
</el-card> |
||||
|
<div></div> |
||||
|
</template> |
||||
|
<script setup lang="ts"> |
||||
|
import {useWebsite} from "~/composables/configState"; |
||||
|
|
||||
|
const website = useWebsite() |
||||
|
|
||||
|
const status = ['运行中','维护中','已关闭'][Number(website.value.status)]; |
||||
|
|
||||
|
const navigateTo = (url: string) => { |
||||
|
window.location.href = url; |
||||
|
} |
||||
|
</script> |
@ -0,0 +1,53 @@ |
|||||
|
<template> |
||||
|
<!-- Banner --> |
||||
|
<Banner :data="form" /> |
||||
|
|
||||
|
<div v-if="form" class="flex flex-col w-full md:w-3/4 m-auto my-3"> |
||||
|
|
||||
|
<Breadcrumb :data="form" title="文章详情" /> |
||||
|
|
||||
|
<div class="m-3 bg-white p-3 mt-4 flex flex-col gap-xl rounded-lg"> |
||||
|
<div class="article-title-box p-4"> |
||||
|
<div class="sm:text-3xl text-xl sm:text-left text-center">{{ form.title }}</div> |
||||
|
<div class="text-sm pt-2 text-gray-4 flex gap-xl sm:text-left sm:justify-start justify-center"> |
||||
|
<span>{{ form.createTime }}</span> |
||||
|
<span>浏览:{{ form.actualViews }}</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
<el-divider style="height: 1px " /> |
||||
|
<div class="content leading-8 sm:text-xl px-3 text-gray-700" v-html="form.content"></div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div v-if="!form"> |
||||
|
<el-empty description="404 页面不存在"></el-empty> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script setup lang="ts"> |
||||
|
import type {ApiResult} from "~/api"; |
||||
|
import {useServerRequest} from "~/composables/useServerRequest"; |
||||
|
import type {Goods} from "~/api/shop/goods/model"; |
||||
|
import type {Article} from "~/api/cms/article/model"; |
||||
|
import Breadcrumb from "~/components/Breadcrumb.vue"; |
||||
|
import {getIdByParam} from "~/utils/common"; |
||||
|
|
||||
|
const route = useRoute(); |
||||
|
const { params } = route; |
||||
|
const { id } = params; |
||||
|
|
||||
|
// 页面信息 |
||||
|
const form = ref<Article | any>(); |
||||
|
|
||||
|
// 请求数据 |
||||
|
const { data: info } = await useServerRequest<ApiResult<Article>>('/cms/article/' + getIdByParam(id)) |
||||
|
form.value = info.value?.data; |
||||
|
form.value.num = 1; |
||||
|
form.value.radio = '0' |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
.content *{ |
||||
|
max-width: 100%; |
||||
|
overflow: hidden; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,58 @@ |
|||||
|
<template> |
||||
|
<!-- Banner --> |
||||
|
<Banner :data="form" /> |
||||
|
|
||||
|
<div v-if="form" class="flex flex-col w-full md:w-3/4 m-auto my-3"> |
||||
|
|
||||
|
<Breadcrumb :data="form" /> |
||||
|
|
||||
|
<div class="p-4 mt-4 flex flex-col gap-xl"> |
||||
|
<div class="article-title-box p-4"> |
||||
|
<div class="text-3xl">{{ form.title }}</div> |
||||
|
<div class="text-sm pt-3 text-gray-4 flex gap-xl"> |
||||
|
<span>{{ form.createTime }}</span> |
||||
|
<span>浏览:{{ form.actualViews }}</span> |
||||
|
</div> |
||||
|
<el-divider style="height: 1px " /> |
||||
|
</div> |
||||
|
<div class="content leading-8 text-xl p-3 text-gray-8" v-html="form.content"></div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div v-if="!form"> |
||||
|
<el-empty description="404 页面不存在"></el-empty> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script setup lang="ts"> |
||||
|
import type {ApiResult} from "~/api"; |
||||
|
import {useServerRequest} from "~/composables/useServerRequest"; |
||||
|
import type {Goods} from "~/api/shop/goods/model"; |
||||
|
import type {Article} from "~/api/cms/article/model"; |
||||
|
import Breadcrumb from "~/components/Breadcrumb.vue"; |
||||
|
|
||||
|
const route = useRoute(); |
||||
|
const { query, params } = route; |
||||
|
const { id } = params; |
||||
|
const activeName = ref('parameter'); |
||||
|
const rate = ref(4); |
||||
|
|
||||
|
|
||||
|
// 页面信息 |
||||
|
const form = ref<Article | any>(); |
||||
|
|
||||
|
// 请求数据 |
||||
|
const { data: info } = await useServerRequest<ApiResult<Article>>('/cms/article/' + id) |
||||
|
form.value = info.value?.data; |
||||
|
// form.value.files = JSON.parse(form.value.files); |
||||
|
form.value.num = 1; |
||||
|
form.value.radio = '0' |
||||
|
|
||||
|
const handleClick = (tab, event) => { |
||||
|
console.log(tab, event); |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
.content *{ |
||||
|
max-width: 100%; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,67 @@ |
|||||
|
<template> |
||||
|
<!-- Banner --> |
||||
|
<Banner :data="form" /> |
||||
|
|
||||
|
<!-- 容器 --> |
||||
|
<div class="container md:w-3/4 m-auto"> |
||||
|
<div class="flex flex-col"> |
||||
|
<Breadcrumb :title="`站内搜索`" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div v-if="!form"> |
||||
|
<el-empty description="404 页面不存在"></el-empty> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script setup lang="ts"> |
||||
|
import type {Design} from "~/api/cms/design/model"; |
||||
|
import type {ApiResult} from "~/api"; |
||||
|
import {useServerRequest} from "~/composables/useServerRequest"; |
||||
|
import {useConfigInfo, useToken} from "~/composables/configState"; |
||||
|
import Breadcrumb from "~/components/Breadcrumb.vue"; |
||||
|
import type {BreadcrumbItem} from "~/types/global"; |
||||
|
import type {Navigation} from "~/api/cms/navigation/model"; |
||||
|
|
||||
|
const route = useRoute(); |
||||
|
const { params } = route; |
||||
|
const { custom: path } = params; |
||||
|
|
||||
|
// 网站配置信息 |
||||
|
const config = useConfigInfo(); |
||||
|
const token = useToken(); |
||||
|
// 页面信息 |
||||
|
const form = ref<Navigation | any>(); |
||||
|
const breadcrumb = ref<BreadcrumbItem>(); |
||||
|
|
||||
|
// 请求数据 |
||||
|
const { data: nav } = await useServerRequest<ApiResult<Navigation>>('/cms/navigation/getNavigationByPath',{ |
||||
|
query: { |
||||
|
path: '/' + path |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
if (nav.value) { |
||||
|
// seo |
||||
|
form.value = nav.value.data |
||||
|
if(form.value){ |
||||
|
useHead({ |
||||
|
title: `${form.value.title} - 网宿软件`, |
||||
|
meta: [{ name: form.value.design.keywords, content: form.value.design.description }], |
||||
|
bodyAttrs: { |
||||
|
class: "page-container", |
||||
|
}, |
||||
|
script: [ |
||||
|
{ |
||||
|
children: "console.log('Hello World')", |
||||
|
}, |
||||
|
], |
||||
|
}); |
||||
|
// 面包屑 |
||||
|
breadcrumb.value = form.value.breadcrumb |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
|
||||
|
</style> |
@ -1,44 +1,61 @@ |
|||||
<script setup lang="ts"> |
|
||||
import {useServerRequest} from "~/composables/useServerRequest"; |
|
||||
import type {ApiResult, PageResult} from "~/api"; |
|
||||
import type {Domain} from "~/api/cms/domain/model"; |
|
||||
|
|
||||
const {data: domainInfo } = await useServerRequest<ApiResult<PageResult<Domain>>>('/cms/domain/getByDomain/nbg.wsdns.cn'); |
|
||||
|
|
||||
console.log(domainInfo.value) |
|
||||
</script> |
|
||||
|
|
||||
<template> |
<template> |
||||
<div class="p-20 pt-[200px]"> |
|
||||
|
<el-card shadow="hover"> |
||||
|
<template #header> |
||||
|
<div class="flex items-center gap-xs"> |
||||
|
<el-icon> |
||||
|
<ElIconLink/> |
||||
|
</el-icon> |
||||
|
<span>推荐文章</span> |
||||
|
</div> |
||||
|
</template> |
||||
|
<div class="flex flex-wrap p-2"> |
||||
|
<div v-for="(item,index) in links" class="flex items-center"> |
||||
|
<a :href="item.url" target="_blank">{{ item.name }}</a> |
||||
|
<el-divider v-if="index + 1 != links.length" direction="vertical" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
</el-card> |
||||
|
|
||||
|
<el-card shadow="hover"> |
||||
|
<template #header> |
||||
|
<div class="flex items-center gap-xs"> |
||||
|
<el-icon> |
||||
|
<ElIconLink/> |
||||
|
</el-icon> |
||||
|
<span>友情链接</span> |
||||
|
</div> |
||||
|
</template> |
||||
|
<div class="flex flex-wrap p-2"> |
||||
|
<div v-for="(item,index) in links" class="flex items-center"> |
||||
|
<a :href="item.url" target="_blank">{{ item.name }}</a> |
||||
|
<el-divider v-if="index + 1 != links.length" direction="vertical" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
</el-card> |
||||
|
|
||||
<el-icon> |
|
||||
<ElIconLink/> |
|
||||
</el-icon> |
|
||||
<el-icon><ElIconArrowDown /></el-icon> |
|
||||
|
|
||||
|
|
||||
<!-- <el-dropdown>--> |
|
||||
<!-- <span class="el-dropdown-link">--> |
|
||||
<!-- Dropdown List--> |
|
||||
<!-- <el-icon class="el-icon--right">--> |
|
||||
<!-- <arrow-down />--> |
|
||||
<!-- </el-icon>--> |
|
||||
<!-- </span>--> |
|
||||
<!-- <template #dropdown>--> |
|
||||
<!-- <el-dropdown-menu>--> |
|
||||
<!-- <el-dropdown-item>Action 1</el-dropdown-item>--> |
|
||||
<!-- <el-dropdown-item>Action 2</el-dropdown-item>--> |
|
||||
<!-- <el-dropdown-item>Action 3</el-dropdown-item>--> |
|
||||
<!-- <el-dropdown-item disabled>Action 4</el-dropdown-item>--> |
|
||||
<!-- <el-dropdown-item divided>Action 5</el-dropdown-item>--> |
|
||||
<!-- </el-dropdown-menu>--> |
|
||||
<!-- </template>--> |
|
||||
<!-- </el-dropdown>--> |
|
||||
|
|
||||
<!-- <el-tag type="primary">Tag 1</el-tag>--> |
|
||||
</div> |
|
||||
</template> |
</template> |
||||
|
|
||||
<style scoped lang="scss"> |
|
||||
|
<script setup lang="ts"> |
||||
|
import type {ApiResult} from "~/api"; |
||||
|
import type {AdItem} from "~/api/cms/ad/model"; |
||||
|
import type {Link} from "~/api/cms/link/model"; |
||||
|
import {useServerRequest} from "~/composables/useServerRequest"; |
||||
|
|
||||
</style> |
|
||||
|
const banner = ref<any>(); |
||||
|
const links = ref<any>(); |
||||
|
const movieList = ref<any>(); |
||||
|
const screenWidth = window.innerWidth; |
||||
|
const screenHeight = window.innerHeight; |
||||
|
|
||||
|
// 获取数据 |
||||
|
const reload = async () => { |
||||
|
await nextTick() |
||||
|
const getSlide = useServerRequest<ApiResult<AdItem[]>>('/cms/ad/side'); |
||||
|
const getLink = useServerRequest<ApiResult<Link[]>>('/oa/link?linkType=友情链接'); |
||||
|
const [{data: slide}, {data: link}] = await Promise.all([getSlide, getLink]); |
||||
|
console.log(slide.value) |
||||
|
banner.value = slide.value?.data; |
||||
|
links.value = link.value?.data; |
||||
|
} |
||||
|
reload(); |
||||
|
</script> |
||||
|
Loading…
Reference in new issue