Back to blocks

专业应用设计指南

4.0
en技术开发应用设计任务管理客户联系

Prompt

Design a professional application that remembers all the information, which is the customer's phone number and all the tasks you have performed, with dates and alerts when the time is completed and the customer must be contacted.

Résultat Généré

import React, { useState, useEffect } from 'react';

const App = () => {
  const [customers, setCustomers] = useState([]);
  const [newPhone, setNewPhone] = useState('');
  const [newTask, setNewTask] = useState('');
  const [selectedDate, setSelectedDate] = useState('');

  useEffect(() => {
    const savedCustomers = JSON.parse(localStorage.getItem('customers')) || [];
    setCustomers(savedCustomers);
  }, []);

  const addCustomer = () => {
    if (newPhone && newTask && selectedDate) {
      const newCustomer = {
        phone: newPhone,
        tasks: [{ description: newTask, date: selectedDate, completed: false }],
      };
      const updatedCustomers = [...customers, newCustomer];
      setCustomers(updatedCustomers);
      localStorage.setItem('customers', JSON.stringify(updatedCustomers));
      setNewPhone('');
      setNewTask('');
      setSelectedDate('');
    }
  };

  const addTask = (index) => {
    if (newTask && selectedDate) {
      const updatedCustomers = [...customers];
      updatedCustomers[index].tasks.push({ description: newTask, date: selectedDate, completed: false });
      setCustomers(updatedCustomers);
      localStorage.setItem('customers', JSON.stringify(updatedCustomers));
      setNewTask('');
      setSelectedDate('');
    }
  };

  const markTaskCompleted = (customerIndex, taskIndex) => {
    const updatedCustomers = [...customers];
    updatedCustomers[customerIndex].tasks[taskIndex].completed = true;
    setCustomers(updatedCustomers);
    localStorage.setItem('customers', JSON.stringify(updatedCustomers));
  };

  const deleteCustomer = (index) => {
    const updatedCustomers = customers.filter((_, i) => i !== index);
    setCustomers(updatedCustomers);
    localStorage.setItem('customers', JSON.stringify(updatedCustomers));
  };

  return (
    <div className='min-h-screen bg-gray-100 p-6'>
      <h1 className='text-3xl font-bold text-center mb-8'>Customer Task Manager</h1>
      <div className='bg-white p-6 rounded-lg shadow-md mb-8'>
        <h2 className='text-2xl font-semibold mb-4'>Add New Customer</h2>
        <div className='flex flex-col space-y-4'>
          <input
            type='text'
            placeholder='Phone Number'
            value={newPhone}
            onChange={(e) => setNewPhone(e.target.value)}
            className='p-2 border border-gray-300 rounded-lg'
          />
          <input
            type='text'
            placeholder='Task Description'
            value={newTask}
            onChange={(e) => setNewTask(e.target.value)}
            className='p-2 border border-gray-300 rounded-lg'
          />
          <input
            type='date'
            value={selectedDate}
            onChange={(e) => setSelectedDate(e.target.value)}
            className='p-2 border border-gray-300 rounded-lg'
          />
          <button
            onClick={addCustomer}
            className='bg-blue-500 text-white p-2 rounded-lg hover:bg-blue-600'
          >
            Add Customer
          </button>
        </div>
      </div>
      <div className='space-y-6'>
        {customers.map((customer, customerIndex) => (
          <div key={customerIndex} className='bg-white p-6 rounded-lg shadow-md'>
            <div className='flex justify-between items-center mb-4'>
              <h2 className='text-xl font-semibold'>Phone: {customer.phone}</h2>
              <button
                onClick={() => deleteCustomer(customerIndex)}
                className='bg-red-500 text-white p-2 rounded-lg hover:bg-red-600'
              >
                Delete Customer
              </button>
            </div>
            <div className='flex flex-col space-y-4'>
              <input
                type='text'
                placeholder='Task Description'
                value={newTask}
                onChange={(e) => setNewTask(e.target.value)}
                className='p-2 border border-gray-300 rounded-lg'
              />
              <input
                type='date'
                value={selectedDate}
                onChange={(e) => setSelectedDate(e.target.value)}
                className='p-2 border border-gray-300 rounded-lg'
              />
              <button
                onClick={() => addTask(customerIndex)}
                className='bg-green-500 text-white p-2 rounded-lg hover:bg-green-600'
              >
                Add Task
              </button>
            </div>
            <div className='mt-6'>
              <h3 className='text-lg font-medium mb-4'>Tasks:</h3>
              {customer.tasks.map((task, taskIndex) => (
                <div key={taskIndex} className='flex justify-between items-center p-4 bg-gray-50 rounded-lg mb-2'>
                  <div>
                    <p className='text-gray-700'>{task.description}</p>
                    <p className='text-sm text-gray-500'>Date: {task.date}</p>
                    <p className='text-sm text-gray-500'>Status: {task.completed ? 'Completed' : 'Pending'}</p>
                  </div>
                  {!task.completed && (
                    <button
                      onClick={() => markTaskCompleted(customerIndex, taskIndex)}
                      className='bg-yellow-500 text-white p-2 rounded-lg hover:bg-yellow-600'
                    >
                      Mark Completed
                    </button>
                  )}
                </div>
              ))}
            </div>
          </div>
        ))}
      </div>
      <footer className='text-center text-gray-600 mt-8'>
        © 2025 Task Manager. All rights reserved.
      </footer>
    </div>
  );
};

