hookehuyr

fix(打卡): 统一使用task_type参数替代type参数

修复打卡功能中参数命名不一致问题,将原type参数统一改为task_type,确保前后端参数命名一致
......@@ -28,7 +28,7 @@
</van-popup>
</div>
<!-- 计数对象 -->
<div v-if="checkinType === 'count'" class="mb-4">
<div v-if="taskType === 'count'" class="mb-4">
<div class="flex justify-between items-center mb-2 mx-2">
<div class="text-sm font-bold text-gray-700">{{ dynamicFieldText }}对象</div>
<van-button size="small" type="primary" plain icon="plus"
......@@ -60,7 +60,7 @@
</div>
<!-- 计数次数 -->
<div v-if="checkinType === 'count'"
<div v-if="taskType === 'count'"
class="mb-4 flex items-center justify-between bg-gray-50 p-3 rounded-lg">
<div class="text-sm font-bold text-gray-700">{{ dynamicFieldText }}次数</div>
<van-stepper v-model="countValue" min="1" integer input-width="80px" button-size="28px" />
......@@ -82,8 +82,8 @@
<!-- 文本输入区域 -->
<div class="text-input-area">
<van-field v-model="message" rows="6" autosize type="textarea"
:placeholder="checkinType === 'count' ? '请输入留言(可选)' : (activeType === 'text' ? '请输入留言,至少需要10个字符' : '请输入留言(可选)')"
:maxlength="activeType === 'text' && checkinType !== 'count' ? 500 : 200" show-word-limit />
:placeholder="taskType === 'count' ? '请输入留言(可选)' : (activeType === 'text' ? '请输入留言,至少需要10个字符' : '请输入留言(可选)')"
:maxlength="activeType === 'text' && taskType !== 'count' ? 500 : 200" show-word-limit />
</div>
<!-- 类型选项卡 -->
......@@ -227,7 +227,7 @@ const dynamicFieldText = ref('感恩')
const taskDetail = ref({})
// 打卡类型
const checkinType = computed(() => route.query.type)
const taskType = computed(() => route.query.task_type)
// 作业选择相关
const showTaskPicker = ref(false)
......@@ -323,7 +323,7 @@ const handleSubmit = async () => {
}
// 2. 计数打卡特定校验
if (checkinType.value === 'count') {
if (taskType.value === 'count') {
if (selectedTargets.value.length === 0) {
showToast(`请选择${dynamicFieldText.value}对象`)
return
......@@ -469,7 +469,7 @@ const getTaskDetail = async (month) => {
}
// 设置默认选中类型(非计数打卡模式下)
if (checkinType.value !== 'count' && attachmentTypeOptions.value.length > 0 && !activeType.value) {
if (taskType.value !== 'count' && attachmentTypeOptions.value.length > 0 && !activeType.value) {
activeType.value = attachmentTypeOptions.value[0].key
}
}
......
<!--
* @Date: 2025-05-29 15:34:17
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-12-11 13:32:41
* @LastEditTime: 2025-12-11 13:46:21
* @FilePath: /mlaj/src/views/checkin/IndexCheckInPage.vue
* @Description: 文件描述
-->
......@@ -600,7 +600,7 @@ const goToCheckinDetailPage = () => {
id: route.query.id,
date: current_date,
is_patch: isPatchCheckin.value ? '1' : '0',
type: taskDetail.value.task_type,
task_type: taskDetail.value.task_type,
// type: 'count',
}
})
......@@ -670,6 +670,7 @@ const editCheckin = (post) => {
query: {
post_id: post.id,
type: post.file_type,
task_type: taskDetail.value.task_type,
status: 'edit',
}
})
......