群发消息与页面刷新

This commit is contained in:
XiuYun CHEN 2025-08-01 17:18:36 +08:00
parent 3f58565a76
commit 92b91dd65e
23 changed files with 512 additions and 185 deletions

View File

@ -356,7 +356,8 @@ export function getOperateMenuSize(msgInfo: NIMMessageInfo | undefined) {
* @returns 消息长按弹窗宽度
*/
export function computeOperateViewWidth(msg: NIMMessageInfo | undefined): number {
return ChatConst.menuItemWidth * Math.min(getOperateMenuSize(msg), ChatConst.menuItemColumnNum)
// return ChatConst.menuItemWidth * Math.min(getOperateMenuSize(msg), ChatConst.menuItemColumnNum)
return ChatConst.menuItemWidth * 5
}
export function computeOperateViewHeight(msg: NIMMessageInfo | undefined): number {

View File

@ -38,6 +38,7 @@ export class ChatConst {
static readonly menuItemHeight: number = 50;
// 消息长按菜单列数
static readonly menuItemColumnNum: number = 5;
// static readonly menuItemColumnNum: number = 3;
// PIN 消息操作者名称最大长度
static readonly pinOperatorNameMaxLen: number = 15;
// 消息撤回本地存储,是否为本端撤回消息

View File

@ -330,6 +330,10 @@ export struct ChatP2PPage {
let rawAttach = JSON.stringify(jsonData)
this.chatViewModel.sendCustomMessage(BasicConstant.VisitTeach, rawAttach)
}
else
{
HMRouterMgr.push({pageUrl:'OutpatientComp',param:"chat"})
}
}

View File

@ -18,36 +18,36 @@ export struct ConversationOperationDialog {
build() {
if (this.conversationInfo != null) {
Column({ space: 10 }) {
if (this.conversationInfo.stickTop) {
Text($r('app.string.unstick_top_conversation'))
.fontSize(16)
.fontColor('#333333')
.onClick(() => {
if (ErrorUtils.checkNetworkAndToast()) {
ConversationRepo.stickTopConversation(this.conversationInfo?.conversationId ?? '', false)
}
this.controller.close()
})
.height(30)
.width('100%')
.margin({ top: 15 })
.textAlign(TextAlign.Center)
} else {
Text($r('app.string.stick_top_conversation'))
.fontSize(16)
.fontColor('#333333')
.onClick(() => {
if (ErrorUtils.checkNetworkAndToast()) {
ConversationRepo.stickTopConversation(this.conversationInfo?.conversationId ?? '', true)
}
this.controller.close()
})
.height(30)
.width('100%')
.margin({ top: 15 })
.textAlign(TextAlign.Center)
}
Line().height(1).backgroundColor('#EFF1F4').width('100%').opacity(0.5)
// if (this.conversationInfo.stickTop) {
// Text($r('app.string.unstick_top_conversation'))
// .fontSize(16)
// .fontColor('#333333')
// .onClick(() => {
// if (ErrorUtils.checkNetworkAndToast()) {
// ConversationRepo.stickTopConversation(this.conversationInfo?.conversationId ?? '', false)
// }
// this.controller.close()
// })
// .height(30)
// .width('100%')
// .margin({ top: 15 })
// .textAlign(TextAlign.Center)
// } else {
// Text($r('app.string.stick_top_conversation'))
// .fontSize(16)
// .fontColor('#333333')
// .onClick(() => {
// if (ErrorUtils.checkNetworkAndToast()) {
// ConversationRepo.stickTopConversation(this.conversationInfo?.conversationId ?? '', true)
// }
// this.controller.close()
// })
// .height(30)
// .width('100%')
// .margin({ top: 15 })
// .textAlign(TextAlign.Center)
// }
// Line().height(1).backgroundColor('#EFF1F4').width('100%').opacity(0.5)
Text($r('app.string.delete_conversation'))
.fontSize(16)
.fontColor('#333333')

View File

@ -17,6 +17,7 @@ export struct ItemCompArrange {
@Link deleteUuid:string
@Link delete: boolean
deleteCallBack: (uuid:string) => void = () => {};
onChangeEvent?: (change: boolean) => void; // 声明回调函数
@State lineHeight:Length=10;
aboutToAppear(): void {
this.initDialog()
@ -38,10 +39,21 @@ export struct ItemCompArrange {
inputCallBack:(input: string,title:string)=>{
if(this.inputPlaceholder=='您确定修改此条信息吗')
{
HMRouterMgr.push({ pageUrl: 'AddOutpatient', param: {
item: this.item, isHistory: 'true'
} })
}
HMRouterMgr.push({
pageUrl: 'AddOutpatient',
param: {
item: this.item, isHistory: 'true'
}
},
{
onResult: (popInfo: PopInfo) => {
const result = JSON.parse(String(popInfo.result)) as boolean
this.onChangeEvent?.(result); // 触发回调并传参
}
}
)
}
else
{
this.deleteUuid=this.item.uuid

View File

@ -3,6 +3,7 @@ import { InterrogationBean } from '../model/ConsulModel'
import { router } from '@kit.ArkUI'
import { calculateExactAge } from '@itcast/basic'
import { HMRouterMgr } from '@hadss/hmrouter';
@Preview
@ -27,8 +28,7 @@ export struct ItemCompMany {
}.fontSize(19).layoutWeight(1)
Text(this.item.create_date?this.item.create_date.length>10?this.item.create_date.substring(0,10):this.item.create_date:'')
.fontSize(15).fontColor($r('app.color.common_gray_03')).padding({left:5})
// Text('').width(11).height(11).backgroundColor('#ffff3e3e').borderRadius(20).margin({top:-20})
// .visibility(this.isHistory?Visibility.Visible:Visibility.None)
}
Text(this.item.disease_describe)
@ -63,10 +63,13 @@ export struct ItemCompMany {
.width('100%')
.padding(10)
.onClick(() => {
router.pushUrl({
url: 'pages/Netease/InterrogationDetailCompPage',
params: { uuid: this.item.step1_uuid,isHistory:this.isHistory+''}
});
HMRouterMgr.push({ pageUrl: 'InterrogationDetailComp' , param: {
uuid: this.item.step1_uuid,isHistory:this.isHistory+''
} })
// router.pushUrl({
// url: 'pages/Netease/InterrogationDetailCompPage',
// params: { uuid: this.item.step1_uuid,isHistory:this.isHistory+''}
// });
})
}

View File

@ -33,17 +33,22 @@ export struct ListCompMany {
customStyle: true,
alignment: DialogAlignment.Center
})
private lifecycleOwner = HMRouterMgr.getCurrentLifecycleOwner()
private handleCallback = () => {
this.initData(0)
}
@State isLastPage:boolean=false
// private lifecycleOwner = HMRouterMgr.getCurrentLifecycleOwner()
// private handleCallback = () => {
// if(this.page>1&&!this.isLastPage)
// {
// this.page=this.page-1
// }
// this.initData(0)
//
// }
aboutToAppear() {
this.lifecycleOwner?.addObserver(HMLifecycleState.onShown,this.handleCallback)
// this.lifecycleOwner?.addObserver(HMLifecycleState.onShown,this.handleCallback)
}
aboutToDisappear(): void {
this.lifecycleOwner?.removeObserver(HMLifecycleState.onShown,this.handleCallback)
// this.lifecycleOwner?.removeObserver(HMLifecycleState.onShown,this.handleCallback)
}
onUpdate() {
@ -88,7 +93,7 @@ export struct ListCompMany {
this.list=[]
if(json.data!=null&&json.data.list!=null&&json.data.list.length>0)
{
this.list = json.data.list
this.list = [...json.data.list]
}
}
@ -96,8 +101,8 @@ export struct ListCompMany {
{
this.list.push(...json.data.list)
}
if (json.data.isLastPage) {
this.isLastPage=json.data.isLastPage
if (this.isLastPage) {
this.controller.finished()
} else {
this.page++

View File

@ -5,6 +5,7 @@ import { promptAction, router } from '@kit.ArkUI'
import { BusinessError } from '@kit.BasicServicesKit';
import { EmptyViewComp,HdLoadingDialog } from '@itcast/basic'
import HashMap from '@ohos.util.HashMap';
import { HMLifecycleState, HMRouterMgr } from '@hadss/hmrouter';
@Component
@ -46,6 +47,18 @@ export struct ListCompPublic {
this.initData(0)
}
// private lifecycleOwner = HMRouterMgr.getCurrentLifecycleOwner()
// private handleCallback = () => {
// this.initData(0)
//
// }
// aboutToAppear() {
//
// this.lifecycleOwner?.addObserver(HMLifecycleState.onShown,this.handleCallback)
// }
// aboutToDisappear(): void {
// this.lifecycleOwner?.removeObserver(HMLifecycleState.onShown,this.handleCallback)
// }
initData(type:number)
{

View File

@ -104,7 +104,7 @@ export struct AddOutpatient {
this.dialog.close()
let json:BaseBean = JSON.parse(res+'') as BaseBean;
if(json.code == '200') {
HMRouterMgr.pop()
HMRouterMgr.pop({param:true})
} else {
promptAction.showToast({ message: json.message })
}
@ -125,10 +125,6 @@ export struct AddOutpatient {
local:this.local,
inputCallBack: () => {
this.addStopOutPatient()
// HMRouterMgr.pop()
}
}),
keyboardAvoidDistance: LengthMetrics.vp(0), // 设置弹窗底部与键盘顶部间距单位vp
@ -163,8 +159,8 @@ export struct AddOutpatient {
hasBorder: true,
isLeftAction: true,
leftItemAction: () => {
HMRouterMgr.pop()
HMRouterMgr.pop({param:false})
// HMRouterMgr.pop()
}
})

View File

@ -18,6 +18,7 @@ export struct ArrangementsComp {
customStyle: true,
alignment: DialogAlignment.Center
})
@State arrnum: number = 0
@State pageNumber:number = 1;
@State totalPageNumer:number = 1;
@State data:ListOut[]=[];
@ -26,6 +27,8 @@ export struct ArrangementsComp {
@Watch('deleteOutPatient')
delete: boolean=false
@State deleteUuid:string=''
onEvent?: (data: number) => void; // 声明回调函数
onChangeEvent?: (change: boolean) => void; // 声明回调函数
private lifecycleOwner = HMRouterMgr.getCurrentLifecycleOwner()
private handleCallback = () => {
this.getList();
@ -59,6 +62,8 @@ export struct ArrangementsComp {
this.data.push(...json.data.list)
}
this.arrnum=this.data.length
this.onEvent?.(this.arrnum); // 触发回调并传参
this.totalPageNumer =json.data.totalPage;
if (this.data.length > 0) {
this.isEmptyViewVisible = false;
@ -151,7 +156,9 @@ export struct ArrangementsComp {
List({ scroller: this.scroller }) {
ForEach(this.data, (item: ListOut, index) => {
ListItem() {
ItemCompArrange({item:item,deleteUuid:this.deleteUuid,delete:this.delete})
ItemCompArrange({item:item,deleteUuid:this.deleteUuid,delete:this.delete, onChangeEvent:(data:boolean)=> {
this.onChangeEvent?.(data); // 触发回调并传参
} })
}
})
}
@ -172,6 +179,7 @@ export struct ArrangementsComp {
this.dialog.close();
let json:BaseBean = JSON.parse(res+'') as BaseBean;
if(json.code == '200') {
this.onChangeEvent?.(true); // 触发回调并传参
this.getList();
} else {

View File

@ -136,7 +136,7 @@ export struct ConsultationDetailComp {
gdxz_type: BasicConstant.CouTeach,
gdxz_ext_data: ''
}
HMRouterMgr.push({ pageUrl: 'ChatP2PPage' , param: {
HMRouterMgr.replace({ pageUrl: 'ChatP2PPage' , param: {
conversationId: ChatKitClient.nim.conversationIdUtil.p2pConversationId(this.patientUuid
.toLowerCase()),
name: this.patientName,

View File

@ -8,14 +8,14 @@ import { HashMap } from '@kit.ArkTS';
import { GetInterrogationBean, ConsultPhoto, SupplementListBean, AnswerListBean } from '../model/ConsulModel';
import { BusinessError } from '@kit.BasicServicesKit';
import { promptAction, router } from '@kit.ArkUI';
import { HMLifecycleState, HMRouter, HMRouterMgr } from '@hadss/hmrouter';
@HMRouter({ pageUrl: 'InterrogationDetailComp' })
@Component
export struct InterrogationDetailComp {
@State patientName: string='' ;
hashMap: HashMap<string, string> = new HashMap();
@State params:Record<string, string> = router.getParams() as Record<string, string>;
@State params:Record<string, string> = HMRouterMgr.getCurrentParam() as Record<string, string>;
@State state: string='1' ;
@State createDate: string='' ;
@State content: string='' ;
@ -27,6 +27,7 @@ export struct InterrogationDetailComp {
@State supplementList:SupplementListBean[]=[]
@State AnswerList:AnswerListBean[]=[]
@State flag_more:boolean=true
@State answer_id:string=''
scroller = new Scroller()
dialog: CustomDialogController = new CustomDialogController({
builder: HdLoadingDialog({ message: '加载中...' }),
@ -34,11 +35,18 @@ export struct InterrogationDetailComp {
alignment: DialogAlignment.Center
})
aboutToAppear() {
this.initData()
private lifecycleOwner = HMRouterMgr.getCurrentLifecycleOwner()
private handleCallback = () => {
this.initData()
}
aboutToAppear() {
this.initData()
this.lifecycleOwner?.addObserver(HMLifecycleState.onShown,this.handleCallback)
}
aboutToDisappear(): void {
this.lifecycleOwner?.removeObserver(HMLifecycleState.onShown,this.handleCallback)
}
initData()
{
@ -64,7 +72,13 @@ export struct InterrogationDetailComp {
}
this.supplementList=json.data.SupplementList
this.AnswerList=json.data.AnswerList
// if(this.params.isHistory =='true')
// {
let answer=this.AnswerList.find((item)=>authStore.getUser().uuid==item.expert_uuid)
this.answer_id=answer?answer.answer_uuid:''
// }
let a=0
}).catch((err: BusinessError) => {
@ -77,7 +91,12 @@ export struct InterrogationDetailComp {
build() {
Column() {
HdNav({ title: '问题详情', showRightIcon: false, showLeftIcon: true})
HdNav({ title: '问题详情', showRightIcon: false, showLeftIcon: true ,isLeftAction: true,
leftItemAction: () => {
HMRouterMgr.pop()
}})
Scroll(this.scroller) {
Column() {
@ -258,25 +277,25 @@ export struct InterrogationDetailComp {
Button({ type: ButtonType.Normal }){
Text(this.params.isHistory =='false'?'我要回答':'我要编辑')
Text(this.params.isHistory =='false'&&this.answer_id==''?'我要回答':'我要编辑')
}
.width('100%')
.height(53)
.backgroundColor($r('app.color.patient_theme'))
.fontColor(Color.White)
.onClick(() => {
if(this.params.isHistory =='false')
if(this.params.isHistory =='false'&&this.answer_id=='')
{
router.pushUrl({
url: 'pages/Netease/MyOpinionPage',
params: { uuid:this.params.uuid,isHistory:this.params.isHistory,step1_uuid:this.step1_uuid}
params: { uuid:this.answer_id,isHistory:'false',step1_uuid:this.step1_uuid}
});
}
else
{
router.pushUrl({
url: 'pages/Netease/MyOpinionPage',
params: { uuid:this.params.uuid,isHistory:this.params.isHistory,myAnswer:this.getMyanswer(this.AnswerList)}
params: { uuid:this.answer_id,isHistory:'true',myAnswer:this.getMyanswer(this.AnswerList)}
});
}

View File

@ -67,9 +67,10 @@ export struct MessageComp {
Column() {
HdTwoNav({ title: '患者消息', showRightIcon: true,showRightIcon2: true, showLeftIcon: true,showRightText:false,
rightIcon2:$r('app.media.selected_hospital_ws'), rightIcon:$r('app.media.icon_group_send'),rightItemAction:()=>{
router.pushUrl({
url:'pages/PatientsPage/GroupSendMessagePage',
})
// router.pushUrl({
// url:'pages/PatientsPage/GroupSendMessagePage',
// })
HMRouterMgr.push({pageUrl:'MassSendingComp',param:"患者消息"})
},rightItemAction2:()=>{
HMRouterMgr.push({pageUrl:'PatientsListSearchComp'})

View File

@ -1,4 +1,6 @@
import { BasicConstant, ChangePhotoGrids,
import {
authStore,
BasicConstant, ChangePhotoGrids,
ChangeUtil,
hdHttp,
HdLoadingDialog, HdNav,
@ -11,7 +13,11 @@ import { PerfactInputSheet } from "@itcast/basic/src/main/ets/Views/PerfactInput
import { BusinessError } from "@kit.BasicServicesKit"
import { HashMap } from "@kit.ArkTS"
import { StringIsEmpty } from "@nimkit/common"
import { http } from "@kit.NetworkKit"
import { TimestampBean } from "@itcast/basic/src/main/ets/utils/request"
import { bundleManager } from "@kit.AbilityKit"
import { rcp } from "@kit.RemoteCommunicationKit"
import { CryptoJS } from '@ohos/crypto-js'
@Component
export struct MyOpinionComp {
@State photos: string[] = []
@ -97,7 +103,7 @@ export struct MyOpinionComp {
this.photos.push(...selectedUris);
this.maxSelectNumber = 6- this.photos.length;
ChangeUtil.convertUrisOrUrlsToBase64(selectedUris).then(base64Array => {
ChangeUtil.convertUrisOrUrlsToBase64(this.photos).then(base64Array => {
console.info('转换结果:', base64Array+'转换个数:'+base64Array.length)
this.base64Array = base64Array
}).catch((err:BusinessError) => {
@ -233,7 +239,7 @@ export struct MyOpinionComp {
// let req = new rcp.Request("http://example.com", "POST", headers, simpleForm, cookies, transferRange, configuration);
}
async addInterrogationAnswer() {
addInterrogationAnswer() {
this.dialog.open()
this.hashMap.clear();
this.hashMap.set("note",this.text);
@ -249,7 +255,7 @@ export struct MyOpinionComp {
}).catch((err: BusinessError) => {
this.dialog.close()
})
// let req = new rcp.Request("http://example.com", "POST", headers, simpleForm, cookies, transferRange, configuration);
// this.httpReqImg(BasicConstant.addInterrogationAnswer)
}
changeToImg( imgListurl:string[]) {
@ -296,6 +302,19 @@ export struct MyOpinionComp {
}
return imgObject;
}
async getVersion() {
let res = await bundleManager.getBundleInfoForSelf(
bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION |
bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_METADATA
)
return res.versionName
}
}
interface param{

View File

@ -2,7 +2,7 @@ import { HMRouter } from '@hadss/hmrouter';
import { BasicConstant,HdNav } from '@itcast/basic'
import { TabBarOutComp } from './TabBarOutComp';
@HMRouter({ pageUrl: 'OutpatientComp' })
@Component
export struct OutpatientComp {
@State

View File

@ -16,7 +16,7 @@ import { StringIsEmpty } from '@nimkit/common';
import I18n from '@ohos.i18n';
import Intl from '@ohos.intl';
import { BusinessError } from '@kit.BasicServicesKit';
import { HMRouterMgr } from '@hadss/hmrouter';
import { HMLifecycleState, HMRouterMgr } from '@hadss/hmrouter';
let collator = new Intl.Collator(I18n.System.getSystemLocale(), {
usage: 'sort',
@ -65,12 +65,23 @@ export struct PatientListComp {
cornerRadius: 4,
width: '70%',
})
aboutToAppear() {
this. PatientsData()
private lifecycleOwner = HMRouterMgr.getCurrentLifecycleOwner()
private handleCallback = () => {
this.PatientsData()
this.loadPatients()
this.getApplyList()
}
aboutToAppear() {
this.PatientsData()
this.loadPatients()
this.getApplyList()
this.lifecycleOwner?.addObserver(HMLifecycleState.onShown,this.handleCallback)
}
aboutToDisappear(): void {
this.lifecycleOwner?.removeObserver(HMLifecycleState.onShown,this.handleCallback)
}
getApplyList() {
this.dialog.open()
hdHttp.post<string>(BasicConstant.applyList, {
@ -80,6 +91,7 @@ export struct PatientListComp {
let json:applyListCallBacl = JSON.parse(res+'') as applyListCallBacl;
if(json.code == 1) {
this.applyArray = json.data;
this.count=0
if( this.applyArray!=null)
{
this.applyArray.forEach( item=>{
@ -561,7 +573,7 @@ export struct PatientListComp {
}
}
interface updateExtraData {
export interface updateExtraData {
expertUuid: string
}
@CustomDialog

View File

@ -45,7 +45,7 @@ export struct ReleaseOutpatient {
this.dialog.close()
let json:BaseBean = JSON.parse(res+'') as BaseBean;
if(json.code == '200') {
HMRouterMgr.pop()
HMRouterMgr.pop({param:true})
} else {
promptAction.showToast({ message: json.message })
}
@ -67,10 +67,6 @@ export struct ReleaseOutpatient {
date_list:this.reasonIndex === 2 ? this.date_list_temp : this.date_list_normal,
inputCallBack:()=>{
this.addStopOutPatient()
// HMRouterMgr.pop()
}
}),
keyboardAvoidDistance: LengthMetrics.vp(0), // 设置弹窗底部与键盘顶部间距单位vp
@ -172,9 +168,7 @@ export struct ReleaseOutpatient {
{
preferenceStore.setItemString('ReleaseOutpatient',this.noteText)
}
HMRouterMgr.pop()
HMRouterMgr.pop({param:false})
}
}),
@ -201,7 +195,7 @@ export struct ReleaseOutpatient {
}
else
{
HMRouterMgr.pop()
HMRouterMgr.pop({param:false})
}
} })

View File

@ -22,6 +22,7 @@ export struct StopNoticeComp {
@State empty:string='暂无数据'
@State stopnum:number=0
onEvent?: (data: number) => void; // 声明回调函数
onChangeEvent?: (change: boolean) => void; // 声明回调函数
private lifecycleOwner = HMRouterMgr.getCurrentLifecycleOwner()
private handleCallback = () => {
this.getList();
@ -134,6 +135,7 @@ export struct StopNoticeComp {
this.dialog.close();
let json:BaseBean = JSON.parse(res+'') as BaseBean;
if(json.code == '200') {
this.onChangeEvent?.(true); // 触发回调并传参
this.getList();
} else {

View File

@ -1,10 +1,11 @@
import { TabBarCompModel } from '../model/TabBarCompModel'
import { TabBarItems } from '../components/TabBarItems'
import { BasicConstant } from '@itcast/basic'
import { authStore, BasicConstant, hdHttp, HdLoadingDialog, HdResponse } from '@itcast/basic'
import { MessageComp } from '../view/MessageComp'
import { PatientListComp } from './PatientListComp'
import { FollowPlanListComp } from 'patient'
import { HMRouterMgr } from '@hadss/hmrouter'
import { PatientListComp, updateExtraData } from './PatientListComp'
import { applyListCallBacl, FollowPlanListComp } from 'patient'
import { HMLifecycleState, HMRouterMgr } from '@hadss/hmrouter'
import { BusinessError } from '@kit.BasicServicesKit'
@Component
export struct TabBarComp {
@ -13,57 +14,128 @@ export struct TabBarComp {
bottomHeight: number = 0
@Link
activeIndex: number
private lifecycleOwner = HMRouterMgr.getCurrentLifecycleOwner()
private handleCallback = () => {
this.getApplyList()
}
aboutToAppear() {
this.getApplyList()
this.lifecycleOwner?.addObserver(HMLifecycleState.onShown,this.handleCallback)
}
aboutToDisappear(): void {
this.lifecycleOwner?.removeObserver(HMLifecycleState.onShown,this.handleCallback)
}
@State alphabetSelected: number = 0
dialog: CustomDialogController = new CustomDialogController({
builder: HdLoadingDialog({ message: '加载中...' }),
customStyle: true,
alignment: DialogAlignment.Center
})
@State count: number = 0
@Builder
TabBarBuilder(item: TabBarCompModel, index: number) {
Column({ space: BasicConstant.SPACE_SM }) {
Text(item.label)
TabBarBuilder(item: string, index: number) {
Row({ space: BasicConstant.SPACE_SM }) {
Text(item)
.fontSize(16)
.fontColor(this.activeIndex === index ? $r('app.color.top_title'):$r('app.color.common_gray_01') )
.animation({ duration: 300 })
Text(this.count>100?'...':this.count+'')
.width(18)
.height(18)
.fontSize(11)
.textAlign(TextAlign.Center)
.fontColor(Color.White)
.backgroundColor('#ffff3e3e')
.borderRadius(20)
.margin({ top: -20 })
.visibility(this.count>0&&index==1? Visibility.Visible : Visibility.None)
}
}
build() {
// Navigation(this.pathStack) {
Tabs({
index: this.activeIndex
}) {
ForEach(TabBarItems, (item: TabBarCompModel, index: number) => {
TabContent() {
// if (index === 0) MessageComp({ pathStack: this.pathStack })
if (index === 0) MessageComp()
else if (index === 1) PatientListComp()
else if (index === 2) FollowPlanListComp()
Tabs({
index: this.activeIndex
}) {
TabContent() {
if (this.activeIndex === 0) MessageComp()
}
.tabBar(this.TabBarBuilder('患者消息', 0))
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
TabContent() {
if (this.activeIndex === 1) PatientListComp()
}
.tabBar(this.TabBarBuilder(item, index))
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
})
}
.divider({ strokeWidth: $r('app.float.common_border_width'), color: $r('app.color.common_gray_border') })
.barPosition(BarPosition.End)
.barHeight(50)
.scrollable(false)
.margin({ bottom: this.bottomHeight })
.onTabBarClick((index) => {
this.activeIndex = index
// if(index==2)
// {
// HMRouterMgr.push({pageUrl:"FollowPlanListComp",
// param:{
// "patient_uuid":'',
// "FollowUpUuid":'',
// "nickname":'',
// "realName":''}})
// }
})
.tabBar(this.TabBarBuilder('患者列表', 1))
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
TabContent() {
if (this.activeIndex === 2) FollowPlanListComp()
}
.tabBar(this.TabBarBuilder('随访计划', 2))
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
}
.divider({ strokeWidth: $r('app.float.common_border_width'), color: $r('app.color.common_gray_border') })
.barPosition(BarPosition.End)
.barHeight(50)
.scrollable(false)
.margin({ bottom: this.bottomHeight })
.onTabBarClick((index) => {
this.activeIndex = index
})
// Navigation(this.pathStack) {
// Tabs({
// index: this.activeIndex
// }) {
// ForEach(TabBarItems, (item: TabBarCompModel, index: number) => {
// TabContent() {
// if (index === 0) MessageComp()
// else if (index === 1) PatientListComp()
// else if (index === 2) FollowPlanListComp()
//
// }
// .tabBar(this.TabBarBuilder(item, index))
// .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
// })
// }
// .divider({ strokeWidth: $r('app.float.common_border_width'), color: $r('app.color.common_gray_border') })
// .barPosition(BarPosition.End)
// .barHeight(50)
// .scrollable(false)
// .margin({ bottom: this.bottomHeight })
// .onTabBarClick((index) => {
// this.activeIndex = index
// })
// }.mode(NavigationMode.Auto)
// .hideTitleBar(true)
}
getApplyList() {
this.dialog.open()
hdHttp.post<string>(BasicConstant.applyList, {
expertUuid: authStore.getUser().uuid,
} as updateExtraData).then(async (res: HdResponse<string>) => {
this.dialog.close();
let json:applyListCallBacl = JSON.parse(res+'') as applyListCallBacl;
if(json.code == 1) {
this.count=0
if(json.data!=null&&json.data.length>0)
{
json.data.forEach( item=>{
if(1==item.status)
{
this.count++
}
})
}
}
}).catch((err: BusinessError) => {
this.dialog.close();
console.info(`Response fails: ${err}`);
})
}
}

View File

@ -1,5 +1,5 @@
import { TabBarCompModel } from '../model/TabBarCompModel'
import { BasicConstant, hdHttp,HdNav, HdResponse } from '@itcast/basic'
import { BasicConstant, hdHttp, HdLoadingDialog,HdNav, HdResponse, patientDbManager } from '@itcast/basic'
import { ListCompPublic } from '../components/ListCompPublic'
import { ListCompMany } from '../components/ListCompMany'
import { StopNoticeComp } from './StopNoticeComp'
@ -7,9 +7,10 @@ import { HMLifecycleState, HMRouterMgr } from '@hadss/hmrouter'
import { HashMap } from '@kit.ArkTS'
import { BusinessError } from '@kit.BasicServicesKit'
import { PatientNoticeModel } from '../model/PatientNoticeModel'
import { promptAction } from '@kit.ArkUI'
import { LengthMetrics, promptAction, router } from '@kit.ArkUI'
import { ArrangementsComp } from './ArrangementsComp'
import { ListWorkPlaceBean } from '../model/ListOutPatientModel'
import { PerfactInputSheet } from '@itcast/basic/src/main/ets/Views/PerfactInputSheet'
@Component
export struct TabBarOutComp {
@ -21,7 +22,53 @@ export struct TabBarOutComp {
@State uuid:string=''
@State textInfo:string='发布新的停诊'
@State stopnum: number = 0
@State arrnum: number = 0
@State Changestop:boolean=false
@State Changearr:boolean=false
@State worknum: number = 0
dialogs: CustomDialogController = new CustomDialogController({
builder: HdLoadingDialog({ message: '加载中...' }),
customStyle: true,
alignment: DialogAlignment.Center
})
private dialog!:CustomDialogController;
initDialog() {
this.dialog = new CustomDialogController({
builder:PerfactInputSheet({
controller:this.dialog,
inputTitle:'温馨提示',
inputPlaceholder:'您的出/停诊信息有改动,是否通知您的患者?',
needcancelCallBack:true,
style:'2',
okText:'确定',
okColor:$r('app.color.top_title'),
inputCallBack:(input: string,title:string)=>{
if(title=='needcancelCallBack') {
if(this.params)
{
HMRouterMgr.pop()
}
else
{
router.back()
}
}
else
{
this.submintMessage()
}
}}),
keyboardAvoidDistance: LengthMetrics.vp(0), // 设置弹窗底部与键盘顶部间距单位vp
alignment: DialogAlignment.Center,
customStyle: true,
autoCancel: false,
backgroundColor: ('rgba(0,0,0,0.5)'),
height: '100%'
})
}
private params: ESObject = HMRouterMgr.getCurrentParam()
private lifecycleOwner = HMRouterMgr.getCurrentLifecycleOwner()
private handleCallback = () => {
this.mailanNoticeGet()
@ -30,7 +77,7 @@ export struct TabBarOutComp {
}
aboutToAppear() {
this.mailanNoticeGet()
this.initDialog()
this.listWorkPlace()
this.lifecycleOwner?.addObserver(HMLifecycleState.onShown,this.handleCallback)
}
@ -64,7 +111,27 @@ export struct TabBarOutComp {
{
HdNav({ title: '出/停诊公告', showLeftIcon: true, showRightIcon: true,rightIcon:$r('app.media.zhiyedidian'),rightItemAction:()=> {
HMRouterMgr.push({ pageUrl: 'Practicelocation' })
}})
},isLeftAction:true,
leftItemAction:()=>{
if((this.stopnum>0&&this.Changestop)||(this.arrnum>0&&this.Changearr))
{
this.dialog.open()
}
else
{
if(this.params)
{
HMRouterMgr.pop()
}
else
{
router.back()
}
}
},})
Tabs({
index: this.activeIndex
}) {
@ -74,14 +141,20 @@ export struct TabBarOutComp {
{
StopNoticeComp({ onEvent:(data:number)=> {
this.stopnum = data; // 接收子组件数据
} })
}, onChangeEvent:(data:boolean)=> {
this.Changestop = data; // 接收子组件数据
}})
}
}
.tabBar(this.TabBarBuilder('停诊公告', 0))
TabContent() {
if(this.activeIndex==1)
{
ArrangementsComp()
ArrangementsComp({ onEvent:(data:number)=> {
this.arrnum = data; // 接收子组件数据
}, onChangeEvent:(data:boolean)=> {
this.Changearr = data; // 接收子组件数据
} })
}
}
.tabBar(this.TabBarBuilder('门诊安排', 1))
@ -126,7 +199,13 @@ export struct TabBarOutComp {
}
else
{
HMRouterMgr.push({ pageUrl: 'ReleaseOutpatient' })
// HMRouterMgr.push({ pageUrl: 'ReleaseOutpatient' })
HMRouterMgr.push({pageUrl:'ReleaseOutpatient'},{
onResult: (popInfo: PopInfo) => {
const result = JSON.parse(String(popInfo.result)) as boolean
this.Changearr = result
}
})
}
}
@ -138,9 +217,17 @@ export struct TabBarOutComp {
}
else
{
HMRouterMgr.push({ pageUrl: 'AddOutpatient', param: {
isHistory: 'false'
} })
HMRouterMgr.push({pageUrl:'AddOutpatient', param: {
isHistory: 'false'
}},{
onResult: (popInfo: PopInfo) => {
const result = JSON.parse(String(popInfo.result)) as boolean
this.Changestop = result
}
})
// HMRouterMgr.push({ pageUrl: 'AddOutpatient', param: {
// isHistory: 'false'
// } })
}
}
@ -209,6 +296,54 @@ export struct TabBarOutComp {
}
async submintMessage() {
this.dialogs.open()
const patients = await patientDbManager.getAllPatients();
if(patients==null||patients==undefined||patients.length<1)
{
this.dialogs.close()
promptAction.showToast({ message: '暂未读取到随访患者', duration: 1000 })
return
}
else if(patients.length>200)
{
this.dialogs.close()
router.pushUrl({
url:'pages/PatientsPage/GroupSendMessagePage',
})
return
}
let patient_user_uuid=''
patients.forEach(item=>{
patient_user_uuid+=item.uuid+','
})
patient_user_uuid=patient_user_uuid.slice(0,-1)
const hashMap: HashMap<string, string> = new HashMap();
hashMap.set('msg_type','5')
hashMap.set('msg_content','')
hashMap.set('patient_user_uuid',patient_user_uuid)
hdHttp.httpReq<string>(BasicConstant.addGroupSendMsg4YunXin,hashMap).then(async (res: HdResponse<string>) => {
this.dialogs.close()
let json:Record<string,string> = JSON.parse(res+'') as Record<string,string>;
if(json.code == '200') {
promptAction.showToast({ message: '消息已发出', duration: 1000 })
if(this.params)
{
HMRouterMgr.pop()
}
else
{
router.back()
}
} else {
promptAction.showToast({ message: json.message, duration: 1000 })
}
}).catch((err: BusinessError) => {
console.info(`Response fails: ${err}`);
})
}
}

View File

@ -6,14 +6,15 @@ import { HashMap,JSON } from "@kit.ArkTS";
import { BusinessError } from "@kit.BasicServicesKit";
import { promptAction, router } from "@kit.ArkUI";
import { PullToRefreshLayout, RefreshController } from "refreshlib";
import { HMLifecycleState, HMPopInfo, HMRouterMgr } from "@hadss/hmrouter";
import { HMLifecycleState, HMPopInfo, HMRouter, HMRouterMgr } from "@hadss/hmrouter";
@HMRouter({ pageUrl: 'MassSendingComp' })
@Component
export struct GroupMessageSendingComp {
@State pageNumber: number = 1
@State totalPage: number = 1
scroller = new Scroller()
@State messageList: ApiItem[] = []
private params: ESObject = HMRouterMgr.getCurrentParam()
public controller: RefreshController = new RefreshController()
private lifecycleOwner = HMRouterMgr.getCurrentLifecycleOwner()
private handleCallback = () => {
@ -124,9 +125,9 @@ export struct GroupMessageSendingComp {
title: '群发消息',
showRightText: false,
showRightIcon: false,
isLeftAction: true,
leftItemAction: () => {
router.back()
isLeftAction:this.params?true:false,
leftItemAction:()=>{
HMRouterMgr.pop()
}
})

View File

@ -97,6 +97,7 @@ export struct PatientApplyPage {
let json:applyListCallBacl = JSON.parse(res+'') as applyListCallBacl;
if(json.code == 1) {
if (status == '2') {
this.submintMessage(model.patientUuid+'')
this.getApplyList();
// 添加单个患者
const singlePatient: PatientData = {
@ -119,10 +120,13 @@ export struct PatientApplyPage {
console.info('添加失败');
}
promptAction.showToast({ message: '消息已处理', duration: 1000 })
router.pushUrl({
url:'pages/PatientsPage/PatientMsgSetPage',
params:{ 'model':model }
})
// router.pushUrl({
// url:'pages/PatientsPage/PatientMsgSetPage',
// params:{ 'model':model }
// })
HMRouterMgr.push({ pageUrl: 'PatientSetMsgPage' , param: {
'model': model
} })
} else if (status == '3') {
this.pageNumber = 1;
this.getApplyList();
@ -225,4 +229,27 @@ export struct PatientApplyPage {
}
}.width('100%').height('100%').backgroundColor('#f4f4f4')
}
submintMessage(patient_user_uuid:string) {
const hashMap: HashMap<string, string> = new HashMap();
hashMap.set('msg_type','1')
hashMap.set('msg_content','你好,我已经是你的随访医生了')
hashMap.set('patient_user_uuid',patient_user_uuid)
// this.dialog.open()
hdHttp.httpReq<string>(BasicConstant.addGroupSendMsg4YunXin,hashMap).then(async (res: HdResponse<string>) => {
// this.dialog.close();
// logger.info('Response addGroupSendMsg4YunXin'+res);
// let json:Record<string,string> = JSON.parse(res+'') as Record<string,string>;
// if(json.code == '200') {
// promptAction.showToast({ message: '消息已发出', duration: 1000 })
//
// } else {
// console.error('群发消息失败:'+json.message)
// promptAction.showToast({ message: json.message, duration: 1000 })
// }
}).catch((err: BusinessError) => {
this.dialog.close();
console.info(`Response fails: ${err}`);
})
}
}

View File

@ -17,37 +17,37 @@ export struct LocalConversationOperationDialog {
build() {
if (this.conversationInfo != null) {
Column({ space: 10 }) {
if (this.conversationInfo.stickTop) {
Text($r('app.string.unstick_top_conversation'))
.fontSize(16)
.fontColor('#333333')
.onClick(() => {
if (ErrorUtils.checkNetworkAndToast()) {
LocalConversationRepo.stickTopConversation(this.conversationInfo?.conversationId ?? '', false)
}
this.controller.close()
})
.height(30)
.width('100%')
.margin({ top: 15 })
.textAlign(TextAlign.Center)
} else {
Text($r('app.string.stick_top_conversation'))
.fontSize(16)
.fontColor('#333333')
.onClick(() => {
if (ErrorUtils.checkNetworkAndToast()) {
LocalConversationRepo.stickTopConversation(this.conversationInfo?.conversationId ?? '', true)
}
this.controller.close()
})
.height(30)
.width('100%')
.margin({ top: 15 })
.textAlign(TextAlign.Center)
}
Line().height(1).backgroundColor('#EFF1F4').width('100%').opacity(0.5)
Column({ space: 0 }) {
// if (this.conversationInfo.stickTop) {
// Text($r('app.string.unstick_top_conversation'))
// .fontSize(16)
// .fontColor('#333333')
// .onClick(() => {
// if (ErrorUtils.checkNetworkAndToast()) {
// LocalConversationRepo.stickTopConversation(this.conversationInfo?.conversationId ?? '', false)
// }
// this.controller.close()
// })
// .height(30)
// .width('100%')
// .margin({ top: 15 })
// .textAlign(TextAlign.Center)
// } else {
// Text($r('app.string.stick_top_conversation'))
// .fontSize(16)
// .fontColor('#333333')
// .onClick(() => {
// if (ErrorUtils.checkNetworkAndToast()) {
// LocalConversationRepo.stickTopConversation(this.conversationInfo?.conversationId ?? '', true)
// }
// this.controller.close()
// })
// .height(30)
// .width('100%')
// .margin({ top: 15 })
// .textAlign(TextAlign.Center)
// }
// Line().height(1).backgroundColor('#EFF1F4').width('100%').opacity(0.5)
Text($r('app.string.delete_conversation'))
.fontSize(16)
.fontColor('#333333')
@ -55,9 +55,11 @@ export struct LocalConversationOperationDialog {
LocalConversationRepo.deleteConversation(this.conversationInfo?.conversationId ?? '')
this.controller.close()
})
.margin({ top: 25 })
.height(30)
.width('100%')
.margin({ bottom: 15 })
// .backgroundColor(Color.Red)
// .margin({ bottom: 15 })
.textAlign(TextAlign.Center)
}.width('100%').backgroundColor($r('sys.color.white'))
}