返回代码库

打造Billal Gym健身应用

4.0
zh软件开发健身应用React NativeBMI计算

提示语

Create a fitness and workout application called "Billal Gym" with the following features:

1. **Login with one-time use codes**: 
   - Generate 10 random 6-digit authentication codes when the app is first launched.
   - Each code can only be used once for logging in. After a user successfully logs in, the used code is removed from the list.
   - Store the valid codes using local storage (AsyncStorage) in React Native.
   - When a code is entered and it's valid, allow access to the main app interface.

2. **Main App Interface (Home Screen)**:
   - Display two buttons on the home screen:
     - "Enter Body Data": For users to input their body measurements (weight, height, age).
     - "Manage Daily Tasks": For users to input and track their workout routines and schedule.

3. **Body Data Screen**:
   - Allow users to input their body data such as weight, height, and age.
   - Calculate BMI (Body Mass Index) based on the input data and show it on the screen.
   
4. **Daily Tasks Management**:
   - Allow users to manage their daily workout tasks.
   - Users can add and remove exercises, set times, and track progress.
   - Use a simple to-do list style interface with checkboxes for task completion.

5. **Design Details**:
   - Use a minimalistic, modern design.
   - The app should have a clean layout with intuitive navigation.
   - Use blue and white color scheme to match the fitness theme.
   - Include attractive icons for each button (use a site like Flaticon for icons).
   - Provide a professional and clean logo for the app with the name "Billal Gym".
   
6. **Login Flow**:
   - Display a screen where the user enters one of the valid codes.
   - If the code is correct, allow access to the home screen. If the code is incorrect or has been used before, show an error message.

7. **Tools and Technology**:
   - Use React Native and Expo for building the mobile application.
   - Use AsyncStorage to store the codes and user data.
   - Implement navigation using React Navigation.
   
8. **Generate APK/IPA for Android/iOS**:
   - Provide an option to generate APK for Android or IPA for iOS after the app is developed.

生成结果

import React, { useState, useEffect } from 'react';
import { View, Text, TextInput, Button, StyleSheet, FlatList, TouchableOpacity } from 'react-native';
import AsyncStorage from '@react-native-async-storage/async-storage';

