修复bug
This commit is contained in:
@@ -71,14 +71,14 @@
|
||||
<text class="item-arrow">\u003E</text>
|
||||
</view> -->
|
||||
<!-- 点击这里弹出下拉选择 -->
|
||||
<view class="form-item" @click="showPopup = true">
|
||||
<view class="form-item" style="opacity: 0.6;">
|
||||
<text class="label">房屋状态</text>
|
||||
<text class="value"
|
||||
:class="{selected:formData.status}">{{ formData.status.name || '请选择' }}</text>
|
||||
<text class="item-arrow"></text>
|
||||
</view>
|
||||
|
||||
<view class="form-item switch-item">
|
||||
<view class="form-item switch-item" v-if="!houseId">
|
||||
<text class="item-label" style="width: 100px;">设为默认房屋</text>
|
||||
<switch class="no-cross-switch" :checked="formData.isDefault" color="#1677ff"
|
||||
@change="onSwitchChange" />
|
||||
@@ -281,7 +281,7 @@
|
||||
unitId: uni.getStorageSync('unitId'),
|
||||
floorId: uni.getStorageSync('floorId'),
|
||||
houseNumberId: uni.getStorageSync('houseNumberId'),
|
||||
status: uni.getStorageSync('houseStatus'),
|
||||
status: uni.getStorageSync('houseStatus') || { id: 0, name: '自住' },
|
||||
isDefault: uni.getStorageSync('houseIsDefault') == true ? true : false, // 开关默认开启
|
||||
})
|
||||
const statusList = ref([{
|
||||
@@ -499,7 +499,6 @@
|
||||
})
|
||||
|
||||
// 页面显示时从 storage 同步选择数据(从选择小区/楼栋等页面返回时)
|
||||
// 注意:不用 || 兜底,否则 storage 被清空后旧值会残留导致页面显示与实际数据不一致
|
||||
const syncFormDataFromStorage = () => {
|
||||
formData.community = uni.getStorageSync('communityName')
|
||||
formData.communityId = uni.getStorageSync('communityId')
|
||||
@@ -511,7 +510,7 @@
|
||||
formData.floorId = uni.getStorageSync('floorId')
|
||||
formData.houseNumber = uni.getStorageSync('houseNumberName')
|
||||
formData.houseNumberId = uni.getStorageSync('houseNumberId')
|
||||
formData.status = uni.getStorageSync('houseStatus')
|
||||
formData.status = uni.getStorageSync('houseStatus') || { id: 0, name: '自住' }
|
||||
}
|
||||
onShow(() => {
|
||||
syncFormDataFromStorage()
|
||||
@@ -520,9 +519,7 @@
|
||||
try {
|
||||
const tempPath = await (type === 'front' ? idCardFrontUpload.chooseImage() : idCardBackUpload
|
||||
.chooseImage())
|
||||
// 已经由 hook 自动处理了 previewUrl 和 tempFilePath
|
||||
} catch (err) {
|
||||
// 用户取消选择,不处理
|
||||
}
|
||||
}
|
||||
|
||||
@@ -601,7 +598,6 @@
|
||||
// 下一步
|
||||
const goNext = () => {
|
||||
console.log(typeof(uni.getStorageSync('communityId')));
|
||||
// 基础校验
|
||||
if (!formData.community) {
|
||||
uni.showToast({
|
||||
title: '请选择小区',
|
||||
@@ -645,13 +641,11 @@
|
||||
return
|
||||
}
|
||||
currentStep.value = 1
|
||||
//跳转
|
||||
}
|
||||
|
||||
|
||||
// 完整校验
|
||||
const goSubmit = async () => {
|
||||
// 1. 前端校验
|
||||
if (!form.name) return uni.showToast({
|
||||
title: '请输入住户姓名',
|
||||
icon: 'none'
|
||||
@@ -688,8 +682,7 @@
|
||||
title: '请上传身份证国徽面',
|
||||
icon: 'none'
|
||||
})
|
||||
|
||||
// 2. 确认弹窗
|
||||
|
||||
const modalRes = await new Promise((resolve) => {
|
||||
uni.showModal({
|
||||
title: '确认提交',
|
||||
@@ -699,7 +692,6 @@
|
||||
})
|
||||
if (!modalRes.confirm) return
|
||||
|
||||
// 3. 开始提交
|
||||
uni.showLoading({
|
||||
title: '提交中...',
|
||||
mask: true
|
||||
@@ -743,7 +735,7 @@
|
||||
gender: form.gender == '男' ? '0' : '1',
|
||||
idCardType: form.cardType.id,
|
||||
idCard: form.cardNo,
|
||||
houseStatus: uni.getStorageSync('houseStatus').id,
|
||||
houseStatus: formData.status.id,
|
||||
ownerRelationship: form.relation.id,
|
||||
phone: form.phone,
|
||||
smsCode: form.code,
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
<template>
|
||||
<view class="contentStyle">
|
||||
<view class="status-bar"></view>
|
||||
<uni-nav-bar title="车辆详情" left-icon="left" @clickLeft="goBack" backgroundColor="transparent" :border="false">
|
||||
</uni-nav-bar>
|
||||
|
||||
<scroll-view class="page" scroll-y="true">
|
||||
<view class="info-card">
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
<template>
|
||||
<view class="contentStyle" style="">
|
||||
<view class="status-bar"></view>
|
||||
<uni-nav-bar title="房屋详情" left-icon="left" @clickLeft="goBack" :border="false" backgroundColor="transparent">
|
||||
</uni-nav-bar>
|
||||
|
||||
<scroll-view class="page" scroll-y="true">
|
||||
<!-- 顶部状态区 -->
|
||||
@@ -132,10 +129,6 @@
|
||||
deleteMyHouse
|
||||
} from '/pageSubPack/api/apiSub.js'
|
||||
|
||||
// 响应式数据
|
||||
const goBack = () => {
|
||||
uni.navigateBack()
|
||||
}
|
||||
|
||||
const statusBarHeight = ref(20)
|
||||
const id = ref()
|
||||
@@ -540,9 +533,4 @@
|
||||
color: #fff;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.status-bar {
|
||||
width: 100vw;
|
||||
height: 46px;
|
||||
}
|
||||
</style>
|
||||
@@ -153,11 +153,14 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
background-color: #f5f7fa;
|
||||
}
|
||||
|
||||
.page {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
height: 0;
|
||||
overflow-y: auto;
|
||||
padding: 0px 40rpx;
|
||||
box-sizing: border-box;
|
||||
@@ -181,6 +184,8 @@
|
||||
|
||||
.bottom-btn {
|
||||
padding: 20rpx 30rpx 40rpx;
|
||||
flex-shrink: 0;
|
||||
background-color: #f5f7fa;
|
||||
}
|
||||
|
||||
.car-item {
|
||||
|
||||
Reference in New Issue
Block a user