feat: 产品页面搭建

This commit is contained in:
Gsh
2025-06-18 23:28:27 +08:00
parent 8a8e69596a
commit 890727d495
8 changed files with 637 additions and 4 deletions

View File

@@ -0,0 +1,432 @@
<template>
<div class="products-page">
<!-- Hero Section -->
<section class="hero-section">
<div class="container">
<h1 class="hero-title">AI 订阅服务</h1>
<p class="hero-subtitle">
选择适合您需求的AI解决方案释放人工智能的全部潜力
</p>
<el-button type="primary" size="large" round @click="scrollToProducts">
查看产品
<el-icon class="ml-2"><ArrowDown /></el-icon>
</el-button>
</div>
</section>
<!-- Products Comparison -->
<section class="comparison-section">
<div class="container">
<h2 class="section-title">产品对比</h2>
<div class="comparison-table">
<el-table :data="comparisonData" style="width: 100%" border>
<el-table-column prop="feature" label="功能" width="180" />
<el-table-column prop="basic" label="基础版" />
<el-table-column prop="pro" label="专业版" />
<el-table-column prop="enterprise" label="企业版" />
</el-table>
</div>
</div>
</section>
<!-- Products Cards -->
<section class="products-section" ref="productsSection">
<div class="container">
<h2 class="section-title">我们的产品</h2>
<div class="products-grid">
<el-card
v-for="product in products"
:key="product.id"
class="product-card"
:class="{ 'popular-card': hasPopularPlan(product) }"
shadow="hover"
>
<div class="product-header">
<div class="product-badge" v-if="hasPopularPlan(product)">
最受欢迎
</div>
<h3 class="product-name">{{ product.name }}</h3>
<p class="product-title">{{ product.title }}</p>
<p class="product-description">{{ product.description }}</p>
</div>
<div class="product-highlight">
<el-tag type="info" effect="dark" round>{{ product.highlight }}</el-tag>
</div>
<div class="product-features">
<div v-for="feature in product.features" :key="feature.title" class="feature-item">
<el-icon class="feature-icon"><component :is="feature.icon" /></el-icon>
<div class="feature-text">
<h4>{{ feature.title }}</h4>
<p>{{ feature.description }}</p>
</div>
</div>
</div>
<div class="pricing-plans">
<div
v-for="plan in product.pricing"
:key="plan.name"
class="pricing-plan"
:class="{ 'popular-plan': plan.isPopular }"
>
<div class="plan-header">
<h4>{{ plan.name }}</h4>
<div class="plan-price" v-if="plan.price > 0">
<span class="price-amount">¥{{ plan.price }}</span>
<span class="price-period">/{{ plan.period }}</span>
</div>
<div class="plan-price" v-else>
<span class="price-amount">定制价格</span>
</div>
</div>
<ul class="plan-features">
<li v-for="(feature, idx) in plan.features" :key="idx">
<el-icon class="feature-check"><CircleCheck /></el-icon>
{{ feature }}
</li>
</ul>
<el-button
type="primary"
class="subscribe-btn"
:class="{ 'popular-btn': plan.isPopular }"
round
>
立即订阅
</el-button>
</div>
</div>
</el-card>
</div>
</div>
</section>
<!-- FAQ Section -->
<section class="faq-section">
<div class="container">
<h2 class="section-title">常见问题</h2>
<div class="faq-grid">
<el-collapse v-for="product in products" :key="product.id + '-faq'" accordion>
<el-collapse-item :title="product.name + '常见问题'" :name="product.id">
<div v-for="(faq, idx) in product.faqs" :key="idx" class="faq-item">
<h4>{{ faq.question }}</h4>
<p>{{ faq.answer }}</p>
</div>
</el-collapse-item>
</el-collapse>
</div>
</div>
</section>
</div>
</template>
<script setup lang="ts">
import { ref, computed } from 'vue'
import { ArrowDown, CircleCheck, MagicStick, Clock, Lock, Cpu, DataLine, User, Setting, OfficeBuilding, Service } from '@element-plus/icons-vue'
import { products } from '@/data/products'
import { Product } from '@/api/products/products'
const productsSection = ref<HTMLElement | null>(null)
const scrollToProducts = () => {
productsSection.value?.scrollIntoView({ behavior: 'smooth' })
}
const hasPopularPlan = (product: Product) => {
return product.pricing.some(plan => plan.isPopular)
}
const comparisonData = computed(() => {
return [
{ feature: '基础模型访问', basic: '✓', pro: '✓', enterprise: '✓' },
{ feature: '高级模型访问', basic: '✗', pro: '✓', enterprise: '✓' },
{ feature: '请求次数', basic: '有限', pro: '较多', enterprise: '无限' },
{ feature: '支持响应', basic: '标准', pro: '优先', enterprise: '专属' },
{ feature: '数据分析工具', basic: '✗', pro: '✓', enterprise: '✓' },
{ feature: '定制模型', basic: '✗', pro: '有限', enterprise: '完全' },
{ feature: '部署方式', basic: '公有云', pro: '公有云', enterprise: '私有/公有' }
]
})
</script>
<style scoped lang="scss">
.products-page {
color: #333;
line-height: 1.6;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}
.section-title {
text-align: center;
font-size: 2rem;
margin-bottom: 2.5rem;
color: #2c3e50;
position: relative;
&::after {
content: '';
display: block;
width: 80px;
height: 4px;
background: linear-gradient(90deg, #3f87a6, #ebf8e1);
margin: 0.5rem auto 0;
border-radius: 2px;
}
}
/* Hero Section */
.hero-section {
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
padding: 6rem 0;
text-align: center;
color: #2c3e50;
.hero-title {
font-size: 3rem;
font-weight: 700;
margin-bottom: 1rem;
}
.hero-subtitle {
font-size: 1.25rem;
max-width: 700px;
margin: 0 auto 2rem;
color: #5a6a85;
}
}
/* Comparison Section */
.comparison-section {
padding: 4rem 0;
background-color: #fff;
.comparison-table {
margin-top: 2rem;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
border-radius: 8px;
overflow: hidden;
}
}
/* Products Section */
.products-section {
padding: 4rem 0;
background-color: #f8fafc;
.products-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 2rem;
margin-top: 2rem;
}
.product-card {
border-radius: 12px;
transition: transform 0.3s ease, box-shadow 0.3s ease;
position: relative;
overflow: hidden;
border: none;
&:hover {
transform: translateY(-5px);
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}
&.popular-card {
border-top: 4px solid #3f87a6;
}
}
.product-header {
padding: 1.5rem 1.5rem 0;
text-align: center;
.product-badge {
position: absolute;
top: 0;
right: 0;
background-color: #3f87a6;
color: white;
padding: 0.25rem 1rem;
border-bottom-left-radius: 8px;
font-size: 0.75rem;
font-weight: bold;
}
.product-name {
font-size: 1.5rem;
font-weight: 700;
margin-bottom: 0.5rem;
color: #2c3e50;
}
.product-title {
font-size: 1.1rem;
color: #3f87a6;
margin-bottom: 0.5rem;
}
.product-description {
color: #666;
margin-bottom: 1rem;
}
}
.product-highlight {
text-align: center;
margin: 1rem 0;
}
.product-features {
padding: 0 1.5rem;
.feature-item {
display: flex;
align-items: flex-start;
margin-bottom: 1.25rem;
.feature-icon {
font-size: 1.5rem;
color: #3f87a6;
margin-right: 1rem;
flex-shrink: 0;
}
.feature-text {
h4 {
margin: 0 0 0.25rem;
font-size: 1rem;
color: #2c3e50;
}
p {
margin: 0;
color: #666;
font-size: 0.9rem;
}
}
}
}
.pricing-plans {
margin-top: 2rem;
border-top: 1px solid #eee;
padding: 1.5rem;
.pricing-plan {
background: #fff;
border-radius: 8px;
padding: 1.5rem;
margin-bottom: 1.5rem;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
&.popular-plan {
border: 2px solid #3f87a6;
}
.plan-header {
text-align: center;
margin-bottom: 1rem;
h4 {
margin: 0 0 0.5rem;
font-size: 1.1rem;
color: #2c3e50;
}
.plan-price {
.price-amount {
font-size: 1.75rem;
font-weight: 700;
color: #3f87a6;
}
.price-period {
font-size: 1rem;
color: #666;
}
}
}
.plan-features {
list-style: none;
padding: 0;
margin: 0 0 1.5rem;
li {
padding: 0.5rem 0;
font-size: 0.9rem;
color: #555;
.feature-check {
color: #3f87a6;
margin-right: 0.5rem;
}
}
}
.subscribe-btn {
width: 100%;
&.popular-btn {
background: linear-gradient(90deg, #3f87a6, #5ab1d8);
border: none;
}
}
}
}
}
/* FAQ Section */
.faq-section {
padding: 4rem 0;
background-color: #fff;
.faq-grid {
max-width: 800px;
margin: 0 auto;
.faq-item {
padding: 1rem 0;
h4 {
margin: 0 0 0.5rem;
color: #2c3e50;
}
p {
margin: 0;
color: #666;
}
}
}
}
@media (max-width: 768px) {
.hero-section {
padding: 4rem 0;
.hero-title {
font-size: 2.2rem;
}
.hero-subtitle {
font-size: 1.1rem;
}
}
.products-grid {
grid-template-columns: 1fr !important;
}
.section-title {
font-size: 1.75rem;
}
}
</style>

View File

@@ -0,0 +1,13 @@
<template>
</template>
<script>
export default {
name: "index"
}
</script>
<style scoped>
</style>