Merge remote-tracking branch 'origin/master'

This commit is contained in:
xiaoxiao 2025-08-05 09:46:31 +08:00
commit 36455701a5
23 changed files with 512 additions and 185 deletions

View File

@ -356,7 +356,8 @@ export function getOperateMenuSize(msgInfo: NIMMessageInfo | undefined) {
* @returns 消息长按弹窗宽度 * @returns 消息长按弹窗宽度
*/ */
export function computeOperateViewWidth(msg: NIMMessageInfo | undefined): number { 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 { export function computeOperateViewHeight(msg: NIMMessageInfo | undefined): number {

View File

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

View File

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

View File

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

View File

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

View File

@ -3,6 +3,7 @@ import { InterrogationBean } from '../model/ConsulModel'
import { router } from '@kit.ArkUI' import { router } from '@kit.ArkUI'
import { calculateExactAge } from '@itcast/basic' import { calculateExactAge } from '@itcast/basic'
import { HMRouterMgr } from '@hadss/hmrouter';
@Preview @Preview
@ -27,8 +28,7 @@ export struct ItemCompMany {
}.fontSize(19).layoutWeight(1) }.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:'') 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}) .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) Text(this.item.disease_describe)
@ -63,10 +63,13 @@ export struct ItemCompMany {
.width('100%') .width('100%')
.padding(10) .padding(10)
.onClick(() => { .onClick(() => {
router.pushUrl({ HMRouterMgr.push({ pageUrl: 'InterrogationDetailComp' , param: {
url: 'pages/Netease/InterrogationDetailCompPage', uuid: this.item.step1_uuid,isHistory:this.isHistory+''
params: { 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, customStyle: true,
alignment: DialogAlignment.Center alignment: DialogAlignment.Center
}) })
private lifecycleOwner = HMRouterMgr.getCurrentLifecycleOwner() @State isLastPage:boolean=false
private handleCallback = () => { // private lifecycleOwner = HMRouterMgr.getCurrentLifecycleOwner()
this.initData(0) // private handleCallback = () => {
// if(this.page>1&&!this.isLastPage)
} // {
// this.page=this.page-1
// }
// this.initData(0)
//
// }
aboutToAppear() { aboutToAppear() {
this.lifecycleOwner?.addObserver(HMLifecycleState.onShown,this.handleCallback) // this.lifecycleOwner?.addObserver(HMLifecycleState.onShown,this.handleCallback)
} }
aboutToDisappear(): void { aboutToDisappear(): void {
this.lifecycleOwner?.removeObserver(HMLifecycleState.onShown,this.handleCallback) // this.lifecycleOwner?.removeObserver(HMLifecycleState.onShown,this.handleCallback)
} }
onUpdate() { onUpdate() {
@ -88,7 +93,7 @@ export struct ListCompMany {
this.list=[] this.list=[]
if(json.data!=null&&json.data.list!=null&&json.data.list.length>0) 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) this.list.push(...json.data.list)
} }
this.isLastPage=json.data.isLastPage
if (json.data.isLastPage) { if (this.isLastPage) {
this.controller.finished() this.controller.finished()
} else { } else {
this.page++ this.page++

View File

@ -5,6 +5,7 @@ import { promptAction, router } from '@kit.ArkUI'
import { BusinessError } from '@kit.BasicServicesKit'; import { BusinessError } from '@kit.BasicServicesKit';
import { EmptyViewComp,HdLoadingDialog } from '@itcast/basic' import { EmptyViewComp,HdLoadingDialog } from '@itcast/basic'
import HashMap from '@ohos.util.HashMap'; import HashMap from '@ohos.util.HashMap';
import { HMLifecycleState, HMRouterMgr } from '@hadss/hmrouter';
@Component @Component
@ -46,6 +47,18 @@ export struct ListCompPublic {
this.initData(0) 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) initData(type:number)
{ {

View File

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

View File

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

View File

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

View File

@ -8,14 +8,14 @@ import { HashMap } from '@kit.ArkTS';
import { GetInterrogationBean, ConsultPhoto, SupplementListBean, AnswerListBean } from '../model/ConsulModel'; import { GetInterrogationBean, ConsultPhoto, SupplementListBean, AnswerListBean } from '../model/ConsulModel';
import { BusinessError } from '@kit.BasicServicesKit'; import { BusinessError } from '@kit.BasicServicesKit';
import { promptAction, router } from '@kit.ArkUI'; import { promptAction, router } from '@kit.ArkUI';
import { HMLifecycleState, HMRouter, HMRouterMgr } from '@hadss/hmrouter';
@HMRouter({ pageUrl: 'InterrogationDetailComp' })
@Component @Component
export struct InterrogationDetailComp { export struct InterrogationDetailComp {
@State patientName: string='' ; @State patientName: string='' ;
hashMap: HashMap<string, string> = new HashMap(); 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 state: string='1' ;
@State createDate: string='' ; @State createDate: string='' ;
@State content: string='' ; @State content: string='' ;
@ -27,6 +27,7 @@ export struct InterrogationDetailComp {
@State supplementList:SupplementListBean[]=[] @State supplementList:SupplementListBean[]=[]
@State AnswerList:AnswerListBean[]=[] @State AnswerList:AnswerListBean[]=[]
@State flag_more:boolean=true @State flag_more:boolean=true
@State answer_id:string=''
scroller = new Scroller() scroller = new Scroller()
dialog: CustomDialogController = new CustomDialogController({ dialog: CustomDialogController = new CustomDialogController({
builder: HdLoadingDialog({ message: '加载中...' }), builder: HdLoadingDialog({ message: '加载中...' }),
@ -34,11 +35,18 @@ export struct InterrogationDetailComp {
alignment: DialogAlignment.Center alignment: DialogAlignment.Center
}) })
private lifecycleOwner = HMRouterMgr.getCurrentLifecycleOwner()
aboutToAppear() { private handleCallback = () => {
this.initData()
this.initData()
} }
aboutToAppear() {
this.initData()
this.lifecycleOwner?.addObserver(HMLifecycleState.onShown,this.handleCallback)
}
aboutToDisappear(): void {
this.lifecycleOwner?.removeObserver(HMLifecycleState.onShown,this.handleCallback)
}
initData() initData()
{ {
@ -64,7 +72,13 @@ export struct InterrogationDetailComp {
} }
this.supplementList=json.data.SupplementList this.supplementList=json.data.SupplementList
this.AnswerList=json.data.AnswerList 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) => { }).catch((err: BusinessError) => {
@ -77,7 +91,12 @@ export struct InterrogationDetailComp {
build() { build() {
Column() { Column() {
HdNav({ title: '问题详情', showRightIcon: false, showLeftIcon: true}) HdNav({ title: '问题详情', showRightIcon: false, showLeftIcon: true ,isLeftAction: true,
leftItemAction: () => {
HMRouterMgr.pop()
}})
Scroll(this.scroller) { Scroll(this.scroller) {
Column() { Column() {
@ -258,25 +277,25 @@ export struct InterrogationDetailComp {
Button({ type: ButtonType.Normal }){ Button({ type: ButtonType.Normal }){
Text(this.params.isHistory =='false'?'我要回答':'我要编辑') Text(this.params.isHistory =='false'&&this.answer_id==''?'我要回答':'我要编辑')
} }
.width('100%') .width('100%')
.height(53) .height(53)
.backgroundColor($r('app.color.patient_theme')) .backgroundColor($r('app.color.patient_theme'))
.fontColor(Color.White) .fontColor(Color.White)
.onClick(() => { .onClick(() => {
if(this.params.isHistory =='false') if(this.params.isHistory =='false'&&this.answer_id=='')
{ {
router.pushUrl({ router.pushUrl({
url: 'pages/Netease/MyOpinionPage', 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 else
{ {
router.pushUrl({ router.pushUrl({
url: 'pages/Netease/MyOpinionPage', 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() { Column() {
HdTwoNav({ title: '患者消息', showRightIcon: true,showRightIcon2: true, showLeftIcon: true,showRightText:false, 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:()=>{ rightIcon2:$r('app.media.selected_hospital_ws'), rightIcon:$r('app.media.icon_group_send'),rightItemAction:()=>{
router.pushUrl({ // router.pushUrl({
url:'pages/PatientsPage/GroupSendMessagePage', // url:'pages/PatientsPage/GroupSendMessagePage',
}) // })
HMRouterMgr.push({pageUrl:'MassSendingComp',param:"患者消息"})
},rightItemAction2:()=>{ },rightItemAction2:()=>{
HMRouterMgr.push({pageUrl:'PatientsListSearchComp'}) HMRouterMgr.push({pageUrl:'PatientsListSearchComp'})

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,10 +1,11 @@
import { TabBarCompModel } from '../model/TabBarCompModel' import { TabBarCompModel } from '../model/TabBarCompModel'
import { TabBarItems } from '../components/TabBarItems' 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 { MessageComp } from '../view/MessageComp'
import { PatientListComp } from './PatientListComp' import { PatientListComp, updateExtraData } from './PatientListComp'
import { FollowPlanListComp } from 'patient' import { applyListCallBacl, FollowPlanListComp } from 'patient'
import { HMRouterMgr } from '@hadss/hmrouter' import { HMLifecycleState, HMRouterMgr } from '@hadss/hmrouter'
import { BusinessError } from '@kit.BasicServicesKit'
@Component @Component
export struct TabBarComp { export struct TabBarComp {
@ -13,57 +14,128 @@ export struct TabBarComp {
bottomHeight: number = 0 bottomHeight: number = 0
@Link @Link
activeIndex: number activeIndex: number
private lifecycleOwner = HMRouterMgr.getCurrentLifecycleOwner()
private handleCallback = () => {
this.getApplyList()
}
aboutToAppear() { 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 @Builder
TabBarBuilder(item: TabBarCompModel, index: number) { TabBarBuilder(item: string, index: number) {
Column({ space: BasicConstant.SPACE_SM }) { Row({ space: BasicConstant.SPACE_SM }) {
Text(item.label) Text(item)
.fontSize(16) .fontSize(16)
.fontColor(this.activeIndex === index ? $r('app.color.top_title'):$r('app.color.common_gray_01') ) .fontColor(this.activeIndex === index ? $r('app.color.top_title'):$r('app.color.common_gray_01') )
.animation({ duration: 300 }) .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() { build() {
// Navigation(this.pathStack) { Tabs({
Tabs({ index: this.activeIndex
index: this.activeIndex }) {
}) { TabContent() {
ForEach(TabBarItems, (item: TabBarCompModel, index: number) => { if (this.activeIndex === 0) MessageComp()
TabContent() { }
// if (index === 0) MessageComp({ pathStack: this.pathStack }) .tabBar(this.TabBarBuilder('患者消息', 0))
if (index === 0) MessageComp() .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
else if (index === 1) PatientListComp() TabContent() {
else if (index === 2) FollowPlanListComp() 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') }) .tabBar(this.TabBarBuilder('患者列表', 1))
.barPosition(BarPosition.End) .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
.barHeight(50) TabContent() {
.scrollable(false) if (this.activeIndex === 2) FollowPlanListComp()
.margin({ bottom: this.bottomHeight }) }
.onTabBarClick((index) => { .tabBar(this.TabBarBuilder('随访计划', 2))
this.activeIndex = index .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
// if(index==2)
// { }
// HMRouterMgr.push({pageUrl:"FollowPlanListComp", .divider({ strokeWidth: $r('app.float.common_border_width'), color: $r('app.color.common_gray_border') })
// param:{ .barPosition(BarPosition.End)
// "patient_uuid":'', .barHeight(50)
// "FollowUpUuid":'', .scrollable(false)
// "nickname":'', .margin({ bottom: this.bottomHeight })
// "realName":''}}) .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) // }.mode(NavigationMode.Auto)
// .hideTitleBar(true) // .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 { 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 { ListCompPublic } from '../components/ListCompPublic'
import { ListCompMany } from '../components/ListCompMany' import { ListCompMany } from '../components/ListCompMany'
import { StopNoticeComp } from './StopNoticeComp' import { StopNoticeComp } from './StopNoticeComp'
@ -7,9 +7,10 @@ import { HMLifecycleState, HMRouterMgr } from '@hadss/hmrouter'
import { HashMap } from '@kit.ArkTS' import { HashMap } from '@kit.ArkTS'
import { BusinessError } from '@kit.BasicServicesKit' import { BusinessError } from '@kit.BasicServicesKit'
import { PatientNoticeModel } from '../model/PatientNoticeModel' import { PatientNoticeModel } from '../model/PatientNoticeModel'
import { promptAction } from '@kit.ArkUI' import { LengthMetrics, promptAction, router } from '@kit.ArkUI'
import { ArrangementsComp } from './ArrangementsComp' import { ArrangementsComp } from './ArrangementsComp'
import { ListWorkPlaceBean } from '../model/ListOutPatientModel' import { ListWorkPlaceBean } from '../model/ListOutPatientModel'
import { PerfactInputSheet } from '@itcast/basic/src/main/ets/Views/PerfactInputSheet'
@Component @Component
export struct TabBarOutComp { export struct TabBarOutComp {
@ -21,7 +22,53 @@ export struct TabBarOutComp {
@State uuid:string='' @State uuid:string=''
@State textInfo:string='发布新的停诊' @State textInfo:string='发布新的停诊'
@State stopnum: number = 0 @State stopnum: number = 0
@State arrnum: number = 0
@State Changestop:boolean=false
@State Changearr:boolean=false
@State worknum: number = 0 @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 lifecycleOwner = HMRouterMgr.getCurrentLifecycleOwner()
private handleCallback = () => { private handleCallback = () => {
this.mailanNoticeGet() this.mailanNoticeGet()
@ -30,7 +77,7 @@ export struct TabBarOutComp {
} }
aboutToAppear() { aboutToAppear() {
this.mailanNoticeGet() this.mailanNoticeGet()
this.initDialog()
this.listWorkPlace() this.listWorkPlace()
this.lifecycleOwner?.addObserver(HMLifecycleState.onShown,this.handleCallback) 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:()=> { HdNav({ title: '出/停诊公告', showLeftIcon: true, showRightIcon: true,rightIcon:$r('app.media.zhiyedidian'),rightItemAction:()=> {
HMRouterMgr.push({ pageUrl: 'Practicelocation' }) 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({ Tabs({
index: this.activeIndex index: this.activeIndex
}) { }) {
@ -74,14 +141,20 @@ export struct TabBarOutComp {
{ {
StopNoticeComp({ onEvent:(data:number)=> { StopNoticeComp({ onEvent:(data:number)=> {
this.stopnum = data; // 接收子组件数据 this.stopnum = data; // 接收子组件数据
} }) }, onChangeEvent:(data:boolean)=> {
this.Changestop = data; // 接收子组件数据
}})
} }
} }
.tabBar(this.TabBarBuilder('停诊公告', 0)) .tabBar(this.TabBarBuilder('停诊公告', 0))
TabContent() { TabContent() {
if(this.activeIndex==1) if(this.activeIndex==1)
{ {
ArrangementsComp() ArrangementsComp({ onEvent:(data:number)=> {
this.arrnum = data; // 接收子组件数据
}, onChangeEvent:(data:boolean)=> {
this.Changearr = data; // 接收子组件数据
} })
} }
} }
.tabBar(this.TabBarBuilder('门诊安排', 1)) .tabBar(this.TabBarBuilder('门诊安排', 1))
@ -126,7 +199,13 @@ export struct TabBarOutComp {
} }
else 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 else
{ {
HMRouterMgr.push({ pageUrl: 'AddOutpatient', param: { HMRouterMgr.push({pageUrl:'AddOutpatient', param: {
isHistory: 'false' 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 { BusinessError } from "@kit.BasicServicesKit";
import { promptAction, router } from "@kit.ArkUI"; import { promptAction, router } from "@kit.ArkUI";
import { PullToRefreshLayout, RefreshController } from "refreshlib"; import { PullToRefreshLayout, RefreshController } from "refreshlib";
import { HMLifecycleState, HMPopInfo, HMRouterMgr } from "@hadss/hmrouter"; import { HMLifecycleState, HMPopInfo, HMRouter, HMRouterMgr } from "@hadss/hmrouter";
@HMRouter({ pageUrl: 'MassSendingComp' })
@Component @Component
export struct GroupMessageSendingComp { export struct GroupMessageSendingComp {
@State pageNumber: number = 1 @State pageNumber: number = 1
@State totalPage: number = 1 @State totalPage: number = 1
scroller = new Scroller() scroller = new Scroller()
@State messageList: ApiItem[] = [] @State messageList: ApiItem[] = []
private params: ESObject = HMRouterMgr.getCurrentParam()
public controller: RefreshController = new RefreshController() public controller: RefreshController = new RefreshController()
private lifecycleOwner = HMRouterMgr.getCurrentLifecycleOwner() private lifecycleOwner = HMRouterMgr.getCurrentLifecycleOwner()
private handleCallback = () => { private handleCallback = () => {
@ -124,9 +125,9 @@ export struct GroupMessageSendingComp {
title: '群发消息', title: '群发消息',
showRightText: false, showRightText: false,
showRightIcon: false, showRightIcon: false,
isLeftAction: true, isLeftAction:this.params?true:false,
leftItemAction: () => { leftItemAction:()=>{
router.back() HMRouterMgr.pop()
} }
}) })

View File

@ -97,6 +97,7 @@ export struct PatientApplyPage {
let json:applyListCallBacl = JSON.parse(res+'') as applyListCallBacl; let json:applyListCallBacl = JSON.parse(res+'') as applyListCallBacl;
if(json.code == 1) { if(json.code == 1) {
if (status == '2') { if (status == '2') {
this.submintMessage(model.patientUuid+'')
this.getApplyList(); this.getApplyList();
// 添加单个患者 // 添加单个患者
const singlePatient: PatientData = { const singlePatient: PatientData = {
@ -119,10 +120,13 @@ export struct PatientApplyPage {
console.info('添加失败'); console.info('添加失败');
} }
promptAction.showToast({ message: '消息已处理', duration: 1000 }) promptAction.showToast({ message: '消息已处理', duration: 1000 })
router.pushUrl({ // router.pushUrl({
url:'pages/PatientsPage/PatientMsgSetPage', // url:'pages/PatientsPage/PatientMsgSetPage',
params:{ 'model':model } // params:{ 'model':model }
}) // })
HMRouterMgr.push({ pageUrl: 'PatientSetMsgPage' , param: {
'model': model
} })
} else if (status == '3') { } else if (status == '3') {
this.pageNumber = 1; this.pageNumber = 1;
this.getApplyList(); this.getApplyList();
@ -225,4 +229,27 @@ export struct PatientApplyPage {
} }
}.width('100%').height('100%').backgroundColor('#f4f4f4') }.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() { build() {
if (this.conversationInfo != null) { if (this.conversationInfo != null) {
Column({ space: 10 }) { Column({ space: 0 }) {
if (this.conversationInfo.stickTop) { // if (this.conversationInfo.stickTop) {
Text($r('app.string.unstick_top_conversation')) // Text($r('app.string.unstick_top_conversation'))
.fontSize(16) // .fontSize(16)
.fontColor('#333333') // .fontColor('#333333')
.onClick(() => { // .onClick(() => {
if (ErrorUtils.checkNetworkAndToast()) { // if (ErrorUtils.checkNetworkAndToast()) {
LocalConversationRepo.stickTopConversation(this.conversationInfo?.conversationId ?? '', false) // LocalConversationRepo.stickTopConversation(this.conversationInfo?.conversationId ?? '', false)
} // }
this.controller.close() // this.controller.close()
}) // })
.height(30) // .height(30)
.width('100%') // .width('100%')
.margin({ top: 15 }) // .margin({ top: 15 })
.textAlign(TextAlign.Center) // .textAlign(TextAlign.Center)
} else { // } else {
Text($r('app.string.stick_top_conversation')) // Text($r('app.string.stick_top_conversation'))
.fontSize(16) // .fontSize(16)
.fontColor('#333333') // .fontColor('#333333')
.onClick(() => { // .onClick(() => {
if (ErrorUtils.checkNetworkAndToast()) { // if (ErrorUtils.checkNetworkAndToast()) {
LocalConversationRepo.stickTopConversation(this.conversationInfo?.conversationId ?? '', true) // LocalConversationRepo.stickTopConversation(this.conversationInfo?.conversationId ?? '', true)
} // }
this.controller.close() // this.controller.close()
}) // })
.height(30) // .height(30)
.width('100%') // .width('100%')
.margin({ top: 15 }) // .margin({ top: 15 })
.textAlign(TextAlign.Center) // .textAlign(TextAlign.Center)
} // }
Line().height(1).backgroundColor('#EFF1F4').width('100%').opacity(0.5) // Line().height(1).backgroundColor('#EFF1F4').width('100%').opacity(0.5)
Text($r('app.string.delete_conversation')) Text($r('app.string.delete_conversation'))
.fontSize(16) .fontSize(16)
.fontColor('#333333') .fontColor('#333333')
@ -55,9 +55,11 @@ export struct LocalConversationOperationDialog {
LocalConversationRepo.deleteConversation(this.conversationInfo?.conversationId ?? '') LocalConversationRepo.deleteConversation(this.conversationInfo?.conversationId ?? '')
this.controller.close() this.controller.close()
}) })
.margin({ top: 25 })
.height(30) .height(30)
.width('100%') .width('100%')
.margin({ bottom: 15 }) // .backgroundColor(Color.Red)
// .margin({ bottom: 15 })
.textAlign(TextAlign.Center) .textAlign(TextAlign.Center)
}.width('100%').backgroundColor($r('sys.color.white')) }.width('100%').backgroundColor($r('sys.color.white'))
} }