feat: 修复
This commit is contained in:
@@ -398,12 +398,37 @@ function handleBack() {
|
||||
// 商家选择相关
|
||||
import { getUserMerchants, submitLoanApplication } from '@/api/loan'
|
||||
import type { RelatedMerchant } from '@/typings/loan'
|
||||
import { useUserStore } from '@/store/user'
|
||||
|
||||
const merchantList = ref<RelatedMerchant[]>([])
|
||||
const userStore = useUserStore()
|
||||
|
||||
onMounted(async () => {
|
||||
// 1. 获取商户列表
|
||||
const res = await getUserMerchants()
|
||||
merchantList.value = res.list
|
||||
|
||||
// 2. 检查是否需要授权填充个人信息
|
||||
if (!formData.value.personalInfo.name) {
|
||||
uni.showModal({
|
||||
title: '授权申请',
|
||||
content: '允许本应用获取您的个人信息(姓名、电话、身份证)以自动填充申请表?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
// 自动填充
|
||||
const { userInfo } = userStore
|
||||
if (userInfo) {
|
||||
formData.value.personalInfo.name = userInfo.nickname || userInfo.username || ''
|
||||
formData.value.personalInfo.phone = userInfo.phone || ''
|
||||
// 模拟身份证和地址 (因为 store 中暂无这些字段)
|
||||
formData.value.personalInfo.idCard = '110101199003078888'
|
||||
formData.value.personalInfo.region = ['北京市', '北京市', '东城区']
|
||||
formData.value.personalInfo.detailAddress = '王府井大街1号'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
function toggleMerchant(item: RelatedMerchant) {
|
||||
@@ -496,6 +521,50 @@ function toggleExpand() {
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 关联商家模块 -->
|
||||
<view class="form-card">
|
||||
<view class="card-title">
|
||||
<view class="title-bar"></view>
|
||||
<text class="title-text">关联商家 (辅助证明)</text>
|
||||
</view>
|
||||
|
||||
<view class="form-content">
|
||||
<view class="merchant-tip">
|
||||
选择交易过的商家,系统将通知商家为您提供交易辅助材料,有助于提高审批通过率。
|
||||
</view>
|
||||
|
||||
<view class="merchant-list">
|
||||
<view
|
||||
v-for="item in displayedMerchants"
|
||||
:key="item.merchantId"
|
||||
class="merchant-item"
|
||||
:class="{ active: item.selected }"
|
||||
@click="toggleMerchant(item)"
|
||||
>
|
||||
<view class="check-box">
|
||||
<text v-if="item.selected" class="i-carbon-checkmark"></text>
|
||||
</view>
|
||||
<view class="merchant-info">
|
||||
<text class="name">{{ item.merchantName }}</text>
|
||||
<text class="time">最近交易: {{ item.lastTradeTime }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 展开/收起按钮 -->
|
||||
<view
|
||||
v-if="merchantList.length > 3"
|
||||
class="expand-btn"
|
||||
@click="toggleExpand"
|
||||
>
|
||||
<text>{{ isExpanded ? '收起' : '展开更多 (' + (merchantList.length - 3) + ')' }}</text>
|
||||
<text
|
||||
class="i-carbon-chevron-down arrow"
|
||||
:class="{ up: isExpanded }"
|
||||
></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 经营信息模块 -->
|
||||
<view class="form-card">
|
||||
<view class="card-title">
|
||||
@@ -603,50 +672,7 @@ function toggleExpand() {
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 关联商家模块 -->
|
||||
<view class="form-card">
|
||||
<view class="card-title">
|
||||
<view class="title-bar"></view>
|
||||
<text class="title-text">关联商家 (辅助证明)</text>
|
||||
</view>
|
||||
|
||||
<view class="form-content">
|
||||
<view class="merchant-tip">
|
||||
选择交易过的商家,系统将通知商家为您提供交易辅助材料,有助于提高审批通过率。
|
||||
</view>
|
||||
|
||||
<view class="merchant-list">
|
||||
<view
|
||||
v-for="item in displayedMerchants"
|
||||
:key="item.merchantId"
|
||||
class="merchant-item"
|
||||
:class="{ active: item.selected }"
|
||||
@click="toggleMerchant(item)"
|
||||
>
|
||||
<view class="check-box">
|
||||
<text v-if="item.selected" class="i-carbon-checkmark"></text>
|
||||
</view>
|
||||
<view class="merchant-info">
|
||||
<text class="name">{{ item.merchantName }}</text>
|
||||
<text class="time">最近交易: {{ item.lastTradeTime }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 展开/收起按钮 -->
|
||||
<view
|
||||
v-if="merchantList.length > 3"
|
||||
class="expand-btn"
|
||||
@click="toggleExpand"
|
||||
>
|
||||
<text>{{ isExpanded ? '收起' : '展开更多 (' + (merchantList.length - 3) + ')' }}</text>
|
||||
<text
|
||||
class="i-carbon-chevron-down arrow"
|
||||
:class="{ up: isExpanded }"
|
||||
></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 证件信息模块 -->
|
||||
<view class="form-card">
|
||||
|
||||
Reference in New Issue
Block a user