refactor: 重构移动端页面布局与资源路径,优化打包配置
1. 新增layout.uts统一管理页面尺寸与安全区计算 2. 修正图片资源路径到static/mobile目录 3. 调整App.vue与AppIcon组件样式适配多端 4. 为微信小程序配置打包忽略规则减少包体积 5. 修复API请求错误抛出类型,完善类型定义 6. 补充README文档说明项目运行与维护规范 7. 优化多个页面的样式与生命周期逻辑
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<view class="page">
|
||||
<view class="page" :style="pageStyle()">
|
||||
<AppHeader title="个人中心" :back="false" />
|
||||
<scroll-view scroll-y class="profile-scroll">
|
||||
<scroll-view scroll-y class="profile-scroll" :style="contentStyle(226, false)">
|
||||
<view class="profile-content">
|
||||
<view class="profile-card"><view class="avatar"><text>张</text></view><view class="profile-main"><text class="profile-name">张三</text><text class="profile-phone">138****8888</text></view><view class="verified"><text>已认证</text></view></view>
|
||||
<view class="stat-row"><view><text class="stat-number">1</text><text class="stat-label">申请中</text></view><view><text class="stat-number">3</text><text class="stat-label">已匹配</text></view><view><text class="stat-number">2680</text><text class="stat-label">积分</text></view></view>
|
||||
<view class="stat-row"><view class="stat-row-view"><text class="stat-number">1</text><text class="stat-label">申请中</text></view><view class="stat-row-view"><text class="stat-number">3</text><text class="stat-label">已匹配</text></view><view class="stat-row-view stat-row-view-last-child"><text class="stat-number">2680</text><text class="stat-label">积分</text></view></view>
|
||||
<view class="menu-list">
|
||||
<view class="menu-row" v-for="item in menus" :key="item.name" @click="open(item.url, item.name)"><view :class="'menu-icon ' + item.color"><AppIcon :name="item.icon" :size="40" /></view><text class="menu-name">{{ item.name }}</text><text v-if="item.note.length > 0" class="menu-note">{{ item.note }}</text><AppIcon name="chevron-right" :size="28" muted /></view>
|
||||
</view>
|
||||
@@ -16,11 +16,14 @@
|
||||
</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'
|
||||
import { clearSession } from '@/services/api.uts'
|
||||
const menus = [
|
||||
type ProfileMenu = { icon: string, name: string, note: string, color: string, url: string }
|
||||
const menus: ProfileMenu[] = [
|
||||
{ icon: 'archive', name: '我的融资档案', note: '75%', color: 'blue', url: '/pages/archive/archive' },
|
||||
{ icon: 'points', name: '积分中心', note: '2680', color: 'purple', url: '/pages/points/points' },
|
||||
{ icon: 'shield', name: '账户安全', note: '', color: 'green', url: '' },
|
||||
@@ -33,7 +36,30 @@
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.profile-scroll { height: calc(100vh - var(--status-bar-height) - 226rpx); }.profile-content { padding: 26rpx 28rpx 160rpx; }.profile-card { min-height: 170rpx; padding: 30rpx; border-radius: 18rpx 18rpx 0 0; background-color: #fff; border: 1rpx solid #e5ecf5; flex-direction: row; align-items: center; }.avatar { width: 92rpx; height: 92rpx; border-radius: 50%; background: linear-gradient(145deg, #2d8cff, #0c4fc6); align-items: center; justify-content: center; color: white; font-size: 36rpx; font-weight: 800; margin-right: 22rpx; }.profile-main { flex: 1; }.profile-name { font-size: 32rpx; font-weight: 800; }.profile-phone { color: #8390a3; font-size: 22rpx; margin-top: 10rpx; }.verified { padding: 8rpx 14rpx; border-radius: 9rpx; background-color: #e7f8f0; color: #0ba66e; font-size: 19rpx; }
|
||||
.stat-row { height: 140rpx; background-color: #fff; border: 1rpx solid #e5ecf5; border-top: 0; border-radius: 0 0 18rpx 18rpx; flex-direction: row; }.stat-row view { flex: 1; align-items: center; justify-content: center; border-right: 1rpx solid #edf1f6; }.stat-row view:last-child { border-right: 0; }.stat-number { font-size: 31rpx; font-weight: 800; color: #102557; }.stat-label { color: #8491a4; font-size: 20rpx; margin-top: 8rpx; }
|
||||
.menu-list { margin-top: 24rpx; padding: 0 24rpx; border-radius: 18rpx; background-color: #fff; border: 1rpx solid #e5ecf5; }.menu-row { height: 105rpx; flex-direction: row; align-items: center; border-bottom: 1rpx solid #edf1f6; }.menu-icon { width: 52rpx; height: 52rpx; border-radius: 16rpx; align-items: center; justify-content: center; font-size: 20rpx; font-weight: 800; margin-right: 18rpx; }.blue { color: #0868f7; background-color: #e8f2ff; }.purple { color: #7757ea; background-color: #efebff; }.green { color: #0ba979; background-color: #e6f8f1; }.orange { color: #f2751b; background-color: #fff0e5; }.cyan { color: #0a9eb2; background-color: #e7f8fb; }.gray { color: #667489; background-color: #eef2f6; }.menu-name { flex: 1; font-size: 25rpx; }.menu-note { color: #8793a6; font-size: 21rpx; margin-right: 14rpx; }.chevron { color: #abb5c4; font-size: 36rpx; }.logout { margin-top: 25rpx; height: 88rpx; line-height: 88rpx; border-radius: 16rpx; color: #ef4444; background-color: #fff; border: 1rpx solid #e5ecf5; font-size: 26rpx; }
|
||||
.profile-scroll { }
|
||||
.profile-content { padding: 26rpx 28rpx 160rpx; }
|
||||
.profile-card { min-height: 170rpx; padding: 30rpx; border-radius: 18rpx 18rpx 0 0; background-color: #fff; border: 1rpx solid #e5ecf5; flex-direction: row; align-items: center; }
|
||||
.avatar { width: 92rpx; height: 92rpx; border-radius: 50%; background: linear-gradient(145deg, #2d8cff, #0c4fc6); align-items: center; justify-content: center; color: white; font-size: 36rpx; font-weight: 800; margin-right: 22rpx; }
|
||||
.profile-main { flex: 1; }
|
||||
.profile-name { font-size: 32rpx; font-weight: 800; }
|
||||
.profile-phone { color: #8390a3; font-size: 22rpx; margin-top: 10rpx; }
|
||||
.verified { padding: 8rpx 14rpx; border-radius: 9rpx; background-color: #e7f8f0; color: #0ba66e; font-size: 19rpx; }
|
||||
.stat-row { height: 140rpx; background-color: #fff; border: 1rpx solid #e5ecf5; border-top: 0; border-radius: 0 0 18rpx 18rpx; flex-direction: row; }
|
||||
.stat-row-view { flex: 1; align-items: center; justify-content: center; border-right: 1rpx solid #edf1f6; }
|
||||
.stat-row-view-last-child { border-right: 0; }
|
||||
.stat-number { font-size: 31rpx; font-weight: 800; color: #102557; }
|
||||
.stat-label { color: #8491a4; font-size: 20rpx; margin-top: 8rpx; }
|
||||
.menu-list { margin-top: 24rpx; padding: 0 24rpx; border-radius: 18rpx; background-color: #fff; border: 1rpx solid #e5ecf5; }
|
||||
.menu-row { height: 105rpx; flex-direction: row; align-items: center; border-bottom: 1rpx solid #edf1f6; }
|
||||
.menu-icon { width: 52rpx; height: 52rpx; border-radius: 16rpx; align-items: center; justify-content: center; font-size: 20rpx; font-weight: 800; margin-right: 18rpx; }
|
||||
.blue { color: #0868f7; background-color: #e8f2ff; }
|
||||
.purple { color: #7757ea; background-color: #efebff; }
|
||||
.green { color: #0ba979; background-color: #e6f8f1; }
|
||||
.orange { color: #f2751b; background-color: #fff0e5; }
|
||||
.cyan { color: #0a9eb2; background-color: #e7f8fb; }
|
||||
.gray { color: #667489; background-color: #eef2f6; }
|
||||
.menu-name { flex: 1; font-size: 25rpx; }
|
||||
.menu-note { color: #8793a6; font-size: 21rpx; margin-right: 14rpx; }
|
||||
.chevron { color: #abb5c4; font-size: 36rpx; }
|
||||
.logout { margin-top: 25rpx; height: 88rpx; line-height: 88rpx; border-radius: 16rpx; color: #ef4444; background-color: #fff; border: 1rpx solid #e5ecf5; font-size: 26rpx; }
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user