fix: QR上传提醒改为每月一次,按钮始终显示
Some checks failed
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 4s
Test / build-check (push) Successful in 3s
PR Preview / test (pull_request) Successful in 4s
Test / e2e-test (push) Has been cancelled
PR Preview / deploy-preview (pull_request) Successful in 15s

- 用 localStorage 记录上次弹窗时间,30天内不再弹
- 📲 上传二维码按钮始终显示(只要用户没上传QR)
- 弹窗取消按钮文案改为「下次再说」

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-09 10:12:30 +00:00
parent 5b5b73bba8
commit 1018c1db11

View File

@@ -516,13 +516,18 @@ async function loadBrand() {
} catch {
brand.value = {}
}
// Show upload prompt if user hasn't set up brand assets yet
// Prompt QR upload at most once per month
if (showBrandHint.value) {
const ok = await showConfirm(
'上传你的专属二维码,让配方卡片更专业 ✨',
{ okText: '去上传', cancelText: '取消' }
)
if (ok) goUploadQr()
const lastPrompt = localStorage.getItem('qr_upload_prompt_time')
const oneMonth = 30 * 24 * 60 * 60 * 1000
if (!lastPrompt || Date.now() - Number(lastPrompt) > oneMonth) {
localStorage.setItem('qr_upload_prompt_time', String(Date.now()))
const ok = await showConfirm(
'上传你的专属二维码,让配方卡片更专业 ✨',
{ okText: '去上传', cancelText: '下次再说' }
)
if (ok) goUploadQr()
}
}
}