feat: 新功能改进 #20

Merged
hera merged 57 commits from feat/next-improvements into main 2026-04-10 20:30:37 +00:00
Showing only changes of commit 07a40977e1 - Show all commits

View File

@@ -199,7 +199,7 @@
</div>
<div style="display:flex;gap:8px;align-items:center">
<button class="btn btn-primary" @click="saveBrandSettings">💾 保存品牌设置</button>
<span class="auto-save-hint">所有修改自动保存</span>
<button v-if="returnRecipeId" class="btn btn-outline" @click="goBackToRecipe"> 返回配方卡片</button>
</div>
</div>
@@ -577,11 +577,19 @@ async function handleUpload(type, event) {
if (!file) return
try {
// Convert HEIC/HEIF to JPEG
if (file.name.toLowerCase().match(/\.hei[cf]$/)) {
const isHeic = file.name.toLowerCase().match(/\.hei[cf]$/) ||
file.type === 'image/heic' || file.type === 'image/heif'
if (isHeic) {
ui.showToast('正在转换HEIC格式...')
const heic2any = (await import('heic2any')).default
const blob = await heic2any({ blob: file, toType: 'image/jpeg', quality: 0.8 })
file = new File([blob], file.name.replace(/\.hei[cf]$/i, '.jpg'), { type: 'image/jpeg' })
try {
const heic2any = (await import('heic2any')).default
let blob = await heic2any({ blob: file, toType: 'image/jpeg', quality: 0.8 })
if (Array.isArray(blob)) blob = blob[0]
file = new File([blob], 'photo.jpg', { type: 'image/jpeg' })
} catch (e) {
ui.showToast('HEIC转换失败请手动转为JPG后上传')
return
}
}
let base64 = await readFileAsBase64(file)
@@ -1158,6 +1166,8 @@ async function applyBusiness() {
margin-bottom: 12px;
}
.auto-save-hint { font-size: 12px; color: #999; font-style: italic; }
.verified-badge {
padding: 12px;
background: #e8f5e9;