fix(打卡): 统一使用task_type参数替代type参数
修复打卡功能中参数命名不一致问题,将原type参数统一改为task_type,确保前后端参数命名一致
Showing
2 changed files
with
10 additions
and
9 deletions
| ... | @@ -28,7 +28,7 @@ | ... | @@ -28,7 +28,7 @@ |
| 28 | </van-popup> | 28 | </van-popup> |
| 29 | </div> | 29 | </div> |
| 30 | <!-- 计数对象 --> | 30 | <!-- 计数对象 --> |
| 31 | - <div v-if="checkinType === 'count'" class="mb-4"> | 31 | + <div v-if="taskType === 'count'" class="mb-4"> |
| 32 | <div class="flex justify-between items-center mb-2 mx-2"> | 32 | <div class="flex justify-between items-center mb-2 mx-2"> |
| 33 | <div class="text-sm font-bold text-gray-700">{{ dynamicFieldText }}对象</div> | 33 | <div class="text-sm font-bold text-gray-700">{{ dynamicFieldText }}对象</div> |
| 34 | <van-button size="small" type="primary" plain icon="plus" | 34 | <van-button size="small" type="primary" plain icon="plus" |
| ... | @@ -60,7 +60,7 @@ | ... | @@ -60,7 +60,7 @@ |
| 60 | </div> | 60 | </div> |
| 61 | 61 | ||
| 62 | <!-- 计数次数 --> | 62 | <!-- 计数次数 --> |
| 63 | - <div v-if="checkinType === 'count'" | 63 | + <div v-if="taskType === 'count'" |
| 64 | class="mb-4 flex items-center justify-between bg-gray-50 p-3 rounded-lg"> | 64 | class="mb-4 flex items-center justify-between bg-gray-50 p-3 rounded-lg"> |
| 65 | <div class="text-sm font-bold text-gray-700">{{ dynamicFieldText }}次数</div> | 65 | <div class="text-sm font-bold text-gray-700">{{ dynamicFieldText }}次数</div> |
| 66 | <van-stepper v-model="countValue" min="1" integer input-width="80px" button-size="28px" /> | 66 | <van-stepper v-model="countValue" min="1" integer input-width="80px" button-size="28px" /> |
| ... | @@ -82,8 +82,8 @@ | ... | @@ -82,8 +82,8 @@ |
| 82 | <!-- 文本输入区域 --> | 82 | <!-- 文本输入区域 --> |
| 83 | <div class="text-input-area"> | 83 | <div class="text-input-area"> |
| 84 | <van-field v-model="message" rows="6" autosize type="textarea" | 84 | <van-field v-model="message" rows="6" autosize type="textarea" |
| 85 | - :placeholder="checkinType === 'count' ? '请输入留言(可选)' : (activeType === 'text' ? '请输入留言,至少需要10个字符' : '请输入留言(可选)')" | 85 | + :placeholder="taskType === 'count' ? '请输入留言(可选)' : (activeType === 'text' ? '请输入留言,至少需要10个字符' : '请输入留言(可选)')" |
| 86 | - :maxlength="activeType === 'text' && checkinType !== 'count' ? 500 : 200" show-word-limit /> | 86 | + :maxlength="activeType === 'text' && taskType !== 'count' ? 500 : 200" show-word-limit /> |
| 87 | </div> | 87 | </div> |
| 88 | 88 | ||
| 89 | <!-- 类型选项卡 --> | 89 | <!-- 类型选项卡 --> |
| ... | @@ -227,7 +227,7 @@ const dynamicFieldText = ref('感恩') | ... | @@ -227,7 +227,7 @@ const dynamicFieldText = ref('感恩') |
| 227 | const taskDetail = ref({}) | 227 | const taskDetail = ref({}) |
| 228 | 228 | ||
| 229 | // 打卡类型 | 229 | // 打卡类型 |
| 230 | -const checkinType = computed(() => route.query.type) | 230 | +const taskType = computed(() => route.query.task_type) |
| 231 | 231 | ||
| 232 | // 作业选择相关 | 232 | // 作业选择相关 |
| 233 | const showTaskPicker = ref(false) | 233 | const showTaskPicker = ref(false) |
| ... | @@ -323,7 +323,7 @@ const handleSubmit = async () => { | ... | @@ -323,7 +323,7 @@ const handleSubmit = async () => { |
| 323 | } | 323 | } |
| 324 | 324 | ||
| 325 | // 2. 计数打卡特定校验 | 325 | // 2. 计数打卡特定校验 |
| 326 | - if (checkinType.value === 'count') { | 326 | + if (taskType.value === 'count') { |
| 327 | if (selectedTargets.value.length === 0) { | 327 | if (selectedTargets.value.length === 0) { |
| 328 | showToast(`请选择${dynamicFieldText.value}对象`) | 328 | showToast(`请选择${dynamicFieldText.value}对象`) |
| 329 | return | 329 | return |
| ... | @@ -469,7 +469,7 @@ const getTaskDetail = async (month) => { | ... | @@ -469,7 +469,7 @@ const getTaskDetail = async (month) => { |
| 469 | } | 469 | } |
| 470 | 470 | ||
| 471 | // 设置默认选中类型(非计数打卡模式下) | 471 | // 设置默认选中类型(非计数打卡模式下) |
| 472 | - if (checkinType.value !== 'count' && attachmentTypeOptions.value.length > 0 && !activeType.value) { | 472 | + if (taskType.value !== 'count' && attachmentTypeOptions.value.length > 0 && !activeType.value) { |
| 473 | activeType.value = attachmentTypeOptions.value[0].key | 473 | activeType.value = attachmentTypeOptions.value[0].key |
| 474 | } | 474 | } |
| 475 | } | 475 | } | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2025-05-29 15:34:17 | 2 | * @Date: 2025-05-29 15:34:17 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-12-11 13:32:41 | 4 | + * @LastEditTime: 2025-12-11 13:46:21 |
| 5 | * @FilePath: /mlaj/src/views/checkin/IndexCheckInPage.vue | 5 | * @FilePath: /mlaj/src/views/checkin/IndexCheckInPage.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -600,7 +600,7 @@ const goToCheckinDetailPage = () => { | ... | @@ -600,7 +600,7 @@ const goToCheckinDetailPage = () => { |
| 600 | id: route.query.id, | 600 | id: route.query.id, |
| 601 | date: current_date, | 601 | date: current_date, |
| 602 | is_patch: isPatchCheckin.value ? '1' : '0', | 602 | is_patch: isPatchCheckin.value ? '1' : '0', |
| 603 | - type: taskDetail.value.task_type, | 603 | + task_type: taskDetail.value.task_type, |
| 604 | // type: 'count', | 604 | // type: 'count', |
| 605 | } | 605 | } |
| 606 | }) | 606 | }) |
| ... | @@ -670,6 +670,7 @@ const editCheckin = (post) => { | ... | @@ -670,6 +670,7 @@ const editCheckin = (post) => { |
| 670 | query: { | 670 | query: { |
| 671 | post_id: post.id, | 671 | post_id: post.id, |
| 672 | type: post.file_type, | 672 | type: post.file_type, |
| 673 | + task_type: taskDetail.value.task_type, | ||
| 673 | status: 'edit', | 674 | status: 'edit', |
| 674 | } | 675 | } |
| 675 | }) | 676 | }) | ... | ... |
-
Please register or login to post a comment