修复bug
This commit is contained in:
@@ -178,7 +178,7 @@
|
|||||||
</button>
|
</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>
|
</view>
|
||||||
|
|
||||||
<!-- 报名确认模态框 -->
|
<!-- 报名确认模态框 -->
|
||||||
@@ -251,6 +251,12 @@ const isActivityEnded = computed(() => {
|
|||||||
return false
|
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. 监听实况列表刷新事件
|
// 3. 监听实况列表刷新事件
|
||||||
// uni.$on('refreshLiveList', () => {
|
uni.$on('refreshLiveList', () => {
|
||||||
// getLiveActivityList()
|
getLiveActivityList()
|
||||||
// })
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// 获取列表详情
|
// 获取列表详情
|
||||||
@@ -449,7 +455,7 @@ const liveClick = () =>{
|
|||||||
|
|
||||||
// ---------
|
// ---------
|
||||||
onUnload(() => {
|
onUnload(() => {
|
||||||
// uni.$off('refreshLiveList')
|
uni.$off('refreshLiveList')
|
||||||
})
|
})
|
||||||
|
|
||||||
// 显示提示信息
|
// 显示提示信息
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
<!-- 底部提交按钮 -->
|
<!-- 底部提交按钮 -->
|
||||||
<view class="submit-btn-area">
|
<view class="submit-btn-area">
|
||||||
<button class="submit-btn" @click="submitStatus">提交</button>
|
<button class="submit-btn" :disabled="submitting" @click="submitStatus">{{ submitting ? '提交中...' : '提交' }}</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -67,6 +67,8 @@ const activityId = ref('');
|
|||||||
const statusDesc = ref('');
|
const statusDesc = ref('');
|
||||||
// 输入字符长度
|
// 输入字符长度
|
||||||
const currentLength = ref(0);
|
const currentLength = ref(0);
|
||||||
|
// 提交状态锁(防重复点击)
|
||||||
|
const submitting = ref(false);
|
||||||
// 图片列表(本地临时路径)
|
// 图片列表(本地临时路径)
|
||||||
const imgList = ref([]);
|
const imgList = ref([]);
|
||||||
// 定位信息
|
// 定位信息
|
||||||
@@ -117,7 +119,6 @@ const chooseImg = () => {
|
|||||||
imgList.value = [...imgList.value, ...res.tempFilePaths];
|
imgList.value = [...imgList.value, ...res.tempFilePaths];
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
uni.showToast({ title: '选择图片失败', icon: 'none' });
|
|
||||||
console.error('选择图片失败:', err);
|
console.error('选择图片失败:', err);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -229,6 +230,7 @@ const uploadAllImages = async () => {
|
|||||||
|
|
||||||
// 提交实况
|
// 提交实况
|
||||||
const submitStatus = async () => {
|
const submitStatus = async () => {
|
||||||
|
if (submitting.value) return;
|
||||||
if (!statusDesc.value.trim()) {
|
if (!statusDesc.value.trim()) {
|
||||||
uni.showToast({ title: '请输入实况描述', icon: 'none' });
|
uni.showToast({ title: '请输入实况描述', icon: 'none' });
|
||||||
return;
|
return;
|
||||||
@@ -238,6 +240,7 @@ const submitStatus = async () => {
|
|||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
submitting.value = true;
|
||||||
uni.showLoading({ title: '提交中...', mask: true });
|
uni.showLoading({ title: '提交中...', mask: true });
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -271,6 +274,7 @@ const submitStatus = async () => {
|
|||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
}, 1500);
|
}, 1500);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
submitting.value = false;
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
uni.showToast({ title: err.msg || '提交失败', icon: 'none' });
|
uni.showToast({ title: err.msg || '提交失败', icon: 'none' });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import { navigateToLogin } from '@/common/checkLogin.js'
|
|||||||
|
|
||||||
let baseUrl = '';
|
let baseUrl = '';
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
baseUrl = 'http://192.168.1.6:8080'; // 开发环境
|
// baseUrl = 'http://192.168.1.6:8080'; // 开发环境
|
||||||
// baseUrl = 'https://wuyeapi.ckdzkj.com';
|
baseUrl = 'http://192.168.1.222:8080';
|
||||||
} else {
|
} else {
|
||||||
baseUrl = 'https://wuyeapi.ckdzkj.com'; // 生产环境
|
baseUrl = 'https://wuyeapi.ckdzkj.com'; // 生产环境
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,14 +71,14 @@
|
|||||||
<text class="item-arrow">\u003E</text>
|
<text class="item-arrow">\u003E</text>
|
||||||
</view> -->
|
</view> -->
|
||||||
<!-- 点击这里弹出下拉选择 -->
|
<!-- 点击这里弹出下拉选择 -->
|
||||||
<view class="form-item" @click="showPopup = true">
|
<view class="form-item" style="opacity: 0.6;">
|
||||||
<text class="label">房屋状态</text>
|
<text class="label">房屋状态</text>
|
||||||
<text class="value"
|
<text class="value"
|
||||||
:class="{selected:formData.status}">{{ formData.status.name || '请选择' }}</text>
|
:class="{selected:formData.status}">{{ formData.status.name || '请选择' }}</text>
|
||||||
<text class="item-arrow"></text>
|
<text class="item-arrow"></text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="form-item switch-item">
|
<view class="form-item switch-item" v-if="!houseId">
|
||||||
<text class="item-label" style="width: 100px;">设为默认房屋</text>
|
<text class="item-label" style="width: 100px;">设为默认房屋</text>
|
||||||
<switch class="no-cross-switch" :checked="formData.isDefault" color="#1677ff"
|
<switch class="no-cross-switch" :checked="formData.isDefault" color="#1677ff"
|
||||||
@change="onSwitchChange" />
|
@change="onSwitchChange" />
|
||||||
@@ -281,7 +281,7 @@
|
|||||||
unitId: uni.getStorageSync('unitId'),
|
unitId: uni.getStorageSync('unitId'),
|
||||||
floorId: uni.getStorageSync('floorId'),
|
floorId: uni.getStorageSync('floorId'),
|
||||||
houseNumberId: uni.getStorageSync('houseNumberId'),
|
houseNumberId: uni.getStorageSync('houseNumberId'),
|
||||||
status: uni.getStorageSync('houseStatus'),
|
status: uni.getStorageSync('houseStatus') || { id: 0, name: '自住' },
|
||||||
isDefault: uni.getStorageSync('houseIsDefault') == true ? true : false, // 开关默认开启
|
isDefault: uni.getStorageSync('houseIsDefault') == true ? true : false, // 开关默认开启
|
||||||
})
|
})
|
||||||
const statusList = ref([{
|
const statusList = ref([{
|
||||||
@@ -499,7 +499,6 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
// 页面显示时从 storage 同步选择数据(从选择小区/楼栋等页面返回时)
|
// 页面显示时从 storage 同步选择数据(从选择小区/楼栋等页面返回时)
|
||||||
// 注意:不用 || 兜底,否则 storage 被清空后旧值会残留导致页面显示与实际数据不一致
|
|
||||||
const syncFormDataFromStorage = () => {
|
const syncFormDataFromStorage = () => {
|
||||||
formData.community = uni.getStorageSync('communityName')
|
formData.community = uni.getStorageSync('communityName')
|
||||||
formData.communityId = uni.getStorageSync('communityId')
|
formData.communityId = uni.getStorageSync('communityId')
|
||||||
@@ -511,7 +510,7 @@
|
|||||||
formData.floorId = uni.getStorageSync('floorId')
|
formData.floorId = uni.getStorageSync('floorId')
|
||||||
formData.houseNumber = uni.getStorageSync('houseNumberName')
|
formData.houseNumber = uni.getStorageSync('houseNumberName')
|
||||||
formData.houseNumberId = uni.getStorageSync('houseNumberId')
|
formData.houseNumberId = uni.getStorageSync('houseNumberId')
|
||||||
formData.status = uni.getStorageSync('houseStatus')
|
formData.status = uni.getStorageSync('houseStatus') || { id: 0, name: '自住' }
|
||||||
}
|
}
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
syncFormDataFromStorage()
|
syncFormDataFromStorage()
|
||||||
@@ -520,9 +519,7 @@
|
|||||||
try {
|
try {
|
||||||
const tempPath = await (type === 'front' ? idCardFrontUpload.chooseImage() : idCardBackUpload
|
const tempPath = await (type === 'front' ? idCardFrontUpload.chooseImage() : idCardBackUpload
|
||||||
.chooseImage())
|
.chooseImage())
|
||||||
// 已经由 hook 自动处理了 previewUrl 和 tempFilePath
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// 用户取消选择,不处理
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -601,7 +598,6 @@
|
|||||||
// 下一步
|
// 下一步
|
||||||
const goNext = () => {
|
const goNext = () => {
|
||||||
console.log(typeof(uni.getStorageSync('communityId')));
|
console.log(typeof(uni.getStorageSync('communityId')));
|
||||||
// 基础校验
|
|
||||||
if (!formData.community) {
|
if (!formData.community) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请选择小区',
|
title: '请选择小区',
|
||||||
@@ -645,13 +641,11 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
currentStep.value = 1
|
currentStep.value = 1
|
||||||
//跳转
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 完整校验
|
// 完整校验
|
||||||
const goSubmit = async () => {
|
const goSubmit = async () => {
|
||||||
// 1. 前端校验
|
|
||||||
if (!form.name) return uni.showToast({
|
if (!form.name) return uni.showToast({
|
||||||
title: '请输入住户姓名',
|
title: '请输入住户姓名',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
@@ -689,7 +683,6 @@
|
|||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
|
|
||||||
// 2. 确认弹窗
|
|
||||||
const modalRes = await new Promise((resolve) => {
|
const modalRes = await new Promise((resolve) => {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '确认提交',
|
title: '确认提交',
|
||||||
@@ -699,7 +692,6 @@
|
|||||||
})
|
})
|
||||||
if (!modalRes.confirm) return
|
if (!modalRes.confirm) return
|
||||||
|
|
||||||
// 3. 开始提交
|
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '提交中...',
|
title: '提交中...',
|
||||||
mask: true
|
mask: true
|
||||||
@@ -743,7 +735,7 @@
|
|||||||
gender: form.gender == '男' ? '0' : '1',
|
gender: form.gender == '男' ? '0' : '1',
|
||||||
idCardType: form.cardType.id,
|
idCardType: form.cardType.id,
|
||||||
idCard: form.cardNo,
|
idCard: form.cardNo,
|
||||||
houseStatus: uni.getStorageSync('houseStatus').id,
|
houseStatus: formData.status.id,
|
||||||
ownerRelationship: form.relation.id,
|
ownerRelationship: form.relation.id,
|
||||||
phone: form.phone,
|
phone: form.phone,
|
||||||
smsCode: form.code,
|
smsCode: form.code,
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="contentStyle">
|
<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">
|
<scroll-view class="page" scroll-y="true">
|
||||||
<view class="info-card">
|
<view class="info-card">
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="contentStyle" style="">
|
<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">
|
<scroll-view class="page" scroll-y="true">
|
||||||
<!-- 顶部状态区 -->
|
<!-- 顶部状态区 -->
|
||||||
@@ -132,10 +129,6 @@
|
|||||||
deleteMyHouse
|
deleteMyHouse
|
||||||
} from '/pageSubPack/api/apiSub.js'
|
} from '/pageSubPack/api/apiSub.js'
|
||||||
|
|
||||||
// 响应式数据
|
|
||||||
const goBack = () => {
|
|
||||||
uni.navigateBack()
|
|
||||||
}
|
|
||||||
|
|
||||||
const statusBarHeight = ref(20)
|
const statusBarHeight = ref(20)
|
||||||
const id = ref()
|
const id = ref()
|
||||||
@@ -540,9 +533,4 @@
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-bar {
|
|
||||||
width: 100vw;
|
|
||||||
height: 46px;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
@@ -153,11 +153,14 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
|
overflow: hidden;
|
||||||
background-color: #f5f7fa;
|
background-color: #f5f7fa;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page {
|
.page {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
min-height: 0;
|
||||||
|
height: 0;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
padding: 0px 40rpx;
|
padding: 0px 40rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
@@ -181,6 +184,8 @@
|
|||||||
|
|
||||||
.bottom-btn {
|
.bottom-btn {
|
||||||
padding: 20rpx 30rpx 40rpx;
|
padding: 20rpx 30rpx 40rpx;
|
||||||
|
flex-shrink: 0;
|
||||||
|
background-color: #f5f7fa;
|
||||||
}
|
}
|
||||||
|
|
||||||
.car-item {
|
.car-item {
|
||||||
|
|||||||
@@ -152,6 +152,7 @@ import moment from 'moment/moment'
|
|||||||
// 选中的房屋/项目名称
|
// 选中的房屋/项目名称
|
||||||
const houseName = ref('')
|
const houseName = ref('')
|
||||||
const houseId = ref('')
|
const houseId = ref('')
|
||||||
|
const residentId = ref('')
|
||||||
const projectName = ref('')
|
const projectName = ref('')
|
||||||
const projectId = ref('')
|
const projectId = ref('')
|
||||||
|
|
||||||
@@ -304,6 +305,7 @@ onLoad(() => {
|
|||||||
uni.$on('selectHouse', (data) => {
|
uni.$on('selectHouse', (data) => {
|
||||||
houseName.value = data.name
|
houseName.value = data.name
|
||||||
houseId.value = data.id
|
houseId.value = data.id
|
||||||
|
residentId.value = data.residentId
|
||||||
})
|
})
|
||||||
uni.$on('selectProject', (data) => {
|
uni.$on('selectProject', (data) => {
|
||||||
projectName.value = data.name
|
projectName.value = data.name
|
||||||
@@ -407,7 +409,7 @@ const submitForm = async () => {
|
|||||||
maintenanceItemId: projectId.value,
|
maintenanceItemId: projectId.value,
|
||||||
item: form.value.title,
|
item: form.value.title,
|
||||||
problem: form.value.desc,
|
problem: form.value.desc,
|
||||||
residentId: userId,
|
residentId: residentId.value,
|
||||||
orderDate: form.value.datetime,
|
orderDate: form.value.datetime,
|
||||||
phone: form.value.phone,
|
phone: form.value.phone,
|
||||||
problemImageUrl: imageUrls.join(','),
|
problemImageUrl: imageUrls.join(','),
|
||||||
@@ -423,6 +425,7 @@ const submitForm = async () => {
|
|||||||
form.value = { title: '', desc: '', phone: '', datetime: '', images: [] }
|
form.value = { title: '', desc: '', phone: '', datetime: '', images: [] }
|
||||||
houseName.value = ''
|
houseName.value = ''
|
||||||
houseId.value = ''
|
houseId.value = ''
|
||||||
|
residentId.value = ''
|
||||||
projectName.value = ''
|
projectName.value = ''
|
||||||
projectId.value = ''
|
projectId.value = ''
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,8 @@ const confirmSelect = () => {
|
|||||||
// 把选中的房屋信息传给表单页(通过uni.$emit)
|
// 把选中的房屋信息传给表单页(通过uni.$emit)
|
||||||
uni.$emit('selectHouse', {
|
uni.$emit('selectHouse', {
|
||||||
id: selectedHouse.value.id,
|
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>
|
<u-icon name="arrow-down-fill" size="14" color="#222222"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<scroll-view class="page" scroll-y="true">
|
<view class="page">
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<!-- 水/电费列表 -->
|
<!-- 水/电费列表 -->
|
||||||
<scroll-view class="details-scroll" scroll-y="true" @scrolltolower="onPayLoadMore">
|
<scroll-view class="details-scroll" scroll-y="true" @scrolltolower="onPayLoadMore">
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
|
|
||||||
<view style="width: 100%;height: 30rpx;"></view>
|
<view style="width: 100%;height: 30rpx;"></view>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -331,8 +331,6 @@ page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.page {
|
.page {
|
||||||
flex: 1;
|
|
||||||
overflow-y: auto;
|
|
||||||
padding: 0px 40rpx;
|
padding: 0px 40rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
@@ -471,11 +469,11 @@ page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.details-scroll {
|
.details-scroll {
|
||||||
max-height: 500rpx;
|
height: 550rpx;
|
||||||
padding: 0 0 20rpx 0;
|
padding: 0 0 20rpx 0;
|
||||||
}
|
}
|
||||||
.details-scroll-bill{
|
.details-scroll-bill{
|
||||||
max-height: 500rpx;
|
height: 550rpx;
|
||||||
padding: 0 0 40rpx 0;
|
padding: 0 0 40rpx 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -267,8 +267,7 @@
|
|||||||
{
|
{
|
||||||
"path": "houseDetail",
|
"path": "houseDetail",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "房屋详情"
|
||||||
"navigationStyle": "custom"
|
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
"path": "addHouse",
|
"path": "addHouse",
|
||||||
@@ -366,8 +365,7 @@
|
|||||||
{
|
{
|
||||||
"path": "carDetail",
|
"path": "carDetail",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "车辆详情"
|
||||||
"navigationStyle": "custom"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user