普兆健康管家前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

357 lines
11 KiB

  1. <template>
  2. <view class="page__view">
  3. <navbar title="详情报告" leftClick @leftClick="$utils.navigateBack" color="#191919" bgColor="#FFFFFF" />
  4. <view class="main">
  5. <reportCard>
  6. <view class="section">
  7. <cardHeader :BMI="BMI"></cardHeader>
  8. </view>
  9. <view class="section" v-for="(step, index) in list" :key="step.key">
  10. <view class="flex section-header">
  11. <view class="section-header-index">
  12. <text>{{ index + 1 }}</text>
  13. <image class="section-header-index-icon" :src="step.url" mode="widthFix"></image>
  14. </view>
  15. <view class="section-header-title">
  16. <view class="section-header-title-zh">{{ step.name }}</view>
  17. <view class="section-header-title-en">{{ step.nameEn }}</view>
  18. </view>
  19. </view>
  20. <view class="section-content">
  21. <template v-if="step.key === 'improvementGoal'">
  22. <view class="tags">
  23. <view class="tag" v-for="(item, tIdx) in step.tags" :key="tIdx">{{ item }}</view>
  24. </view>
  25. </template>
  26. <template v-else-if="step.key === 'topPriority'">
  27. <view class="tags">
  28. <view class="tag highlight">{{ step.tag }}</view>
  29. </view>
  30. </template>
  31. <template v-else-if="step.key === 'potentialHealthIssues'">
  32. <view class="flex section-content-tag">
  33. <image class="section-content-tag-icon" :src="step.tag.icon" mode="widthFix"></image>
  34. <text class="section-content-tag-text">{{ step.tag.text }}</text>
  35. </view>
  36. <view>
  37. <view class="section-content-item" v-for="(item, idx) in step.content" :key="idx">
  38. <view class="flex section-content-item-header">
  39. <view class="section-content-item-index">{{ `${idx + 1}.` }}</view>
  40. <view class="section-content-item-title">{{ item.title }}</view>
  41. </view>
  42. <view class="section-content-item-detail">{{ item.detail }}</view>
  43. </view>
  44. </view>
  45. </template>
  46. <template v-else>
  47. <view>
  48. <view class="section-content-item" v-for="(item, idx) in step.content" :key="idx">
  49. <view class="flex section-content-item-header">
  50. <view class="section-content-item-index">{{ `${idx + 1}.` }}</view>
  51. <view class="section-content-item-title">{{ item.title }}</view>
  52. </view>
  53. <view class="section-content-item-detail">{{ item.detail }}</view>
  54. </view>
  55. </view>
  56. </template>
  57. </view>
  58. </view>
  59. <view class="section tips">
  60. *以上是根据你的营养目标以及饮食运动作息状况给出的针对性健康建议可以辅助你达成营养目标同时养成良好的生活习惯
  61. </view>
  62. </reportCard>
  63. </view>
  64. <view class="bottom">
  65. <button class="flex btn" @click="jumpToNutritionProgram">查看营养方案</button>
  66. </view>
  67. </view>
  68. </template>
  69. <script>
  70. import reportCard from '@/pages_order/components/reportCard.vue';
  71. import cardHeader from './cardHeader.vue';
  72. export default {
  73. components: {
  74. reportCard,
  75. cardHeader,
  76. },
  77. data() {
  78. return {
  79. BMI: null,
  80. list: [],
  81. }
  82. },
  83. onLoad() {
  84. this.BMI = 16.5
  85. this.list = [
  86. {
  87. id: '001',
  88. key: 'improvementGoal',
  89. name: '本次改善目标',
  90. nameEn: 'This improvement goal',
  91. url: '/pages_order/static/report/report-detail-1.png',
  92. tags: ['皮肤', '脑力/注意力', '眼睛/视力', '睡眠', '骨骼/关节']
  93. },
  94. {
  95. id: '002',
  96. key: 'topPriority',
  97. name: '首要目标',
  98. nameEn: 'Top priority',
  99. url: '/pages_order/static/report/report-detail-2.png',
  100. tag: '脑力/注意力'
  101. },
  102. {
  103. id: '003',
  104. key: 'targetSuggestion',
  105. name: '健康目标建议',
  106. nameEn: 'Target Suggestion',
  107. url: '/pages_order/static/report/report-detail-3.png',
  108. content: [
  109. { title: '吃一小把混合坚果对皮肤好', detail: '增加不饱和脂肪酸的摄入有益皮肤健康,可以每天食用一小把混合类坚果,例如核桃、葵花籽、开心果等。' },
  110. ]
  111. },
  112. {
  113. id: '004',
  114. key: 'dailyGoals',
  115. name: '每日小目标',
  116. nameEn: 'Daily Small Goals',
  117. url: '/pages_order/static/report/report-detail-4.png',
  118. content: [
  119. { title: '每天吃1个水煮鸡蛋', detail: '每天食用1个鸡蛋可以补充丰富的动物蛋白以及多种维生素和矿物质,如维生素A、维生素D、 维生素B12、胆碱、叶酸、磷和碘等。' },
  120. { title: '今天的饭后甜点是低糖酸奶', detail: '每天食用1个鸡蛋可以补充丰富的动物蛋白以及多种维生素和矿物质,如维生素A、维生素D、 维生素B12、胆碱、叶酸、磷和碘等。' },
  121. ]
  122. },
  123. {
  124. id: '005',
  125. key: 'potentialHealthIssues',
  126. name: '需要注意的潜在健康问题',
  127. nameEn: 'Potential health issues to note',
  128. url: '/pages_order/static/report/report-detail-5.png',
  129. tag: {
  130. text: '心血管问题',
  131. icon: '/pages_order/static/report/cardiovascular.png',
  132. },
  133. content: [
  134. { title: '影响因素', detail: '较少食用富含Omega3的食物(如:深海鱼,坚果)' },
  135. { title: '营养建议', detail: '建议每天吃一把坚果。' },
  136. ]
  137. },
  138. {
  139. id: '006',
  140. key: 'specialReminder',
  141. name: '特殊提醒',
  142. nameEn: 'Special Reminder',
  143. url: '/pages_order/static/report/report-detail-6.png',
  144. content: [
  145. { title: '眼睛长时间感觉到干涩可能是干眼症,一般是由于泪腺泪液分泌不足导致的,严重的话请及时就医。' },
  146. { title: '同时使用不同品牌的膳食补剂容易导致营养素摄入过量, 请注意服用剂量,避免造成补剂摄入过量带来的副作用。' },
  147. ]
  148. },
  149. {
  150. id: '007',
  151. key: 'exerciseRest',
  152. name: '运动 & 作息',
  153. nameEn: 'Exercise & Rest',
  154. url: '/pages_order/static/report/report-detail-7.png',
  155. content: [
  156. { title: '请尽量避免在阳光强烈的时段(通常是中午至下午3点)户外活动。在户外时,涂抹SPF(防晒系数)高的防晒霜在暴露的皮肤上,并穿着长袖衣物、帽子和太阳镜减少皮肤接触到紫外线的机会。' }
  157. ]
  158. },
  159. {
  160. id: '008',
  161. key: 'dietaryRecommendations',
  162. name: '饮食建议',
  163. nameEn: 'Dietary recommendations',
  164. url: '/pages_order/static/report/report-detail-8.png',
  165. content: [
  166. { title: '一天不要超过三杯美式咖啡', detail: '健康成年人每天摄入的咖啡因应控制在400mg以内。1杯 355mL的小杯美式咖啡,所含咖啡因为150mg,所以一天最好不要饮用超过3小杯咖啡。' },
  167. ]
  168. },
  169. ]
  170. },
  171. methods: {
  172. jumpToNutritionProgram() {
  173. this.$utils.navigateTo(`/pages_order/report/nutritionProgram/index?id=${this.id}`)
  174. },
  175. },
  176. }
  177. </script>
  178. <style scoped lang="scss">
  179. .page__view {
  180. width: 100vw;
  181. min-height: 100vh;
  182. background-color: $uni-bg-color;
  183. position: relative;
  184. /deep/ .nav-bar__view {
  185. position: fixed;
  186. top: 0;
  187. left: 0;
  188. }
  189. }
  190. .main {
  191. padding: calc(var(--status-bar-height) + 152rpx) 32rpx 272rpx 32rpx;
  192. }
  193. .section {
  194. & + & {
  195. margin-top: 48rpx;
  196. padding-top: 12rpx;
  197. border-top: 2rpx dashed #989898;
  198. }
  199. &-header {
  200. justify-content: flex-start;
  201. &-index {
  202. position: relative;
  203. font-family: HarmonyOS Sans;
  204. font-weight: 700;
  205. font-size: 96rpx;
  206. line-height: 1.4;
  207. color: #D9D9D9;
  208. &-icon {
  209. position: absolute;
  210. left: 34rpx;
  211. top: 70rpx;
  212. width: 40rpx;
  213. height: 40rpx;
  214. }
  215. }
  216. &-title {
  217. margin-left: 32rpx;
  218. font-family: PingFang SC;
  219. line-height: 1.4;
  220. color: #252545;
  221. &-zh {
  222. font-weight: 600;
  223. font-size: 40rpx;
  224. }
  225. &-en {
  226. font-weight: 400;
  227. font-size: 26rpx;
  228. }
  229. }
  230. }
  231. &-content {
  232. padding-top: 18rpx;
  233. &-item {
  234. font-family: PingFang SC;
  235. font-weight: 400;
  236. line-height: 1.5;
  237. color: #252545;
  238. & + & {
  239. margin-top: 24rpx;
  240. }
  241. &-header {
  242. align-items: flex-start;
  243. justify-content: flex-start;
  244. }
  245. &-index {
  246. display: inline-block;
  247. width: 44rpx;
  248. font-size: 24rpx;
  249. text-align: right;
  250. line-height: 44rpx;
  251. padding-right: 10rpx;
  252. box-sizing: border-box;
  253. }
  254. &-title {
  255. font-size: 28rpx;
  256. }
  257. &-detail {
  258. margin-top: 8rpx;
  259. font-size: 24rpx;
  260. color: #989898;
  261. }
  262. }
  263. &-tag {
  264. margin-bottom: 24rpx;
  265. padding: 16rpx 0;
  266. background: #E5E4EB8C;
  267. border-radius: 16rpx;
  268. column-gap: 16rpx;
  269. &-icon {
  270. width: 40rpx;
  271. height: 40rpx;
  272. }
  273. &-text {
  274. font-family: PingFang SC;
  275. font-weight: 400;
  276. font-size: 28rpx;
  277. line-height: 1.5;
  278. color: #252545;
  279. }
  280. }
  281. }
  282. }
  283. .tags {
  284. display: flex;
  285. flex-wrap: wrap;
  286. gap: 16rpx;
  287. .tag {
  288. padding: 8rpx 40rpx;
  289. font-family: PingFang SC;
  290. font-weight: 400;
  291. font-size: 28rpx;
  292. line-height: 1.5;
  293. color: #252545;
  294. background: #E5E4EB;
  295. border-radius: 30rpx;
  296. &.highlight {
  297. font-weight: 600;
  298. color: #FFFFFF;
  299. background: #252545;
  300. }
  301. }
  302. }
  303. .section.tips {
  304. padding-top: 48rpx;
  305. font-family: PingFang SC;
  306. font-weight: 400;
  307. font-size: 18rpx;
  308. line-height: 1.4;
  309. color: #989898;
  310. }
  311. .bottom {
  312. width: 100%;
  313. position: fixed;
  314. left: 0;
  315. bottom: 0;
  316. padding: 24rpx 40rpx 92rpx 40rpx;
  317. box-sizing: border-box;
  318. background: #FFFFFF;
  319. .btn {
  320. padding: 16rpx 0;
  321. font-family: PingFang SC;
  322. font-size: 36rpx;
  323. font-weight: 500;
  324. line-height: 1;
  325. color: #FFFFFF;
  326. background-image: linear-gradient(to right, #4B348F, #845CFA);
  327. border-radius: 41rpx;
  328. }
  329. }
  330. </style>