修复bug

This commit is contained in:
zhouyanli
2026-08-13 17:42:59 +08:00
parent 32765cc004
commit 9e8f5d6acc
11 changed files with 42 additions and 50 deletions

View File

@@ -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' });
}