|
@@ -30,25 +30,26 @@
|
|
|
<text class="item-desc">一键预约复诊</text>
|
|
<text class="item-desc">一键预约复诊</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="function-item blue" @click="onItemClick('用药管理')">
|
|
|
|
|
|
|
+ <view class="function-item orange" @click="onItemClick('我的家属')">
|
|
|
<view class="item-content">
|
|
<view class="item-content">
|
|
|
<view class="title-row">
|
|
<view class="title-row">
|
|
|
<view class="item-line"></view>
|
|
<view class="item-line"></view>
|
|
|
- <text class="item-title">用药管理</text>
|
|
|
|
|
|
|
+ <text class="item-title">我的家属</text>
|
|
|
</view>
|
|
</view>
|
|
|
- <text class="item-desc">管理您的用药记录</text>
|
|
|
|
|
|
|
+ <text class="item-desc">添加或解除绑定您的家属</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
|
|
+
|
|
|
</view>
|
|
</view>
|
|
|
<view class="function-row">
|
|
<view class="function-row">
|
|
|
- <view class="function-item orange" @click="onItemClick('提醒管理')">
|
|
|
|
|
|
|
+ <view class="function-item blue" @click="onItemClick('用药管理')">
|
|
|
<view class="item-content">
|
|
<view class="item-content">
|
|
|
<view class="title-row">
|
|
<view class="title-row">
|
|
|
<view class="item-line"></view>
|
|
<view class="item-line"></view>
|
|
|
- <text class="item-title">提醒管理</text>
|
|
|
|
|
|
|
+ <text class="item-title">用药管理</text>
|
|
|
</view>
|
|
</view>
|
|
|
- <text class="item-desc">管理您的健康提醒</text>
|
|
|
|
|
|
|
+ <text class="item-desc">管理您的用药方案</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="function-item purple" @click="onItemClick('健康档案')">
|
|
<view class="function-item purple" @click="onItemClick('健康档案')">
|
|
@@ -70,22 +71,14 @@
|
|
|
<text class="card-subtitle">{{ currentDate }}</text>
|
|
<text class="card-subtitle">{{ currentDate }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="card-content">
|
|
<view class="card-content">
|
|
|
- <view
|
|
|
|
|
- class="checkin-item"
|
|
|
|
|
- v-for="(task, index) in checkinTasks"
|
|
|
|
|
- :key="index"
|
|
|
|
|
- @click="toggleCheckin(task)"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <view class="checkin-item" v-for="(task, index) in checkinTasks" :key="index" @click="toggleCheckin(task)">
|
|
|
<view class="checkin-info">
|
|
<view class="checkin-info">
|
|
|
<text class="checkin-time">{{ task.time }}</text>
|
|
<text class="checkin-time">{{ task.time }}</text>
|
|
|
<text class="checkin-type">{{ task.type }}</text>
|
|
<text class="checkin-type">{{ task.type }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="checkin-status" :class="{ checked: task.checked }">
|
|
<view class="checkin-status" :class="{ checked: task.checked }">
|
|
|
- <uni-icons
|
|
|
|
|
- :type="task.checked ? 'checkbox-filled' : 'circle'"
|
|
|
|
|
- :color="task.checked ? '#07C160' : '#ddd'"
|
|
|
|
|
- size="24"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <uni-icons :type="task.checked ? 'checkbox-filled' : 'circle'" :color="task.checked ? '#07C160' : '#ddd'"
|
|
|
|
|
+ size="24" />
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -262,7 +255,7 @@ const generateCheckinTasks = () => {
|
|
|
|
|
|
|
|
// 按时间排序
|
|
// 按时间排序
|
|
|
tasks.sort((a, b) => a.time.localeCompare(b.time))
|
|
tasks.sort((a, b) => a.time.localeCompare(b.time))
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
checkinTasks.value = tasks
|
|
checkinTasks.value = tasks
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
console.error('生成打卡任务失败:', e)
|
|
console.error('生成打卡任务失败:', e)
|
|
@@ -274,12 +267,12 @@ const toggleCheckin = (task: { time: string; type: string }) => {
|
|
|
try {
|
|
try {
|
|
|
const today = currentDate.value
|
|
const today = currentDate.value
|
|
|
const checkinRecords = uni.getStorageSync('checkinRecords') || {}
|
|
const checkinRecords = uni.getStorageSync('checkinRecords') || {}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 初始化今天的记录
|
|
// 初始化今天的记录
|
|
|
if (!checkinRecords[today]) {
|
|
if (!checkinRecords[today]) {
|
|
|
checkinRecords[today] = {}
|
|
checkinRecords[today] = {}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 生成任务键名
|
|
// 生成任务键名
|
|
|
let taskKey = ''
|
|
let taskKey = ''
|
|
|
if (task.type === '测量血压') {
|
|
if (task.type === '测量血压') {
|
|
@@ -291,13 +284,13 @@ const toggleCheckin = (task: { time: string; type: string }) => {
|
|
|
} else if (task.type === '用药提醒') {
|
|
} else if (task.type === '用药提醒') {
|
|
|
taskKey = `medication_${task.time}`
|
|
taskKey = `medication_${task.time}`
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 切换打卡状态
|
|
// 切换打卡状态
|
|
|
checkinRecords[today][taskKey] = !checkinRecords[today][taskKey]
|
|
checkinRecords[today][taskKey] = !checkinRecords[today][taskKey]
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 保存到本地存储
|
|
// 保存到本地存储
|
|
|
uni.setStorageSync('checkinRecords', checkinRecords)
|
|
uni.setStorageSync('checkinRecords', checkinRecords)
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 更新界面显示
|
|
// 更新界面显示
|
|
|
generateCheckinTasks()
|
|
generateCheckinTasks()
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
@@ -311,11 +304,11 @@ const cleanExpiredCheckinRecords = () => {
|
|
|
const checkinRecords = uni.getStorageSync('checkinRecords') || {}
|
|
const checkinRecords = uni.getStorageSync('checkinRecords') || {}
|
|
|
const today = currentDate.value
|
|
const today = currentDate.value
|
|
|
const keys = Object.keys(checkinRecords)
|
|
const keys = Object.keys(checkinRecords)
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 只保留最近7天的记录
|
|
// 只保留最近7天的记录
|
|
|
const sevenDaysAgo = new Date()
|
|
const sevenDaysAgo = new Date()
|
|
|
sevenDaysAgo.setDate(sevenDaysAgo.getDate() - 7)
|
|
sevenDaysAgo.setDate(sevenDaysAgo.getDate() - 7)
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
const cleanedRecords: Record<string, any> = {}
|
|
const cleanedRecords: Record<string, any> = {}
|
|
|
keys.forEach(key => {
|
|
keys.forEach(key => {
|
|
|
// 简单的日期比较(格式:YYYY-MM-DD)
|
|
// 简单的日期比较(格式:YYYY-MM-DD)
|
|
@@ -323,7 +316,7 @@ const cleanExpiredCheckinRecords = () => {
|
|
|
cleanedRecords[key] = checkinRecords[key]
|
|
cleanedRecords[key] = checkinRecords[key]
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
uni.setStorageSync('checkinRecords', cleanedRecords)
|
|
uni.setStorageSync('checkinRecords', cleanedRecords)
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
console.error('清理过期打卡记录失败:', e)
|
|
console.error('清理过期打卡记录失败:', e)
|
|
@@ -366,8 +359,8 @@ function handleScan(res: any) {
|
|
|
function onItemClick(type: string) {
|
|
function onItemClick(type: string) {
|
|
|
if (type === '健康档案') {
|
|
if (type === '健康档案') {
|
|
|
uni.navigateTo({ url: '/pages/patient/profile/infos/patient-filing' })
|
|
uni.navigateTo({ url: '/pages/patient/profile/infos/patient-filing' })
|
|
|
- } else if (type === '提醒管理') {
|
|
|
|
|
- uni.navigateTo({ url: '/pages/patient/health/reminder' })
|
|
|
|
|
|
|
+ } else if (type === '我的家属') {
|
|
|
|
|
+ uni.navigateTo({ url: '/pages/patient/index/family' })
|
|
|
} else if (type === '我的医生') {
|
|
} else if (type === '我的医生') {
|
|
|
uni.navigateTo({ url: '/pages/patient/index/my-doctor' })
|
|
uni.navigateTo({ url: '/pages/patient/index/my-doctor' })
|
|
|
} else if (type === '用药管理') {
|
|
} else if (type === '用药管理') {
|