const App = () => {
  const [codes, setCodes] = useState([]);
  const [inputCode, setInputCode] = useState('');
  const [loggedIn, setLoggedIn] = useState(false);
  const [bodyData, setBodyData] = useState({ weight: '', height: '', age: '' });
  const [bmi, setBmi] = useState(null);
  const [tasks, setTasks] = useState([]);
  const [newTask, setNewTask] = useState('');

  useEffect(() => {
    generateCodes();
  }, []);

  const generateCodes = async () => {
    const newCodes = Array.from({ length: 10 }, () => Math.floor(100000 + Math.random() * 900000).toString());
    await AsyncStorage.setItem('codes', JSON.stringify(newCodes));
    setCodes(newCodes);
  };

  const handleLogin = async () => {
    const storedCodes = await AsyncStorage.getItem('codes');
    const validCodes = JSON.parse(storedCodes);
    if (validCodes.includes(inputCode)) {
      const updatedCodes = validCodes.filter(code => code !== inputCode);
      await AsyncStorage.setItem('codes', JSON.stringify(updatedCodes));
      setCodes(updatedCodes);
      setLoggedIn(true);
    } else {
      alert('Invalid or used code');
    }
  };

  const calculateBmi = () => {
    const weight = parseFloat(bodyData.weight);
    const height = parseFloat(bodyData.height) / 100;
    const bmiValue = (weight / (height * height)).toFixed(2);
    setBmi(bmiValue);
  };

  const addTask = () => {
    if (newTask.trim()) {
      setTasks([...tasks, { id: Date.now().toString(), text: newTask, completed: false }]);
      setNewTask('');
    }
  };

  const toggleTask = (id) => {
    setTasks(tasks.map(task => task.id === id ? { ...task, completed: !task.completed } : task));
  };

  const deleteTask = (id) => {
    setTasks(tasks.filter(task => task.id !== id));
  };

  if (!loggedIn) {
    return (
      <View style={styles.container}>
        <Text style={styles.title}>Billal Gym</Text>
        <TextInput
          style={styles.input}
          placeholder="Enter 6-digit code"
          value={inputCode}
          onChangeText={setInputCode}
          keyboardType="numeric"
        />
        <Button title="Login" onPress={handleLogin} />
      </View>
    );
  }

  return (
    <View style={styles.container}>
      <Text style={styles.title}>Billal Gym</Text>
      <View style={styles.buttonContainer}>
        <Button title="Enter Body Data" onPress={() => setBodyData({ weight: '', height: '', age: '' })} />
        <Button title="Manage Daily Tasks" onPress={() => setTasks([])} />
      </View>
      {bodyData.weight === '' ? (
        <View style={styles.bodyDataContainer}>
          <TextInput
            style={styles.input}
            placeholder="Weight (kg)"
            value={bodyData.weight}
            onChangeText={(text) => setBodyData({ ...bodyData, weight: text })}
            keyboardType="numeric"
          />
          <TextInput
            style={styles.input}
            placeholder="Height (cm)"
            value={bodyData.height}
            onChangeText={(text) => setBodyData({ ...bodyData, height: text })}
            keyboardType="numeric"
          />
          <TextInput
            style={styles.input}
            placeholder="Age"
            value={bodyData.age}
            onChangeText={(text) => setBodyData({ ...bodyData, age: text })}
            keyboardType="numeric"
          />
          <Button title="Calculate BMI" onPress={calculateBmi} />
          {bmi && <Text style={styles.bmiText}>Your BMI: {bmi}</Text>}
        </View>
      ) : (
        <View style={styles.taskContainer}>
          <TextInput
            style={styles.input}
            placeholder="New Task"
            value={newTask}
            onChangeText={setNewTask}
          />
          <Button title="Add Task" onPress={addTask} />
          <FlatList
            data={tasks}
            keyExtractor={(item) => item.id}
            renderItem={({ item }) => (
              <View style={styles.taskItem}>
                <TouchableOpacity onPress={() => toggleTask(item.id)}>
                  <Text style={item.completed ? styles.completedTask : styles.taskText}>{item.text}</Text>
                </TouchableOpacity>
                <Button title="Delete" onPress={() => deleteTask(item.id)} />
              </View>
            )}
          />
        </View>
      )}
    </View>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    padding: 20,
    backgroundColor: '#f0f4f8',
  },
  title: {
    fontSize: 24,
    fontWeight: 'bold',
    textAlign: 'center',
    marginBottom: 20,
    color: '#1a73e8',
  },
  input: {
    height: 40,
    borderColor: '#ccc',
    borderWidth: 1,
    borderRadius: 5,
    paddingHorizontal: 10,
    marginBottom: 10,
    backgroundColor: '#fff',
  },
  buttonContainer: {
    flexDirection: 'row',
    justifyContent: 'space-around',
    marginBottom: 20,
  },
  bodyDataContainer: {
    marginBottom: 20,
  },
  bmiText: {
    fontSize: 18,
    textAlign: 'center',
    marginTop: 10,
    color: '#1a73e8',
  },
  taskContainer: {
    flex: 1,
  },
  taskItem: {
    flexDirection: 'row',
    justifyContent: 'space-between',
    alignItems: 'center',
    padding: 10,
    borderBottomWidth: 1,
    borderBottomColor: '#ccc',
  },
  taskText: {
    fontSize: 16,
  },
  completedTask: {
    fontSize: 16,
    textDecorationLine: 'line-through',
    color: '#888',
  },
});

export default App;

更多推荐

查看全部

Python Turtle WoW 插件开发

软件开发zh
4.0

