Merge remote-tracking branch 'origin/master'

# Conflicts:
#	features/register/src/main/ets/view/PerfectUserDataComp.ets
This commit is contained in:
XiuYun CHEN 2025-06-13 17:40:12 +08:00
commit 2ad7db0c7b
4 changed files with 128 additions and 45 deletions

View File

@ -55,3 +55,5 @@ export { Huanzhelast444Model } from './src/main/ets/models/Huanzhelast444Model'
export { huanzheDb } from './src/main/ets/utils/HuanzhelasDbHelper' export { huanzheDb } from './src/main/ets/utils/HuanzhelasDbHelper'
export { HdSearchNav } from './src/main/ets/components/HdSearchNav' export { HdSearchNav } from './src/main/ets/components/HdSearchNav'
export { DefaultHintProWindows } from './src/main/ets/Views/DefaultHintProWindows'

View File

@ -0,0 +1,65 @@
@CustomDialog
export struct DefaultHintProWindows {
@Prop title: string = '温馨提示';
@Prop titleFont: number = 18;
@Prop message: string = '';
@Prop messageFont: number = 16;
@Prop cancleTitle: string = '取消';
@Prop cancleTitleColor:ResourceStr = '#666666';
@Prop confirmTitle:string = '确定';
@Prop confirmTitleColor:ResourceStr = '#000000';
@Prop cancleColor:ResourceStr = '#FFFFFF';
@Prop confirmColor:ResourceStr = '#FFFFFF';
controller: CustomDialogController;
// 添加回调函数属性
private selectedButton: (index: number) => void = () => {};
// 修改构造函数
constructor(controller: CustomDialogController, selectedButton: (index:number) => void) {
super();
this.controller = controller;
this.selectedButton = selectedButton;
}
build() {
Row(){
Column() {
Text(this.title)
.fontSize(this.titleFont)
.fontWeight(FontWeight.Bold)
.textAlign(TextAlign.Center)
.margin({ top: 20 })
Text(this.message)
.fontSize(this.messageFont)
.textAlign(TextAlign.Center)
.margin({ top: 10 })
Row({ space: 20 }) {
Button({ buttonStyle: ButtonStyleMode.TEXTUAL }) {
Text(this.cancleTitle)
.fontSize(15)
.fontColor(this.cancleTitleColor)
}
.width('45%').height(30).backgroundColor(this.cancleColor)
.onClick(() => {
this.selectedButton(0)
})
.visibility(this.cancleTitle?Visibility.Visible:Visibility.None)
Button({ buttonStyle: ButtonStyleMode.TEXTUAL }) {
Text(this.confirmTitle)
.fontSize(15)
.fontColor(this.confirmTitleColor)
}.width('45%').height(30).backgroundColor(this.cancleColor)
.onClick(() => {
this.selectedButton(1)
})
}.margin({ top: 20, bottom: 20 })
}
.width('100%').backgroundColor(Color.White)
}.borderRadius(24)
}
}

View File

