|
|
|
@ -340,7 +340,7 @@ export default function DemoScreen() { |
|
|
|
<Text style={styles.infoText}> |
|
|
|
<Text style={styles.infoText}> |
|
|
|
状态: {tenantLoad ? '✅ 已加载' : '❌ 未加载'} |
|
|
|
状态: {tenantLoad ? '✅ 已加载' : '❌ 未加载'} |
|
|
|
</Text> |
|
|
|
</Text> |
|
|
|
{tenantInfo && ( |
|
|
|
{tenantInfo ? ( |
|
|
|
<> |
|
|
|
<> |
|
|
|
<Text style={styles.infoText}>TID: {tenantInfo.tid || '无'}</Text> |
|
|
|
<Text style={styles.infoText}>TID: {tenantInfo.tid || '无'}</Text> |
|
|
|
<Text style={styles.infoText}> |
|
|
|
<Text style={styles.infoText}> |
|
|
|
@ -350,7 +350,7 @@ export default function DemoScreen() { |
|
|
|
域名: {tenantInfo.domain_addr || '无'} |
|
|
|
域名: {tenantInfo.domain_addr || '无'} |
|
|
|
</Text> |
|
|
|
</Text> |
|
|
|
</> |
|
|
|
</> |
|
|
|
)} |
|
|
|
) : null} |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
|
|
|
|
|
|
|
|
{/* 用户状态显示 */} |
|
|
|
{/* 用户状态显示 */} |
|
|
|
@ -358,9 +358,9 @@ export default function DemoScreen() { |
|
|
|
<Text style={styles.sectionTitle}>👤 用户状态 (Zustand)</Text> |
|
|
|
<Text style={styles.sectionTitle}>👤 用户状态 (Zustand)</Text> |
|
|
|
{isLoggedIn ? ( |
|
|
|
{isLoggedIn ? ( |
|
|
|
<View style={styles.userInfo}> |
|
|
|
<View style={styles.userInfo}> |
|
|
|
{user?.avatar && ( |
|
|
|
{user?.avatar ? ( |
|
|
|
<Image source={{ uri: user.avatar }} style={styles.avatar} contentFit="cover" /> |
|
|
|
<Image source={{ uri: user.avatar }} style={styles.avatar} contentFit="cover" /> |
|
|
|
)} |
|
|
|
) : null} |
|
|
|
<View style={styles.userDetails}> |
|
|
|
<View style={styles.userDetails}> |
|
|
|
<Text style={styles.userName}>{user?.nickname}</Text> |
|
|
|
<Text style={styles.userName}>{user?.nickname}</Text> |
|
|
|
<Text style={styles.userEmail}>{user?.email}</Text> |
|
|
|
<Text style={styles.userEmail}>{user?.email}</Text> |
|
|
|
@ -378,7 +378,7 @@ export default function DemoScreen() { |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
|
|
|
|
|
|
|
|
{/* 登录表单 */} |
|
|
|
{/* 登录表单 */} |
|
|
|
{!isLoggedIn && ( |
|
|
|
{!isLoggedIn ? ( |
|
|
|
<View style={styles.section}> |
|
|
|
<View style={styles.section}> |
|
|
|
<Text style={styles.sectionTitle}>🔐 登录表单 (React Hook Form + Zod)</Text> |
|
|
|
<Text style={styles.sectionTitle}>🔐 登录表单 (React Hook Form + Zod)</Text> |
|
|
|
|
|
|
|
|
|
|
|
@ -414,9 +414,9 @@ export default function DemoScreen() { |
|
|
|
secureTextEntry |
|
|
|
secureTextEntry |
|
|
|
style={[styles.input, errors.password && styles.inputError]} |
|
|
|
style={[styles.input, errors.password && styles.inputError]} |
|
|
|
/> |
|
|
|
/> |
|
|
|
{errors.password && ( |
|
|
|
{errors.password ? ( |
|
|
|
<Text style={styles.errorText}>{errors.password.message}</Text> |
|
|
|
<Text style={styles.errorText}>{errors.password.message}</Text> |
|
|
|
)} |
|
|
|
) : null} |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
)} |
|
|
|
)} |
|
|
|
/> |
|
|
|
/> |
|
|
|
@ -433,7 +433,7 @@ export default function DemoScreen() { |
|
|
|
)} |
|
|
|
)} |
|
|
|
</TouchableOpacity> |
|
|
|
</TouchableOpacity> |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
)} |
|
|
|
) : null} |
|
|
|
|
|
|
|
|
|
|
|
{/* 搜索示例 */} |
|
|
|
{/* 搜索示例 */} |
|
|
|
<View style={styles.section}> |
|
|
|
<View style={styles.section}> |
|
|
|
@ -444,7 +444,7 @@ export default function DemoScreen() { |
|
|
|
placeholder="输入搜索内容..." |
|
|
|
placeholder="输入搜索内容..." |
|
|
|
style={styles.input} |
|
|
|
style={styles.input} |
|
|
|
/> |
|
|
|
/> |
|
|
|
{searchResults.length > 0 && ( |
|
|
|
{searchResults.length > 0 ? ( |
|
|
|
<View style={styles.searchResults}> |
|
|
|
<View style={styles.searchResults}> |
|
|
|
{searchResults.map((result, index) => ( |
|
|
|
{searchResults.map((result, index) => ( |
|
|
|
<Text key={index} style={styles.searchResult}> |
|
|
|
<Text key={index} style={styles.searchResult}> |
|
|
|
@ -452,7 +452,7 @@ export default function DemoScreen() { |
|
|
|
</Text> |
|
|
|
</Text> |
|
|
|
))} |
|
|
|
))} |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
)} |
|
|
|
) : null} |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
|
|
|
|
|
|
|
|
{/* 节流点击示例 */} |
|
|
|
{/* 节流点击示例 */} |
|
|
|
@ -481,11 +481,11 @@ export default function DemoScreen() { |
|
|
|
<Text style={styles.buttonText}>读取数据</Text> |
|
|
|
<Text style={styles.buttonText}>读取数据</Text> |
|
|
|
</TouchableOpacity> |
|
|
|
</TouchableOpacity> |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
{storageValue && ( |
|
|
|
{storageValue ? ( |
|
|
|
<View style={styles.codeBlock}> |
|
|
|
<View style={styles.codeBlock}> |
|
|
|
<Text style={styles.codeText}>{storageValue}</Text> |
|
|
|
<Text style={styles.codeText}>{storageValue}</Text> |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
)} |
|
|
|
) : null} |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
|
|
|
|
|
|
|
|
{/* 会话存储示例 */} |
|
|
|
{/* 会话存储示例 */} |
|
|
|
@ -514,11 +514,11 @@ export default function DemoScreen() { |
|
|
|
<Text style={styles.buttonText}>清空</Text> |
|
|
|
<Text style={styles.buttonText}>清空</Text> |
|
|
|
</TouchableOpacity> |
|
|
|
</TouchableOpacity> |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
{sessionValue && ( |
|
|
|
{sessionValue ? ( |
|
|
|
<View style={styles.codeBlock}> |
|
|
|
<View style={styles.codeBlock}> |
|
|
|
<Text style={styles.codeText}>{sessionValue}</Text> |
|
|
|
<Text style={styles.codeText}>{sessionValue}</Text> |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
)} |
|
|
|
) : null} |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
|
|
|
|
|
|
|
|
{/* 日期格式化示例 */} |
|
|
|
{/* 日期格式化示例 */} |
|
|
|
|