feat: 完成全流程融资助手应用开发
- 新增文章、课程详情页面,完善融资课堂模块 - 新增登录/注册、评估填报、结果匹配全流程业务 - 新增会话管理、错误重试与状态加载逻辑 - 重构首页路由逻辑,适配已登录用户跳转 - 完善个人中心登出与数据持久化功能
This commit is contained in:
@@ -4,28 +4,35 @@
|
||||
<view class="assessment-content">
|
||||
<view class="step-line"><view v-for="i in 4" :key="i" :class="i <= step + 1 ? 'step-segment done' : 'step-segment'"></view></view>
|
||||
<text class="step-count">{{ step + 1 }}/4</text>
|
||||
<view v-if="step < 3" class="form-list">
|
||||
<view class="form-row" v-for="item in fieldGroups[step]" :key="item.label">
|
||||
<text class="field-label">{{ item.label }}</text>
|
||||
<input class="field-input" :placeholder="item.placeholder" placeholder-class="placeholder" />
|
||||
<text v-if="item.select" class="field-arrow">⌄</text>
|
||||
</view>
|
||||
<view v-if="step == 0" class="form-list">
|
||||
<view class="form-row"><text class="field-label">姓名</text><input v-model="form.name" class="field-input" placeholder="请输入姓名" placeholder-class="placeholder" /></view>
|
||||
<view class="form-row"><text class="field-label">身份证号</text><input v-model="form.idCard" class="field-input" placeholder="请输入身份证号" placeholder-class="placeholder" /></view>
|
||||
<view class="form-row"><text class="field-label">手机号</text><input v-model="form.phone" class="field-input" type="number" placeholder="请输入手机号" placeholder-class="placeholder" /></view>
|
||||
<view class="form-row"><text class="field-label">所在城市</text><input v-model="form.city" class="field-input" placeholder="请选择所在城市" placeholder-class="placeholder" /><text class="field-arrow">⌄</text></view>
|
||||
<view class="form-row"><text class="field-label">婚姻状况</text><input v-model="form.maritalStatus" class="field-input" placeholder="请选择" placeholder-class="placeholder" /><text class="field-arrow">⌄</text></view>
|
||||
</view>
|
||||
<view v-else-if="step == 1" class="form-list">
|
||||
<view class="form-row"><text class="field-label">职业类型</text><input v-model="form.occupation" class="field-input" placeholder="请选择" placeholder-class="placeholder" /><text class="field-arrow">⌄</text></view>
|
||||
<view class="form-row"><text class="field-label">工作单位</text><input v-model="form.company" class="field-input" placeholder="请输入工作单位" placeholder-class="placeholder" /></view>
|
||||
<view class="form-row"><text class="field-label">月收入(元)</text><input v-model="form.monthlyIncome" class="field-input" type="number" placeholder="请输入月收入" placeholder-class="placeholder" /></view>
|
||||
<view class="form-row"><text class="field-label">社保缴纳</text><input v-model="form.socialSecurity" class="field-input" placeholder="请选择" placeholder-class="placeholder" /><text class="field-arrow">⌄</text></view>
|
||||
<view class="form-row"><text class="field-label">公积金缴纳</text><input v-model="form.housingFund" class="field-input" placeholder="请选择" placeholder-class="placeholder" /><text class="field-arrow">⌄</text></view>
|
||||
</view>
|
||||
<view v-else-if="step == 2" class="form-list">
|
||||
<view class="form-row"><text class="field-label">房产情况</text><input v-model="form.house" class="field-input" placeholder="请选择" placeholder-class="placeholder" /><text class="field-arrow">⌄</text></view>
|
||||
<view class="form-row"><text class="field-label">车辆情况</text><input v-model="form.car" class="field-input" placeholder="请选择" placeholder-class="placeholder" /><text class="field-arrow">⌄</text></view>
|
||||
<view class="form-row"><text class="field-label">存款情况</text><input v-model="form.savings" class="field-input" placeholder="请选择" placeholder-class="placeholder" /><text class="field-arrow">⌄</text></view>
|
||||
<view class="form-row"><text class="field-label">信用卡使用情况</text><input v-model="form.creditCard" class="field-input" placeholder="请选择" placeholder-class="placeholder" /><text class="field-arrow">⌄</text></view>
|
||||
<view class="form-row"><text class="field-label">其他资产</text><input v-model="form.otherAssets" class="field-input" placeholder="选填" placeholder-class="placeholder" /><text class="field-arrow">⌄</text></view>
|
||||
</view>
|
||||
<view v-else class="upload-area">
|
||||
<text class="upload-title">上传资料(选填)</text>
|
||||
<view class="upload-grid">
|
||||
<view class="upload-card" v-for="item in uploads" :key="item" @click="chooseImage(item)"><view class="upload-icon"><AppIcon name="upload" :size="38" /></view><text>{{ item }}</text><text class="upload-state">点击上传</text></view>
|
||||
</view>
|
||||
<view class="upload-grid"><view class="upload-card" v-for="item in uploads" :key="item" @click="chooseImage(item)"><view class="upload-icon"><AppIcon name="upload" :size="38" /></view><text>{{ item }}</text><text class="upload-state">{{ uploaded[item] == true ? '已选择' : '点击上传' }}</text></view></view>
|
||||
<text class="upload-title other-title">其他资料</text>
|
||||
<view class="upload-grid">
|
||||
<view class="upload-card small-card" v-for="item in otherUploads" :key="item" @click="chooseImage(item)"><view class="file-icon"><AppIcon name="file-text" :size="30" /></view><text>{{ item }}</text></view>
|
||||
</view>
|
||||
<view class="upload-grid"><view class="upload-card small-card" v-for="item in otherUploads" :key="item" @click="chooseImage(item)"><view class="file-icon"><AppIcon name="file-text" :size="30" /></view><text>{{ item }}</text></view></view>
|
||||
<view class="consent" @click="consented = !consented"><view :class="consented ? 'checkbox checked' : 'checkbox'"><text v-if="consented">✓</text></view><text>我已阅读并同意《授权协议》</text></view>
|
||||
</view>
|
||||
<view class="bottom-action">
|
||||
<button v-if="step > 0" class="back-button" @click="step--">上一步</button>
|
||||
<button class="primary-button next-button" @click="next">{{ step == 3 ? '下一步' : '继续' }}</button>
|
||||
</view>
|
||||
<view class="bottom-action"><button v-if="step > 0" class="back-button" @click="previous">上一步</button><button class="primary-button next-button" @click="next">{{ step == 3 ? '确认信息' : '继续' }}</button></view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -34,21 +41,48 @@
|
||||
import AppHeader from '@/components/AppHeader.uvue'
|
||||
import AppIcon from '@/components/AppIcon.uvue'
|
||||
const step = ref(0)
|
||||
const assessmentType = ref('personal')
|
||||
const consented = ref(true)
|
||||
const titles = ['基本信息', '经营 / 收入信息', '资产 / 负债信息', '资料上传 / 授权']
|
||||
const fieldGroups = [
|
||||
[{ label: '姓名', placeholder: '请输入姓名', select: false }, { label: '身份证号', placeholder: '请输入身份证号', select: false }, { label: '手机号', placeholder: '请输入手机号', select: false }, { label: '所在城市', placeholder: '请选择所在城市', select: true }, { label: '婚姻状况', placeholder: '请选择', select: true }],
|
||||
[{ label: '职业类型', placeholder: '请选择', select: true }, { label: '工作单位', placeholder: '请输入工作单位', select: false }, { label: '月收入(元)', placeholder: '请输入月收入', select: false }, { label: '社保缴纳', placeholder: '请选择', select: true }, { label: '公积金缴纳', placeholder: '请选择', select: true }],
|
||||
[{ label: '房产情况', placeholder: '请选择', select: true }, { label: '车辆情况', placeholder: '请选择', select: true }, { label: '存款情况', placeholder: '请选择', select: true }, { label: '信用卡使用情况', placeholder: '请选择', select: true }, { label: '其他资产', placeholder: '选填', select: true }]
|
||||
]
|
||||
const uploads = ['身份证正面', '银行卡', '收入证明']
|
||||
const otherUploads = ['房产证', '营业执照', '其他文件']
|
||||
const chooseImage = (name: string) => { uni.showToast({ title: name + '上传入口已预留', icon: 'none' }) }
|
||||
const next = () => {
|
||||
if (step.value < 3) step.value++
|
||||
else if (!consented.value) uni.showToast({ title: '请同意授权协议', icon: 'none' })
|
||||
else uni.navigateTo({ url: '/pages/confirm/confirm' })
|
||||
const form = reactive({ name: '', idCard: '', phone: '', city: '', maritalStatus: '', occupation: '', company: '', monthlyIncome: '', socialSecurity: '', housingFund: '', house: '', car: '', savings: '', creditCard: '', otherAssets: '' })
|
||||
const uploaded = reactive({ '身份证正面': false, '银行卡': false, '收入证明': false, '房产证': false, '营业执照': false, '其他文件': false })
|
||||
const saveDraft = () => { uni.setStorageSync('assessmentDraft', { type: assessmentType.value, name: form.name, idCard: form.idCard, phone: form.phone, city: form.city, maritalStatus: form.maritalStatus, occupation: form.occupation, company: form.company, monthlyIncome: form.monthlyIncome, socialSecurity: form.socialSecurity, housingFund: form.housingFund, house: form.house, car: form.car, savings: form.savings, creditCard: form.creditCard, otherAssets: form.otherAssets, consented: consented.value, uploaded: uploaded }) }
|
||||
const fillDraft = (saved: UTSJSONObject) => {
|
||||
const read = (key: string): string => { const value = saved[key]; return value == null ? '' : value as string }
|
||||
form.name = read('name'); form.idCard = read('idCard'); form.phone = read('phone'); form.city = read('city'); form.maritalStatus = read('maritalStatus'); form.occupation = read('occupation'); form.company = read('company'); form.monthlyIncome = read('monthlyIncome'); form.socialSecurity = read('socialSecurity'); form.housingFund = read('housingFund'); form.house = read('house'); form.car = read('car'); form.savings = read('savings'); form.creditCard = read('creditCard'); form.otherAssets = read('otherAssets')
|
||||
const savedConsent = saved['consented']; if (savedConsent != null) consented.value = savedConsent as boolean
|
||||
}
|
||||
onLoad((options) => {
|
||||
const routeType = options != null && options['type'] == 'enterprise' ? 'enterprise' : ''
|
||||
const saved = uni.getStorageSync('assessmentDraft') as UTSJSONObject
|
||||
if (routeType.length > 0) assessmentType.value = routeType
|
||||
if (saved != null) {
|
||||
const savedType = saved['type'] == null ? '' : saved['type'] as string
|
||||
if (savedType.length > 0 && (routeType.length == 0 || savedType == routeType)) fillDraft(saved)
|
||||
}
|
||||
})
|
||||
onShow(() => {
|
||||
const requestedStep = uni.getStorageSync('assessmentEditStep') as number
|
||||
if (requestedStep != null && requestedStep >= 0 && requestedStep < 4) {
|
||||
step.value = requestedStep
|
||||
uni.removeStorageSync('assessmentEditStep')
|
||||
}
|
||||
})
|
||||
const chooseImage = (name: string) => { uploaded[name] = true; saveDraft(); uni.showToast({ title: name + '上传入口已预留', icon: 'none' }) }
|
||||
const previous = () => { saveDraft(); if (step.value > 0) step.value-- }
|
||||
const validateStep = (): boolean => {
|
||||
if (step.value == 0) {
|
||||
if (form.name.trim().length < 2) { uni.showToast({ title: '请输入正确姓名', icon: 'none' }); return false }
|
||||
if (form.idCard.trim().length < 15) { uni.showToast({ title: '请输入正确身份证号', icon: 'none' }); return false }
|
||||
if (form.phone.trim().length != 11 || !form.phone.startsWith('1')) { uni.showToast({ title: '请输入正确手机号', icon: 'none' }); return false }
|
||||
if (form.city.trim().length == 0) { uni.showToast({ title: '请选择所在城市', icon: 'none' }); return false }
|
||||
}
|
||||
if (step.value == 1 && form.monthlyIncome.trim().length == 0) { uni.showToast({ title: '请输入月收入', icon: 'none' }); return false }
|
||||
return true
|
||||
}
|
||||
const next = () => { if (!validateStep()) return; saveDraft(); if (step.value < 3) step.value++; else if (!consented.value) uni.showToast({ title: '请同意授权协议', icon: 'none' }); else uni.navigateTo({ url: '/pages/confirm/confirm' }) }
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
Reference in New Issue
Block a user