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
+21 -6
View File
@@ -1,5 +1,5 @@
<template>
<view class="page page-white">
<view class="page page-white" :style="pageStyle()">
<AppHeader title="确认信息" />
<view class="confirm-content">
<view class="confirm-tip"><view class="tip-icon"><text>✓</text></view><view><text class="tip-title">信息填写完成</text><text class="tip-desc">请确认以下信息准确无误</text></view></view>
@@ -10,16 +10,21 @@
</template>
<script setup lang="uts">
import { usePageLayout } from '@/services/layout.uts'
const { pageStyle } = usePageLayout()
import AppHeader from '@/components/AppHeader.uvue'
import { submitAssessment } from '@/services/api.uts'
const submitting = ref(false)
const sections = ref([{ title: '基本信息', rows: [{ label: '姓名', value: '未填写' }, { label: '身份证号', value: '未填写' }, { label: '手机号', value: '未填写' }, { label: '所在城市', value: '未填写' }, { label: '婚姻状况', value: '未填写' }] }, { title: '经营 / 收入', rows: [{ label: '职业', value: '未填写' }, { label: '工作单位', value: '未填写' }, { label: '月收入', value: '未填写' }, { label: '社保 / 公积金', value: '未填写' }] }, { title: '资产 / 负债', rows: [{ label: '房产情况', value: '未填写' }, { label: '车辆情况', value: '未填写' }, { label: '存款情况', value: '未填写' }, { label: '信用卡', value: '未填写' }, { label: '其他资产', value: '未填写' }] }])
type InfoRow = { label: string, value: string }
type InfoSection = { title: string, rows: InfoRow[] }
const sections = ref<InfoSection[]>([{ title: '基本信息', rows: [{ label: '姓名', value: '未填写' }, { label: '身份证号', value: '未填写' }, { label: '手机号', value: '未填写' }, { label: '所在城市', value: '未填写' }, { label: '婚姻状况', value: '未填写' }] }, { title: '经营 / 收入', rows: [{ label: '职业', value: '未填写' }, { label: '工作单位', value: '未填写' }, { label: '月收入', value: '未填写' }, { label: '社保 / 公积金', value: '未填写' }] }, { title: '资产 / 负债', rows: [{ label: '房产情况', value: '未填写' }, { label: '车辆情况', value: '未填写' }, { label: '存款情况', value: '未填写' }, { label: '信用卡', value: '未填写' }, { label: '其他资产', value: '未填写' }] }])
const payload = ref<UTSJSONObject>({ source: 'mobile', confirmed: false })
const mask = (value: string, left: number, right: number): string => { if (value.length <= left + right) return value; return value.substring(0, left) + '****' + value.substring(value.length - right) }
const read = (saved: UTSJSONObject, key: string): string => { const value = saved[key]; return value == null ? '' : value as string }
const loadDraft = () => {
const saved = uni.getStorageSync('assessmentDraft') as UTSJSONObject
if (saved == null) return
const storedDraft = uni.getStorageSync('assessmentDraft')
if (storedDraft == null || typeof storedDraft != 'object') return
const saved = storedDraft as UTSJSONObject
const name = read(saved, 'name'); const idCard = read(saved, 'idCard'); const phone = read(saved, 'phone'); const city = read(saved, 'city'); const marital = read(saved, 'maritalStatus'); const occupation = read(saved, 'occupation'); const company = read(saved, 'company'); const income = read(saved, 'monthlyIncome'); const social = read(saved, 'socialSecurity'); const fund = read(saved, 'housingFund'); const house = read(saved, 'house'); const car = read(saved, 'car'); const savings = read(saved, 'savings'); const card = read(saved, 'creditCard'); const other = read(saved, 'otherAssets')
sections.value = [{ title: '基本信息', rows: [{ label: '姓名', value: name.length > 0 ? name : '未填写' }, { label: '身份证号', value: idCard.length > 0 ? mask(idCard, 4, 4) : '未填写' }, { label: '手机号', value: phone.length > 0 ? mask(phone, 3, 4) : '未填写' }, { label: '所在城市', value: city.length > 0 ? city : '未填写' }, { label: '婚姻状况', value: marital.length > 0 ? marital : '未填写' }] }, { title: '经营 / 收入', rows: [{ label: '职业', value: occupation.length > 0 ? occupation : '未填写' }, { label: '工作单位', value: company.length > 0 ? company : '未填写' }, { label: '月收入', value: income.length > 0 ? income + '元' : '未填写' }, { label: '社保 / 公积金', value: (social.length > 0 ? social : '未填写') + ' / ' + (fund.length > 0 ? fund : '未填写') }] }, { title: '资产 / 负债', rows: [{ label: '房产情况', value: house.length > 0 ? house : '未填写' }, { label: '车辆情况', value: car.length > 0 ? car : '未填写' }, { label: '存款情况', value: savings.length > 0 ? savings : '未填写' }, { label: '信用卡', value: card.length > 0 ? card : '未填写' }, { label: '其他资产', value: other.length > 0 ? other : '未填写' }] }]
payload.value = { ...saved, source: 'mobile', confirmed: true }
@@ -30,6 +35,16 @@
</script>
<style>
.confirm-content { padding: 26rpx 30rpx 80rpx; }.confirm-tip { padding: 26rpx; border-radius: 16rpx; background-color: #edf6ff; flex-direction: row; align-items: center; }.tip-icon { width: 64rpx; height: 64rpx; border-radius: 50%; background-color: #0868f7; color: white; align-items: center; justify-content: center; font-size: 30rpx; margin-right: 20rpx; }.tip-title { font-size: 28rpx; font-weight: 700; }.tip-desc { color: #718096; font-size: 22rpx; margin-top: 5rpx; }
.info-section { margin-top: 28rpx; border-top: 1rpx solid #edf1f6; }.section-bar { height: 82rpx; flex-direction: row; align-items: center; justify-content: space-between; font-size: 28rpx; font-weight: 700; }.edit { color: #0868f7; font-size: 22rpx; font-weight: 500; }.info-row { min-height: 72rpx; flex-direction: row; align-items: center; justify-content: space-between; }.info-label { color: #778499; font-size: 24rpx; }.info-value { color: #1a273f; font-size: 25rpx; font-weight: 600; }.submit-button { margin-top: 50rpx; }
.confirm-content { padding: 26rpx 30rpx 80rpx; }
.confirm-tip { padding: 26rpx; border-radius: 16rpx; background-color: #edf6ff; flex-direction: row; align-items: center; }
.tip-icon { width: 64rpx; height: 64rpx; border-radius: 50%; background-color: #0868f7; color: white; align-items: center; justify-content: center; font-size: 30rpx; margin-right: 20rpx; }
.tip-title { font-size: 28rpx; font-weight: 700; }
.tip-desc { color: #718096; font-size: 22rpx; margin-top: 5rpx; }
.info-section { margin-top: 28rpx; border-top: 1rpx solid #edf1f6; }
.section-bar { height: 82rpx; flex-direction: row; align-items: center; justify-content: space-between; font-size: 28rpx; font-weight: 700; }
.edit { color: #0868f7; font-size: 22rpx; font-weight: 500; }
.info-row { min-height: 72rpx; flex-direction: row; align-items: center; justify-content: space-between; }
.info-label { color: #778499; font-size: 24rpx; }
.info-value { color: #1a273f; font-size: 25rpx; font-weight: 600; }
.submit-button { margin-top: 50rpx; }
</style>