export default App;

Plus de Recommandations

Voir Tout

创建AI安卓应用

技术开发en
4.0

Create applications ai for android the name app is a aw ai.eg the app can make photo and video the ai He must be smart and ai can speak Arabic

AI应用安卓开发智能助手20/06/2025

Archive.org 电影搜索

技术开发en
4.0

make a app that find all full popular movies on https://archive.org/

电影搜索Archive.org应用开发19/06/2025

打造任务管理应用

技术开发en
4.0

create task management app like ticktick.com

任务管理应用开发TickTick18/06/2025

Mr. Fanny 应用开发指南

技术开发en
4.0

Create a professional mobile application called "Mr. Fanny" that works on both Android and iOS. The app connects customers with home service technicians (electricians, plumbers, AC technicians, etc.). It must support both Arabic and English languages. 🔹 The app should have 3 main interfaces: 1. Customer Interface: - Ability to sign up or log in. - Choose type of service needed. - Enter location/address. - Provide phone number. - Submit service request and receive confirmation notification. 2. Technician Interface: - Sign up or log in. - Fill in registration form (name, service type, area, phone number, profile photo). - View list of incoming service requests. - Update status of each request (e.g., In Progress / Completed). - Dedicated page named “My Payments” showing the commission due with a "Mark as Paid" button. 3. Admin Panel: - Admin can review technician registrations and approve/reject them. - View list of approved technicians. - Monitor all service requests (open and completed). - Track technician payments. 🔔 Notifications: - Technician gets notified when a new request arrives. - Admin gets notified when a new technician signs up. 🧾 Future Features (optional for later development): - Customer rating system for technicians. - In-app chat between customer and technician. - In-app payment for services and commissions. - Allow customers to attach images of the issue when sending requests. 🖌️ Design Requirements: - Simple, user-friendly interface. - Touch-friendly and responsive for all screen sizes. - RTL support for Arabic and LTR for English. - Modern and clean layout. I want the full application built using HTML, CSS, and JavaScript only. It should be ready to upload on platforms like AppsGeyser or run in a WebView inside a mobile app.

移动应用HTML开发多语言支持13/06/2025

定制Chrome新标签页

技术开发en
4.0

Create a Chrome Extension that fully customizes the new tab page with the following features: 1. Replace the default Google new tab page with a transparent custom design that includes: - A search bar only (without the Google logo). - Islamic prayer times for Marrakech (GMT+1), fetched via Aladhan API or similar. - A daily Quranic verse in "Quran" font with: - Audio playback option with selectable voices (top 5 reciters: Abdul Basit, Al-Afasy, Maher Al-Muaiqly, Ahmed Al-Ajmi, Faris Abbad). - Related Hadith and wisdom of the day. - Tafsir of the verse from an Islamic source (Tafsir API). - This content changes on every new tab open. 2. A fully Arabic football live fixture panel showing: - Matches currently being played, today, and tomorrow. - Includes team names, match times, and TV channels (open/encrypted). - Covers top leagues: Arab, European, Asian, Latin American, and major international tournaments. - Data can be fetched from api-football or LiveScore APIs. 3. Weather widget for Marrakech: - Shows current temperature, humidity, wind speed, and 2-day forecast. - Use OpenWeatherMap API (Arabic language, metric units). 4. A custom shortcuts section: - Grid-style favorite website icons (e.g., YouTube, Amazon, Reddit, Twitch). - Support for drag-and-drop reordering. Design requirements: - Fully responsive UI with light/dark mode support. - Arabic as the default language, with optional English. - Clean and modern layout. Target users: Arabic-speaking Chrome users who want a spiritual, informative, and useful custom new tab experience.

Chrome扩展伊斯兰文化足球赛事12/06/2025

React调用MercadoPago

技术开发en
4.0

Calling the init_point https://www.mercadopago.com.co/checkout/v1/redirect?pref_id= mercadopago from react

ReactMercadoPagoAPI11/06/2025