html 外卖(可以随意改名)平台登录界面+ 点单界面

代码:

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>外卖网页</title>

    <style>

        body {

            font-family: Arial, sans-serif;

            margin: 0;

            padding: 0;

            background-color: #f4f4f4;

        }

        header {

            background-color: #333;

            color: #fff;

            text-align: center;

            padding: 1em 0;

        }

        section {

            padding: 20px;

        }

        .restaurant-list {

            display: flex;

            flex-wrap: wrap;

            justify-content: space-around;

        }

        .restaurant-card {

            width: 300px;

            border: 1px solid #ccc;

            margin: 10px;

            padding: 10px;

            background-color: #fff;

            border-radius: 5px;

            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);

        }

        .order-btn {

            display: block;

            width: 100%;

            padding: 10px;

            background-color: #4caf50;

            color: #fff;

            text-align: center;

            text-decoration: none;

            border: none;

            border-radius: 5px;

            cursor: pointer;

        }

        .login-form {

            max-width: 400px;

            margin: 0 auto;

            background-color: #fff;

            padding: 20px;

            border-radius: 5px;

            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);

        }

        .form-group {

            margin-bottom: 20px;

        }

        .form-group label {

            display: block;

            margin-bottom: 5px;

        }

        .form-group input {

            width: 100%;

            padding: 8px;

            box-sizing: border-box;

            border: 1px solid #ccc;

            border-radius: 3px;

        }

        .login-btn {

            display: block;

            width: 100%;

            padding: 10px;

            background-color: #333;

            color: #fff;

            text-align: center;

            text-decoration: none;

            border: none;

            border-radius: 5px;

            cursor: pointer;

        }

    </style>

</head>

<body>

    <header>

        <h1>外卖服务</h1>

    </header>

   

    <section>

        <h2>个人登录</h2>

        <div class="login-form">

            <div class="form-group">

                <label for="phone">手机号:</label>

                <input type="tel" id="phone" placeholder="请输入手机号">

            </div>

            <div class="form-group">

                <label for="password">密码:</label>

                <input type="password" id="password" placeholder="请输入密码">

            </div>

            <button class="login-btn" οnclick="login()">登录</button>

        </div>

    </section>

    <section>

        <h2>选择餐馆</h2>

        <div class="restaurant-list">

            <div class="restaurant-card">

                <h3>餐馆1</h3>

                <p>提供美味的食物</p>

                <button class="order-btn" οnclick="orderFood('餐馆1')">立即订购</button>

            </div>

            <div class="restaurant-card">

                <h3>餐馆2</h3>

                <p>新鲜、健康的食品</p>

                <button class="order-btn" οnclick="orderFood('餐馆2')">立即订购</button>

            </div>

            <!-- 添加更多餐馆卡片 -->

        </div>

    </section>

    <section>

        <h2>订单信息</h2>

        <div id="order-info"></div>

    </section>

    <script>

        function login() {

            // 在这里添加登录处理逻辑,例如验证用户输入

            // 这里只是一个简单的示例,没有真正的身份验证

            alert("登录成功!");

            redirectToOrderPage();

        }

        function redirectToOrderPage() {

    // 在这里添加重定向逻辑,直接跳转到指定页面

    window.location.href = "file:///C:/科技/登陆后.html";

}

        function orderFood(restaurantName) {

            // 这里可以添加订单处理逻辑,例如向服务器发送请求

            // 在这个简单示例中,我们只是在页面上显示订单信息

            const orderInfoDiv = document.getElementById('order-info');

            orderInfoDiv.innerHTML = `<p>您已成功订购${restaurantName}的美味食物!</p>`;

        }

    </script>

</body>

</html>

请注意,path/to/your/order/page.html应该被替换为实际的订单页面路径。

登录后点单页面代码:

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>外卖网页</title>

    <style>

        body {

            font-family: Arial, sans-serif;

            margin: 0;

            padding: 0;

            background-color: #f4f4f4;

        }

        header {

            background-color: #333;

            color: #fff;

            text-align: center;

            padding: 1em 0;

        }

        section {

            padding: 20px;

        }

        .restaurant-list {

            display: flex;

            flex-wrap: wrap;

            justify-content: space-around;

        }

        .restaurant-card {

            width: 300px;

            border: 1px solid #ccc;

            margin: 10px;

            padding: 10px;

            background-color: #fff;

            border-radius: 5px;

            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);

        }

        .order-btn {

            display: block;

            width: 100%;

            padding: 10px;

            background-color: #4caf50;

            color: #fff;

            text-align: center;

            text-decoration: none;

            border: none;

            border-radius: 5px;

            cursor: pointer;

        }

    </style>

</head>

<body>

    <header>

        <h1>外卖服务</h1>

    </header>

   

    <section>

        <h2>选择餐馆</h2>

        <div class="restaurant-list">

            <div class="restaurant-card">

                <h3>餐馆1</h3>

                <p>提供美味的食物</p>

                <button class="order-btn" οnclick="orderFood('餐馆1')">立即订购</button>

            </div>

            <div class="restaurant-card">

                <h3>餐馆2</h3>

                <p>新鲜、健康的食品</p>

                <button class="order-btn" οnclick="orderFood('餐馆2')">立即订购</button>

            </div>

            <!-- 添加更多餐馆卡片 -->

        </div>

    </section>

    <section>

        <h2>订单信息</h2>

        <div id="order-info"></div>

    </section>

    <script>

        function orderFood(restaurantName) {

            // 这里可以添加订单处理逻辑,例如向服务器发送请求

            // 在这个简单示例中,我们只是在页面上显示订单信息

            const orderInfoDiv = document.getElementById('order-info');

            orderInfoDiv.innerHTML = `<p>您已成功订购${restaurantName}的美味食物!</p>`;

        }

    </script>

</body>

</html>

  • 34
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个简单的外卖系统登录界面HTML代码: ``` <!DOCTYPE html> <html> <head> <title>外卖系统登录</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> form { display: flex; flex-direction: column; align-items: center; padding: 20px; border: 1px solid #ccc; border-radius: 5px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); } input[type=text], input[type=password] { padding: 10px; margin: 10px 0; border: none; border-radius: 3px; box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); } button { padding: 10px; margin: 10px 0; background-color: #4CAF50; color: white; border: none; border-radius: 3px; cursor: pointer; box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); } button:hover { background-color: #3e8e41; } a { color: #4CAF50; text-decoration: none; } a:hover { text-decoration: underline; } </style> </head> <body> <form> <h2>外卖系统登录</h2> <label for="username">用户名:</label> <input type="text" id="username" name="username" placeholder="请输入用户名" required> <label for="password">密码:</label> <input type="password" id="password" name="password" placeholder="请输入密码" required> <button type="submit">登录</button> <p>还没有账号?<a href="register.html">立即注册</a></p> <p><a href="#">忘记密码?</a></p> </form> </body> </html> ``` 以上代码使用了HTMLCSS语言,实现了一个简单的外卖系统登录界面。其中包含一个表单、两个输入框、两个按钮和两个链接。用户可以通过输入用户名和密码来登录系统,也可以点击注册按钮跳转到注册页面。同时也提供了忘记密码的链接,方便用户找回密码。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值