hookehuyr

fix(打卡): 调整打卡提交条件和输入框提示

修改文字打卡的提交条件为必须不少于10个字符,图片/视频/音频打卡不再强制要求填写内容
更新输入框提示文字,明确可选内容
...@@ -28,9 +28,11 @@ export function useCheckin() { ...@@ -28,9 +28,11 @@ export function useCheckin() {
28 */ 28 */
29 const canSubmit = computed(() => { 29 const canSubmit = computed(() => {
30 if (activeType.value === 'text') { 30 if (activeType.value === 'text') {
31 + // 文字打卡:必须填写内容且长度不少于10个字符
31 return message.value.trim() !== '' && message.value.trim().length >= 10 32 return message.value.trim() !== '' && message.value.trim().length >= 10
32 } else { 33 } else {
33 - return fileList.value.length > 0 && message.value.trim() !== '' 34 + // 图片、视频、音频打卡:必须有文件,内容可选
35 + return fileList.value.length > 0
34 } 36 }
35 }) 37 })
36 38
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
26 rows="6" 26 rows="6"
27 autosize 27 autosize
28 type="textarea" 28 type="textarea"
29 - :placeholder="activeType === 'text' ? '请输入打卡内容,至少需要10个字符' : '请输入打卡留言'" 29 + :placeholder="activeType === 'text' ? '请输入打卡内容,至少需要10个字符' : '请输入打卡留言(可选)'"
30 :maxlength="activeType === 'text' ? 500 : 200" 30 :maxlength="activeType === 'text' ? 500 : 200"
31 show-word-limit 31 show-word-limit
32 /> 32 />
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
41 v-for="option in attachmentTypeOptions" 41 v-for="option in attachmentTypeOptions"
42 :key="option.key" 42 :key="option.key"
43 @click="!isEditMode ? switchType(option.key) : null" 43 @click="!isEditMode ? switchType(option.key) : null"
44 - :class="['tab-item', { 44 + :class="['tab-item', {
45 active: activeType === option.key, 45 active: activeType === option.key,
46 disabled: isEditMode && activeType !== option.key 46 disabled: isEditMode && activeType !== option.key
47 }]" 47 }]"
...@@ -368,7 +368,7 @@ onMounted(async () => { ...@@ -368,7 +368,7 @@ onMounted(async () => {
368 &.disabled { 368 &.disabled {
369 opacity: 0.5; 369 opacity: 0.5;
370 cursor: not-allowed; 370 cursor: not-allowed;
371 - 371 +
372 &:hover { 372 &:hover {
373 border-color: #e8f5e8; 373 border-color: #e8f5e8;
374 background-color: #fafffe; 374 background-color: #fafffe;
...@@ -418,7 +418,7 @@ onMounted(async () => { ...@@ -418,7 +418,7 @@ onMounted(async () => {
418 color: #333; 418 color: #333;
419 overflow: hidden; 419 overflow: hidden;
420 text-overflow: ellipsis; 420 text-overflow: ellipsis;
421 - white-space: nowrap; 421 + // white-space: nowrap;
422 } 422 }
423 423
424 .file-status { 424 .file-status {
......