80 lines
1.6 KiB
Plaintext
80 lines
1.6 KiB
Plaintext
<!-- 健康提醒列表 - uts-android 兼容版 -->
|
|
<template>
|
|
<view class="alerts-list-page">
|
|
<view class="header">
|
|
<text class="header-title">健康提醒</text>
|
|
</view>
|
|
<view v-for="alert in alerts" :key="alert.id" class="alert-item">
|
|
<text class="alert-title">{{ alert.title }}</text>
|
|
<text class="alert-desc">{{ alert.description }}</text>
|
|
<text class="alert-patient">患者: {{ alert.elder_name }}</text>
|
|
<text class="alert-time">{{ alert.created_at }}</text>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
<script setup lang="uts">
|
|
import { ref } from 'vue'
|
|
import supa from '@/components/supadb/aksupainstance.uts'
|
|
const alerts = ref<any[]>([])
|
|
const loadAlert = async () => {
|
|
const result = await supa.from('ec_health_alerts')
|
|
.select('*', { count: 'exact' })
|
|
.order('created_at', { ascending: false })
|
|
.limit(100)
|
|
.execute()
|
|
if (result.data != null) alerts.value = result.data
|
|
}
|
|
onLoad(() => {
|
|
loadAlert()
|
|
})
|
|
</script>
|
|
<style lang="scss">
|
|
.alerts-list-page {
|
|
padding: 20px;
|
|
background: #f5f5f5;
|
|
min-height: 100vh;
|
|
}
|
|
|
|
.header {
|
|
padding: 20px 0 10px 0;
|
|
text-align: center;
|
|
}
|
|
|
|
.header-title {
|
|
font-size: 22px;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.alert-item {
|
|
background: #fff;
|
|
border-radius: 8px;
|
|
margin-bottom: 16px;
|
|
padding: 14px;
|
|
}
|
|
|
|
.alert-title {
|
|
font-size: 16px;
|
|
font-weight: bold;
|
|
color: #333;
|
|
}
|
|
|
|
.alert-desc {
|
|
font-size: 14px;
|
|
color: #555;
|
|
margin: 6px 0;
|
|
display: block;
|
|
}
|
|
|
|
.alert-patient {
|
|
font-size: 13px;
|
|
color: #888;
|
|
display: block;
|
|
}
|
|
|
|
.alert-time {
|
|
font-size: 12px;
|
|
color: #aaa;
|
|
display: block;
|
|
margin-top: 4px;
|
|
}
|
|
</style> |