fix(profile): 添加确认对话框的按钮文本和颜色
refactor(checkin): 移除未使用的文件预览函数代码 docs(vant): 为弹出框添加注释说明
Showing
3 changed files
with
81 additions
and
76 deletions
| 1 | /* | 1 | /* |
| 2 | * @Date: 2025-03-24 13:44:27 | 2 | * @Date: 2025-03-24 13:44:27 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-04-16 18:28:45 | 4 | + * @LastEditTime: 2025-12-16 20:00:58 |
| 5 | * @FilePath: /mlaj/src/vant.config.js | 5 | * @FilePath: /mlaj/src/vant.config.js |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | */ | 7 | */ |
| ... | @@ -52,4 +52,6 @@ export const themeVars = { | ... | @@ -52,4 +52,6 @@ export const themeVars = { |
| 52 | 52 | ||
| 53 | // Picker 选择器 | 53 | // Picker 选择器 |
| 54 | pickerConfirmActionColor: '#22c55e', | 54 | pickerConfirmActionColor: '#22c55e', |
| 55 | + | ||
| 56 | + // 弹出框 | ||
| 55 | }; | 57 | }; | ... | ... |
| ... | @@ -691,86 +691,86 @@ const onClickPreview = (file, detail) => { | ... | @@ -691,86 +691,86 @@ const onClickPreview = (file, detail) => { |
| 691 | * 预览文件 | 691 | * 预览文件 |
| 692 | * @param {Object} item - 文件项 | 692 | * @param {Object} item - 文件项 |
| 693 | */ | 693 | */ |
| 694 | -const previewFile = (item) => { | 694 | +// const previewFile = (item) => { |
| 695 | - console.log('previewFile - item:', item) | 695 | +// console.log('previewFile - item:', item) |
| 696 | - console.log('previewFile - item对象的所有属性:', Object.keys(item)) | 696 | +// console.log('previewFile - item对象的所有属性:', Object.keys(item)) |
| 697 | 697 | ||
| 698 | - const fileName = item.name || item.file?.name || '' | 698 | +// const fileName = item.name || item.file?.name || '' |
| 699 | 699 | ||
| 700 | - // 尝试多种方式获取文件URL | 700 | +// // 尝试多种方式获取文件URL |
| 701 | - let fileUrl = '' | 701 | +// let fileUrl = '' |
| 702 | 702 | ||
| 703 | - // 方式1: 直接从item对象获取 | 703 | +// // 方式1: 直接从item对象获取 |
| 704 | - if (item.url) { | 704 | +// if (item.url) { |
| 705 | - fileUrl = item.url | 705 | +// fileUrl = item.url |
| 706 | - console.log('从item.url获取URL:', fileUrl) | 706 | +// console.log('从item.url获取URL:', fileUrl) |
| 707 | - } | 707 | +// } |
| 708 | - // 方式2: 从item.value获取 | 708 | +// // 方式2: 从item.value获取 |
| 709 | - else if (item.value) { | 709 | +// else if (item.value) { |
| 710 | - fileUrl = item.value | 710 | +// fileUrl = item.value |
| 711 | - console.log('从item.value获取URL:', fileUrl) | 711 | +// console.log('从item.value获取URL:', fileUrl) |
| 712 | - } | 712 | +// } |
| 713 | - // 方式3: 从item.content获取 | 713 | +// // 方式3: 从item.content获取 |
| 714 | - else if (item.content) { | 714 | +// else if (item.content) { |
| 715 | - fileUrl = item.content | 715 | +// fileUrl = item.content |
| 716 | - console.log('从item.content获取URL:', fileUrl) | 716 | +// console.log('从item.content获取URL:', fileUrl) |
| 717 | - } | 717 | +// } |
| 718 | - // 方式4: 从item.objectURL获取 | 718 | +// // 方式4: 从item.objectURL获取 |
| 719 | - else if (item.objectURL) { | 719 | +// else if (item.objectURL) { |
| 720 | - fileUrl = item.objectURL | 720 | +// fileUrl = item.objectURL |
| 721 | - console.log('从item.objectURL获取URL:', fileUrl) | 721 | +// console.log('从item.objectURL获取URL:', fileUrl) |
| 722 | - } | 722 | +// } |
| 723 | - // 方式5: 从item.file获取 | 723 | +// // 方式5: 从item.file获取 |
| 724 | - else if (item.file) { | 724 | +// else if (item.file) { |
| 725 | - if (item.file.url) { | 725 | +// if (item.file.url) { |
| 726 | - fileUrl = item.file.url | 726 | +// fileUrl = item.file.url |
| 727 | - console.log('从item.file.url获取URL:', fileUrl) | 727 | +// console.log('从item.file.url获取URL:', fileUrl) |
| 728 | - } else { | 728 | +// } else { |
| 729 | - // 创建临时URL | 729 | +// // 创建临时URL |
| 730 | - try { | 730 | +// try { |
| 731 | - fileUrl = URL.createObjectURL(item.file) | 731 | +// fileUrl = URL.createObjectURL(item.file) |
| 732 | - console.log('通过URL.createObjectURL创建URL:', fileUrl) | 732 | +// console.log('通过URL.createObjectURL创建URL:', fileUrl) |
| 733 | - } catch (error) { | 733 | +// } catch (error) { |
| 734 | - console.error('创建ObjectURL失败:', error) | 734 | +// console.error('创建ObjectURL失败:', error) |
| 735 | - } | 735 | +// } |
| 736 | - } | 736 | +// } |
| 737 | - } | 737 | +// } |
| 738 | - // 方式6: 检查是否有其他可能的URL字段 | 738 | +// // 方式6: 检查是否有其他可能的URL字段 |
| 739 | - else { | 739 | +// else { |
| 740 | - const possibleUrlFields = ['src', 'path', 'href', 'link', 'downloadUrl', 'previewUrl'] | 740 | +// const possibleUrlFields = ['src', 'path', 'href', 'link', 'downloadUrl', 'previewUrl'] |
| 741 | - for (const field of possibleUrlFields) { | 741 | +// for (const field of possibleUrlFields) { |
| 742 | - if (item[field]) { | 742 | +// if (item[field]) { |
| 743 | - fileUrl = item[field] | 743 | +// fileUrl = item[field] |
| 744 | - console.log(`从item.${field}获取URL:`, fileUrl) | 744 | +// console.log(`从item.${field}获取URL:`, fileUrl) |
| 745 | - break | 745 | +// break |
| 746 | - } | 746 | +// } |
| 747 | - } | 747 | +// } |
| 748 | - } | 748 | +// } |
| 749 | 749 | ||
| 750 | - console.log('最终提取的文件名:', fileName) | 750 | +// console.log('最终提取的文件名:', fileName) |
| 751 | - console.log('最终提取的文件URL:', fileUrl) | 751 | +// console.log('最终提取的文件URL:', fileUrl) |
| 752 | 752 | ||
| 753 | - if (!fileUrl) { | 753 | +// if (!fileUrl) { |
| 754 | - console.warn('文件URL不存在,文件对象完整结构:', JSON.stringify(item, null, 2)) | 754 | +// console.warn('文件URL不存在,文件对象完整结构:', JSON.stringify(item, null, 2)) |
| 755 | - showToast('无法获取文件URL,请检查文件是否上传成功') | 755 | +// showToast('无法获取文件URL,请检查文件是否上传成功') |
| 756 | - return | 756 | +// return |
| 757 | - } | 757 | +// } |
| 758 | 758 | ||
| 759 | - // 根据打卡类型或文件扩展名判断文件类型 | 759 | +// // 根据打卡类型或文件扩展名判断文件类型 |
| 760 | - if (activeType.value === 'audio' || isAudioFile(fileName)) { | 760 | +// if (activeType.value === 'audio' || isAudioFile(fileName)) { |
| 761 | - console.log('准备播放音频:', fileName, fileUrl) | 761 | +// console.log('准备播放音频:', fileName, fileUrl) |
| 762 | - showAudio(fileName, fileUrl) | 762 | +// showAudio(fileName, fileUrl) |
| 763 | - } else if (activeType.value === 'video' || isVideoFile(fileName)) { | 763 | +// } else if (activeType.value === 'video' || isVideoFile(fileName)) { |
| 764 | - console.log('准备播放视频:', fileName, fileUrl) | 764 | +// console.log('准备播放视频:', fileName, fileUrl) |
| 765 | - showVideo(fileName, fileUrl) | 765 | +// showVideo(fileName, fileUrl) |
| 766 | - } else if (activeType.value === 'image' || isImageFile(fileName)) { | 766 | +// } else if (activeType.value === 'image' || isImageFile(fileName)) { |
| 767 | - console.log('准备预览图片:', fileName, fileUrl) | 767 | +// console.log('准备预览图片:', fileName, fileUrl) |
| 768 | - showImage(fileUrl) | 768 | +// showImage(fileUrl) |
| 769 | - } else { | 769 | +// } else { |
| 770 | - console.log('该文件类型不支持预览,文件名:', fileName, '打卡类型:', activeType.value) | 770 | +// console.log('该文件类型不支持预览,文件名:', fileName, '打卡类型:', activeType.value) |
| 771 | - showToast('该文件类型不支持预览') | 771 | +// showToast('该文件类型不支持预览') |
| 772 | - } | 772 | +// } |
| 773 | -} | 773 | +// } |
| 774 | 774 | ||
| 775 | /** | 775 | /** |
| 776 | * 判断是否为音频文件 | 776 | * 判断是否为音频文件 | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2025-03-24 13:04:21 | 2 | * @Date: 2025-03-24 13:04:21 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-12-04 10:32:03 | 4 | + * @LastEditTime: 2025-12-16 20:00:23 |
| 5 | * @FilePath: /mlaj/src/views/profile/SettingsPage.vue | 5 | * @FilePath: /mlaj/src/views/profile/SettingsPage.vue |
| 6 | * @Description: 用户设置页面 | 6 | * @Description: 用户设置页面 |
| 7 | --> | 7 | --> |
| ... | @@ -145,6 +145,9 @@ const handleLogout = () => { | ... | @@ -145,6 +145,9 @@ const handleLogout = () => { |
| 145 | showConfirmDialog({ | 145 | showConfirmDialog({ |
| 146 | title: '提示', | 146 | title: '提示', |
| 147 | message: '确定要退出登录吗?', | 147 | message: '确定要退出登录吗?', |
| 148 | + confirmButtonText: '确定', | ||
| 149 | + cancelButtonText: '取消', | ||
| 150 | + confirmButtonColor: '#22c55e', | ||
| 148 | }) | 151 | }) |
| 149 | .then(() => { | 152 | .then(() => { |
| 150 | // 确认退出 | 153 | // 确认退出 | ... | ... |
-
Please register or login to post a comment