Create a Python desktop application for Turtle WoW (1.12.1) addon development with these features: 1. **Core Functionality** - Lua 5.0 editor with syntax highlighting - Real-time compatibility validator (flags retail/C_* APIs, Lua 5.1+ features) - Turtle WoW API autocomplete (custom races/quests) - Secure code analyzer (taint detection, memory leak checks) 2. **Integrated Tools** - Snippet manager with preloaded templates: * Secure action buttons * Event-driven frames * Saved variables * Slash commands - Project wizard (auto-generates .toc, folder structure) - Version-safe function lookup (Lua 5.0 vs 5.1 differences) 3. **Turtle-Specific Modules** - High Elf detection template - Custom quest hook generator - Hardcore mode utilities - Turtle API explorer (scraped from wiki) 4. **Technical Requirements** - GUI: PyQt6 or Tkinter - Lua parsing: Lupa or Lunatic Python - Output: Single .exe (PyInstaller) - Vanilla API database: JSON file with: { "GetUnitHealth": { "syntax": "health = UnitHealth(unit)", "version": "1.0+", "taint": "secure" }, "C_QuestLog": { "status": "FORBIDDEN (retail)" } } 5. **UI Layout** ┌────────────────┬────────────────┐ │ Project Manager│ Code Editor │ │ (TOC/files) │ (Lua 5.0) │ ├────────────────┴────────────────┤ │ Turtle Tools │ │ [Race Detector][Quest Builder] │ ├─────────────────────────────────┤ │ Validation Panel │ │ ✔ Secure ✘ Lua 5.1 ⚠ Taint │ └─────────────────────────────────┘

PythonTurtle WoWLua2025/6/19

跨境会计应用开发

软件开发en
4.0

Make me an accounting application and transfer work from one country to another

会计应用跨境业务软件开发2025/6/15

Mr. Fanny Web App

软件开发en
4.0

You are an elite software engineer and full-stack developer team. Your task is to generate a full HTML/CSS/JavaScript frontend web application ready to be used as a mobile app inside WebView for Android and iOS, or published as a PWA. Project Title: **Mr. Fanny - Home Services Platform** 🌐 **Languages**: Arabic and English (toggle switch) ➡️ Must support full RTL (right-to-left) layout when Arabic is selected. ➡️ All text and interface must be dynamically switchable between Arabic and English. 👥 **User Types**: 1. Customer 2. Technician 🧩 **Pages to include**: - `index.html`: Welcome page with language selector, and role selection (Customer or Technician) - `login.html`: Login page (email/phone + password) - `register_customer.html`: Register form for customers - `register_technician.html`: Register form for technicians (includes name, area, phone, service type) - `dashboard_customer.html`: Home screen for customer: request service, track status, past requests - `dashboard_technician.html`: Technician dashboard: see available jobs, accept/reject, mark as done - `settings.html`: Switch language, change password - Optional: `admin.html`: Admin login + view all requests + statistics 🛠️ **Functionalities**: - LocalStorage-based session simulation - Store user data and service requests in localStorage - Each user sees their respective dashboard after login - Technician can mark a job as done and see commission (10%) - Customer can send new request and track it - Admin (if included) can see overall stats and control approvals 🎨 **UI Requirements**: - Responsive mobile-first design - Use icons for services (plumbing, AC, electrical, etc.) - Dark/light theme toggle (optional) - Navbar or bottom bar for navigation - Clear UX flow with no page reloads if possible (use JavaScript for transitions) 📁 **File Structure**: - /index.html - /login.html - /register_customer.html - /register_technician.html - /dashboard_customer.html - /dashboard_technician.html - /assets/css/styles.css - /assets/js/lang.js → manages dynamic language switching - /assets/js/auth.js → handles login/register/localStorage - /assets/js/dashboard.js → loads different content for each role - /assets/img/ → icons for services 💡 **Extra Features**: - Service categories shown as cards (AC, Electricity, Plumbing...) - When technician accepts request, it disappears from the global pool - Show status timeline for customer (Pending, Accepted, In Progress, Done) - Technician profile with stats (completed jobs, total earnings) 📦 **Output**: Generate all source code files inside a zipped project folder. Make sure everything is linked properly. Provide working HTML pages with realistic sample data to demonstrate flow. Bonus: Add a simple guide README.txt in English explaining the file structure and how to run the app locally (just open index.html).

