index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756
  1. <template>
  2. <view class="diet-page">
  3. <scroll-view class="content" scroll-y>
  4. <!-- 页面标题区 -->
  5. <view class="page-header">
  6. <view class="header-icon-wrap">
  7. <text class="header-icon">🍽️</text>
  8. </view>
  9. <view class="header-text">
  10. <text class="header-title">饮食推荐</text>
  11. <text class="header-subtitle">科学膳食 · 健康生活</text>
  12. </view>
  13. </view>
  14. <!-- 今日共餐摘要 -->
  15. <view class="card">
  16. <view class="card-header">
  17. <view class="card-dot"></view>
  18. <text class="card-title">今日共餐</text>
  19. </view>
  20. <view class="card-body">
  21. <view class="meal-grid">
  22. <view class="meal-item" v-if="mealSummary.breakfast">
  23. <text class="meal-emoji">🌅</text>
  24. <text class="meal-label">早餐</text>
  25. <text class="meal-members">{{ mealSummary.breakfast }}</text>
  26. </view>
  27. <view class="meal-item" v-if="mealSummary.lunch">
  28. <text class="meal-emoji">☀️</text>
  29. <text class="meal-label">午餐</text>
  30. <text class="meal-members">{{ mealSummary.lunch }}</text>
  31. </view>
  32. <view class="meal-item" v-if="mealSummary.dinner">
  33. <text class="meal-emoji">🌙</text>
  34. <text class="meal-label">晚餐</text>
  35. <text class="meal-members">{{ mealSummary.dinner }}</text>
  36. </view>
  37. </view>
  38. <view class="empty-hint" v-if="!mealSummary.breakfast && !mealSummary.lunch && !mealSummary.dinner">
  39. <text class="empty-icon">📋</text>
  40. <text class="empty-text">尚未配置共餐</text>
  41. <text class="empty-sub">点击下方「共餐配置」开始设置</text>
  42. </view>
  43. </view>
  44. </view>
  45. <!-- 食材推荐器 -->
  46. <view class="card">
  47. <view class="card-header">
  48. <view class="card-dot"></view>
  49. <text class="card-title">今日食材推荐</text>
  50. </view>
  51. <view class="card-body">
  52. <view class="action-bar">
  53. <view class="action-btn" @tap="refreshIngredients">
  54. <text class="action-btn-text">🔄 换一批</text>
  55. </view>
  56. <view class="action-btn action-btn-primary" @tap="showFoodPicker">
  57. <text class="action-btn-text-primary">+ 添加食材</text>
  58. </view>
  59. <view class="action-btn action-btn-accent" @tap="generateRecipe" :class="{'action-btn-disabled': selectedIngredients.length === 0}">
  60. <text class="action-btn-text-accent">✨ 生成食谱</text>
  61. </view>
  62. </view>
  63. <view class="ingredient-list" v-if="ingredients.length > 0">
  64. <view class="ingredient-item" v-for="(item, index) in ingredients" :key="getIngredientKey(item, index)">
  65. <view class="ingredient-left">
  66. <view class="ingredient-badge">
  67. <text class="ingredient-badge-text">{{ index + 1 }}</text>
  68. </view>
  69. <view class="ingredient-info">
  70. <text class="ingredient-name">{{ item.name }}</text>
  71. <text class="ingredient-reason" v-if="item.reason">{{ item.reason }}</text>
  72. </view>
  73. </view>
  74. <view class="ingredient-remove" @tap="removeIngredient(index)">
  75. <text class="remove-text">✕</text>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="empty-state" v-else>
  80. <text class="empty-icon">🥬</text>
  81. <text class="empty-text">{{ ingredientsLoading ? '加载中...' : '暂无推荐食材' }}</text>
  82. <text class="empty-sub" v-if="!ingredientsLoading">点击「添加食材」或「换一批」获取推荐</text>
  83. </view>
  84. </view>
  85. </view>
  86. <!-- 快捷入口 -->
  87. <view class="section-label">
  88. <text class="section-label-text">常用功能</text>
  89. </view>
  90. <view class="nav-grid">
  91. <view class="nav-item" @tap="navTo('/pages/diet/food-query')">
  92. <view class="nav-icon-wrap nav-icon-green">
  93. <text class="nav-icon">🥗</text>
  94. </view>
  95. <text class="nav-label">食材查询</text>
  96. </view>
  97. <view class="nav-item" @tap="navTo('/pages/diet/records')">
  98. <view class="nav-icon-wrap nav-icon-blue">
  99. <text class="nav-icon">📝</text>
  100. </view>
  101. <text class="nav-label">饮食记录</text>
  102. </view>
  103. <view class="nav-item" @tap="navTo('/pages/diet/preferences')">
  104. <view class="nav-icon-wrap nav-icon-orange">
  105. <text class="nav-icon">📋</text>
  106. </view>
  107. <text class="nav-label">调研表</text>
  108. </view>
  109. <view class="nav-item" @tap="navTo('/pages/diet/meal-config')">
  110. <view class="nav-icon-wrap nav-icon-purple">
  111. <text class="nav-icon">👨‍👩‍👧</text>
  112. </view>
  113. <text class="nav-label">共餐配置</text>
  114. </view>
  115. <view class="nav-item" @tap="navTo('/pages/diet/recommendation')">
  116. <view class="nav-icon-wrap nav-icon-red">
  117. <text class="nav-icon">🍽️</text>
  118. </view>
  119. <text class="nav-label">食谱推荐</text>
  120. </view>
  121. </view>
  122. <!-- 本周趋势 -->
  123. <view class="card" v-if="trendData.days > 0">
  124. <view class="card-header">
  125. <view class="card-dot"></view>
  126. <text class="card-title">本周饮食</text>
  127. </view>
  128. <view class="card-body">
  129. <view class="trend-row">
  130. <view class="trend-item">
  131. <text class="trend-num">{{ trendData.totalCalories || 0 }}</text>
  132. <text class="trend-unit">kcal</text>
  133. <text class="trend-label">总摄入</text>
  134. </view>
  135. <view class="trend-divider"></view>
  136. <view class="trend-item">
  137. <text class="trend-num">{{ trendData.days }}</text>
  138. <text class="trend-unit">天</text>
  139. <text class="trend-label">记录天数</text>
  140. </view>
  141. </view>
  142. </view>
  143. </view>
  144. <!-- 底部留白 -->
  145. <view class="bottom-space"></view>
  146. </scroll-view>
  147. <!-- 食材选择弹窗 -->
  148. <view class="modal" v-if="showPicker" @tap="closePicker">
  149. <view class="modal-mask"></view>
  150. <view class="modal-content" @tap.stop>
  151. <view class="modal-header">
  152. <text class="modal-title">选择食材</text>
  153. <view class="modal-close" @tap="closePicker">
  154. <text class="close-text">✕</text>
  155. </view>
  156. </view>
  157. <view class="search-wrap">
  158. <input class="search-input" placeholder="搜索食材..." placeholder-style="color:#bbb" v-model="searchQuery" @input="searchFood" />
  159. </view>
  160. <scroll-view class="food-list" scroll-y>
  161. <view class="food-item" v-for="food in searchResults" :key="food.id" @tap="addFood(food)">
  162. <text class="food-name">{{ food.name }}</text>
  163. <text class="food-tag">{{ food.category }}</text>
  164. </view>
  165. </scroll-view>
  166. <view class="empty-state" v-if="searchResults.length === 0 && searchQuery">
  167. <text class="empty-text">未找到匹配食材</text>
  168. </view>
  169. </view>
  170. </view>
  171. </view>
  172. </template>
  173. <script>
  174. import { getDietIngredients, refreshDietIngredients, addDietIngredient, removeDietIngredient, generateDietRecommendation, getMealConfig } from '@/utils/api.js'
  175. import { parseDate } from '@/utils/format.js'
  176. export default {
  177. data: function() {
  178. return {
  179. familyId: null,
  180. familyMemberId: null,
  181. ingredients: [],
  182. selectedIngredients: [],
  183. ingredientsLoading: false,
  184. mealSummary: {},
  185. trendData: {},
  186. showPicker: false,
  187. searchQuery: '',
  188. searchResults: [],
  189. uploadPromptShown: false
  190. }
  191. },
  192. onLoad: function() {
  193. this.familyId = uni.getStorageSync('familyId')
  194. this.familyMemberId = uni.getStorageSync('currentChildId') || uni.getStorageSync('currentMemberId') || uni.getStorageSync('userId')
  195. this.loadIngredients()
  196. this.loadMealSummary()
  197. },
  198. onShow: function() {
  199. this.loadIngredients()
  200. this.loadMealSummary()
  201. },
  202. methods: {
  203. navTo: function(url) {
  204. uni.navigateTo({ url: url })
  205. },
  206. getIngredientKey: function(item, index) {
  207. return 'ing-' + (item.id || index)
  208. },
  209. loadIngredients: function() {
  210. this.ingredientsLoading = true
  211. var self = this
  212. getDietIngredients().then(function(res) {
  213. self.ingredientsLoading = false
  214. if (res && res.ingredients) {
  215. self.ingredients = res.ingredients
  216. if (res.ingredients.length === 0 && !self.uploadPromptShown) {
  217. self.uploadPromptShown = true
  218. uni.showModal({
  219. title: '暂无推荐食材',
  220. content: '还未上传菌群报告,无法生成个性化食材推荐。是否前往上传报告?',
  221. confirmText: '去上传',
  222. cancelText: '稍后',
  223. success: function(modalRes) {
  224. if (modalRes.confirm) {
  225. uni.navigateTo({ url: '/pages/health/report-upload' })
  226. }
  227. }
  228. })
  229. }
  230. }
  231. }).catch(function() {
  232. self.ingredientsLoading = false
  233. })
  234. },
  235. refreshIngredients: function() {
  236. var self = this
  237. refreshDietIngredients().then(function(res) {
  238. if (res && res.ingredients) {
  239. self.ingredients = res.ingredients
  240. }
  241. })
  242. },
  243. addIngredient: function(index) {
  244. var self = this
  245. var item = this.ingredients[index]
  246. addDietIngredient({ food_id: item.foodId, name: item.name }).then(function(res) {
  247. self.loadIngredients()
  248. })
  249. },
  250. removeIngredient: function(index) {
  251. var self = this
  252. var item = this.ingredients[index]
  253. removeDietIngredient({ food_id: item.foodId }).then(function(res) {
  254. self.loadIngredients()
  255. })
  256. },
  257. generateRecipe: function() {
  258. var self = this
  259. var foodIds = this.ingredients.map(function(item) { return { food_id: item.foodId, name: item.name } })
  260. generateDietRecommendation({
  261. date: self.formatDate(new Date()),
  262. meal_type: 'all',
  263. selected_foods: JSON.stringify(foodIds)
  264. }).then(function(res) {
  265. if (res && res.id) {
  266. uni.showToast({ title: '食谱生成成功', icon: 'success' })
  267. setTimeout(function() {
  268. self.navTo('/pages/diet/recommendation')
  269. }, 1000)
  270. }
  271. })
  272. },
  273. formatDate: function(date) {
  274. var d = parseDate(date)
  275. if (!d) return ''
  276. var m = (d.getMonth() + 1).toString()
  277. if (m.length < 2) m = '0' + m
  278. var day = d.getDate().toString()
  279. if (day.length < 2) day = '0' + day
  280. return d.getFullYear() + '-' + m + '-' + day
  281. },
  282. loadMealSummary: function() {
  283. var self = this
  284. var dateType = self.isWeekend(new Date()) ? 'weekend' : 'weekday'
  285. Promise.all([
  286. getMealConfig({ date_type: dateType, meal_type: 'breakfast' }),
  287. getMealConfig({ date_type: dateType, meal_type: 'lunch' }),
  288. getMealConfig({ date_type: dateType, meal_type: 'dinner' })
  289. ]).then(function(results) {
  290. self.mealSummary.breakfast = self.parseMembers(results[0])
  291. self.mealSummary.lunch = self.parseMembers(results[1])
  292. self.mealSummary.dinner = self.parseMembers(results[2])
  293. })
  294. },
  295. parseMembers: function(config) {
  296. if (!config || !config.participantMemberIds) return ''
  297. try {
  298. var ids = JSON.parse(config.participantMemberIds)
  299. return '共 ' + ids.length + ' 人'
  300. } catch (e) {
  301. return ''
  302. }
  303. },
  304. isWeekend: function(date) {
  305. var day = date.getDay()
  306. return day === 0 || day === 6
  307. },
  308. showFoodPicker: function() {
  309. this.showPicker = true
  310. },
  311. closePicker: function() {
  312. this.showPicker = false
  313. this.searchQuery = ''
  314. this.searchResults = []
  315. },
  316. searchFood: function() {
  317. if (!this.searchQuery) {
  318. this.searchResults = []
  319. return
  320. }
  321. this.searchResults = []
  322. },
  323. addFood: function(food) {
  324. var self = this
  325. addDietIngredient({ food_id: food.id, name: food.name }).then(function(res) {
  326. self.closePicker()
  327. self.loadIngredients()
  328. })
  329. }
  330. }
  331. }
  332. </script>
  333. <style scoped>
  334. .diet-page {
  335. min-height: 100vh;
  336. background: linear-gradient(180deg, #FFF7ED 0%, #FFF3E6 30%, #F5F7FA 100%);
  337. }
  338. .content {
  339. padding: 24rpx 32rpx;
  340. }
  341. /* 页面头部 */
  342. .page-header {
  343. display: flex;
  344. align-items: center;
  345. padding: 20rpx 0 32rpx;
  346. }
  347. .header-icon-wrap {
  348. width: 80rpx;
  349. height: 80rpx;
  350. border-radius: 24rpx;
  351. background: linear-gradient(135deg, #FF8C42, #FFB366);
  352. display: flex;
  353. align-items: center;
  354. justify-content: center;
  355. margin-right: 24rpx;
  356. flex-shrink: 0;
  357. }
  358. .header-icon {
  359. font-size: 40rpx;
  360. }
  361. .header-text {
  362. display: flex;
  363. flex-direction: column;
  364. }
  365. .header-title {
  366. font-size: 36rpx;
  367. font-weight: 700;
  368. color: #333;
  369. }
  370. .header-subtitle {
  371. font-size: 24rpx;
  372. color: #999;
  373. margin-top: 4rpx;
  374. }
  375. /* 卡片通用 */
  376. .card {
  377. background: #FFFFFF;
  378. border-radius: 24rpx;
  379. margin-bottom: 24rpx;
  380. box-shadow: 0 4rpx 20rpx rgba(255, 140, 66, 0.08);
  381. overflow: hidden;
  382. }
  383. .card-header {
  384. display: flex;
  385. align-items: center;
  386. padding: 28rpx 28rpx 0;
  387. }
  388. .card-dot {
  389. width: 8rpx;
  390. height: 32rpx;
  391. border-radius: 4rpx;
  392. background: linear-gradient(180deg, #FF8C42, #FFB366);
  393. margin-right: 16rpx;
  394. flex-shrink: 0;
  395. }
  396. .card-title {
  397. font-size: 30rpx;
  398. font-weight: 600;
  399. color: #333;
  400. }
  401. .card-body {
  402. padding: 24rpx 28rpx 28rpx;
  403. }
  404. /* 共餐格子 */
  405. .meal-grid {
  406. display: flex;
  407. justify-content: space-between;
  408. }
  409. .meal-item {
  410. flex: 1;
  411. display: flex;
  412. flex-direction: column;
  413. align-items: center;
  414. background: #FFF8F0;
  415. border-radius: 16rpx;
  416. padding: 24rpx 12rpx;
  417. margin-left: 12rpx;
  418. margin-right: 12rpx;
  419. }
  420. .meal-item:first-child {
  421. margin-left: 0;
  422. }
  423. .meal-item:last-child {
  424. margin-right: 0;
  425. }
  426. .meal-emoji {
  427. font-size: 36rpx;
  428. margin-bottom: 8rpx;
  429. }
  430. .meal-label {
  431. font-size: 24rpx;
  432. color: #666;
  433. margin-bottom: 4rpx;
  434. }
  435. .meal-members {
  436. font-size: 24rpx;
  437. color: #FF8C42;
  438. font-weight: 600;
  439. }
  440. /* 操作按钮栏 */
  441. .action-bar {
  442. display: flex;
  443. margin-bottom: 24rpx;
  444. }
  445. .action-btn {
  446. padding: 14rpx 24rpx;
  447. border-radius: 32rpx;
  448. background: #F5F5F5;
  449. margin-right: 16rpx;
  450. }
  451. .action-btn:last-child {
  452. margin-right: 0;
  453. }
  454. .action-btn-primary {
  455. background: #FF8C42;
  456. }
  457. .action-btn-accent {
  458. background: #FFF0E0;
  459. }
  460. .action-btn-disabled {
  461. opacity: 0.4;
  462. }
  463. .action-btn-text {
  464. font-size: 24rpx;
  465. color: #666;
  466. }
  467. .action-btn-text-primary {
  468. font-size: 24rpx;
  469. color: #FFFFFF;
  470. }
  471. .action-btn-text-accent {
  472. font-size: 24rpx;
  473. color: #FF8C42;
  474. }
  475. /* 食材列表 */
  476. .ingredient-list {
  477. margin-top: 8rpx;
  478. }
  479. .ingredient-item {
  480. display: flex;
  481. align-items: center;
  482. justify-content: space-between;
  483. padding: 20rpx 0;
  484. border-bottom: 1rpx solid #F5F5F5;
  485. }
  486. .ingredient-item:last-child {
  487. border-bottom: none;
  488. }
  489. .ingredient-left {
  490. display: flex;
  491. align-items: center;
  492. flex: 1;
  493. }
  494. .ingredient-badge {
  495. width: 40rpx;
  496. height: 40rpx;
  497. border-radius: 12rpx;
  498. background: linear-gradient(135deg, #FF8C42, #FFB366);
  499. display: flex;
  500. align-items: center;
  501. justify-content: center;
  502. margin-right: 20rpx;
  503. flex-shrink: 0;
  504. }
  505. .ingredient-badge-text {
  506. font-size: 20rpx;
  507. color: #FFFFFF;
  508. font-weight: 600;
  509. }
  510. .ingredient-info {
  511. display: flex;
  512. flex-direction: column;
  513. flex: 1;
  514. }
  515. .ingredient-name {
  516. font-size: 28rpx;
  517. color: #333;
  518. font-weight: 500;
  519. }
  520. .ingredient-reason {
  521. font-size: 22rpx;
  522. color: #999;
  523. margin-top: 4rpx;
  524. }
  525. .ingredient-remove {
  526. width: 48rpx;
  527. height: 48rpx;
  528. display: flex;
  529. align-items: center;
  530. justify-content: center;
  531. flex-shrink: 0;
  532. }
  533. .remove-text {
  534. font-size: 28rpx;
  535. color: #ccc;
  536. }
  537. /* 区域标签 */
  538. .section-label {
  539. padding: 8rpx 0 16rpx;
  540. }
  541. .section-label-text {
  542. font-size: 28rpx;
  543. font-weight: 600;
  544. color: #333;
  545. }
  546. /* 快捷入口网格 */
  547. .nav-grid {
  548. display: flex;
  549. flex-wrap: wrap;
  550. margin-bottom: 24rpx;
  551. }
  552. .nav-item {
  553. width: 20%;
  554. display: flex;
  555. flex-direction: column;
  556. align-items: center;
  557. padding: 20rpx 0;
  558. position: relative;
  559. z-index: 1;
  560. }
  561. .nav-icon-wrap {
  562. width: 88rpx;
  563. height: 88rpx;
  564. border-radius: 24rpx;
  565. display: flex;
  566. align-items: center;
  567. justify-content: center;
  568. margin-bottom: 12rpx;
  569. }
  570. .nav-icon-green {
  571. background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
  572. }
  573. .nav-icon-blue {
  574. background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
  575. }
  576. .nav-icon-orange {
  577. background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
  578. }
  579. .nav-icon-purple {
  580. background: linear-gradient(135deg, #F3E5F5, #E1BEE7);
  581. }
  582. .nav-icon-red {
  583. background: linear-gradient(135deg, #FBE9E7, #FFCCBC);
  584. }
  585. .nav-icon {
  586. font-size: 36rpx;
  587. }
  588. .nav-label {
  589. font-size: 22rpx;
  590. color: #333;
  591. }
  592. /* 趋势卡片 */
  593. .trend-row {
  594. display: flex;
  595. align-items: center;
  596. }
  597. .trend-item {
  598. flex: 1;
  599. display: flex;
  600. flex-direction: column;
  601. align-items: center;
  602. }
  603. .trend-divider {
  604. width: 1rpx;
  605. height: 60rpx;
  606. background: #F0F0F0;
  607. }
  608. .trend-num {
  609. font-size: 48rpx;
  610. font-weight: 700;
  611. color: #FF8C42;
  612. }
  613. .trend-unit {
  614. font-size: 22rpx;
  615. color: #999;
  616. margin-top: 4rpx;
  617. }
  618. .trend-label {
  619. font-size: 22rpx;
  620. color: #666;
  621. margin-top: 4rpx;
  622. }
  623. /* 空状态 */
  624. .empty-hint {
  625. display: flex;
  626. flex-direction: column;
  627. align-items: center;
  628. padding: 20rpx 0;
  629. }
  630. .empty-state {
  631. display: flex;
  632. flex-direction: column;
  633. align-items: center;
  634. padding: 40rpx 0;
  635. }
  636. .empty-icon {
  637. font-size: 48rpx;
  638. margin-bottom: 12rpx;
  639. }
  640. .empty-text {
  641. font-size: 26rpx;
  642. color: #999;
  643. }
  644. .empty-sub {
  645. font-size: 22rpx;
  646. color: #ccc;
  647. margin-top: 8rpx;
  648. }
  649. /* 弹窗 */
  650. .modal {
  651. position: fixed;
  652. top: 0;
  653. left: 0;
  654. right: 0;
  655. bottom: 0;
  656. z-index: 999;
  657. display: flex;
  658. align-items: flex-end;
  659. justify-content: center;
  660. }
  661. .modal-mask {
  662. position: fixed;
  663. top: 0;
  664. left: 0;
  665. right: 0;
  666. bottom: 0;
  667. background: rgba(0, 0, 0, 0.5);
  668. }
  669. .modal-content {
  670. position: relative;
  671. width: 100%;
  672. max-height: 80vh;
  673. background: #FFFFFF;
  674. border-radius: 32rpx 32rpx 0 0;
  675. padding: 32rpx;
  676. z-index: 1;
  677. }
  678. .modal-header {
  679. display: flex;
  680. align-items: center;
  681. justify-content: space-between;
  682. margin-bottom: 24rpx;
  683. }
  684. .modal-title {
  685. font-size: 32rpx;
  686. font-weight: 600;
  687. color: #333;
  688. }
  689. .modal-close {
  690. width: 48rpx;
  691. height: 48rpx;
  692. display: flex;
  693. align-items: center;
  694. justify-content: center;
  695. }
  696. .close-text {
  697. font-size: 32rpx;
  698. color: #999;
  699. }
  700. .search-wrap {
  701. margin-bottom: 20rpx;
  702. }
  703. .search-input {
  704. border: 1rpx solid #eee;
  705. border-radius: 40rpx;
  706. padding: 20rpx 28rpx;
  707. font-size: 28rpx;
  708. background: #F8F8F8;
  709. }
  710. .food-list {
  711. max-height: 500rpx;
  712. }
  713. .food-item {
  714. display: flex;
  715. align-items: center;
  716. justify-content: space-between;
  717. padding: 24rpx 0;
  718. border-bottom: 1rpx solid #F5F5F5;
  719. }
  720. .food-name {
  721. font-size: 28rpx;
  722. color: #333;
  723. }
  724. .food-tag {
  725. font-size: 22rpx;
  726. color: #FF8C42;
  727. background: #FFF0E0;
  728. padding: 6rpx 16rpx;
  729. border-radius: 20rpx;
  730. }
  731. /* 底部留白 */
  732. .bottom-space {
  733. height: 40rpx;
  734. }
  735. </style>