ZingTruyen.Xyz

شفاء العالم باستخدام شيفرات الذكاء الاصطناعي

4

MarkPIcassoMPA

الآن بعد أن أصبحت عائلتك دافئة، وأصبحوا قادرين على البقاء أصحاء بفضل مهارات النظافة والطهي، كل شيء على ما يرام في البداية. تستمتعون بالحياة وبقضاء الوقت مع بعضكم البعض. من بعيد تسمع طفلك يصرخ. لقد ذهب للتو إلى الحمام وهناك شيء خاطئ. لا تعرف ماذا تفعل. ليس لديك طبيب، فقط أنت. هناك شيء خطأ جدًا في براز طفلك. إنه أبيض ويبدو حيًا. تشعر بالرعب. تتذكر أن لديك تطبيقًا جديدًا على هاتفك. تفتحه:

تلتقط صورة للمشكلة، ويتم التعرف على المشكلة فورًا، كما يتم تقديم حل. طفلك مصاب بالديدان. وبما أنه لا يوجد طبيب، يتعلم طفلك ما الذي يساعد على التخلص منها. لديك الآن خطة وتعرف أنهم بأمان. كل ما يحتاجونه هو المساعدة.

بالنسبة لهذا التطبيق، أردت بعض الأمور:

يجب أن يسمح بالتقاط الصور للمشاكل.

يجب أن يكون هناك مكان لإضافة الصور الجديدة باستمرار لتحديد المزيد من المشاكل.

Hebrew (עברית)

עכשיו, כאשר המשפחה שלך חמה, והם יכולים להישאר בריאים בזכות מיומנויות היגיינה ובישול, בהתחלה הכל בסדר. אתם נהנים מהחיים ומהחברה של אחד את השני. מרחוק אתם שומעים את ילדכם צועק. הוא הלך זה עתה לשירותים ומשהו לא בסדר. אינכם יודעים מה לעשות. אין לכם רופא, רק אתם. משהו לא תקין בצואה של הילד שלכם. היא לבנה ונראית חיה. אתם מפוחדים. אתם זוכרים שיש לכם אפליקציה חדשה בטלפון. אתם פותחים את האפליקציה:

אתם מצלמים תמונה של הבעיה והיא מזוהה מיידית, וגם מוצע פתרון. הילד שלכם סובל מהתולעים. מכיוון שאין רופא, הילד לומד מה עוזר להיפטר מהן. עכשיו יש לכם תוכנית ואתם יודעים שהם בטוחים. כל מה שהם צריכים הוא עזרה.

לגבי אפליקציה זו, רציתי כמה דברים:

היא חייבת לאפשר צילום תמונות של הבעיות.

חייב להיות מקום להוסיף ולעדכן תמונות חדשות באופן מתמשך כדי לזהות עוד בעיות.

