import AsyncStorage from '@/utils/kvStore'; // 引导状态存储键 const GUIDE_KEYS = {} as const; /** * 检查用户是否已经完成特定引导 * @param guideKey 引导键名 * @returns Promise 是否已完成 */ export const checkGuideCompleted = async (guideKey: string): Promise => { try { const completed = await AsyncStorage.getItem(guideKey); return completed === 'true'; } catch (error) { console.error('检查引导状态失败:', error); return false; } }; /** * 标记引导为已完成 * @param guideKey 引导键名 */ export const markGuideCompleted = async (guideKey: string): Promise => { try { await AsyncStorage.setItem(guideKey, 'true'); } catch (error) { console.error('保存引导状态失败:', error); } }; /** * 重置所有引导状态(用于测试或重置用户引导) */ export const resetAllGuides = async (): Promise => { try { // 由于没有引导键,这个函数现在什么都不做 console.log('所有引导状态已重置(无引导键)'); } catch (error) { console.error('重置引导状态失败:', error); } }; /** * 获取所有引导状态 * @returns Promise> 所有引导的完成状态 */ export const getAllGuideStatus = async (): Promise> => { try { // 由于没有引导键,返回空对象 return {}; } catch (error) { console.error('获取引导状态失败:', error); return {}; } };