| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319 |
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>完善信息 - 食养智鉴</title>
- <link href="https://at.alicdn.com/t/c/font_4525513_9u8m8q8q5x.css" rel="stylesheet">
- <style>
- :root {
- --primary: #2E5B4D;
- --secondary: #8BAE8F;
- --accent: #C44536;
- --bg: #F8F9FA;
- --text: #333333;
- --card-bg: #FFFFFF;
- }
- * {
- margin: 0;
- padding: 0;
- box-sizing: border-box;
- font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
- }
- body {
- background: var(--bg);
- color: var(--text);
- min-height: 100vh;
- }
- .container {
- max-width: 100%;
- padding: 20px;
- margin: 0 auto;
- }
- .header {
- text-align: center;
- margin-bottom: 30px;
- }
- .logo {
- font-size: 1.8rem;
- color: var(--primary);
- margin-bottom: 10px;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- .logo i {
- margin-right: 10px;
- }
- .title {
- font-size: 1.5rem;
- font-weight: 600;
- margin-bottom: 8px;
- }
- .subtitle {
- color: #666;
- font-size: 0.9rem;
- }
- .form-group {
- margin-bottom: 25px;
- }
- .form-label {
- display: block;
- margin-bottom: 10px;
- font-weight: 500;
- }
- .gender-select {
- display: flex;
- gap: 15px;
- margin-bottom: 5px;
- }
- .gender-option {
- flex: 1;
- position: relative;
- }
- .gender-option input {
- position: absolute;
- opacity: 0;
- width: 0;
- height: 0;
- }
- .gender-label {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- padding: 15px 10px;
- background: var(--card-bg);
- border-radius: 10px;
- border: 1px solid #ddd;
- cursor: pointer;
- transition: all 0.3s;
- }
- .gender-option input:checked + .gender-label {
- border-color: var(--primary);
- background: rgba(46,91,77,0.05);
- }
- .gender-icon {
- font-size: 1.8rem;
- margin-bottom: 8px;
- color: var(--primary);
- }
- .gender-text {
- font-size: 0.95rem;
- }
- .input-group {
- position: relative;
- }
- .input-field {
- width: 100%;
- padding: 15px;
- border: 1px solid #ddd;
- border-radius: 10px;
- font-size: 1rem;
- background: var(--card-bg);
- }
- .input-field:focus {
- outline: none;
- border-color: var(--primary);
- }
- .input-unit {
- position: absolute;
- right: 15px;
- top: 50%;
- transform: translateY(-50%);
- color: #666;
- }
- .date-picker {
- position: relative;
- }
- .date-picker input {
- width: 100%;
- padding: 15px;
- border: 1px solid #ddd;
- border-radius: 10px;
- font-size: 1rem;
- background: var(--card-bg);
- }
- .date-icon {
- position: absolute;
- right: 15px;
- top: 50%;
- transform: translateY(-50%);
- color: var(--primary);
- }
- .submit-btn {
- width: 100%;
- padding: 15px;
- background: var(--primary);
- color: white;
- border: none;
- border-radius: 10px;
- font-size: 1rem;
- font-weight: 500;
- cursor: pointer;
- transition: background 0.3s;
- margin-top: 10px;
- }
- .submit-btn:hover {
- background: #1e3d33;
- }
- .progress-steps {
- display: flex;
- justify-content: center;
- margin-bottom: 30px;
- }
- .step {
- width: 30px;
- height: 30px;
- border-radius: 50%;
- background: #ddd;
- color: white;
- display: flex;
- align-items: center;
- justify-content: center;
- margin: 0 5px;
- font-size: 0.9rem;
- }
- .step.active {
- background: var(--primary);
- }
- .step-line {
- height: 2px;
- background: #ddd;
- flex: 1;
- margin: 0 -5px;
- align-self: center;
- }
- .step-line.active {
- background: var(--primary);
- }
- </style>
- </head>
- <body>
- <div class="container">
- <!-- 进度条 -->
- <div class="progress-steps">
- <div class="step active">1</div>
- <div class="step-line active"></div>
- <div class="step active">2</div>
- <div class="step-line"></div>
- <div class="step">3</div>
- </div>
- <!-- 页眉 -->
- <div class="header">
- <div class="logo">
- <i class="iconfont icon-leaf"></i>
- <span>食养智鉴</span>
- </div>
- <h1 class="title">完善您的健康信息</h1>
- <p class="subtitle">个性化配餐需要这些基础数据</p>
- </div>
- <!-- 表单区域 -->
- <form>
- <!-- 性别选择 -->
- <div class="form-group">
- <label class="form-label">性别</label>
- <div class="gender-select">
- <div class="gender-option">
- <input type="radio" id="male" name="gender" value="male" checked>
- <label for="male" class="gender-label">
- <i class="iconfont icon-male gender-icon"></i>
- <span class="gender-text">男性</span>
- </label>
- </div>
- <div class="gender-option">
- <input type="radio" id="female" name="gender" value="female">
- <label for="female" class="gender-label">
- <i class="iconfont icon-female gender-icon"></i>
- <span class="gender-text">女性</span>
- </label>
- </div>
- </div>
- </div>
- <!-- 体重输入 -->
- <div class="form-group">
- <label for="weight" class="form-label">体重</label>
- <div class="input-group">
- <input type="number" id="weight" class="input-field" placeholder="请输入您的体重" min="30" max="200" step="0.1">
- <span class="input-unit">kg</span>
- </div>
- </div>
- <!-- 生日选择 -->
- <div class="form-group">
- <label for="birthday" class="form-label">出生日期</label>
- <div class="date-picker">
- <input type="date" id="birthday" class="input-field">
- <i class="iconfont icon-calendar date-icon"></i>
- </div>
- </div>
- <!-- 提交按钮 -->
- <button type="submit" class="submit-btn">下一步</button>
- </form>
- </div>
- <script>
- // 日期输入框默认值设置(18岁以上)
- document.addEventListener('DOMContentLoaded', function() {
- const today = new Date();
- const minDate = new Date();
- minDate.setFullYear(today.getFullYear() - 100);
-
- const maxDate = new Date();
- maxDate.setFullYear(today.getFullYear() - 18);
-
- const birthdayInput = document.getElementById('birthday');
- birthdayInput.min = formatDate(minDate);
- birthdayInput.max = formatDate(maxDate);
- birthdayInput.value = formatDate(maxDate);
-
- function formatDate(date) {
- const d = new Date(date);
- let month = '' + (d.getMonth() + 1);
- let day = '' + d.getDate();
- const year = d.getFullYear();
-
- if (month.length < 2) month = '0' + month;
- if (day.length < 2) day = '0' + day;
-
- return [year, month, day].join('-');
- }
- });
- </script>
- </body>
- </html>
|