refactor: 重构移动端页面布局与资源路径,优化打包配置

1. 新增layout.uts统一管理页面尺寸与安全区计算
2. 修正图片资源路径到static/mobile目录
3. 调整App.vue与AppIcon组件样式适配多端
4. 为微信小程序配置打包忽略规则减少包体积
5. 修复API请求错误抛出类型,完善类型定义
6. 补充README文档说明项目运行与维护规范
7. 优化多个页面的样式与生命周期逻辑
This commit is contained in:
hujun
2026-09-15 16:16:55 +08:00
parent 626cef9d38
commit b0ee4f9d7e
67 changed files with 80727 additions and 189 deletions
+23 -4
View File
@@ -1,8 +1,8 @@
<template>
<view class="page">
<view class="page" :style="pageStyle()">
<AppHeader title="消息中心" :back="false" />
<view class="message-tabs"><view v-for="item in tabs" :key="item" :class="tab == item ? 'message-tab active' : 'message-tab'" @click="tab=item"><text>{{ item }}</text></view></view>
<scroll-view scroll-y class="messages-scroll">
<scroll-view scroll-y class="messages-scroll" :style="contentStyle(314, false)">
<view class="messages-content">
<view class="notice" v-for="item in notices" :key="item.title"><view :class="'notice-icon ' + item.color"><AppIcon :name="item.icon" :size="44" /></view><view class="notice-copy"><view class="notice-head"><text class="notice-title">{{ item.title }}</text><text class="notice-time">{{ item.time }}</text></view><text class="notice-desc">{{ item.desc }}</text></view><view v-if="item.unread" class="unread"></view></view>
</view>
@@ -12,12 +12,15 @@
</template>
<script setup lang="uts">
import { usePageLayout } from '@/services/layout.uts'
const { contentStyle, pageStyle } = usePageLayout()
import AppHeader from '@/components/AppHeader.uvue'
import BottomNav from '@/components/BottomNav.uvue'
import AppIcon from '@/components/AppIcon.uvue'
const tabs = ['全部', '系统通知', '审批进度', '活动消息']
const tab = ref('全部')
const notices = [
type Notice = { icon: string, color: string, title: string, desc: string, time: string, unread: boolean }
const notices: Notice[] = [
{ icon: 'approval', color: 'blue', title: '审核进度更新', desc: '您的融资评估已完成,匹配到3个方案。', time: '10:30', unread: true },
{ icon: 'payout', color: 'purple', title: '放款成功', desc: '您的招商银行闪电贷已成功放款。', time: '09:15', unread: false },
{ icon: 'gift', color: 'orange', title: '活动通知', desc: '邀请好友赢积分活动进行中。', time: '08:42', unread: false },
@@ -26,5 +29,21 @@
</script>
<style>
.message-tabs { height: 88rpx; flex-direction: row; background-color: #fff; border-bottom: 1rpx solid #e6edf6; padding: 0 18rpx; }.message-tab { flex: 1; align-items: center; justify-content: center; color: #7b8799; font-size: 22rpx; }.message-tab.active { color: #0868f7; font-weight: 700; border-bottom: 4rpx solid #0868f7; }.messages-scroll { height: calc(100vh - var(--status-bar-height) - 314rpx); }.messages-content { padding: 10rpx 28rpx 150rpx; }.notice { min-height: 150rpx; background-color: #fff; border-bottom: 1rpx solid #e8eef6; flex-direction: row; align-items: center; position: relative; }.notice-icon { width: 78rpx; height: 78rpx; border-radius: 25rpx; align-items: center; justify-content: center; color: #fff; font-size: 24rpx; font-weight: 800; margin-right: 20rpx; }.blue { background-color: #3b7df1; }.purple { background-color: #b74ae8; }.orange { background-color: #ff8431; }.green { background-color: #18ae82; }.notice-copy { flex: 1; }.notice-head { flex-direction: row; justify-content: space-between; align-items: center; }.notice-title { font-size: 27rpx; font-weight: 700; }.notice-time { color: #9ca7b7; font-size: 19rpx; }.notice-desc { color: #778499; font-size: 22rpx; margin-top: 11rpx; }.unread { position: absolute; width: 13rpx; height: 13rpx; border-radius: 50%; background-color: #ff4d4f; right: 2rpx; top: 40rpx; }
.message-tabs { height: 88rpx; flex-direction: row; background-color: #fff; border-bottom: 1rpx solid #e6edf6; padding: 0 18rpx; }
.message-tab { flex: 1; align-items: center; justify-content: center; color: #7b8799; font-size: 22rpx; }
.message-tab.active { color: #0868f7; font-weight: 700; border-bottom: 4rpx solid #0868f7; }
.messages-scroll { }
.messages-content { padding: 10rpx 28rpx 150rpx; }
.notice { min-height: 150rpx; background-color: #fff; border-bottom: 1rpx solid #e8eef6; flex-direction: row; align-items: center; position: relative; }
.notice-icon { width: 78rpx; height: 78rpx; border-radius: 25rpx; align-items: center; justify-content: center; color: #fff; font-size: 24rpx; font-weight: 800; margin-right: 20rpx; }
.blue { background-color: #3b7df1; }
.purple { background-color: #b74ae8; }
.orange { background-color: #ff8431; }
.green { background-color: #18ae82; }
.notice-copy { flex: 1; }
.notice-head { flex-direction: row; justify-content: space-between; align-items: center; }
.notice-title { font-size: 27rpx; font-weight: 700; }
.notice-time { color: #9ca7b7; font-size: 19rpx; }
.notice-desc { color: #778499; font-size: 22rpx; margin-top: 11rpx; }
.unread { position: absolute; width: 13rpx; height: 13rpx; border-radius: 50%; background-color: #ff4d4f; right: 2rpx; top: 40rpx; }
</style>