优化取名逻辑

This commit is contained in:
cjd
2025-11-05 17:26:52 +08:00
parent 1d312df7ca
commit 200c29ac09
5 changed files with 95 additions and 57 deletions

View File

@@ -146,6 +146,7 @@ Page({
generateName(payload)
.then((response) => {
const results = response && Array.isArray(response.results) ? response.results : [];
const analysis = response && response.analysis ? response.analysis : null;
if (!results.length) {
showToast(messages.GENERATION_FAILED);
return;
@@ -157,7 +158,8 @@ Page({
}
accumulator.push({
name,
meaning: item.meaning || item.Meaning || ""
meaning: item.meaning || item.Meaning || "",
elementReason: item.elementReason || item.ElementReason || ""
});
return accumulator;
}, []);
@@ -165,7 +167,10 @@ Page({
showToast(messages.GENERATION_FAILED);
return;
}
namingStore.setResults(normalizedResults);
namingStore.setResults({
results: normalizedResults,
analysis
});
namingStore.incrementQuota();
this.updateQuotaState();
if (typeof tt !== "undefined" && tt.navigateTo) {