feat: add discovery tool cards, refactor AiTabSwitch and update client configs

- Update xiaoqi client configuration: adjust clientId, sync appid across config files and switch to production build by setting developVersion to false
- Refactor AiTabSwitch component to use background images instead of inline image tags, clean up redundant SCSS styles and replace tab icon assets
- Add three new Discovery page tool components: audio guide, map guide and photo generator cards
- Clean up unused code in Discovery page and ChatMainList component, remove unused scroll view and computed property
- Fix regex pattern and formatting issues in update-appid.js script
- Comment out unused SpriteAnimator component in ChatMainList
This commit is contained in:
duanshuwen
2026-07-06 20:51:45 +08:00
parent 190793b156
commit aa07286010
18 changed files with 1013 additions and 326 deletions

View File

@@ -102,7 +102,7 @@ function updateBaseJs(clientName) {
content = content.replace(regex, newExport);
fs.writeFileSync(basePath, content, "utf8");
console.log(
`✅ base.js 更新成功,切换到 ${CLIENT_CONFIGS[clientName].name} 配置`
`✅ base.js 更新成功,切换到 ${CLIENT_CONFIGS[clientName].name} 配置`,
);
return true;
} else {
@@ -125,12 +125,10 @@ function updateManifestJson(newAppId) {
// 由于manifest.json包含注释需要特殊处理
// 使用正则表达式替换mp-weixin中的appid
const regex = /"mp-weixin":\s*{[^}]*"appid":\s*"[^"]*"/;
const regex = /("mp-weixin"\s*:\s*\{[\s\S]*?"appid"\s*:\s*")[^"]*(")/;
if (regex.test(content)) {
content = content.replace(regex, (match) => {
return match.replace(/"appid":\s*"[^"]*"/, `"appid": "${newAppId}"`);
});
content = content.replace(regex, `$1${newAppId}$2`);
fs.writeFileSync(manifestPath, content, "utf8");
console.log("✅ manifest.json 更新成功");
} else {
@@ -158,7 +156,7 @@ function updateProjectConfigJson(newAppId) {
fs.writeFileSync(
projectConfigPath,
JSON.stringify(config, null, 2),
"utf8"
"utf8",
);
console.log("✅ project.config.json 更新成功");
console.log(` 旧appid: ${oldAppId}`);
@@ -210,11 +208,11 @@ function main() {
clientName = input;
newAppId = CLIENT_CONFIGS[input].appId;
console.log(
`🎯 检测到客户端配置: ${CLIENT_CONFIGS[input].name} (${clientName})`
`🎯 检测到客户端配置: ${CLIENT_CONFIGS[input].name} (${clientName})`,
);
console.log(
`目标客户端: ${CLIENT_CONFIGS[clientName].name} (${clientName})`
`目标客户端: ${CLIENT_CONFIGS[clientName].name} (${clientName})`,
);
console.log(`目标appid: ${newAppId}\n`);
@@ -233,7 +231,9 @@ function main() {
console.log("\n🎉 所有文件更新完成!");
console.log(`💡 已切换到 ${CLIENT_CONFIGS[clientName].name} 客户端配置`);
console.log("💡 提示: 请检查文件内容确认更新正确");
console.log("\n💡 版本升级: 请到request/api/config.js文件中更新versionValue版本号\n");
console.log(
"\n💡 版本升级: 请到request/api/config.js文件中更新versionValue版本号\n",
);
} else {
console.log("\n❌ 部分文件更新失败,请检查错误信息");
process.exit(1);