优化已知问题

This commit is contained in:
2025-03-15 16:37:11 +08:00
parent abb9a4dbe7
commit 287ceacaf3
19 changed files with 279 additions and 123 deletions

View File

@@ -1,53 +1,52 @@
<template>
<!-- 主体部分 -->
<div class="xl:w-screen-xl m-auto py-4 mt-12 px-4 sm:px-0 sm:mt-20">
<el-page-header :icon="ArrowLeft" @back="goBack">
<template #content>
<span class="text-large font-600"> 产品详情 </span>
</template>
<template #extra>
<div class="h-[32px]"></div>
</template>
<!-- 主体部分 -->
<div class="xl:w-screen-xl m-auto py-4 mt-12 px-4 sm:px-0 sm:mt-20">
<el-page-header :icon="ArrowLeft" @back="goBack">
<template #content>
<span class="text-large font-600"> 产品详情 </span>
</template>
<template #extra>
</template>
<!-- 应用介绍 -->
<PageBanner :form="page" @done="reload"/>
<!-- 应用介绍 -->
<PageBanner :form="page" @done="reload"/>
<!-- 评分插件 -->
<AppInfo :form="form" />
<!-- 评分插件 -->
<AppInfo :form="form"/>
<!-- 应用截屏 -->
<div id="screen-item" class="screen-item my-6">
<el-descriptions title="截屏" class="mt-5" />
<el-scrollbar class="bg-white p-5">
<div class="flex" v-if="form.files">
<el-image
v-for="(item,index) in JSON.parse(form.files)"
:key="index"
class="scrollbar-item w-[240px] max-h-[625px] mr-4 mb-3"
:src="item"
:zoom-rate="1.2"
:max-scale="7"
:min-scale="0.2"
:preview-src-list="srcList"
:initial-index="4"
fit="contain"
/>
</div>
</el-scrollbar>
<el-descriptions title="详细介绍" class="mt-5" />
<MdPreview id="preview-only" class="px-3" :modelValue="form.content || '暂无详细内容'" />
</div>
<!-- 应用截屏 -->
<div id="screen-item" class="screen-item my-6">
<el-descriptions class="mt-5" title="截屏"/>
<el-scrollbar class="bg-white p-5">
<div v-if="form.files" class="flex">
<el-image
v-for="(item,index) in JSON.parse(form.files)"
:key="index"
:initial-index="4"
:max-scale="7"
:min-scale="0.2"
:preview-src-list="srcList"
:src="item"
:zoom-rate="1.2"
class="scrollbar-item w-[240px] max-h-[625px] mr-4 mb-3"
fit="contain"
/>
</div>
</el-scrollbar>
<el-descriptions class="mt-5" title="详细介绍"/>
<MdPreview id="preview-only" :modelValue="form.content || '暂无详细内容'" class="px-3"/>
</div>
<!-- 评分及评价 -->
<Comments :productId="form.companyId" :comments="comments" :count="commentsTotal" @done="doComments" />
<!-- 评分及评价 -->
<Comments :comments="comments" :count="commentsTotal" :productId="form.companyId" @done="doComments"/>
<div class="h-[100px]"></div>
<div class="h-[100px]"></div>
</el-page-header>
</div>
</el-page-header>
</div>
</template>
<script setup lang="ts">
import { ArrowLeft,View, Monitor, Search,Cpu, Platform, Avatar } from '@element-plus/icons-vue'
import {ArrowLeft, View, Monitor, Search, Cpu, Platform, Avatar, MoreFilled} from '@element-plus/icons-vue'
import type {ApiResult, PageResult} from "~/api";
import {useServerRequest} from "~/composables/useServerRequest";
import {usePage} from "~/composables/configState";
@@ -59,13 +58,14 @@ import Comments from './components/Comments.vue';
import type {CompanyComment} from "~/api/system/companyComment/model";
import {getCmsWebsiteAll} from "~/api/cms/cmsWebsite";
import type {CmsWebsite} from "~/api/cms/cmsWebsite/model";
import { MdPreview } from 'md-editor-v3';
import {MdPreview} from 'md-editor-v3';
// preview.css相比style.css少了编辑器那部分样式
import 'md-editor-v3/lib/preview.css';
// 引入状态管理
const route = useRoute();
const router = useRouter();
const user = useUser();
const page = usePage();
const comments = ref<CompanyComment[]>([]);
const commentsTotal = ref(0);
@@ -194,7 +194,7 @@ const reloadComments = async () => {
// status: 1
}
})
if(commentsResponse.value && commentsResponse.value?.data){
if (commentsResponse.value && commentsResponse.value?.data) {
comments.value = commentsResponse.value?.data?.list
commentsTotal.value = commentsResponse.value?.data?.count;
}
@@ -217,7 +217,7 @@ const reload = async () => {
}
// 应用截图
if(data.files){
if (data.files) {
const imgArr = JSON.parse(data.files);
imgArr.map((item: any) => {
srcList.value.push(item)
@@ -232,17 +232,17 @@ const reload = async () => {
})
}).catch(err => {
console.log(err,'加载失败...')
console.log(err, '加载失败...')
})
}
watch(
() => route.params.id,
(id) => {
navId.value = getNavIdByParamsId(id);
reload();
},
{ immediate: true }
() => route.params.id,
(id) => {
navId.value = getNavIdByParamsId(id);
reload();
},
{immediate: true}
);
</script>
@@ -253,9 +253,11 @@ watch(
height: auto !important;
}
}
.scrollbar-flex-content {
display: flex;
}
.scrollbar-item {
flex-shrink: 0;
display: flex;

View File

@@ -8,18 +8,30 @@
<el-image :src="form.websiteLogo" shape="square"
class="hidden-sm-and-down bg-white w-[128px] h-[128px] cursor-pointer rounded-avatar shadow-sm hover:shadow mr-6"/>
</template>
<div class="title flex flex-col">
<h1
<div class="title flex flex-col justify-between">
<div>
<h1
class="text-2xl font-bold tracking-tight text-gray-900 dark:text-white sm:text-3xl lg:text-3xl">
<el-space>
<span>{{ form.websiteName }}</span>
</el-space>
</h1>
<div class="my-1 text-sm text-gray-500 w-auto sm:max-w-3xl max-w-xs flex-1 dark:text-gray-400">
{{ form?.comments || desc }}
<el-space>
<span>{{ form.websiteName }}</span>
</el-space>
</h1>
<div class="text-sm mt-1 text-gray-500 w-auto sm:max-w-4xl line-clamp-2 max-w-xs dark:text-gray-400">
{{ form?.comments }}
</div>
</div>
<el-space class="btn">
<nuxt-link target="_blank"><el-button type="primary" round>获取</el-button></nuxt-link>
<nuxt-link v-if="form.domain" :to="`https://${form.domain}`" target="_blank"><el-button round type="primary">访问</el-button></nuxt-link>
<nuxt-link v-if="form.adminUrl" :to="`https://${form.adminUrl}`" target="_blank"><el-button round>管理</el-button></nuxt-link>
<!-- <el-dropdown>-->
<!-- <el-button :icon="MoreFilled" round></el-button>-->
<!-- <template #dropdown>-->
<!-- <el-dropdown-menu>-->
<!-- <el-dropdown-item @click="openUrl(`https://git.websoft.top`)">源码</el-dropdown-item>-->
<!-- <el-dropdown-item divided><nuxt-link to="/developer">编辑</nuxt-link></el-dropdown-item>-->
<!-- </el-dropdown-menu>-->
<!-- </template>-->
<!-- </el-dropdown>-->
</el-space>
</div>
</div>
@@ -33,6 +45,7 @@
import type {ApiResult} from "~/api";
import type {Company} from "~/api/system/company/model";
import type {CmsWebsite} from "~/api/cms/cmsWebsite/model";
import {MoreFilled} from "@element-plus/icons-vue";
const token = useToken();

View File

@@ -39,6 +39,12 @@
<SearchBar :where="where" id="search" />
<!-- 应用列表 -->
<el-tabs>
<el-tab-pane label="全部" name="all">
<el-button :icon="View" class="hidden-sm-and-up" @click="showSearch = true"></el-button>
</el-tab-pane>
</el-tabs>
<el-row :gutter="24" id="container" class="clearfix">
<el-col v-for="(item,index) in list" :key="index" :xs="24" :sm="8" class="left mb-8">
<el-card shadow="hover" :body-style="{ padding: '0px' }" class="cursor-pointer" @mouseover="showDomain(item)"