feat: 完成全流程融资助手应用开发

- 新增文章、课程详情页面,完善融资课堂模块
- 新增登录/注册、评估填报、结果匹配全流程业务
- 新增会话管理、错误重试与状态加载逻辑
- 重构首页路由逻辑,适配已登录用户跳转
- 完善个人中心登出与数据持久化功能
This commit is contained in:
hujun
2026-09-11 20:23:10 +08:00
parent 60b58442ce
commit 626cef9d38
14 changed files with 3016 additions and 76 deletions
+16 -14
View File
@@ -3,11 +3,8 @@
<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>
<view class="info-section" v-for="section in sections" :key="section.title">
<view class="section-bar"><text>{{ section.title }}</text><text class="edit" @click="edit">编辑</text></view>
<view class="info-row" v-for="row in section.rows" :key="row.label"><text class="info-label">{{ row.label }}</text><text class="info-value">{{ row.value }}</text></view>
</view>
<button class="primary-button submit-button" @click="submit">确认提交</button>
<view class="info-section" v-for="(section, sectionIndex) in sections" :key="section.title"><view class="section-bar"><text>{{ section.title }}</text><text class="edit" @click="edit(sectionIndex)">编辑</text></view><view class="info-row" v-for="row in section.rows" :key="row.label"><text class="info-label">{{ row.label }}</text><text class="info-value">{{ row.value }}</text></view></view>
<button class="primary-button submit-button" :disabled="submitting" @click="submit">{{ submitting ? '提交中...' : '确认提交' }}</button>
</view>
</view>
</template>
@@ -15,16 +12,21 @@
<script setup lang="uts">
import AppHeader from '@/components/AppHeader.uvue'
import { submitAssessment } from '@/services/api.uts'
const sections = [
{ title: '基本信息', rows: [{ label: '姓名', value: '张三' }, { label: '身份证号', value: '4401****1234' }, { label: '手机号', value: '138****8888' }, { label: '所在城市', value: '新加坡' }] },
{ title: '经营 / 收入', rows: [{ label: '职业', value: '互联网 / 技术' }, { label: '月收入', value: '20,000元' }] },
{ title: '资产 / 负债', rows: [{ label: '房产情况', value: '无负债' }, { label: '信用卡', value: '使用良好' }] }
]
const edit = () => { uni.navigateBack() }
const submit = async () => {
await submitAssessment({ source: 'mobile', confirmed: true })
uni.redirectTo({ url: '/pages/analyzing/analyzing' })
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: '未填写' }] }])
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 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 }
}
onLoad(() => loadDraft())
const edit = (sectionIndex: number) => { uni.setStorageSync('assessmentEditStep', sectionIndex); if (getCurrentPages().length > 1) uni.navigateBack({ delta: 1 }); else uni.navigateTo({ url: '/pages/assessment/assessment' }) }
const submit = async () => { if (submitting.value) return; submitting.value = true; try { await submitAssessment(payload.value); uni.redirectTo({ url: '/pages/analyzing/analyzing' }) } catch (e) { submitting.value = false; uni.showToast({ title: '提交失败,请重试', icon: 'none' }) } }
</script>
<style>