Web开发PWARTL支持2025/6/13

农场预订平台项目文档

软件开发en
4.0

Important Note Before Beginning: Website design exclusively in HTML, CSS, and JS, programming exclusively in PHP, and database exclusively in MySQL. # **Farm Booking Platform Project Document - Integrated Management** ## **1. Overview** Objective: To build an integrated accounting and management system to manage farm reservations, employees, financial funds, and detailed reports. --- ## **2. Admin Dashboard Interfaces** ### **Home Page (Control Panel)** - Live Statistics: - Number of reservations (day/month/year). - Number of active employees. - Total revenues and expenses. - **Quick navigation icons** for all pages (e.g., reservation calendar, reports, add farm, etc.). ### **1. Employee Management Page** - A table with data for each employee (name, permissions, number of reservations, financial fund). - **Options**: - Delete/Disable an employee. - Modify permissions (e.g., prevent modifications to reservations). - Accept or reject job applications. ### **2. Detailed Reservations Page** - A table of all reservations with filters (by date, farm, employee). - **Actions**: - Edit/delete any reservation. - Add a manual reservation (for employees or direct customers). ### **3. Add New Reservation Page** - Form to enter: - Select the farm (from a drop-down list). - Select the date (with pre-booked dates blocked). - Customer information (name, contact information). - Attach an invoice (PDF/Print). ### **4. Financial Reports** - **Custom Reports**: - Daily/Monthly/Annual Profits. - Detailed Expenses (Expense Type, Date, Amount). - Compare Revenue vs. Expenses. - **Export**: Excel / PDF / Print. ### **5. Calendar View** - Monthly view (booked days = highlighted in blue). - **When clicking on a day**: - Reservation details (client, amount, responsible employee). - Delete/Edit option (for managers only). ### **6. Add a New Expense** - Entry Form: - Expense type (maintenance, salaries, advertising, etc.). - Amount + disbursement date. - Attach proof (image/PDF). ### **7. Add a New Farm** - Farm details: - Name, location (Google Maps), price, photos. - Days not available for booking. ### **8. Employee Funds** - **Track Due Amounts**: - For each employee: Total amounts collected from their reservations. - **"Reset Fund"** button: Archive the amount and reset to zero. - Report of financial transactions for each employee. ### **9. Backup** - Options: - Download a copy of the data (SQL/Excel). - Restore data from a previous copy. ### **10. Employee Permissions** - Define permissions for each employee: - View reservations only vs. modify them. - Access financial reports. ### **11. Login and Activity** - Record employee login dates. - Notifications for: - Unusual logins. - Failed login attempts. ### **12. Notifications** - Send alerts to the manager/employee when: - New reservation, cancellation, or modification. - Payment is received in the employee's account. --- ## **3. Employee Interface** ### **1. Join Application** - Registration Form (Name, Password). ### **2. Control Panel (After Acceptance)** - **Booking Calendar**: - View booked days (cannot be modified). - Add bookings on empty days. - **My Cashier**: - Amount to be paid to the manager. - A record of collected bookings. --- ### **B. Security:** - Data encryption (SSL). - User permissions (Roles & Permissions). - Daily backups.

农场管理PHP开发MySQL数据库2025/6/13

AutoCAD智能操作Ribbon菜单

软件开发zh
4.0

为AutoCAD创建名为"智能操作"的Ribbon菜单,包含7个按钮: 1. 自动编号 2.插入图幅 3.智能识图 4.设置图名图号专业 5.批量打印 6.批量转PDF 7.生成图纸目录 使用WPF实现,兼容各CAD版本(要求要美观 )

AutoCADRibbon菜单WPF2025/4/5

埃及打车应用开发

软件开发zh
4.0

