index.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <template>
  2. <CustomNav title="健康数据" leftType="back" />
  3. <view class="content">
  4. <view class="menu-card">
  5. <view class="menu-list">
  6. <view class="menu-item" @click="openDetail('physical','height')">
  7. <image src="/static/icons/remixicon/height.svg" class="menu-icon" mode="widthFix" />
  8. <text class="menu-text">身高</text>
  9. <text class="menu-value">--</text>
  10. <uni-icons class="menu-arrow" type="arrowright" size="20" color="#c0c0c0" />
  11. </view>
  12. <view class="menu-item" @click="openDetail('physical','weight')">
  13. <image src="/static/icons/remixicon/weight.svg" class="menu-icon" mode="widthFix" />
  14. <text class="menu-text">体重</text>
  15. <text class="menu-value">80.0 公斤</text>
  16. <uni-icons class="menu-arrow" type="arrowright" size="20" color="#c0c0c0" />
  17. </view>
  18. <view class="menu-item" @click="openDetail('physical','bmi')">
  19. <image src="/static/icons/remixicon/bmi.svg" class="menu-icon" mode="widthFix" />
  20. <text class="menu-text">BMI</text>
  21. <text class="menu-value">--</text>
  22. <uni-icons class="menu-arrow" type="arrowright" size="20" color="#c0c0c0" />
  23. </view>
  24. <view class="menu-item" @click="openDetail('blood-pressure')"><image src="/static/icons/remixicon/scan-line.svg" class="menu-icon" mode="widthFix" />
  25. <text class="menu-text">血压</text>
  26. <text class="menu-value">--</text>
  27. <uni-icons class="menu-arrow" type="arrowright" size="20" color="#c0c0c0" />
  28. </view>
  29. <view class="menu-item" @click="openDetail('blood-glucose')"><image src="/static/icons/remixicon/contrast-drop-2-line.svg" class="menu-icon" mode="widthFix" />
  30. <text class="menu-text">血糖</text>
  31. <text class="menu-value">--</text>
  32. <uni-icons class="menu-arrow" type="arrowright" size="20" color="#c0c0c0" />
  33. </view>
  34. <view class="menu-item" @click="openDetail('heart-rate')">
  35. <image src="/static/icons/remixicon/heart-pulse.svg" class="menu-icon" mode="widthFix" />
  36. <text class="menu-text">心率</text>
  37. <text class="menu-value">--</text>
  38. <uni-icons class="menu-arrow" type="arrowright" size="20" color="#c0c0c0" />
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <!-- 删除了TabBar组件,因为这是一个公共页面,供医生或家属像病人一样快速查看患者的健康数据 -->
  44. <!-- TabBar is removed because this is a public page for doctors or family members to quickly view patient health data like patients do -->
  45. </template>
  46. <script setup lang="ts">
  47. import { ref, onMounted } from 'vue'
  48. import { onLoad } from '@dcloudio/uni-app'
  49. import CustomNav from '@/components/custom-nav.vue'
  50. // 删除了TabBar导入,因为这是一个公共页面,供医生或家属像病人一样快速查看患者的健康数据
  51. // Removed TabBar import because this is a public page for doctors or family members to quickly view patient health data like patients do
  52. const title = ref('健康数据')
  53. const patientId = ref<string | null>(null)
  54. const bindingType = ref<string | null>(null)
  55. // 页面加载时检查是否传入了患者ID和绑定类型
  56. onLoad((options) => {
  57. console.log('传入的参数:', options)
  58. if (options && options.patientId && options.bindingType) {
  59. patientId.value = options.patientId
  60. bindingType.value = options.bindingType
  61. console.log('患者ID:', patientId.value)
  62. console.log('绑定类型:', bindingType.value)
  63. } else {
  64. // 如果没有传入patientId或bindingType,则弹窗提示并返回上一页
  65. uni.showToast({
  66. title: '未携带必要参数',
  67. icon: 'none',
  68. duration: 2000
  69. })
  70. setTimeout(() => {
  71. uni.navigateBack()
  72. }, 2000)
  73. }
  74. })
  75. const openDetail = (type: string, metric?: string) => {
  76. // 检查是否有患者ID和绑定类型
  77. if (!patientId.value || !bindingType.value) {
  78. uni.showToast({
  79. title: '未携带必要参数',
  80. icon: 'none'
  81. })
  82. return
  83. }
  84. const url = metric
  85. ? `details/${type}?metric=${metric}&patientId=${patientId.value}&bindingType=${bindingType.value}`
  86. : `details/${type}?patientId=${patientId.value}&bindingType=${bindingType.value}`
  87. uni.navigateTo({ url })
  88. }
  89. const openReminder = () => {
  90. // 检查是否有患者ID和绑定类型
  91. if (!patientId.value || !bindingType.value) {
  92. uni.showToast({
  93. title: '未携带必要参数',
  94. icon: 'none'
  95. })
  96. return
  97. }
  98. uni.navigateTo({ url: `reminder?patientId=${patientId.value}&bindingType=${bindingType.value}` })
  99. }
  100. </script>
  101. <style scoped>
  102. .content {
  103. padding-top: calc(var(--status-bar-height) + 44px);
  104. min-height: 100vh;
  105. background-color: #f5f5f5;
  106. box-sizing: border-box;
  107. }
  108. .text-area {
  109. display: flex;
  110. justify-content: center;
  111. }
  112. .title {
  113. font-size: 36rpx;
  114. color: #8f8f94;
  115. }
  116. .menu-card {
  117. padding: 50rpx 0rpx;
  118. }
  119. .menu-list {
  120. background-color: #fff;
  121. border-radius: 12rpx;
  122. overflow: hidden;
  123. }
  124. .menu-item {
  125. display: flex;
  126. justify-content: flex-start;
  127. align-items: center;
  128. padding: 30rpx 40rpx;
  129. border-bottom: 1rpx solid #eee;
  130. }
  131. .menu-item:last-child {
  132. border-bottom: none
  133. }
  134. .menu-text {
  135. font-size: 32rpx;
  136. color: #000000;
  137. flex: 1;
  138. /* 字符间距,调整数值以获得所需视觉效果 */
  139. letter-spacing: 1rpx;
  140. }
  141. .menu-value {
  142. font-size: 28rpx;
  143. color: #5a5a5a;
  144. margin-right: 10rpx
  145. }
  146. .menu-arrow {
  147. display: inline-flex;
  148. align-items: center;
  149. justify-content: center;
  150. width: 44rpx;
  151. height: 44rpx;
  152. }
  153. .menu-icon {
  154. width: 40rpx;
  155. height: 40rpx;
  156. margin-right: 30rpx;
  157. display: inline-block;
  158. }
  159. .reminder-card {
  160. margin-top: 20rpx;
  161. padding: 50rpx 0rpx;
  162. }
  163. .reminder-button {
  164. display: flex;
  165. justify-content: flex-start;
  166. align-items: center;
  167. padding: 30rpx 40rpx;
  168. background-color: #fff;
  169. border-radius: 12rpx;
  170. }
  171. .reminder-text {
  172. font-size: 32rpx;
  173. color: #000000;
  174. flex: 1;
  175. letter-spacing: 1rpx;
  176. }
  177. .reminder-arrow {
  178. display: inline-flex;
  179. align-items: center;
  180. justify-content: center;
  181. width: 44rpx;
  182. height: 44rpx;
  183. }
  184. .reminder-icon {
  185. width: 40rpx;
  186. height: 40rpx;
  187. margin-right: 30rpx;
  188. display: inline-block;
  189. }
  190. </style>