feat: 我的、设置、打印指南页面开发完成

This commit is contained in:
R524809
2026-05-07 16:32:49 +08:00
parent 0737c6165e
commit c732111e12
43 changed files with 1702 additions and 837 deletions
+18
View File
@@ -76,6 +76,24 @@ export async function getFavoriteList(
}
}
/**
* 获取当前用户收藏总数
*/
export async function getFavoriteCount(): Promise<number> {
try {
await getUser();
const res = await wx.cloud.callFunction({
name: 'userFavorites',
data: { action: 'count' },
});
const result = (res?.result as any) || {};
return result.code === 0 ? Number(result.data?.count || 0) : 0;
} catch (e) {
console.error('getFavoriteCount failed', e);
return 0;
}
}
/**
* 检查是否已收藏
*/