feat: 完成项目基础功能搭建与样式优化

1.  新增评估选择组件、本地草稿存储与新闻/金融内容服务
2.  重构页面布局与样式:调整按钮阴影、图标尺寸、导航栏样式
3.  更新启动页、报告页、消息中心等页面UI与交互逻辑
4.  替换图标资源,调整禁用态透明度
5.  补充README文档与本地数据模拟实现
This commit is contained in:
hujun
2026-09-18 12:59:43 +08:00
parent b0ee4f9d7e
commit 94a4558290
30 changed files with 1376 additions and 640 deletions
+60 -37
View File
@@ -1,11 +1,26 @@
<template>
<view class="page" :style="pageStyle()">
<AppHeader title="融资课堂" />
<scroll-view scroll-y class="classroom-scroll" :style="contentStyle(96, false)">
<scroll-view scroll-y :style="contentStyle(96, false)">
<view class="classroom-content">
<view class="classroom-hero"><view class="hero-copy"><text class="hero-title">融资课堂</text><text class="hero-subtitle">把融资知识,变成申请底气</text><text class="hero-desc">从准备材料到优化信用,分阶段掌握实用方法</text></view><image src="/static/mobile/images/news-policy.png" mode="aspectFill" class="classroom-hero-image"></image></view>
<view class="lesson-section"><view class="section-head"><text class="section-title">热门课程</text><text class="lesson-count">12 节课程</text></view><view class="lesson-card" v-for="(item,index) in lessons" :key="item.title" @click="openLesson(index)"><image :src="item.image" mode="aspectFill" class="lesson-card-image"></image><view class="lesson-copy"><text class="lesson-title">{{ item.title }}</text><text class="lesson-desc">{{ item.desc }}</text><view class="lesson-meta"><text>{{ item.duration }}</text><text class="lesson-tag">{{ item.tag }}</text></view></view><AppIcon name="chevron-right" :size="28" muted /></view></view>
<view class="topic-section"><text class="section-title">按场景学习</text><view class="topic-grid"><view class="topic-card blue-topic" @click="openTopic('个人信用提升')"><AppIcon name="user" :size="46" /><text class="topic-card-text-1">个人信用提升</text><text class="topic-card-text-2">3 节课程</text></view><view class="topic-card orange-topic" @click="openTopic('小微经营融资')"><AppIcon name="building" :size="46" /><text class="topic-card-text-1">小微经营融资</text><text class="topic-card-text-2">4 节课程</text></view><view class="topic-card green-topic" @click="openTopic('材料准备清单')"><AppIcon name="file-text" :size="46" /><text class="topic-card-text-1">材料准备清单</text><text class="topic-card-text-2">5 节课程</text></view></view></view>
<view class="classroom-hero"><view class="hero-copy"><text class="hero-eyebrow">实用融资知识</text><text class="hero-title">准备更充分</text><text class="hero-title hero-title-next">申请更从容</text><text class="hero-desc">每次几分钟,掌握一个知识点</text></view><image src="/static/mobile/images/news-policy.png" mode="aspectFill" class="hero-image"></image></view>
<view class="topic-section">
<text class="section-title">按场景学习</text>
<view class="topic-list">
<view v-for="item in topics" :key="item.id" :class="activeTopic == item.id ? 'topic-card selected-topic' : 'topic-card'" @click="selectTopic(item.id)">
<AppIcon :name="item.icon" :size="48" />
<view class="topic-copy"><text class="topic-title">{{ item.title }}</text><text class="topic-desc">{{ item.desc }}</text></view>
<text v-if="activeTopic == item.id" class="topic-selected">已选</text><AppIcon v-else name="chevron-right" :size="28" muted />
</view>
</view>
</view>
<view class="lesson-section">
<view class="section-head"><text class="section-title">{{ activeTopic == '' ? '精选课程' : activeTopicTitle }}</text><view class="all-lessons" @click="activeTopic = ''"><text class="lesson-count">{{ activeTopic == '' ? lessons.length + ' 门课程' : '查看全部' }}</text></view></view>
<view class="lesson-card" v-for="item in lessons" :key="item.id" @click="openLesson(item.id)">
<image :src="item.image" mode="aspectFill" class="lesson-card-image"></image>
<view class="lesson-copy"><text class="lesson-title">{{ item.title }}</text><text class="lesson-desc">{{ item.desc }}</text><view class="lesson-meta"><text class="lesson-duration">{{ item.duration }}</text><text class="lesson-tag">{{ item.tag }}</text></view></view>
</view>
</view>
</view>
</scroll-view>
</view>
@@ -13,45 +28,53 @@
<script setup lang="uts">
import { usePageLayout } from '@/services/layout.uts'
const { contentStyle, pageStyle } = usePageLayout()
import { financeLessons, FinanceLesson } from '@/services/content.uts'
import AppHeader from '@/components/AppHeader.uvue'
import AppIcon from '@/components/AppIcon.uvue'
type LessonSummary = { title: string, desc: string, duration: string, tag: string, image: string }
const lessons: LessonSummary[] = [
{ title: '如何提高个人贷款通过率', desc: '征信、负债和收入的申请准备方法', duration: '6 分钟', tag: '个人融资', image: '/static/mobile/images/news-calculator.png' },
{ title: '小微企业融资材料清单', desc: '一次准备齐全,减少补充资料时间', duration: '8 分钟', tag: '企业融资', image: '/static/mobile/images/news-business.png' },
{ title: '读懂贷款利率与还款方式', desc: '选对期限,降低长期资金成本', duration: '5 分钟', tag: '基础知识', image: '/static/mobile/images/news-city.png' }
const { contentStyle, pageStyle } = usePageLayout()
type LessonTopic = { id: string, title: string, desc: string, icon: string }
const topics: LessonTopic[] = [
{ id: 'credit', title: '个人信用提升', desc: '了解信用记录与还款能力', icon: 'user' },
{ id: 'business', title: '小微经营融资', desc: '梳理经营材料与融资成本', icon: 'building' },
{ id: 'documents', title: '材料准备清单', desc: '按申请场景,逐项检查资料', icon: 'file-text' }
]
const openLesson = (index: number) => { uni.navigateTo({ url: '/pages/lesson/lesson?id=' + index }) }
const openTopic = (title: string) => { uni.navigateTo({ url: '/pages/lesson/lesson?title=' + title }) }
const activeTopic = ref('')
const activeTopicTitle = computed((): string => topics.find((item: LessonTopic): boolean => item.id == activeTopic.value)?.title ?? '精选课程')
const lessons = computed((): FinanceLesson[] => {
if (activeTopic.value == '') return financeLessons
return financeLessons.filter((item: FinanceLesson): boolean => item.topics.includes(activeTopic.value))
})
const selectTopic = (id: string): void => { activeTopic.value = activeTopic.value == id ? '' : id }
const openLesson = (id: string): void => { uni.navigateTo({ url: '/pages/lesson/lesson?id=' + id }) }
</script>
<style>
.classroom-scroll { }
.classroom-content { padding: 26rpx 28rpx 70rpx; }
.classroom-hero { height: 242rpx; border-radius: 20rpx; background: linear-gradient(135deg, #0b2a66, #087aff); padding: 28rpx; overflow: hidden; position: relative; }
.hero-copy { width: 68%; z-index: 2; }
.hero-title { color: #fff; font-size: 38rpx; line-height: 50rpx; font-weight: 800; }
.hero-subtitle { color: #fff; font-size: 27rpx; line-height: 40rpx; font-weight: 700; margin-top: 10rpx; }
.hero-desc { color: #bfd7ff; font-size: 21rpx; line-height: 32rpx; margin-top: 12rpx; }
.classroom-hero-image { position: absolute; right: -18rpx; top: 0; width: 220rpx; height: 242rpx; opacity: .78; }
.lesson-section { margin-top: 30rpx; }
.classroom-content { padding: 24rpx 28rpx 48rpx; }
.classroom-hero { border-radius: 20rpx; background-color: #e8f2ff; flex-direction: row; overflow: hidden; align-items: center; }
.hero-copy { flex: 1; padding: 28rpx 12rpx 28rpx 26rpx; }
.hero-eyebrow { color: #0868f7; font-size: 22rpx; font-weight: 600; }
.hero-title { color: #14335f; font-size: 37rpx; line-height: 51rpx; font-weight: 700; margin-top: 10rpx; }
.hero-title-next { margin-top: 0; }
.hero-desc { color: #4b6586; font-size: 23rpx; line-height: 36rpx; margin-top: 14rpx; }
.hero-image { width: 230rpx; height: 280rpx; flex-shrink: 0; }
.topic-section { margin-top: 28rpx; }
.topic-list { margin-top: 16rpx; }
.topic-card { flex-direction: row; align-items: center; min-height: 116rpx; padding: 18rpx 22rpx; border-radius: 16rpx; border: 1rpx solid #e5ecf5; background-color: #ffffff; margin-bottom: 12rpx; }
.selected-topic { background-color: #eef5ff; border-color: #99c1fb; }
.topic-copy { flex: 1; margin-left: 20rpx; }
.topic-title { color: #172640; font-size: 28rpx; line-height: 40rpx; font-weight: 600; }
.topic-desc { color: #66758a; font-size: 23rpx; line-height: 34rpx; margin-top: 4rpx; }
.topic-selected { color: #0868f7; font-size: 23rpx; margin-left: 10rpx; }
.lesson-section { margin-top: 18rpx; }
.section-head { flex-direction: row; align-items: center; justify-content: space-between; }
.lesson-count { color: #8b98aa; font-size: 21rpx; }
.lesson-card { min-height: 150rpx; margin-top: 16rpx; padding: 18rpx; border-radius: 16rpx; background-color: #fff; border: 1rpx solid #e4ebf5; flex-direction: row; align-items: center; }
.lesson-card-image { width: 142rpx; height: 114rpx; border-radius: 12rpx; margin-right: 18rpx; flex-shrink: 0; }
.all-lessons { padding: 12rpx 0 12rpx 20rpx; }
.lesson-count { color: #0868f7; font-size: 23rpx; }
.lesson-card { margin-top: 16rpx; padding: 20rpx; border-radius: 18rpx; background-color: #ffffff; border: 1rpx solid #e5ecf5; flex-direction: row; align-items: center; }
.lesson-card-image { width: 142rpx; height: 150rpx; border-radius: 12rpx; margin-right: 20rpx; flex-shrink: 0; }
.lesson-copy { flex: 1; }
.lesson-title { color: #1a2941; font-size: 26rpx; line-height: 36rpx; font-weight: 700; }
.lesson-desc { color: #778499; font-size: 21rpx; line-height: 31rpx; margin-top: 7rpx; }
.lesson-meta { flex-direction: row; align-items: center; margin-top: 10rpx; color: #99a5b4; font-size: 18rpx; }
.lesson-tag { margin-left: 14rpx; color: #0868f7; }
.topic-section { margin-top: 32rpx; }
.topic-grid { flex-direction: row; flex-wrap: wrap; justify-content: space-between; margin-top: 16rpx; }
.topic-card { width: 48.5%; min-height: 150rpx; margin-bottom: 14rpx; padding: 20rpx; border-radius: 16rpx; border: 1rpx solid #e4ebf5; }
.topic-card .app-icon { margin-bottom: 9rpx; }
.topic-card-text-1 { color: #23324a; font-size: 23rpx; font-weight: 700; }
.topic-card-text-2 { color: #8190a4; font-size: 19rpx; margin-top: 6rpx; }
.blue-topic { background-color: #eef6ff; }
.orange-topic { background-color: #fff3e9; }
.green-topic { background-color: #eaf8f1; }
.lesson-title { color: #172640; font-size: 30rpx; line-height: 42rpx; font-weight: 600; }
.lesson-desc { color: #66758a; font-size: 24rpx; line-height: 36rpx; margin-top: 8rpx; }
.lesson-meta { flex-direction: row; align-items: center; margin-top: 12rpx; }
.lesson-duration { color: #66758a; font-size: 22rpx; }
.lesson-tag { margin-left: 16rpx; color: #0868f7; font-size: 22rpx; }
</style>