zc.html 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>完善信息 - 食养智鉴</title>
  7. <link href="https://at.alicdn.com/t/c/font_4525513_9u8m8q8q5x.css" rel="stylesheet">
  8. <style>
  9. :root {
  10. --primary: #2E5B4D;
  11. --secondary: #8BAE8F;
  12. --accent: #C44536;
  13. --bg: #F8F9FA;
  14. --text: #333333;
  15. --card-bg: #FFFFFF;
  16. }
  17. * {
  18. margin: 0;
  19. padding: 0;
  20. box-sizing: border-box;
  21. font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  22. }
  23. body {
  24. background: var(--bg);
  25. color: var(--text);
  26. min-height: 100vh;
  27. }
  28. .container {
  29. max-width: 100%;
  30. padding: 20px;
  31. margin: 0 auto;
  32. }
  33. .header {
  34. text-align: center;
  35. margin-bottom: 30px;
  36. }
  37. .logo {
  38. font-size: 1.8rem;
  39. color: var(--primary);
  40. margin-bottom: 10px;
  41. display: flex;
  42. justify-content: center;
  43. align-items: center;
  44. }
  45. .logo i {
  46. margin-right: 10px;
  47. }
  48. .title {
  49. font-size: 1.5rem;
  50. font-weight: 600;
  51. margin-bottom: 8px;
  52. }
  53. .subtitle {
  54. color: #666;
  55. font-size: 0.9rem;
  56. }
  57. .form-group {
  58. margin-bottom: 25px;
  59. }
  60. .form-label {
  61. display: block;
  62. margin-bottom: 10px;
  63. font-weight: 500;
  64. }
  65. .gender-select {
  66. display: flex;
  67. gap: 15px;
  68. margin-bottom: 5px;
  69. }
  70. .gender-option {
  71. flex: 1;
  72. position: relative;
  73. }
  74. .gender-option input {
  75. position: absolute;
  76. opacity: 0;
  77. width: 0;
  78. height: 0;
  79. }
  80. .gender-label {
  81. display: flex;
  82. flex-direction: column;
  83. align-items: center;
  84. justify-content: center;
  85. padding: 15px 10px;
  86. background: var(--card-bg);
  87. border-radius: 10px;
  88. border: 1px solid #ddd;
  89. cursor: pointer;
  90. transition: all 0.3s;
  91. }
  92. .gender-option input:checked + .gender-label {
  93. border-color: var(--primary);
  94. background: rgba(46,91,77,0.05);
  95. }
  96. .gender-icon {
  97. font-size: 1.8rem;
  98. margin-bottom: 8px;
  99. color: var(--primary);
  100. }
  101. .gender-text {
  102. font-size: 0.95rem;
  103. }
  104. .input-group {
  105. position: relative;
  106. }
  107. .input-field {
  108. width: 100%;
  109. padding: 15px;
  110. border: 1px solid #ddd;
  111. border-radius: 10px;
  112. font-size: 1rem;
  113. background: var(--card-bg);
  114. }
  115. .input-field:focus {
  116. outline: none;
  117. border-color: var(--primary);
  118. }
  119. .input-unit {
  120. position: absolute;
  121. right: 15px;
  122. top: 50%;
  123. transform: translateY(-50%);
  124. color: #666;
  125. }
  126. .date-picker {
  127. position: relative;
  128. }
  129. .date-picker input {
  130. width: 100%;
  131. padding: 15px;
  132. border: 1px solid #ddd;
  133. border-radius: 10px;
  134. font-size: 1rem;
  135. background: var(--card-bg);
  136. }
  137. .date-icon {
  138. position: absolute;
  139. right: 15px;
  140. top: 50%;
  141. transform: translateY(-50%);
  142. color: var(--primary);
  143. }
  144. .submit-btn {
  145. width: 100%;
  146. padding: 15px;
  147. background: var(--primary);
  148. color: white;
  149. border: none;
  150. border-radius: 10px;
  151. font-size: 1rem;
  152. font-weight: 500;
  153. cursor: pointer;
  154. transition: background 0.3s;
  155. margin-top: 10px;
  156. }
  157. .submit-btn:hover {
  158. background: #1e3d33;
  159. }
  160. .progress-steps {
  161. display: flex;
  162. justify-content: center;
  163. margin-bottom: 30px;
  164. }
  165. .step {
  166. width: 30px;
  167. height: 30px;
  168. border-radius: 50%;
  169. background: #ddd;
  170. color: white;
  171. display: flex;
  172. align-items: center;
  173. justify-content: center;
  174. margin: 0 5px;
  175. font-size: 0.9rem;
  176. }
  177. .step.active {
  178. background: var(--primary);
  179. }
  180. .step-line {
  181. height: 2px;
  182. background: #ddd;
  183. flex: 1;
  184. margin: 0 -5px;
  185. align-self: center;
  186. }
  187. .step-line.active {
  188. background: var(--primary);
  189. }
  190. </style>
  191. </head>
  192. <body>
  193. <div class="container">
  194. <!-- 进度条 -->
  195. <div class="progress-steps">
  196. <div class="step active">1</div>
  197. <div class="step-line active"></div>
  198. <div class="step active">2</div>
  199. <div class="step-line"></div>
  200. <div class="step">3</div>
  201. </div>
  202. <!-- 页眉 -->
  203. <div class="header">
  204. <div class="logo">
  205. <i class="iconfont icon-leaf"></i>
  206. <span>食养智鉴</span>
  207. </div>
  208. <h1 class="title">完善您的健康信息</h1>
  209. <p class="subtitle">个性化配餐需要这些基础数据</p>
  210. </div>
  211. <!-- 表单区域 -->
  212. <form>
  213. <!-- 性别选择 -->
  214. <div class="form-group">
  215. <label class="form-label">性别</label>
  216. <div class="gender-select">
  217. <div class="gender-option">
  218. <input type="radio" id="male" name="gender" value="male" checked>
  219. <label for="male" class="gender-label">
  220. <i class="iconfont icon-male gender-icon"></i>
  221. <span class="gender-text">男性</span>
  222. </label>
  223. </div>
  224. <div class="gender-option">
  225. <input type="radio" id="female" name="gender" value="female">
  226. <label for="female" class="gender-label">
  227. <i class="iconfont icon-female gender-icon"></i>
  228. <span class="gender-text">女性</span>
  229. </label>
  230. </div>
  231. </div>
  232. </div>
  233. <!-- 体重输入 -->
  234. <div class="form-group">
  235. <label for="weight" class="form-label">体重</label>
  236. <div class="input-group">
  237. <input type="number" id="weight" class="input-field" placeholder="请输入您的体重" min="30" max="200" step="0.1">
  238. <span class="input-unit">kg</span>
  239. </div>
  240. </div>
  241. <!-- 生日选择 -->
  242. <div class="form-group">
  243. <label for="birthday" class="form-label">出生日期</label>
  244. <div class="date-picker">
  245. <input type="date" id="birthday" class="input-field">
  246. <i class="iconfont icon-calendar date-icon"></i>
  247. </div>
  248. </div>
  249. <!-- 提交按钮 -->
  250. <button type="submit" class="submit-btn">下一步</button>
  251. </form>
  252. </div>
  253. <script>
  254. // 日期输入框默认值设置(18岁以上)
  255. document.addEventListener('DOMContentLoaded', function() {
  256. const today = new Date();
  257. const minDate = new Date();
  258. minDate.setFullYear(today.getFullYear() - 100);
  259. const maxDate = new Date();
  260. maxDate.setFullYear(today.getFullYear() - 18);
  261. const birthdayInput = document.getElementById('birthday');
  262. birthdayInput.min = formatDate(minDate);
  263. birthdayInput.max = formatDate(maxDate);
  264. birthdayInput.value = formatDate(maxDate);
  265. function formatDate(date) {
  266. const d = new Date(date);
  267. let month = '' + (d.getMonth() + 1);
  268. let day = '' + d.getDate();
  269. const year = d.getFullYear();
  270. if (month.length < 2) month = '0' + month;
  271. if (day.length < 2) day = '0' + day;
  272. return [year, month, day].join('-');
  273. }
  274. });
  275. </script>
  276. </body>
  277. </html>