From b8ce0e7f0652aab9d9b0df9c5fbaebd924d31cc2 Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期日, 04 六月 2023 09:52:24 +0800
Subject: [PATCH] upbug
---
src/stores/userInfo.ts | 39 +++++++++++++++++++++++++++------------
1 files changed, 27 insertions(+), 12 deletions(-)
diff --git a/src/stores/userInfo.ts b/src/stores/userInfo.ts
index 1d8ac01..1730e13 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({
@@ -8,22 +9,36 @@
headimgurl:'',
nickname:'',
})
- // const patient=ref({
- // patientName:'',
- // patientTelNo:'',
- // id:0,
- // code:'',
- // })
+ const patient=ref({
+ patientInfo:{
+ age:0,
+ code:'',
+ id:'',
+ patientCardNo:'',
+ patientOpenId:'',
+ patientIdentityNo:'',
+ patientName:'',
+ patientTelNo:'',
+ patientAvatarIcon:'',
+ patientCreditValue:0,
+ patientAddress:'',
+ clientCode:'',
+ },
+ pressure:'',
+ weight:''
+ })
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 setUser(userInfo:{openid:string, headimgurl:string,nickname:string}) {
- // info.value.openid=userInfo.openid
- // info.value.headimgurl=userInfo.headimgurl
- // info.value.nickname=userInfo.nickname
- // }
+ function setPatient(userInfo:any) {
+ patient.value=userInfo
+ }
+ const setPatientApi= async()=>{
+ const res= await ajaxPost('/patient/info/getPatientInfo','')
+ setPatient(res)
+ }
- return { info, setInfo }
+ return { info,patient,setPatient, setInfo,setPatientApi }
})
--
Gitblit v1.8.0