From bb6e8dab96d91b59281ea938130accdc32cab918 Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期四, 10 七月 2025 19:33:15 +0800
Subject: [PATCH] gx
---
src/stores/userInfo.ts | 17 ++++++++
src/views/home/index.vue | 11 ++++-
src/views/login/index.vue | 3 -
src/views/home/assets/index.scss | 8 ++--
src/views/record/index.vue | 21 +++++++---
src/router/index.ts | 22 ++++++----
project.config.json | 2
7 files changed, 58 insertions(+), 26 deletions(-)
diff --git a/project.config.json b/project.config.json
index 149113f..b857e8e 100644
--- a/project.config.json
+++ b/project.config.json
@@ -1,7 +1,7 @@
{
"appid": "wx0edc9a56412f6b5e",
"compileType": "miniprogram",
- "libVersion": "3.0.0",
+ "libVersion": "3.8.9",
"packOptions": {
"ignore": [],
"include": []
diff --git a/src/router/index.ts b/src/router/index.ts
index 041d7f3..4c93bc9 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -36,18 +36,22 @@
document.title = to.meta.title
}
// 看看有没有toke
- const token = Session.get('token');
- console.log(!token)
+ const token = Session.get('token')
+ console.log(!token)
if (to.path === '/login') {
- next();
-
- }else{
+ next()
+
+ } else {
if (!token){
- next('/login');
- }else{
+ next('/login')
+ } else {
console.log('---')
- await userInfo.setPatientApi()
- next();
+ if (to.path === '/'){
+ await userInfo.setPatientApi()
+
+ await userInfo.setPatientApi()
+ }
+ next()
}
}
})
diff --git a/src/stores/userInfo.ts b/src/stores/userInfo.ts
index 1730e13..6018e38 100644
--- a/src/stores/userInfo.ts
+++ b/src/stores/userInfo.ts
@@ -27,6 +27,11 @@
pressure:'',
weight:''
})
+
+ const 最近体重血压 = ref({
+ 血压: '',
+ 体重: ''
+ })
function setInfo(userInfo:{openid:string, headimgurl:string,nickname:string}) {
info.value.openid=userInfo.openid
info.value.headimgurl=userInfo.headimgurl
@@ -34,11 +39,21 @@
}
function setPatient(userInfo:any) {
patient.value=userInfo
+ set最近体重血压(userInfo.patientInfo.code)
}
const setPatientApi= async()=>{
const res= await ajaxPost('/patient/info/getPatientInfo','')
setPatient(res)
}
+ const set最近体重血压 = async(patientCode:any)=>{
+ const data= await ajaxPost('/patient/info/getPatientBodyWeightBloodPressure?patientCode='+patientCode,'')
+ console.log(data,'最近体重血压数据')
+ 最近体重血压.value = {
+ 血压: data.透前血压,
+ 体重: data.透前称重
+ }
+ console.log(最近体重血压.value,'最近体重血压数据')
+ }
- return { info,patient,setPatient, setInfo,setPatientApi }
+ return { info,patient,最近体重血压,setPatient, setInfo,setPatientApi }
})
diff --git a/src/views/home/assets/index.scss b/src/views/home/assets/index.scss
index 1ae1af0..d59ce2a 100644
--- a/src/views/home/assets/index.scss
+++ b/src/views/home/assets/index.scss
@@ -98,8 +98,8 @@
.crainfo{
border-radius: 50%;
border: 2.5px solid rgba(101, 170, 255, 1);
- width: 70px;
- height: 70px;
+ width: 80px;
+ height: 80px;
text-align: center;margin:auto;
.tizhong{
overflow-wrap: break-word;
@@ -109,7 +109,7 @@
font-family: PingFangSC-Medium;
text-align: center;
white-space: nowrap;
- margin-top: 20px;
+ margin-top: 25px;
line-height: 28px;
}
.xueya{
@@ -120,7 +120,7 @@
font-family: PingFangSC-Medium;
text-align: center;
white-space: nowrap;
- margin-top: 20px;
+ margin-top: 15px;
line-height: 28px;
}
}
diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index 2d3e440..e177ae1 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -64,14 +64,18 @@
<div class="viewInfo">
<div class="box">
<div class="crainfo">
- <div class="tizhong">{{patientInfo.weight}}</div>
+ <div class="tizhong">{{最近体重血压.体重}}</div>
</div>
<div class="hanzhi">体重(kg)</div>
<div class="yinyu">Patient weight data</div>
</div>
<div class="box">
<div class="crainfo">
- <div class="xueya">{{patientInfo.pressure}}</div>
+ <div class="xueya">
+ <div v-if="最近体重血压.血压">{{最近体重血压.血压.split('/')[0]}}</div>
+ <div style="height: 1px;background-color: #909399;"></div>
+ <div v-if="最近体重血压.血压">{{最近体重血压.血压.split('/')[1]}}</div>
+ </div>
</div>
<div class="hanzhi">血压(mmHg)</div>
<div class="yinyu">Patient blood pressure data</div>
@@ -156,6 +160,9 @@
const patientInfo=computed(() => {
return userInfo.patient
})
+ const 最近体重血压=computed(() => {
+ return userInfo.最近体重血压
+ })
const Info=computed(() => {
return userInfo.info
})
diff --git a/src/views/login/index.vue b/src/views/login/index.vue
index 3e5d085..3e2a97c 100644
--- a/src/views/login/index.vue
+++ b/src/views/login/index.vue
@@ -125,7 +125,7 @@
}
onMounted(()=>{
// userInfo.setInfo({openid:'odFja56xfwSZDHhAEMn-JotSzlRc',nickname:'大橙子',headimgurl:'https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTJB…ibLYic7qC9cm0Yjia3VkHRPVa12N0OK6dgdz984biceWg/132'})
- // Session.set('token', 'eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJQQVRfU0ZfUEFUOTE0MzE2NDAyMTk1N0pOcUMiLCJhdXRoIjpbeyJhdXRob3JpdHkiOiJhZG1pbiJ9XSwiaWF0IjoxNzQwNzM2Nzg2LCJleHAiOjE3NDEwOTY3ODZ9.stAHeAJ_pB4qWL4W-1rv0UUnBV3Wn2vsSH-td2j26cw')
+ // Session.set('token', 'eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJQQVRfU0ZfUEFUOTE0MzE2NDAyMTk1N0pOcUMiLCJhdXRoIjpbeyJhdXRob3JpdHkiOiJhZG1pbiJ9XSwiaWF0IjoxNzUyMDU5ODk0LCJleHAiOjE3NTI0MTk4OTR9.a-Zw910bXendD9Oq7jxjDYfaWLf693maoh7MgAfqK9Y')
// getUserinfo()
Session.remove('token')
if (isWechat()){
@@ -170,7 +170,6 @@
title: '提示',
message: '请在微信中打开浏览',
}).then(() => {
- // on close
})
}
})
diff --git a/src/views/record/index.vue b/src/views/record/index.vue
index 78faf44..0a752db 100644
--- a/src/views/record/index.vue
+++ b/src/views/record/index.vue
@@ -28,17 +28,17 @@
<span style="color: #777;">状态:</span>
<span v-if="pageInfo.medState === 0" style="color: #769aff;">未签到</span>
<span v-if="pageInfo.medState === 1" style="color: #769aff;">已签到</span>
- <span v-if="pageInfo.medState === 2" style="color: #769aff;">透析中</span>
+ <span v-if="pageInfo.medState === 2 || pageInfo.medState === 2.5" style="color: #769aff;">透析中</span>
<span v-if="pageInfo.medState === 3" style="color: #769aff;">已检查</span>
<span v-if="pageInfo.medState === 4" style="color: #769aff;">已归档</span>
</van-col>
<van-col span="8">
<span style="color: #777;">上机:</span>
- <span style="color: #769aff;">{{pageInfo.detailForPatientMedStartTime}}</span>
+ <span style="color: #769aff;">{{pageInfo.detailForPatientMedStartTime.substring(11,16)}}</span>
</van-col>
<van-col span="8">
<span style="color: #777;">下机:</span>
- <span style="color: #769aff;">{{pageInfo.detailForPatientMedEndTime}}</span>
+ <span style="color: #769aff;">{{pageInfo.detailForPatientMedEndTime.substring(11,16)}}</span>
</van-col>
</van-row>
<van-row class="lable">
@@ -60,7 +60,7 @@
<van-row class="lable2">
<van-col span="8">
<span style="color: #777;">次数:</span>
- <span style="color: #769aff;">{{pageInfo.detailForPatientMedCount}}</span>
+ <span style="color: #769aff;">{{pageInfo.historyCount}}</span>
</van-col>
<van-col span="8">
<span style="color: #777;">本次费用:</span>
@@ -111,7 +111,7 @@
<script lang="ts" setup>
import {ref} from 'vue'
import {ajaxPost} from '@/utils/axios'
- import { Calendar as vanCalendar } from 'vant'
+ import { Calendar as vanCalendar, Toast } from 'vant'
import {useRouter} from 'vue-router'
import { userInfoStore } from '@/stores/userInfo'
const userInfo = userInfoStore()
@@ -137,7 +137,14 @@
const d = day.getDate()
const x=selectDate.value.findIndex(e=>{return e.y===y&&e.m===m&&e.d===d})
console.log(selectDate.value[x],'找到了')
- getDetail(selectDate.value[x].id)
+ if (x===-1){
+
+ Toast('没有排班信息,请选择其他日期!')
+ }
+ else {
+ getDetail(selectDate.value[x].id)
+ }
+
}
const fanhui=()=>{
@@ -201,7 +208,7 @@
}
const getDetail=(id:any)=>{
loand.value=true
- ajaxPost('/patient/hemo/med/record/detail',`id=${id}`).then((re:any)=>{
+ ajaxPost('/patient/hemo/med/record/detailForMobile',`id=${id}`).then((re:any)=>{
console.log(re)
pageInfo.value=re
loand.value=false
--
Gitblit v1.8.0