fix: 下架改用原生fetch调试、翻译保存错误可见、手机字号加大
Some checks failed
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 5s
Test / build-check (push) Successful in 3s
PR Preview / test (pull_request) Successful in 4s
PR Preview / deploy-preview (pull_request) Successful in 15s
Test / e2e-test (push) Failing after 1m26s

下架:
- 改用原生 fetch 替代 api.post,避免抽象层干扰
- 详细错误信息: status code + response text
- 分步检查: name/meta 为空时分别提示

翻译保存:
- 失败不再静默吞掉,显示成功/失败数量
- console.error 记录具体失败原因

手机字号:
- @media(max-width:480px): 名称13px 英文9px 价格12px
- grid 最小宽度160px,间距8px

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-09 16:46:27 +00:00
parent 73a041d9c8
commit 321b1ea585
2 changed files with 39 additions and 16 deletions

View File

@@ -624,17 +624,24 @@ async function applyTranslation() {
}
// 2. Save each oil's English name to oils table (syncs with oil reference page)
let failed = 0
for (const [oilName, enName] of Object.entries(customOilNameEn.value)) {
if (!enName?.trim()) continue
const meta = oilsStore.oilsMeta[oilName]
if (!meta || meta.enName === enName.trim()) continue
if (!meta) continue
if (meta.enName === enName.trim()) continue
try {
await oilsStore.saveOil(oilName, meta.bottlePrice, meta.dropCount, meta.retailPrice, enName.trim())
saved++
} catch {}
} catch (e) {
console.error('Save oil en_name failed:', oilName, e)
failed++
}
}
if (saved > 0) ui.showToast(`翻译已保存(${saved}项)`)
if (saved > 0) ui.showToast(`翻译已保存(${saved}项)` + (failed > 0 ? `${failed}项失败` : ''))
else if (failed > 0) ui.showToast(`保存失败 ${failed}`)
else ui.showToast('没有修改')
cardImageUrl.value = null
nextTick(() => generateCardImage())