🌟 React Native Code – Holistic Health Snapimport React, { useState, useEffect } from 'react'; import { View, Text, Button, Image, FlatList, TextInput, StyleSheet, TouchableOpacity } from 'react-native'; import { launchCamera } from 'react-native-image-picker'; import AsyncStorage from '@react-native-async-storage/async-storage'; // ------------------- // Categories & Remedies // ------------------- const CATEGORIES = [ { name: "Skin", remedies: ["Clean gently with mild soap", "Apply aloe vera gel", "Avoid scratching"] }, { name: "Bug Bite", remedies: ["Clean bite with water", "Apply honey or aloe", "Use cold compress"] }, { name: "Bruise", remedies: ["Apply cold pack initially", "Elevate affected area", "Gentle massage after 48 hours"] }, { name: "Parasites", remedies: ["Maintain hygiene", "Boil water before drinking", "Eat fiber-rich foods"] }, { name: "Other", remedies: ["Keep area clean", "Monitor for changes", "Seek help if worsens"] }, ]; // ------------------- // Main App // ------------------- export default function App() { const [photoData, setPhotoData] = useState([]); const [description, setDescription] = useState(''); const [selectedCategory, setSelectedCategory] = useState(CATEGORIES[0].name); const [currentPhoto, setCurrentPhoto] = useState(null); useEffect(() => { loadData(); }, []); // Load saved photos const loadData = async () => { try { const data = await AsyncStorage.getItem('photos'); if (data !== null) setPhotoData(JSON.parse(data)); } catch (error) { console.log(error); } }; // Save photo data const saveData = async (newData) => { try { await AsyncStorage.setItem('photos', JSON.stringify(newData)); } catch (error) { console.log(error); } }; // Launch camera const takePhoto = () => { launchCamera({ mediaType: 'photo', quality: 0.5 }, response => { if (response.assets && response.assets.length > 0) { setCurrentPhoto(response.assets[0].uri); } }); }; // Save photo + description + remedies const savePhoto = () => { if (!currentPhoto) return; const categoryObj = CATEGORIES.find(cat => cat.name === selectedCategory) || { remedies: [] }; const newEntry = { uri: currentPhoto, category: selectedCategory, description, remedies: categoryObj.remedies, timestamp: new Date().toISOString() }; const updatedData = [newEntry, ...photoData]; setPhotoData(updatedData); saveData(updatedData); setCurrentPhoto(null); setDescription(''); }; // ------------------- // Render // ------------------- return ( <View style={styles.container}> <Text style={styles.header}>Holistic Health Snap</Text> <Button onPress={takePhoto} /> {currentPhoto && ( <View style={styles.preview}> <Image source={{ uri: currentPhoto }} style={styles.image} /> <TextInput value={description} onChangeText={setDescription} style={styles.input} /> <View style={styles.categories}> {CATEGORIES.map(cat => ( <TouchableOpacity key={cat.name} onPress={() => setSelectedCategory(cat.name)} style={[styles.categoryButton, selectedCategory === cat.name && styles.selectedCategory]} > <Text>{cat.name}</Text> </TouchableOpacity> ))} </View> <Button onPress={savePhoto} /> </View> )} <Text style={styles.subHeader}>Saved Photos & Remedies:</Text> <FlatList data={photoData} keyExtractor={(item, index) => index.toString()} renderItem={({ item }) => ( <View style={styles.item}> <Image source={{ uri: item.uri }} style={styles.thumbnail} /> <View style={{ flex: 1, marginLeft: 10 }}> <Text style={styles.itemText}>Category: {item.category}</Text> <Text style={styles.itemText}>Description: {item.description || "N/A"}</Text> <Text style={styles.itemText}>Date: {new Date(item.timestamp).toLocaleString()}</Text> <Text style={styles.itemTextBold}>Holistic Remedies:</Text> {item.remedies.map((remedy, i) => ( <Text key={i} style={styles.itemText}>• {remedy}</Text> ))} </View> </View> )} /> </View> ); } // ------------------- // Styles // ------------------- const styles = StyleSheet.create({ container: { flex: 1, padding: 20, backgroundColor: '#f5f5f5' }, header: { fontSize: 28, fontWeight: 'bold', marginBottom: 10 }, subHeader: { fontSize: 20, marginTop: 20, marginBottom: 10 }, preview: { marginVertical: 10 }, image: { width: '100%', height: 200, marginBottom: 10 }, input: { borderColor: '#ccc', borderWidth: 1, padding: 8, marginBottom: 10, borderRadius: 5 }, categories: { flexDirection: 'row', flexWrap: 'wrap', marginBottom: 10 }, categoryButton: { padding: 8, borderWidth: 1, borderColor: '#ccc', borderRadius: 5, marginRight: 5, marginBottom: 5 }, selectedCategory: { backgroundColor: '#a0e1e5' }, item: { flexDirection: 'row', marginBottom: 10, backgroundColor: '#fff', padding: 10, borderRadius: 5 }, thumbnail: { width: 80, height: 80, borderRadius: 5 }, itemText: { fontSize: 14 }, itemTextBold: { fontSize: 16, fontWeight: 'bold', marginTop: 5 } });

Bạn đang đọc truyện trên: ZingTruyen.Xyz