修复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

@@ -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')
})
// 显示提示信息

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