gut-index.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <view class="page">
  3. <view class="nav-bar">
  4. <view class="nav-back" @tap="goBack">
  5. <text class="back-text">‹ 返回</text>
  6. </view>
  7. <text class="nav-title">菌群</text>
  8. </view>
  9. <scroll-view class="content" scroll-y>
  10. <view class="card">
  11. <view class="card-accent"></view>
  12. <view class="card-body">
  13. <text class="card-title">认识肠道菌群</text>
  14. <text class="card-desc">肠道菌群是生活在人体肠道内的微生物群落,被称为人体的"第二基因组"。它们对健康起着至关重要的作用:</text>
  15. <view class="info-list">
  16. <view class="info-item">
  17. <text class="info-age">帮助消化吸收</text>
  18. <text class="info-desc">分解食物中的纤维素,合成维生素 K 和 B 族维生素,促进营养吸收。</text>
  19. </view>
  20. <view class="info-item">
  21. <text class="info-age">增强免疫力</text>
  22. <text class="info-desc">调节免疫系统功能,抵抗有害菌入侵,减少过敏和感染风险。</text>
  23. </view>
  24. <view class="info-item">
  25. <text class="info-age">影响情绪和认知</text>
  26. <text class="info-desc">通过"肠脑轴"影响神经递质产生,对情绪、压力和睡眠有重要作用。</text>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="card">
  32. <view class="card-accent"></view>
  33. <view class="card-body">
  34. <text class="card-title">有益菌食物</text>
  35. <view class="info-list">
  36. <view class="info-item">
  37. <text class="info-age">🥛 发酵乳制品</text>
  38. <text class="info-desc">酸奶、开菲尔、发酵乳富含益生菌,直接补充肠道有益菌群。</text>
  39. </view>
  40. <view class="info-item">
  41. <text class="info-age">🥒 发酵蔬菜</text>
  42. <text class="info-desc">泡菜、酸菜、纳豆等发酵食品含有丰富益生菌和酶,促进肠道健康。</text>
  43. </view>
  44. <view class="info-item">
  45. <text class="info-age">🌿 高纤维食物</text>
  46. <text class="info-desc">燕麦、香蕉、洋葱、大蒜、芦笋等富含益生元,为有益菌提供养料。</text>
  47. </view>
  48. <view class="info-item">
  49. <text class="info-age">🍎 多酚类食物</text>
  50. <text class="info-desc">蓝莓、可可、绿茶、核桃富含多酚,促进有益菌生长,抑制有害菌。</text>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. <view class="card">
  56. <view class="card-accent"></view>
  57. <view class="card-body">
  58. <text class="card-title">维护肠道健康</text>
  59. <view class="info-list">
  60. <view class="info-item">
  61. <text class="info-age">均衡饮食</text>
  62. <text class="info-desc">多样化饮食,多吃蔬菜水果和全谷物,为肠道菌群提供丰富的营养来源。</text>
  63. </view>
  64. <view class="info-item">
  65. <text class="info-age">充足水分</text>
  66. <text class="info-desc">每天饮用足够的水,促进肠道蠕动,帮助消化和排便。</text>
  67. </view>
  68. <view class="info-item">
  69. <text class="info-age">规律运动</text>
  70. <text class="info-desc">适度运动促进肠道蠕动,增加肠道菌群多样性,改善肠道环境。</text>
  71. </view>
  72. <view class="info-item">
  73. <text class="info-age">合理使用抗生素</text>
  74. <text class="info-desc">抗生素会破坏肠道菌群平衡,遵医嘱使用,必要时补充益生菌。</text>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="action-section">
  80. <view class="action-btn" @tap="goToReportUpload">
  81. <text class="action-btn-text">上传检测报告</text>
  82. </view>
  83. </view>
  84. </scroll-view>
  85. </view>
  86. </template>
  87. <script>
  88. import { getLatestHealthReport } from '../../utils/api.js'
  89. export default {
  90. data() {
  91. return {}
  92. },
  93. methods: {
  94. goBack: function() {
  95. uni.navigateBack()
  96. },
  97. goToReportUpload: function() {
  98. uni.navigateTo({
  99. url: '/pages/health/report-upload'
  100. })
  101. },
  102. goToMyReport: function() {
  103. var self = this
  104. var childId = getApp().globalData.currentChildId || ''
  105. uni.showLoading({ title: '加载中...' })
  106. getLatestHealthReport(childId).then(function(res) {
  107. uni.hideLoading()
  108. if (res && res.code === 200 && res.data) {
  109. var reportId = res.data.id
  110. if (reportId) {
  111. uni.showToast({ title: '报告详情页开发中', icon: 'none' })
  112. } else {
  113. uni.showToast({ title: '暂无肠道菌群报告', icon: 'none' })
  114. }
  115. } else {
  116. uni.showToast({ title: '暂无肠道菌群报告', icon: 'none' })
  117. }
  118. }).catch(function() {
  119. uni.hideLoading()
  120. uni.showToast({ title: '暂无肠道菌群报告', icon: 'none' })
  121. })
  122. }
  123. }
  124. }
  125. </script>
  126. <style scoped>
  127. .page {
  128. min-height: 100vh;
  129. background-color: #F5F7FA;
  130. display: flex;
  131. flex-direction: column;
  132. }
  133. .nav-bar {
  134. display: flex;
  135. align-items: center;
  136. justify-content: center;
  137. height: 88rpx;
  138. padding-top: var(--status-bar-height, 0);
  139. background-color: #FFFFFF;
  140. position: relative;
  141. border-bottom: 1rpx solid #f0f0f0;
  142. }
  143. .nav-back {
  144. position: absolute;
  145. left: 30rpx;
  146. top: 50%;
  147. transform: translateY(-50%);
  148. padding: 10rpx;
  149. }
  150. .back-text {
  151. font-size: 28rpx;
  152. color: #333;
  153. }
  154. .nav-title {
  155. font-size: 32rpx;
  156. font-weight: 600;
  157. color: #333;
  158. }
  159. .content {
  160. flex: 1;
  161. padding: 30rpx;
  162. }
  163. .card {
  164. display: flex;
  165. background-color: #FFFFFF;
  166. border-radius: 20rpx;
  167. margin-bottom: 30rpx;
  168. box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
  169. overflow: hidden;
  170. }
  171. .card-accent {
  172. width: 8rpx;
  173. background-color: #FF8C42;
  174. flex-shrink: 0;
  175. }
  176. .card-body {
  177. flex: 1;
  178. padding: 30rpx;
  179. }
  180. .card-title {
  181. font-size: 30rpx;
  182. font-weight: 600;
  183. color: #333;
  184. margin-bottom: 16rpx;
  185. display: block;
  186. }
  187. .card-desc {
  188. font-size: 24rpx;
  189. color: #666;
  190. line-height: 1.6;
  191. display: block;
  192. margin-bottom: 20rpx;
  193. }
  194. .info-list {
  195. display: flex;
  196. flex-direction: column;
  197. gap: 20rpx;
  198. }
  199. .info-item {
  200. display: flex;
  201. flex-direction: column;
  202. gap: 6rpx;
  203. }
  204. .info-age {
  205. font-size: 26rpx;
  206. font-weight: 500;
  207. color: #FF8C42;
  208. display: block;
  209. }
  210. .info-desc {
  211. font-size: 24rpx;
  212. color: #666;
  213. line-height: 1.6;
  214. display: block;
  215. }
  216. .action-section {
  217. display: flex;
  218. justify-content: center;
  219. padding: 20rpx 0 40rpx;
  220. }
  221. .action-btn {
  222. background-color: #FF8C42;
  223. border-radius: 40rpx;
  224. padding: 24rpx 80rpx;
  225. box-shadow: 0 4rpx 12rpx rgba(255, 140, 66, 0.3);
  226. }
  227. .action-btn.primary {
  228. background-color: #5B9BD5;
  229. box-shadow: 0 4rpx 12rpx rgba(91, 155, 213, 0.3);
  230. }
  231. .action-btn-text {
  232. font-size: 28rpx;
  233. color: #FFFFFF;
  234. font-weight: 500;
  235. }
  236. </style>