From 2d962dc3868f54accb572021f509f87c5333329e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B7=A6=E5=93=A5?= <17630302050@163.com>
Date: Wed, 18 Jun 2025 21:42:12 +0800
Subject: [PATCH] dsdw
---
pages/clockIn/index.js | 12 ++++++++++-
pages/clockIn/index.wxml | 4 ++--
pages/home/index.js | 44 ++++++++++++++++++++++++++++++++++++++--
pages/home/index.less | 15 ++++++++++----
pages/home/index.wxml | 34 ++++++++-----------------------
5 files changed, 75 insertions(+), 34 deletions(-)
diff --git a/pages/clockIn/index.js b/pages/clockIn/index.js
index 286ac58..350ab80 100644
--- a/pages/clockIn/index.js
+++ b/pages/clockIn/index.js
@@ -45,7 +45,17 @@ Page({
newTime: formattedTime
})
},
-
+ async medicineRecord(e){
+ const {id, status} = e.currentTarget.dataset
+ if(status == 1){
+ await request('patient/medicine_record/'+id, 'put', {})
+ wx.showToast({
+ type: 'success',
+ title: '打卡成功',
+ })
+ this.getList()
+ }
+ },
/**
* 生命周期函数--监听页面初次渲染完成
*/
diff --git a/pages/clockIn/index.wxml b/pages/clockIn/index.wxml
index 048f7ca..81b2e79 100644
--- a/pages/clockIn/index.wxml
+++ b/pages/clockIn/index.wxml
@@ -22,8 +22,8 @@
- 未打卡
-
+ 未打卡
+
打卡
diff --git a/pages/home/index.js b/pages/home/index.js
index 40ece98..0759589 100644
--- a/pages/home/index.js
+++ b/pages/home/index.js
@@ -150,7 +150,9 @@ Page({
heightData: [],
weightData: [],
heightChart: null,
- weightChart: null
+ weightChart: null,
+ carList: [],
+ carLength: 0
},
// Helper function to strip HTML tags and convert to plain text
@@ -160,6 +162,12 @@ Page({
},
async getSfList(){
+
+ this.followPlans()
+ this.getArticleList()
+ this.getCarList()
+ },
+ async followPlans(){
const res = await request('patient/follow_plans', 'get', {
page: 1,
page_size: 10,
@@ -179,7 +187,8 @@ Page({
daysUntilPlan: diffDays
}
})
-
+ },
+ async getArticleList(){
const res2 = await request('patient/articles', 'get', { title: '', page: 1, page_size: 2 });
// Convert rich text content to plain text
const plainTextContent = this.stripHtml(res2.list[0].content);
@@ -195,6 +204,37 @@ Page({
})
},
+ async getCarList() {
+ const res3 = await request('patient/medicine_records', 'get', {
+ time_type: 1,
+ status: 0,
+ page: 1,
+ page_size: 10
+ })
+ const carList = res3.list.map(item => {
+ item.detail = JSON.parse(item.detail)
+ return item
+ })
+ setTimeout(() => {
+ this.setData({
+ carLength: res3.total,
+ carList: carList
+ })
+ })
+ },
+
+ async medicineRecord(e){
+ const {id, status} = e.currentTarget.dataset
+ if(status == 1){
+ await request('patient/medicine_record/'+id, 'put', {})
+ wx.showToast({
+ type: 'success',
+ title: '打卡成功',
+ })
+ this.getCarList()
+ }
+ },
+
async getChartData(){
const res = await request('patient/chat/0', 'get')
const heightData = []
diff --git a/pages/home/index.less b/pages/home/index.less
index 577c736..b4b17af 100644
--- a/pages/home/index.less
+++ b/pages/home/index.less
@@ -334,8 +334,6 @@
color: rgba(34,34,34,1);
font-size: 32rpx;
font-family: Alibaba-PuHuiTi-M;
- font-weight: normal;
- text-align: right;
white-space: nowrap;
line-height: 32rpx;
margin-right: 86rpx;
@@ -360,16 +358,25 @@
margin: 20rpx 0 18rpx 100rpx;
}
.text-wrapper_6 {
- background-color: rgba(0,91,162,1.000000);
+
border-radius: 32rpx;
display: flex;
flex-direction: column;
margin: 22rpx 0 22rpx 24rpx;
padding: 12rpx 40rpx 12rpx 40rpx;
+ .text_23 {
+ color:rgba(0,91,162,1.000000);
+ }
+}
+.catArt{
+ background-color: rgba(0,91,162,1.000000);
+
+ .text_23 {
+ color: #fff;
+ }
}
.text_23 {
overflow-wrap: break-word;
- color: rgba(255,255,255,1);
font-size: 28rpx;
font-family: Alibaba-PuHuiTi-M;
font-weight: normal;
diff --git a/pages/home/index.wxml b/pages/home/index.wxml
index f286733..f0090d2 100644
--- a/pages/home/index.wxml
+++ b/pages/home/index.wxml
@@ -29,42 +29,26 @@
更多
-
-
+
+
- 08:00
+ {{item.medicine_time}}
-
+
- 优思弗
- 1片,饭后服用
+ {{item2.name}}
+ {{item2.frequency}}片,{{item2.time}}服用
-
- 打卡
+
+ {{item.status=='2'?'已打卡':'打卡'}}
-
+