修复bug
This commit is contained in:
@@ -178,7 +178,7 @@
|
||||
</button>
|
||||
|
||||
<!-- 活动实况页显示添加实况按钮 -->
|
||||
<button class="action-btn add-status-btn" v-if="hasSigned && !isActivityEnded && activeTab === 'status'" @click="liveClick">添加实况</button>
|
||||
<button class="action-btn add-status-btn" v-if="hasSigned && isActivityStarted && !isActivityEnded && activeTab === 'status'" @click="liveClick">添加实况</button>
|
||||
</view>
|
||||
|
||||
<!-- 报名确认模态框 -->
|
||||
@@ -251,6 +251,12 @@ const isActivityEnded = computed(() => {
|
||||
return false
|
||||
})
|
||||
|
||||
// 判断活动是否已开始(开始时间已到)
|
||||
const isActivityStarted = computed(() => {
|
||||
if (!activityConent.value.startTime) return false
|
||||
return moment().isSameOrAfter(moment(activityConent.value.startTime))
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -277,9 +283,9 @@ onLoad((option) =>{
|
||||
}
|
||||
|
||||
// 3. 监听实况列表刷新事件
|
||||
// uni.$on('refreshLiveList', () => {
|
||||
// getLiveActivityList()
|
||||
// })
|
||||
uni.$on('refreshLiveList', () => {
|
||||
getLiveActivityList()
|
||||
})
|
||||
})
|
||||
|
||||
// 获取列表详情
|
||||
@@ -449,7 +455,7 @@ const liveClick = () =>{
|
||||
|
||||
// ---------
|
||||
onUnload(() => {
|
||||
// uni.$off('refreshLiveList')
|
||||
uni.$off('refreshLiveList')
|
||||
})
|
||||
|
||||
// 显示提示信息
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
|
||||
<!-- 底部提交按钮 -->
|
||||
<view class="submit-btn-area">
|
||||
<button class="submit-btn" @click="submitStatus">提交</button>
|
||||
<button class="submit-btn" :disabled="submitting" @click="submitStatus">{{ submitting ? '提交中...' : '提交' }}</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -67,6 +67,8 @@ const activityId = ref('');
|
||||
const statusDesc = ref('');
|
||||
// 输入字符长度
|
||||
const currentLength = ref(0);
|
||||
// 提交状态锁(防重复点击)
|
||||
const submitting = ref(false);
|
||||
// 图片列表(本地临时路径)
|
||||
const imgList = ref([]);
|
||||
// 定位信息
|
||||
@@ -117,7 +119,6 @@ const chooseImg = () => {
|
||||
imgList.value = [...imgList.value, ...res.tempFilePaths];
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.showToast({ title: '选择图片失败', icon: 'none' });
|
||||
console.error('选择图片失败:', err);
|
||||
}
|
||||
});
|
||||
@@ -229,6 +230,7 @@ const uploadAllImages = async () => {
|
||||
|
||||
// 提交实况
|
||||
const submitStatus = async () => {
|
||||
if (submitting.value) return;
|
||||
if (!statusDesc.value.trim()) {
|
||||
uni.showToast({ title: '请输入实况描述', icon: 'none' });
|
||||
return;
|
||||
@@ -238,6 +240,7 @@ const submitStatus = async () => {
|
||||
// return;
|
||||
// }
|
||||
|
||||
submitting.value = true;
|
||||
uni.showLoading({ title: '提交中...', mask: true });
|
||||
|
||||
try {
|
||||
@@ -271,6 +274,7 @@ const submitStatus = async () => {
|
||||
uni.navigateBack();
|
||||
}, 1500);
|
||||
} catch (err) {
|
||||
submitting.value = false;
|
||||
uni.hideLoading();
|
||||
uni.showToast({ title: err.msg || '提交失败', icon: 'none' });
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ import { navigateToLogin } from '@/common/checkLogin.js'
|
||||
|
||||
let baseUrl = '';
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
baseUrl = 'http://192.168.1.6:8080'; // 开发环境
|
||||
// baseUrl = 'https://wuyeapi.ckdzkj.com';
|
||||
// baseUrl = 'http://192.168.1.6:8080'; // 开发环境
|
||||
baseUrl = 'http://192.168.1.222:8080';
|
||||
} else {
|
||||
baseUrl = 'https://wuyeapi.ckdzkj.com'; // 生产环境
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -152,6 +152,7 @@ import moment from 'moment/moment'
|
||||
// 选中的房屋/项目名称
|
||||
const houseName = ref('')
|
||||
const houseId = ref('')
|
||||
const residentId = ref('')
|
||||
const projectName = ref('')
|
||||
const projectId = ref('')
|
||||
|
||||
@@ -304,6 +305,7 @@ onLoad(() => {
|
||||
uni.$on('selectHouse', (data) => {
|
||||
houseName.value = data.name
|
||||
houseId.value = data.id
|
||||
residentId.value = data.residentId
|
||||
})
|
||||
uni.$on('selectProject', (data) => {
|
||||
projectName.value = data.name
|
||||
@@ -407,7 +409,7 @@ const submitForm = async () => {
|
||||
maintenanceItemId: projectId.value,
|
||||
item: form.value.title,
|
||||
problem: form.value.desc,
|
||||
residentId: userId,
|
||||
residentId: residentId.value,
|
||||
orderDate: form.value.datetime,
|
||||
phone: form.value.phone,
|
||||
problemImageUrl: imageUrls.join(','),
|
||||
@@ -423,6 +425,7 @@ const submitForm = async () => {
|
||||
form.value = { title: '', desc: '', phone: '', datetime: '', images: [] }
|
||||
houseName.value = ''
|
||||
houseId.value = ''
|
||||
residentId.value = ''
|
||||
projectName.value = ''
|
||||
projectId.value = ''
|
||||
|
||||
|
||||
@@ -92,7 +92,8 @@ const confirmSelect = () => {
|
||||
// 把选中的房屋信息传给表单页(通过uni.$emit)
|
||||
uni.$emit('selectHouse', {
|
||||
id: selectedHouse.value.id,
|
||||
name: `${selectedHouse.value.villageName} ${selectedHouse.value.unitNo}-${selectedHouse.value.floorNo}-${selectedHouse.value.houseNo}`
|
||||
name: `${selectedHouse.value.villageName} ${selectedHouse.value.unitNo}-${selectedHouse.value.floorNo}-${selectedHouse.value.houseNo}`,
|
||||
residentId: selectedHouse.value.residentId
|
||||
})
|
||||
|
||||
// 返回上一页
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<u-icon name="arrow-down-fill" size="14" color="#222222"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view class="page" scroll-y="true">
|
||||
<view class="page">
|
||||
<view class="container">
|
||||
<!-- 水/电费列表 -->
|
||||
<scroll-view class="details-scroll" scroll-y="true" @scrolltolower="onPayLoadMore">
|
||||
@@ -94,7 +94,7 @@
|
||||
|
||||
<view style="width: 100%;height: 30rpx;"></view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -331,8 +331,6 @@ page {
|
||||
}
|
||||
|
||||
.page {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 0px 40rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
@@ -471,11 +469,11 @@ page {
|
||||
}
|
||||
|
||||
.details-scroll {
|
||||
max-height: 500rpx;
|
||||
height: 550rpx;
|
||||
padding: 0 0 20rpx 0;
|
||||
}
|
||||
.details-scroll-bill{
|
||||
max-height: 500rpx;
|
||||
height: 550rpx;
|
||||
padding: 0 0 40rpx 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -267,8 +267,7 @@
|
||||
{
|
||||
"path": "houseDetail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarTitleText": "房屋详情"
|
||||
}
|
||||
}, {
|
||||
"path": "addHouse",
|
||||
@@ -366,8 +365,7 @@
|
||||
{
|
||||
"path": "carDetail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarTitleText": "车辆详情"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user