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
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:
@@ -516,13 +516,18 @@ async function loadBrand() {
|
|||||||
} catch {
|
} catch {
|
||||||
brand.value = {}
|
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) {
|
if (showBrandHint.value) {
|
||||||
const ok = await showConfirm(
|
const lastPrompt = localStorage.getItem('qr_upload_prompt_time')
|
||||||
'上传你的专属二维码,让配方卡片更专业 ✨',
|
const oneMonth = 30 * 24 * 60 * 60 * 1000
|
||||||
{ okText: '去上传', cancelText: '取消' }
|
if (!lastPrompt || Date.now() - Number(lastPrompt) > oneMonth) {
|
||||||
)
|
localStorage.setItem('qr_upload_prompt_time', String(Date.now()))
|
||||||
if (ok) goUploadQr()
|
const ok = await showConfirm(
|
||||||
|
'上传你的专属二维码,让配方卡片更专业 ✨',
|
||||||
|
{ okText: '去上传', cancelText: '下次再说' }
|
||||||
|
)
|
||||||
|
if (ok) goUploadQr()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user