登录和接口请求

This commit is contained in:
XiuYun CHEN
2025-08-05 10:52:22 +08:00
parent ef0b32cfe4
commit 9355959b36
11 changed files with 263 additions and 83 deletions
@@ -14,15 +14,15 @@ export struct MessageComp {
// @Param pathStack: NavPathStack = new NavPathStack()
@Param onUreadMessageChange?: (unreadCount?: number) => void = undefined
loadUnreadApplication = async () => {
try {
const unreadCount = await ContactRepo.getAddApplicationUnreadCount()
} catch (err) {
console.log(err)
}
}
// loadUnreadApplication = async () => {
//
// try {
// const unreadCount = await ContactRepo.getAddApplicationUnreadCount()
//
// } catch (err) {
// console.log(err)
// }
// }
//获取会话列表未读数
@@ -48,14 +48,14 @@ export struct MessageComp {
}
)
ChatKitClient.nim.friendService?.on('onFriendAddApplication', async (application: V2NIMFriendAddApplication) => {
await this.loadUnreadApplication()
})
try {
await this.loadUnreadApplication()
} catch (err) {
console.log(err)
}
// ChatKitClient.nim.friendService?.on('onFriendAddApplication', async (application: V2NIMFriendAddApplication) => {
// await this.loadUnreadApplication()
// })
// try {
// await this.loadUnreadApplication()
// } catch (err) {
// console.log(err)
// }
this.loadConfig()
this.loadUnreadMessageCount()
}
@@ -3,6 +3,7 @@ import {
applyListModel,
authStore, BasicConstant,
ChangeUtil,
EmptyViewComp,
hdHttp, HdLoadingDialog, HdResponse,
HdTwoNav,
PatientData,
@@ -49,7 +50,7 @@ export struct PatientListComp {
@State delectuuid:string=''
@State delectname:string=''
@State positionDelete:number = 0
@State isEmptyViewVisible: boolean = false; // 控制显隐的状态变量
dialogDelete = new CustomDialogController({
builder: DelectDialog(
{
@@ -123,20 +124,6 @@ export struct PatientListComp {
console.log('服务器返回的患者数据:', json);
if(json.data!=null)
{
// let regionRequestData: PatientsData[]=[...json.data]
// regionRequestData =[...json.data]
// regionRequestData.push(...json.data)
// regionRequestData.push(...json.data)
// regionRequestData.push(...json.data)
// regionRequestData.push(...json.data)
// regionRequestData.push(...json.data)
// regionRequestData.push(...json.data)
// regionRequestData.push(...json.data)
// regionRequestData.push(...json.data)
// regionRequestData.push(...json.data)
// regionRequestData.push(...json.data)
// regionRequestData.push(...json.data)
// this.collationData(regionRequestData);
if(json.data!=null&&json.data.length>0)
{
this.total=json.data.length
@@ -146,6 +133,12 @@ export struct PatientListComp {
preferenceStore.setItemNumber('old_patient_num',this.total/10)
}
this.collationData(json.data);
this.isEmptyViewVisible=false
}
else
{
this.isEmptyViewVisible=true
this.dialog.close()
}
@@ -198,7 +191,7 @@ export struct PatientListComp {
},rightItemAction2:()=>{
HMRouterMgr.push({pageUrl:'PatientsListSearchComp'})
}})
Stack({ }) {
Stack({ alignContent:Alignment.Top}) {
List({ scroller: this.scroller, space: 0, initialIndex: 0 }) {
ListItem() {
Column()
@@ -303,6 +296,11 @@ export struct PatientListComp {
.onClick(() => {
HMRouterMgr.push({pageUrl:'PatientsGroup',param:"我的患者"})
})
if (this.isEmptyViewVisible){
EmptyViewComp({promptText:'暂无随访患者',isVisibility:this.isEmptyViewVisible})
.width('100%')
.height('60%')
}
ForEach(this.regionDataGroupsList, (regionDataGroups: Groups, index) => {
ListItemGroup({ header: this.itemHead(regionDataGroups.title) }) {
@@ -475,6 +473,7 @@ export struct PatientListComp {
}.width('100%')
.height('100%')
}
private collationData(regionRequestData: PatientsData[]) {