From ace0cfcd61927780dda4bd4a86c7b742ce9d48c2 Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期五, 08 八月 2025 21:38:57 +0800
Subject: [PATCH] gx

---
 src/stores/userInfo.ts |   32 ++++++++++++++++++++++++++++----
 1 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/src/stores/userInfo.ts b/src/stores/userInfo.ts
index 9f23958..6018e38 100644
--- a/src/stores/userInfo.ts
+++ b/src/stores/userInfo.ts
@@ -1,6 +1,7 @@
 
 import { defineStore } from 'pinia'
 import { ref } from 'vue'
+import { ajaxPost} from '@/utils/axios'
 // 使用示例一:函数式定义【个人推荐】
 export const userInfoStore = defineStore('userInfo', () => {
     const info = ref({
@@ -14,22 +15,45 @@
             code:'',
             id:'',
             patientCardNo:'',
+            patientOpenId:'',
             patientIdentityNo:'',
             patientName:'',
             patientTelNo:'',
-            patientAvatarIcon:''
+            patientAvatarIcon:'',
+            patientCreditValue:0,
+            patientAddress:'',
+            clientCode:'',
         },
         pressure:'',
         weight:''
+    })
+
+    const 最近体重血压 = ref({
+        血压: '',
+        体重: ''
     })
     function setInfo(userInfo:{openid:string, headimgurl:string,nickname:string}) {
         info.value.openid=userInfo.openid
         info.value.headimgurl=userInfo.headimgurl
         info.value.nickname=userInfo.nickname
     }
-    function setPatient(info:object) {
-        patient.value=info
+    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 }
+    return { info,patient,最近体重血压,setPatient, setInfo,setPatientApi }
 })

--
Gitblit v1.8.0