@ -1,4 +1,4 @@
import { BasicConstant, authStore } from '@itcast/basic' import { BasicConstant, authStore,DefaultHintProWindows } from '@itcast/basic'
import { commentModel } from '../model/VideoCommentModel' import { commentModel } from '../model/VideoCommentModel'
import { CommentChildView } from '../components/CommentChildView' import { CommentChildView } from '../components/CommentChildView'
import { router,promptAction } from '@kit.ArkUI'; import { router,promptAction } from '@kit.ArkUI';
@ -13,6 +13,31 @@ export struct VideoDetailsComment {
@Prop model:commentModel; @Prop model:commentModel;
@Prop videoCommentUuid:string; @Prop videoCommentUuid:string;
@State isShowMoreComment:boolean = false; @State isShowMoreComment:boolean = false;
private hintWindowDialog!: CustomDialogController;
aboutToAppear(): void {
this.hintPopWindowDialog();
}
private hintPopWindowDialog() {
this.hintWindowDialog = new CustomDialogController({
builder:DefaultHintProWindows({
controller:this.hintWindowDialog,
message:'确定要删除评论?',
cancleTitleColor: '#666666',
confirmTitleColor: $r('app.color.main_color'),
selectedButton: (index:number)=>{
if (index === 1) {
this.deleteComment();
}
this.hintWindowDialog.close();
}
}),
alignment: DialogAlignment.Center,
cornerRadius:24,
backgroundColor: ('rgba(0,0,0,0.5)'),
})
}
deleteComment() { deleteComment() {
const updateDataUrl:string = BasicConstant.deleteComment; const updateDataUrl:string = BasicConstant.deleteComment;
@ -56,14 +81,7 @@ export struct VideoDetailsComment {
Image($r('app.media.video_comment_delete')) Image($r('app.media.video_comment_delete'))
.width(20).height(20).margin({right:15}) .width(20).height(20).margin({right:15})
.onClick(()=>{ .onClick(()=>{
promptAction.showDialog({ title: '温馨提示', message: '确定要删除评论?', this.hintWindowDialog.open()
buttons: [{ text: '取消', color: '#666666' }, { text: '确定', color: $r('app.color.main_color') }],
})
.then(data => {
if (data.index == 1) {
this.deleteComment();
}
})
}) })
} else { } else {
Text('回复') Text('回复')

View File

@ -1,5 +1,5 @@
import { HdNav } from '@itcast/basic'; import { HdNav } from '@itcast/basic';
import { hdHttp, HdResponse,BasicConstant,ExpertData, authStore } from '@itcast/basic' import { hdHttp, HdResponse,BasicConstant,DefaultHintProWindows, authStore } from '@itcast/basic'
import { BusinessError } from '@kit.BasicServicesKit'; import { BusinessError } from '@kit.BasicServicesKit';
import { router } from '@kit.ArkUI' import { router } from '@kit.ArkUI'
import promptAction from '@ohos.promptAction'; import promptAction from '@ohos.promptAction';
@ -18,6 +18,7 @@ interface callBackData {
@Entry @Entry
@Component @Component
struct CancelAccount { struct CancelAccount {
@State hintMessage:string = '';
@State feedbackText: string = @State feedbackText: string =
' 账户注销后不可恢复,您将永久放弃此账户现有权益\n' + ' 账户注销后不可恢复,您将永久放弃此账户现有权益\n' +
' 1.您将不能再使用此账户随访患者,不能接收随访患者发送的信息\n' + ' 1.您将不能再使用此账户随访患者,不能接收随访患者发送的信息\n' +
@ -27,6 +28,32 @@ struct CancelAccount {
' 收到您的注销申请后我们将在10个工作日内帮您完成注销及数据清除工作' ' 收到您的注销申请后我们将在10个工作日内帮您完成注销及数据清除工作'
controller:TextAreaController = new TextAreaController(); controller:TextAreaController = new TextAreaController();
private hintWindowDialog!: CustomDialogController;
aboutToAppear(): void {
this.hintPopWindowDialog();
}
private hintPopWindowDialog() {
this.hintWindowDialog = new CustomDialogController({
builder:DefaultHintProWindows({
controller:this.hintWindowDialog,
message:this.hintMessage,
cancleTitleColor: this.hintMessage.includes('确定要注销肝胆相照平台账号吗?')?'#000000':'#666666',
confirmTitleColor: this.hintMessage.includes('确定要注销肝胆相照平台账号吗?')?'#999999':'#000000',
selectedButton: (index:number)=>{
if (index === 1 && this.hintMessage.includes('确定要注销肝胆相照平台账号吗?')) {
this.uploadCancleAccountAction();
}
this.hintWindowDialog.close();
}
}),
alignment: DialogAlignment.Center,
cornerRadius:24,
backgroundColor: ('rgba(0,0,0,0.5)'),
})
}
uploadCancleAccountAction() { uploadCancleAccountAction() {
hdHttp.post<string>(BasicConstant.urlExpert + 'patientList', { hdHttp.post<string>(BasicConstant.urlExpert + 'patientList', {
expertUuid: authStore.getUser().uuid expertUuid: authStore.getUser().uuid
@ -34,11 +61,8 @@ struct CancelAccount {
let json: callBackData = JSON.parse(res + '') as callBackData; let json: callBackData = JSON.parse(res + '') as callBackData;
console.log('注销账户数据:', json); console.log('注销账户数据:', json);
if (json.data.length > 0) { if (json.data.length > 0) {
promptAction.showDialog({ this.hintMessage = '请您解除所有随访患者后再提交注销申请'
title: '温馨提示', this.hintWindowDialog.open();
message: '请您解除所有随访患者后再提交注销申请',
buttons: [{ text: '确定', color: '#000000' }],
})
} else { } else {
this.uploadFeedBackAction(); this.uploadFeedBackAction();
} }
@ -55,11 +79,7 @@ struct CancelAccount {
let json: callBackData = JSON.parse(res + '') as callBackData; let json: callBackData = JSON.parse(res + '') as callBackData;
console.log('提交注销账户数据:', json); console.log('提交注销账户数据:', json);
if (json.code == 1) { if (json.code == 1) {
promptAction.showDialog({ this.hintMessage = '提交成功!'
title: '温馨提示',
message: '提交成功!',
buttons: [{ text: '取消', color: '#000000' }, { text: '确定', color: '#000000' }]
})
} else { } else {
promptAction.showToast({ message: json.message }); promptAction.showToast({ message: json.message });
} }
@ -111,29 +131,7 @@ struct CancelAccount {
} }
// 提交反馈处理 // 提交反馈处理
private submitFeedback(): void { private submitFeedback(): void {
// 提交逻辑实现 this.hintMessage = '确定要注销肝胆相照平台账号吗?\n注销后您的所有数据将无法恢复';
promptAction.showDialog({ this.hintWindowDialog.open();
title:'注销账户',
message:'确定要注销肝胆相照平台账号吗?\n注销后您的所有数据将无法恢复',
alignment:DialogAlignment.Center,
buttons:[
{
text:'取消',
color:'#333333'
},
{
text:'确定',
color:'#999999'
}
]
})
.then(data=>{
if (data.index === 1) {
this.uploadCancleAccountAction();
}
})
.catch((error:Error)=>{
console.info('showDialog error:'+error)
})
} }
} }