"Act as a professional app development expert with Polt, specialized in designing professional ride-hailing apps. Your task is to create an integrated application called "Waslny" that works in Egypt only, ready to run immediately, without any errors at all, and includes all the required features, pages, transitions, and buttons. The user interface should be very professional, supporting both Arabic and English languages, with all payment methods, the ability to switch between light and dark mode, an advanced registration system for captains that includes photo and document verification, with a price proposal for each kilometer according to the predefined range." --- 1. --- 1. Create the app infrastructure Create a new app called "Waslani" that supports both Arabic and English languages. The app works within the Arab Republic of Egypt only. Supports Android and iOS operating systems seamlessly. Use Material Design or an attractive modern design that reflects the app's professionalism. Add the feature of switching between light and dark mode. Make sure all user and captain data is saved in a secure database with personalized profiles for each user. --- 2. Registration of Users and Captains a. Registration of regular users (passengers) Passengers can register via: Email Phone number with verification code Sign in via Google or Apple ID Each user has a profile containing their name, photo, trip history, and registered payment methods. b. Captains (Drivers) Registration Captains must enter the following information during registration: Full name Email Phone number with verification code Driver's license (upload a clear photo) Vehicle license (upload a clear photo) Vehicle interior photo Vehicle exterior photo Photo verification test: The captain takes a selfie while holding their license for identity verification. After entering the data, it is manually reviewed and approved by management before the account is activated. A profile is created for each captain containing their data, ratings, and flight history. --- 3. Pages and Transitions Home Page: "Request Service" button and "Submit Service" button. Login/Registration page: Supports registration with phone number, email, or Google/Apple ID. Service request page: Specify current location and destination with distance and estimated cost. Choose the type of vehicle (car/motorcycle/parcel delivery). View price suggestions based on an indicative range per kilometer. Captain selection page: View a list of captains with names, ratings, cars, and photos. Ability to negotiate the fare before accepting the request. Trip details page: Displays the captain, car, and agreed upon cost. Trip cancel button and trip start button. Trip tracking page: Live map to track the captain in real time. Continuous update of ETA. Payment page: Supports cash payment, via Fawry, with the ability to add other payment methods later. Rating page: The user can rate the captain and vice versa after the trip is over. Flight history page: Displays all previous trips with full details. Support page: Provides direct communication with the support team to resolve issues. --- 4. Basic Features Integrated GPS: Provides accurate positioning and real-time tracking of the captain. User rating system: Allows passengers and captains to rate each other to build trust. In-app chat system: Communication between passengers and captains without sharing phone numbers. SOS button: Sends an emergency alert directly in the event of an issue. Trip sharing: Share trip details with family or friends. Add night mode (dark): Change the app's interface between light and dark. Save data for each user and captain: Each user has a personal profile that contains all their data and records. --- 5. Workflow and Pricing Direct Negotiation System: Allows the rider to propose a price, and the captain to accept or negotiate it. Indicative prices per kilometer: Motorcycles: EGP 3-7 per kilometer. Cars: EGP 5-10 per kilometer. Parcel delivery: EGP 5 - 8 per kilometer. Prices are displayed in the app as a suggested range when ordering the service. A low commission (7%) is deducted from the captain to ensure that his income is maximized. --- 6. Special Add-ons Quranic Verse Audio Add-on: When opening the app for the first time, a verse is played: "Glory be to Him who made this possible for us, and we were not bound to it, and we will turn to our Lord" in the voice of Sheikh Abdul Basit Abdul Samad in high quality. The option to disable the sound from the settings. Support for e-payment via Fawry: Adding the option to pay via Fawry, with the possibility of supporting other methods later. Advanced security system: Manual review of captains' data before activating accounts. Two-factor authentication for user accounts to protect data. Very professional interface design: Consistent colors, high-quality icons, and smooth animations. Fast and easy user experience without any complications. --- Take a deep breath and start implementing the app step by step, making sure that every detail is executed accurately and professionally."

打车应用埃及市场多语言支持2025/4/3