页面刷新
This commit is contained in:
parent
1e99ff4dfa
commit
69a4ca17e8
@ -1,6 +1,8 @@
|
||||
import { iconsModel } from '../model/HomeModel'
|
||||
import { patientDbManager, PatientEntity } from '@itcast/basic';
|
||||
import { promptAction, router } from '@kit.ArkUI';
|
||||
import { BusinessError } from '@kit.BasicServicesKit';
|
||||
import { pushService } from '@kit.PushKit';
|
||||
|
||||
// interface iconsModel {
|
||||
// img:string;
|
||||
@ -64,6 +66,16 @@ export struct HomeIconComp {
|
||||
router.pushUrl({url:'pages/Netease/imTabPage'})
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
const pushToken = pushService.getToken();
|
||||
console.info("PushService", `Get push token successfully: ${pushToken}`)
|
||||
} catch (err) {
|
||||
// fail
|
||||
let e: BusinessError = err as BusinessError;
|
||||
console.error("PushService", 'Get push token catch error: ' + e.code + ' ' + e.message);
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
}.width('100%').backgroundColor(Color.White)
|
||||
|
||||
@ -6,14 +6,15 @@ import { BasicConstant, ChangePhotoGrids,
|
||||
preferenceStore, ViewImageInfo } from "@itcast/basic"
|
||||
import { PhotoActionSheet } from '@itcast/basic'
|
||||
import { AnswerListBean } from "../model/ConsulModel"
|
||||
import { router } from "@kit.ArkUI"
|
||||
import { promptAction, router } from "@kit.ArkUI"
|
||||
import { PerfactInputSheet } from "@itcast/basic/src/main/ets/Views/PerfactInputSheet"
|
||||
import { BusinessError } from "@kit.BasicServicesKit"
|
||||
import { HashMap } from "@kit.ArkTS"
|
||||
import { rcp } from '@kit.RemoteCommunicationKit';
|
||||
|
||||
@Component
|
||||
export struct MyOpinionComp {
|
||||
@State photos: string[] = []
|
||||
@State base64Array:string[] = []
|
||||
@State previewIndex: number = -1
|
||||
@State maxSelectNumber: number = 6
|
||||
|
||||
@ -30,15 +31,20 @@ export struct MyOpinionComp {
|
||||
hashMap: HashMap<string, Object> = new HashMap();
|
||||
hashMapImg: HashMap<string, string> = new HashMap();
|
||||
|
||||
onAddImg()
|
||||
{
|
||||
onAddImg() {
|
||||
this.photoSheetDialog.open()
|
||||
}
|
||||
onRemoveImg()
|
||||
{
|
||||
|
||||
onRemoveImg() {
|
||||
this.photos.splice(this.removeIndex, 1)
|
||||
this.maxSelectNumber =6- this.photos.length;
|
||||
|
||||
ChangeUtil.convertUrisOrUrlsToBase64(this.photos).then(base64Array => {
|
||||
console.info('转换结果:', base64Array+'转换个数:'+base64Array.length)
|
||||
this.base64Array = base64Array
|
||||
}).catch((err:BusinessError) => {
|
||||
console.error('批量转换失败:', err)
|
||||
})
|
||||
}
|
||||
private custom!:CustomDialogController;
|
||||
dialog: CustomDialogController = new CustomDialogController({
|
||||
@ -46,6 +52,7 @@ export struct MyOpinionComp {
|
||||
customStyle: true,
|
||||
alignment: DialogAlignment.Center
|
||||
})
|
||||
|
||||
initDialog() {
|
||||
this.custom = new CustomDialogController({
|
||||
builder:PerfactInputSheet({
|
||||
@ -57,16 +64,12 @@ export struct MyOpinionComp {
|
||||
inputPlaceholder:'您有未发布的内容,是否保存?',
|
||||
style:'2',
|
||||
inputCallBack:(input: string,title:string)=>{
|
||||
if(title=='needcancelCallBack')
|
||||
{
|
||||
if(title=='needcancelCallBack') {
|
||||
preferenceStore.setItemString('MyOpinionComp'+this.params.uuid,'')
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
preferenceStore.setItemString('MyOpinionComp'+this.params.uuid,this.text)
|
||||
}
|
||||
router.back()
|
||||
|
||||
}
|
||||
}),
|
||||
alignment: DialogAlignment.Center,
|
||||
@ -76,6 +79,7 @@ export struct MyOpinionComp {
|
||||
height: '100%'
|
||||
})
|
||||
}
|
||||
|
||||
private initPhotoDialog() {
|
||||
this.photoSheetDialog = new CustomDialogController({
|
||||
builder: PhotoActionSheet({
|
||||
@ -89,12 +93,16 @@ export struct MyOpinionComp {
|
||||
} else if (typeof uris === 'string') {
|
||||
selectedUris = [uris];
|
||||
}
|
||||
|
||||
this.photos.push(...selectedUris);
|
||||
this.maxSelectNumber = 6- this.photos.length;
|
||||
|
||||
ChangeUtil.convertUrisOrUrlsToBase64(selectedUris).then(base64Array => {
|
||||
console.info('转换结果:', base64Array+'转换个数:'+base64Array.length)
|
||||
this.base64Array = base64Array
|
||||
}).catch((err:BusinessError) => {
|
||||
console.error('批量转换失败:', err)
|
||||
})
|
||||
}
|
||||
|
||||
}),
|
||||
alignment: DialogAlignment.Bottom,
|
||||
customStyle: true,
|
||||
@ -103,28 +111,29 @@ export struct MyOpinionComp {
|
||||
height: '100%'
|
||||
});
|
||||
}
|
||||
|
||||
aboutToAppear(): void {
|
||||
console.log('Response aboutToAppear')
|
||||
this.initPhotoDialog()
|
||||
this.initDialog()
|
||||
if(this.params.isHistory =='true')
|
||||
{
|
||||
if(this.params.isHistory =='true') {
|
||||
this.text=this.params.myAnswer.note
|
||||
if(this.params.myAnswer.imgs!=null)
|
||||
{
|
||||
if(this.params.myAnswer.imgs!=null) {
|
||||
this.photos.push(...this.changeToImgs(this.params.myAnswer.imgs.split(",")))
|
||||
this.maxSelectNumber = 6- this.photos.length;
|
||||
}
|
||||
|
||||
ChangeUtil.convertUrisOrUrlsToBase64(this.changeToImgs(this.params.myAnswer.imgs.split(","))).then(base64Array => {
|
||||
console.info('转换结果:', base64Array+'转换个数:'+base64Array.length)
|
||||
this.base64Array = base64Array
|
||||
}).catch((err:BusinessError) => {
|
||||
console.error('批量转换失败:', err)
|
||||
})
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this.text=preferenceStore.getItemString('MyOpinionComp'+this.params.uuid)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
HdNav({ title: '我的意见', showRightIcon: false, showLeftIcon: true ,isLeftAction:true,leftItemAction:()=>{
|
||||
@ -181,83 +190,94 @@ export struct MyOpinionComp {
|
||||
// params: { uuid:this.params.uuid,isHistory:this.params.isHistory,myAnswer:this.getMyanswer(this.AnswerList)}
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
.backgroundColor(Color.White)
|
||||
.width('100%')
|
||||
|
||||
|
||||
|
||||
}
|
||||
.height('100%')
|
||||
.width('100%')
|
||||
}
|
||||
|
||||
async getUploadImg()
|
||||
{
|
||||
async getUploadImg() {
|
||||
this.hashMapImg.clear();
|
||||
|
||||
if(this.photos.length>0)
|
||||
{
|
||||
if(this.photos.length>0) {
|
||||
for (let index = 0; index < this.photos.length; index++) {
|
||||
if(this.photos[index].includes('http'))
|
||||
{
|
||||
if(this.photos[index].includes('http')) {
|
||||
this.hashMapImg.set('img'+index+1,await ChangeUtil.getImageBase64(this.photos[index]))
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this.hashMapImg.set('img'+index+1, await ChangeUtil.convertUriToBase64(this.photos[index]))
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return this.hashMapImg
|
||||
}
|
||||
|
||||
async updateInterrogationAnswer()
|
||||
{
|
||||
async updateInterrogationAnswer() {
|
||||
this.dialog.open()
|
||||
this.hashMap.clear();
|
||||
this.hashMap.set("note",this.text);
|
||||
this.hashMap.set('uuid', this.params.uuid)
|
||||
this.hashMap.set('imgsBean',await this.getUploadImg())
|
||||
this.hashMap.set('imgsBean',this.assembleBase64Images(this.base64Array))
|
||||
hdHttp.httpReqObject<string>(BasicConstant.updateInterrogationAnswer,this.hashMap).then(async (res: HdResponse<string>) => {
|
||||
this.dialog.close()
|
||||
|
||||
|
||||
|
||||
let json:Record<string,string> = JSON.parse(res+'') as Record<string,string>;
|
||||
promptAction.showToast({ message: json.message })
|
||||
if(json.code == '200') {
|
||||
router.back()
|
||||
}
|
||||
}).catch((err: BusinessError) => {
|
||||
this.dialog.close()
|
||||
|
||||
})
|
||||
|
||||
// let req = new rcp.Request("http://example.com", "POST", headers, simpleForm, cookies, transferRange, configuration);
|
||||
}
|
||||
|
||||
changeToImg( imgListurl:string[])
|
||||
{
|
||||
changeToImg( imgListurl:string[]) {
|
||||
let imgListtmps:ViewImageInfo[]=[]
|
||||
imgListurl.forEach((url: string) => {
|
||||
let item = {uri:url} as ViewImageInfo
|
||||
imgListtmps.push(item)
|
||||
})
|
||||
return imgListtmps
|
||||
|
||||
}
|
||||
changeToImgs( imgListurl:string[])
|
||||
{
|
||||
|
||||
changeToImgs( imgListurl:string[]) {
|
||||
let imgListtmps:string[]=[]
|
||||
imgListurl.forEach((url: string) => {
|
||||
let item = BasicConstant.urlHtml + url
|
||||
imgListtmps.push(item)
|
||||
})
|
||||
return imgListtmps
|
||||
}
|
||||
|
||||
/**
|
||||
* 将base64数组组装为对象
|
||||
* @param base64Array base64字符串数组
|
||||
* @param maxImages 最大图片数量,默认8
|
||||
* @returns 包含img1~imgN字段的对象
|
||||
*/
|
||||
assembleBase64Images(
|
||||
base64Array: string[],
|
||||
maxImages: number = 6
|
||||
): Record<string, string> {
|
||||
const imgObject: Record<string, string> = {};
|
||||
// 确定实际处理的图片数量
|
||||
const processCount = Math.min(base64Array.length, maxImages);
|
||||
for (let i = 0; i < processCount; i++) {
|
||||
const originalBase64 = base64Array[i];
|
||||
// 清理base64前缀[9,10](@ref)
|
||||
const cleanBase64 = originalBase64.replace(
|
||||
/^data:image\/\w+;base64,/i,
|
||||
''
|
||||
);
|
||||
// 生成字段名
|
||||
const fieldName = `img${i + 1}`;
|
||||
imgObject[fieldName] = cleanBase64;
|
||||
}
|
||||
return imgObject;
|
||||
}
|
||||
}
|
||||
|
||||
interface param{
|
||||
uuid:string,
|
||||
isHistory:string,
|
||||
|
||||
@ -16,6 +16,6 @@ export { PatientDetailsComp } from './src/main/ets/components/PatientDetailsComp
|
||||
|
||||
export { GroupManagementComp } from './src/main/ets/components/GroupManagementComp'
|
||||
|
||||
export { MassSendingComp } from './src/main/ets/components/MassSendingComp'
|
||||
export { GroupMessageSendingComp } from './src/main/ets/components/GroupMessageSendingComp'
|
||||
|
||||
export { FollowPlanListComp } from './src/main/ets/components/FollowPlanListComp'
|
||||
@ -7,16 +7,25 @@ import {
|
||||
import { isDate } from "@nimsdk/vendor";
|
||||
import { promptAction } from "@kit.ArkUI";
|
||||
import { BusinessError } from "@kit.BasicServicesKit";
|
||||
import { patientListModel } from "../models/PatientsGroupModel";
|
||||
|
||||
@HMRouter({ pageUrl:'AddFollowPlanComp' })
|
||||
@Component
|
||||
export struct AddFollowPlanComp {
|
||||
scroller:Scroller = new Scroller()
|
||||
private params: ESObject = HMRouterMgr.getCurrentParam()
|
||||
@State name:string = ChangeUtil.stringIsUndefinedAndNull(this.params.nickname)?String(this.params.realName):String(this.params.nickname)
|
||||
@State name:string = ChangeUtil.stringIsUndefinedAndNull(this.params.nickname)?ChangeUtil.stringIsUndefinedAndNull(this.params.realName)?'请选择患者':String(this.params.realName):String(this.params.nickname)
|
||||
@State followList:Array<Record<string,string>> = [{"content":"请于近日来院复诊、复查","time":"请选择时间","date":String(new Date)},{"content":"请于近日来院复诊、复查","time":"请选择时间","date":String(new Date)},{"content":"请于近日来院复诊、复查","time":"请选择时间","date":String(new Date)},{"content":"请于近日来院复诊、复查","time":"请选择时间","date":String(new Date)}]
|
||||
@State isNotiMe:boolean = false
|
||||
@State isNotiPa:boolean = false
|
||||
@State patient_uuid:string = this.params.patientUuid
|
||||
@State page:string = '个人'
|
||||
|
||||
aboutToAppear(): void {
|
||||
if (this.name == '请选择患者') {//页面标识
|
||||
this.page = '列表'
|
||||
}
|
||||
}
|
||||
|
||||
dialog: CustomDialogController = new CustomDialogController({
|
||||
builder: HdLoadingDialog({ message: '加载中...' }),
|
||||
@ -39,7 +48,7 @@ export struct AddFollowPlanComp {
|
||||
.join('☆');
|
||||
const entity = {
|
||||
"expert_uuid": authStore.getUser().uuid,
|
||||
"patient_uuid": this.params.patientUuid,
|
||||
"patient_uuid": this.patient_uuid,
|
||||
"datetime":timeStr,
|
||||
"note":noteStr,
|
||||
"type":"2",
|
||||
@ -81,7 +90,34 @@ export struct AddFollowPlanComp {
|
||||
.layoutWeight(1)
|
||||
Text(this.name)
|
||||
.fontSize(15)
|
||||
.width('50%')
|
||||
.textAlign(TextAlign.End)
|
||||
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
||||
.maxLines(1)
|
||||
.margin({ right: 10 })
|
||||
.onClick(()=>{
|
||||
if (this.page == '列表') {
|
||||
HMRouterMgr.push({pageUrl:'PatientsListComp',
|
||||
param:{group_uuid:"",selectedPatients:[]}
|
||||
},{
|
||||
onResult:(popInfo:HMPopInfo)=>{
|
||||
if (popInfo && popInfo.result && popInfo.result["selectedPatients"] !== undefined) {
|
||||
const patients = popInfo.result["selectedPatients"] as patientListModel[]
|
||||
const patientsList:patientListModel[] = []
|
||||
if (patients?.length) {
|
||||
for (const model of patients) {
|
||||
if (model.isSelected) {
|
||||
patientsList.push(model)
|
||||
this.name = this.converNameToString(patientsList)
|
||||
this.patient_uuid = this.converUuidToString(patientsList)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
.width('100%')
|
||||
.height(40)
|
||||
@ -244,4 +280,24 @@ export struct AddFollowPlanComp {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
converNameToString(patients:patientListModel[]):string {
|
||||
if (!patients?.length) return '[]';
|
||||
const nameList = patients
|
||||
.map(patient => {
|
||||
return patient.nickname || patient.realname || patient.realName || ''
|
||||
})
|
||||
.filter(name => name.trim() !== '')
|
||||
return nameList.join(',')
|
||||
}
|
||||
|
||||
converUuidToString(patients:patientListModel[]):string {
|
||||
if (!patients?.length) return '[]';
|
||||
const nameList = patients
|
||||
.map(patient => {
|
||||
return patient.uuid || ''
|
||||
})
|
||||
.filter(name => name.trim() !== '')
|
||||
return nameList.join(',')
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,12 +13,20 @@ export struct AddScheduleFollowComp {
|
||||
scroller:Scroller = new Scroller()
|
||||
controller:TextAreaController = new TextAreaController()
|
||||
private params: ESObject = HMRouterMgr.getCurrentParam()
|
||||
@State name:string = ChangeUtil.stringIsUndefinedAndNull(this.params.nickname)?String(this.params.realName):String(this.params.nickname)
|
||||
@State name:string = ChangeUtil.stringIsUndefinedAndNull(this.params.nickname)?ChangeUtil.stringIsUndefinedAndNull(this.params.realName)?'请选择患者':String(this.params.realName):String(this.params.nickname)
|
||||
@State note:string = '请于近日来院复诊、复查'
|
||||
@State date:string = ''
|
||||
@State time:string = '请选择日期'
|
||||
@State isNotiMe:boolean = false
|
||||
@State isNotiPa:boolean = false
|
||||
@State patient_uuid:string = this.params.patientUuid
|
||||
@State page:string = '个人'
|
||||
|
||||
aboutToAppear(): void {
|
||||
if (this.name == '请选择患者') {//页面标识
|
||||
this.page = '列表'
|
||||
}
|
||||
}
|
||||
|
||||
dialog: CustomDialogController = new CustomDialogController({
|
||||
builder: HdLoadingDialog({ message: '加载中...' }),
|
||||
@ -37,7 +45,7 @@ export struct AddScheduleFollowComp {
|
||||
}
|
||||
const entity = {
|
||||
"expert_uuid": authStore.getUser().uuid,
|
||||
"patient_uuid": this.params.patientUuid,
|
||||
"patient_uuid": this.patient_uuid,
|
||||
"datetime":this.date,
|
||||
"note":this.note,
|
||||
"type":"1",
|
||||
@ -78,8 +86,22 @@ export struct AddScheduleFollowComp {
|
||||
.margin({ left: 10 })
|
||||
.layoutWeight(1)
|
||||
Text(this.name)
|
||||
.width('50%')
|
||||
.textAlign(TextAlign.End)
|
||||
.fontSize(15)
|
||||
.margin({ right: 10 })
|
||||
.onClick(()=>{
|
||||
if (this.page == '列表') {
|
||||
HMRouterMgr.push({pageUrl:'PatientsListSearchComp',param:{"name":"随访计划"}},{
|
||||
onResult: (popInfo: HMPopInfo) => {
|
||||
if (popInfo && popInfo.result && popInfo.result["patient_uuid"] !== undefined) {
|
||||
this.name = ChangeUtil.stringIsUndefinedAndNull(popInfo.result["nickname"])?String(popInfo.result["realName"]):String(popInfo.result["nickname"])
|
||||
this.patient_uuid = popInfo.result["patient_uuid"]
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
.width('100%')
|
||||
.height(40)
|
||||
|
||||
@ -256,7 +256,7 @@ export struct FollowPlanListComp {
|
||||
"uuid":this.uuid,
|
||||
"patientUuid":this.patientUuid,
|
||||
"nickname":this.nickname,
|
||||
"realName":this.realName
|
||||
"realName":this.realName,
|
||||
}},{
|
||||
onResult:(popInfo:HMPopInfo)=>{
|
||||
if (popInfo && popInfo.result && popInfo.result["isRefresh"] !== undefined) {
|
||||
|
||||
@ -6,18 +6,27 @@ import { HashMap,JSON } from "@kit.ArkTS";
|
||||
import { BusinessError } from "@kit.BasicServicesKit";
|
||||
import { promptAction, router } from "@kit.ArkUI";
|
||||
import { PullToRefreshLayout, RefreshController } from "refreshlib";
|
||||
import { HMPopInfo, HMRouterMgr } from "@hadss/hmrouter";
|
||||
import { HMLifecycleState, HMPopInfo, HMRouterMgr } from "@hadss/hmrouter";
|
||||
|
||||
@Component
|
||||
export struct MassSendingComp {
|
||||
export struct GroupMessageSendingComp {
|
||||
@State pageNumber: number = 1
|
||||
@State totalPage: number = 1
|
||||
scroller = new Scroller()
|
||||
@State messageList: ApiItem[] = []
|
||||
public controller: RefreshController = new RefreshController()
|
||||
private lifecycleOwner = HMRouterMgr.getCurrentLifecycleOwner()
|
||||
private handleCallback = () => {
|
||||
this.initGetGroupListAction()
|
||||
}
|
||||
|
||||
aboutToAppear(): void {
|
||||
this.initGetGroupListAction()
|
||||
this.lifecycleOwner?.addObserver(HMLifecycleState.onShown,this.handleCallback)
|
||||
}
|
||||
|
||||
aboutToDisappear(): void {
|
||||
this.lifecycleOwner?.removeObserver(HMLifecycleState.onShown,this.handleCallback)
|
||||
}
|
||||
|
||||
initGetGroupListAction() {
|
||||
@ -1,4 +1,4 @@
|
||||
import { HMPopInfo, HMRouter, HMRouterMgr } from "@hadss/hmrouter"
|
||||
import { HMLifecycleState, HMPopInfo, HMRouter, HMRouterMgr } from "@hadss/hmrouter"
|
||||
import { BasicConstant, hdHttp, HdNav, HdLoadingDialog, logger, HdResponse, ChangeUtil,
|
||||
DefaultHintProWindows,
|
||||
authStore,
|
||||
@ -12,6 +12,10 @@ import { BusinessError } from "@kit.BasicServicesKit";
|
||||
@Component
|
||||
export struct PatientCommonSettingComp {
|
||||
private params: ESObject = HMRouterMgr.getCurrentParam()
|
||||
private lifecycleOwner = HMRouterMgr.getCurrentLifecycleOwner()
|
||||
private handleCallback = () => {
|
||||
this.getPatientsInfo()
|
||||
}
|
||||
@State itemList:Record<string,string> = {}
|
||||
scroller:Scroller = new Scroller()
|
||||
private hintWindowDialog!: CustomDialogController
|
||||
@ -45,6 +49,11 @@ export struct PatientCommonSettingComp {
|
||||
aboutToAppear(): void {
|
||||
this.getPatientsInfo()
|
||||
this.hintPopWindowDialog()
|
||||
this.lifecycleOwner?.addObserver(HMLifecycleState.onShown,this.handleCallback)
|
||||
}
|
||||
|
||||
aboutToDisappear(): void {
|
||||
this.lifecycleOwner?.removeObserver(HMLifecycleState.onShown,this.handleCallback)
|
||||
}
|
||||
|
||||
getPatientsInfo() {
|
||||
@ -190,8 +199,9 @@ export struct PatientCommonSettingComp {
|
||||
.margin({ left: 15 })
|
||||
.layoutWeight(1)
|
||||
Text(ChangeUtil.stringIsUndefinedAndNull(this.itemList.groupType) ? '通过分组给患者分类' : this.itemList.groupType)
|
||||
.width('50%')
|
||||
.width('60%')
|
||||
.textAlign(TextAlign.End)
|
||||
.maxLines(1)
|
||||
.margin({ right: 10 })
|
||||
.fontSize(15)
|
||||
.fontColor('#666666')
|
||||
@ -217,7 +227,7 @@ export struct PatientCommonSettingComp {
|
||||
.textOverflow({overflow:TextOverflow.Ellipsis})
|
||||
.maxLines(1)
|
||||
.textAlign(TextAlign.End)
|
||||
.width('50%')
|
||||
.width('60%')
|
||||
.margin({ right: 10 })
|
||||
.fontSize(15)
|
||||
.fontColor('#666666')
|
||||
|
||||
@ -8,15 +8,18 @@ import { TextSectionAttribute,LastSpanAttribute } from '../utils/Models'
|
||||
import { applyListModel } from '../models/ApplyModel'
|
||||
import { TextExpandView } from '../views/TextExpandView'
|
||||
import call from '@ohos.telephony.call'
|
||||
import { HMLifecycleContext, HMRouter, HMRouterMgr, IHMLifecycle } from "@hadss/hmrouter"
|
||||
import { HMLifecycleContext, HMLifecycleState, HMRouter, HMRouterMgr, IHMLifecycle } from "@hadss/hmrouter"
|
||||
import { ChatKitClient } from '@nimkit/chatkit';
|
||||
|
||||
@HMRouter({ pageUrl: 'PatientDetailsComp' })
|
||||
@Component
|
||||
export struct PatientDetailsComp {
|
||||
scroller:Scroller = new Scroller()
|
||||
@Consume@Watch('onRefreshAction') refreshFlag: boolean
|
||||
private params: ESObject = HMRouterMgr.getCurrentParam()
|
||||
private lifecycleOwner = HMRouterMgr.getCurrentLifecycleOwner()
|
||||
private handleCallback = () => {
|
||||
this.getPatientCardData()
|
||||
}
|
||||
// @State params:Record<string, string> = router.getParams() as Record<string, string>
|
||||
@State groupArray:Array<Record<string,string>> = []
|
||||
@State footerArray:Array<Record<string,string | ResourceStr>> = [{"img":$r('app.media.sendMessage_blackBtn'),"title":"发消息"},{"img":$r('app.media.fuifangPlan_blackBtn'),"title":"制定随访计划"},{"img":$r('app.media.listBing_blackBtn'),"title":"记录病情"}]
|
||||
@ -36,12 +39,13 @@ export struct PatientDetailsComp {
|
||||
alignment: DialogAlignment.Center
|
||||
})
|
||||
|
||||
onRefreshAction() {
|
||||
this.getPatientCardData()
|
||||
}
|
||||
|
||||
aboutToAppear(): void {
|
||||
this.getPatientCardData()
|
||||
this.lifecycleOwner?.addObserver(HMLifecycleState.onShown,this.handleCallback)
|
||||
}
|
||||
|
||||
aboutToDisappear(): void {
|
||||
this.lifecycleOwner?.removeObserver(HMLifecycleState.onShown,this.handleCallback)
|
||||
}
|
||||
|
||||
getPatientCardData(){
|
||||
@ -384,6 +388,11 @@ export struct PatientDetailsComp {
|
||||
HMRouterMgr.push({pageUrl:"RecordTheIllnessComp",
|
||||
param:{"patient_uuid":this.params.patient_uuid}})
|
||||
} else {
|
||||
const currentStack = HMRouterMgr.getCurrentPathStack()
|
||||
if (currentStack?.getParamByName('ChatP2PPage').length == 1) {
|
||||
HMRouterMgr.popAsync({pageUrl:'ChatP2PPage'})
|
||||
return
|
||||
}
|
||||
preferenceStore.setItemString('gdxz_consult_uuid',this.params.patient_uuid)
|
||||
preferenceStore.setItemString('gdxz_sessionType',BasicConstant.general)
|
||||
HMRouterMgr.push({ pageUrl: 'ChatP2PPage' , param: {
|
||||
|
||||
@ -6,7 +6,7 @@ import HashMap from '@ohos.util.HashMap'
|
||||
import { patientListModel } from '../models/PatientsGroupModel'
|
||||
import { HMPopInfo, HMRouter, HMRouterMgr } from "@hadss/hmrouter"
|
||||
|
||||
@HMRouter({ pageUrl: 'PatientsListComp' })
|
||||
@HMRouter({ pageUrl: 'PatientsListComp',singleton:true })
|
||||
@Component
|
||||
export struct PatientsListComp {
|
||||
private params: ESObject = HMRouterMgr.getCurrentParam()
|
||||
|
||||
@ -5,6 +5,7 @@ import { BusinessError } from '@kit.BasicServicesKit';
|
||||
import HashMap from '@ohos.util.HashMap'
|
||||
import { patientListModel } from '../models/PatientsGroupModel'
|
||||
import { HMPopInfo, HMRouter, HMRouterMgr } from "@hadss/hmrouter"
|
||||
import { it } from '@ohos/hypium';
|
||||
|
||||
@HMRouter({ pageUrl: 'PatientsListSearchComp' })
|
||||
@Component
|
||||
@ -193,11 +194,11 @@ export struct PatientsListSearchComp {
|
||||
.height(80)
|
||||
.backgroundColor(Color.White)
|
||||
.onClick(()=>{
|
||||
if(this.params?.name == '随访计划') {
|
||||
HMRouterMgr.pop({param:{"patient_uuid":item.uuid,"nickname":item.nickname,"realname":item.realname,"realName":item.realName}})
|
||||
} else {
|
||||
HMRouterMgr.push({pageUrl:'PatientDetailsComp',param:{"patient_uuid":item.uuid}})
|
||||
// item.isSelected = !item.isSelected;
|
||||
// this.patientsList = [...this.patientsList];
|
||||
// const selectedNum = this.patientsList.filter(item => item.isSelected == true).length;
|
||||
// this.naviRightTitle = '确定('+selectedNum+')'
|
||||
}
|
||||
})
|
||||
Blank()
|
||||
.width('80%')
|
||||
|
||||
@ -7,7 +7,7 @@ import HashMap from '@ohos.util.HashMap';
|
||||
import { groupRequest,groupRequestCall,groupModel,patientListModel } from '../models/PatientsGroupModel'
|
||||
import { HMRouterMgr, HMRouterPathInfo, HMRouterPathCallback, HMRouter, HMPopInfo } from "@hadss/hmrouter"
|
||||
|
||||
@HMRouter({pageUrl:'SelectedPatientGroupComp'})
|
||||
@HMRouter({pageUrl:'SelectedPatientGroupComp',singleton:true})
|
||||
@Component
|
||||
export struct SelectedPatientGroupComp {
|
||||
private params: ESObject = HMRouterMgr.getCurrentParam()
|
||||
|
||||
@ -13,7 +13,7 @@ import { TeachDialog } from "@nimkit/chatkit_ui"
|
||||
import { PerfactInputSheet } from "@itcast/basic/src/main/ets/Views/PerfactInputSheet"
|
||||
import { NewWaDialog } from "@nimkit/chatkit_ui/src/main/ets/view/NewWaDialog"
|
||||
|
||||
@HMRouter({pageUrl:'SendGroupMessageComp'})
|
||||
@HMRouter({pageUrl:'SendGroupMessageComp',singleton:true})
|
||||
@Component
|
||||
export struct SendGroupMessageComp {
|
||||
private params: ESObject = HMRouterMgr.getCurrentParam()
|
||||
@ -29,24 +29,21 @@ export struct SendGroupMessageComp {
|
||||
dialogController: CustomDialogController = new CustomDialogController({
|
||||
builder: TripleOptionDialog({ title: '温馨提示',subTitle:'',oneButtonTitle:'单独选择',twoButtonTitle:'分组选择',buttonSelected:(actionType:string)=>{
|
||||
if (actionType == '单独选择') {
|
||||
const currentStack = HMRouterMgr.getCurrentPathStack()
|
||||
if (currentStack?.getParamByName('PatientsListComp').length == 1) {
|
||||
HMRouterMgr.popAsync({pageUrl:'PatientsListComp'})
|
||||
return
|
||||
}
|
||||
HMRouterMgr.push({pageUrl:'PatientsListComp',
|
||||
param:{group_uuid:"",selectedPatients:[],pageName:"群发消息"}
|
||||
},{
|
||||
onResult:(popInfo:HMPopInfo)=>{
|
||||
if (popInfo && popInfo.result && popInfo.result["isRefresh"] !== undefined) {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
HMRouterMgr.push({pageUrl:'SelectedPatientGroupComp'
|
||||
},{
|
||||
onResult:(popInfo:HMPopInfo)=>{
|
||||
if (popInfo && popInfo.result && popInfo.result["isRefresh"] !== undefined) {
|
||||
|
||||
const currentStack = HMRouterMgr.getCurrentPathStack()
|
||||
if (currentStack?.getParamByName('SelectedPatientGroupComp').length == 1) {
|
||||
HMRouterMgr.popAsync({pageUrl:'SelectedPatientGroupComp'})
|
||||
return
|
||||
}
|
||||
}
|
||||
})
|
||||
HMRouterMgr.push({pageUrl:'SelectedPatientGroupComp'})
|
||||
}
|
||||
}}),
|
||||
alignment: DialogAlignment.Center,
|
||||
|
||||
@ -6,6 +6,9 @@ import { PLVMediaPlayerStartUp } from '../startup/PLVMediaPlayerStartUp';
|
||||
import contextConstant from '@ohos.app.ability.contextConstant';
|
||||
import { patientDbManager } from '@itcast/basic';
|
||||
import { HMRouterMgr } from '@hadss/hmrouter'
|
||||
import { BusinessError } from '@kit.BasicServicesKit'
|
||||
import pushService from '@hms.core.push.pushService'
|
||||
|
||||
const DOMAIN = 0x0000;
|
||||
|
||||
export default class EntryAbility extends UIAbility {
|
||||
@ -24,6 +27,12 @@ export default class EntryAbility extends UIAbility {
|
||||
logLevel: 'DEBUG'
|
||||
});
|
||||
|
||||
notificationManager.requestEnableNotification().then(() => {
|
||||
console.info(`[ANS] requestEnableNotification success`);
|
||||
}).catch((err:BusinessError) => {
|
||||
console.error(`[ANS] requestEnableNotification failed, code is ${err.code}, message is ${err.message}`);
|
||||
});
|
||||
|
||||
this.context.area = contextConstant.AreaMode.EL2
|
||||
PLVMediaPlayerStartUp.start(this.context)
|
||||
}
|
||||
|
||||
@ -104,7 +104,7 @@ export class NimRepository {
|
||||
//linkUrl: 'imtest-jd.netease.im:8091'
|
||||
},
|
||||
pushServiceConfig: {
|
||||
harmonyCertificateName: "DEMO_HMOS_PUSH"
|
||||
harmonyCertificateName: "igandanHarmony"
|
||||
},
|
||||
databaseServiceConfig: {
|
||||
encrypt: false,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { MassSendingComp } from 'patient'
|
||||
import { GroupMessageSendingComp } from 'patient'
|
||||
import { HMDefaultGlobalAnimator, HMNavigation } from '@hadss/hmrouter';
|
||||
import { AttributeUpdater } from '@kit.ArkUI';
|
||||
|
||||
@ -32,7 +32,7 @@ struct GroupSendMessagePage {
|
||||
modifier:this.modifier
|
||||
}
|
||||
}) {
|
||||
MassSendingComp()
|
||||
GroupMessageSendingComp()
|
||||
}
|
||||
}
|
||||
.height('100%')
|
||||
|
||||
@ -3,12 +3,6 @@ import { PatientDetailsComp } from 'patient'
|
||||
@Entry
|
||||
@Component
|
||||
struct PatientDetailsPage {
|
||||
@Provide refreshFlag:boolean = false;
|
||||
|
||||
onPageShow(): void {
|
||||
this.refreshFlag = !this.refreshFlag;
|
||||
}
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
PatientDetailsComp()
|
||||
|
||||
@ -44,6 +44,10 @@
|
||||
{
|
||||
"name": "ohos.extension.backup",
|
||||
"resource": "$profile:backup_config"
|
||||
},
|
||||
{
|
||||
"name":"client_id",
|
||||
"value":"6917576212737428569"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user