This commit is contained in:
Park Byung Eun 2022-08-30 08:17:58 +00:00
parent 950f0b5835
commit c93a972425

View File

@ -129,7 +129,7 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
memberSettleForm!: FormGroup;
memberGameSettingForm!: FormGroup;
passwordConfirmConfigForm!: FormGroup;
fuseAlertConfirmConfigForm!: FormGroup;
/* currentMember?: User; */
currentMember?: MemberModel;
@ -150,6 +150,9 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
};
changePasswordResultShowAlert: boolean = false;
alertTitle = '알림';
alertChangePasswordMessage = '비밀번호를 변경 하시겠습니까?';
alertUpdateMemberMessage = '회원을 수정 하시겠습니까?';
private _unsubscribeAll: Subject<any> = new Subject<any>();
@ -223,7 +226,7 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
canBetSlot: [],
});
this.passwordConfirmConfigForm = this._formBuilder.group({
this.fuseAlertConfirmConfigForm = this._formBuilder.group({
title: '알림',
message: '비밀번호를 변경 하시겠습니까?',
icon: this._formBuilder.group({
@ -407,6 +410,8 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
return;
}
/* const dialogRef; */
const req = new UpdateMemberRequest();
req.setId(this.currentMember?.getId());
@ -434,10 +439,9 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
}
private modifyMemberDefaultInfo(): void {
if (!this.currentMember?.getId()) {
return;
}
this.showConfirmAlert(this.alertTitle, this.alertUpdateMemberMessage).then(
(result) => {
if (!!result && !!this.currentMember?.getId()) {
const req = new UpdateMemberRequest();
req.setId(this.currentMember?.getId());
@ -457,7 +461,9 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
} = this.memberDefaultForm.value;
if (!!levelName && levelName !== '') {
const level = this.memberLevels.find((v) => v.getName() === levelName);
const level = this.memberLevels.find(
(v) => v.getName() === levelName
);
if (!!level) req.setMemberLevelId(level?.getId());
}
if (!!mobilePhoneNumber && mobilePhoneNumber !== '') {
@ -479,11 +485,18 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
})
.finally(() => this.closeChangePasswordAlert());
}
}
);
}
private modifyMemberBankAccountInfo(): void {
if (!this.memberBankForm.valid) {
return;
}
this.showConfirmAlert(this.alertTitle, this.alertUpdateMemberMessage).then(
(result) => {
if (!!result) {
const {
exchangePw,
exchangePwConfirm,
@ -518,12 +531,18 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
})
.finally(() => this.closeChangePasswordAlert());
}
}
);
}
private modifyMemberSttlemtSettingInfo(): void {
if (!this.memberSettleForm.valid) {
return;
}
this.showConfirmAlert(this.alertTitle, this.alertUpdateMemberMessage).then(
(result) => {
if (!!result) {
const {
rateCasinoBacara,
rateCasinoRoulette,
@ -553,7 +572,9 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
updateSSReq.setCanFirstChargeComp(canFirstChargeComp);
updateSSReq.setCanPerChargeComp(canPerChargeComp);
updateSSReq.setCanExchange(canExchange);
updateSSReq.setManualPaymentTypeForPartner(manualPaymentTypeForPartner);
updateSSReq.setManualPaymentTypeForPartner(
manualPaymentTypeForPartner
);
this._memberSettlementSettingService
.updateMemberSettlementSetting(updateSSReq)
@ -565,13 +586,21 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
})
.finally(() => this.closeChangePasswordAlert());
}
}
);
}
private modifyMemberGameSettingInfo(): void {
this.showConfirmAlert(this.alertTitle, this.alertUpdateMemberMessage).then(
(result) => {
if (!!result) {
const { canBetPowerball, canBetCasino, canBetSlot } =
this.memberGameSettingForm.value;
const updateGSReq = new UpdateMemberGameSettingRequest();
updateGSReq.setId(this.currentMember?.getMemberGameSetting()?.getId()!);
updateGSReq.setId(
this.currentMember?.getMemberGameSetting()?.getId()!
);
updateGSReq.setCanBetPowerball(canBetPowerball);
updateGSReq.setCanBetCasino(canBetCasino);
updateGSReq.setCanBetSlot(canBetSlot);
@ -586,6 +615,9 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
})
.finally(() => this.closeChangePasswordAlert());
}
}
);
}
/**
* Navigate to the panel
*
@ -637,14 +669,11 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
return;
}
const dialogRef = this._fuseConfirmationService.open(
this.passwordConfirmConfigForm.value
);
/* const dialogRef = this._matDialog.open(AddComposeComponent); */
dialogRef.afterClosed().subscribe((result) => {
if (result === 'confirmed') {
this.showConfirmAlert(
this.alertTitle,
this.alertChangePasswordMessage
).then((result) => {
if (!!result) {
const req = new UpdateMemberForPasswordRequest();
req.setPassword(password);
req.setId(this.currentMember!.getId());
@ -682,14 +711,11 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
return;
}
const dialogRef = this._fuseConfirmationService.open(
this.passwordConfirmConfigForm.value
);
/* const dialogRef = this._matDialog.open(AddComposeComponent); */
dialogRef.afterClosed().subscribe((result) => {
if (result === 'confirmed') {
this.showConfirmAlert(
this.alertTitle,
this.alertChangePasswordMessage
).then((result) => {
if (!!result) {
const req = new UpdateMemberBankAccountForExchangePasswordRequest();
req.setExchangePassword(password);
req.setId(this.currentMember!.getId());
@ -717,6 +743,11 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
return;
}
this.showConfirmAlert(
this.alertTitle,
'회원 상태를 수정하시겠습니까?'
).then((result) => {
if (!!result) {
const req = new UpdateMemberForStateRequest();
req.setId(this.currentMember!.getId());
req.setState(state);
@ -731,9 +762,7 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
})
.finally(() => this.closeChangePasswordAlert());
}
__changeMemberState(): void {
const state = this.memberDefaultForm.get('state')?.value;
});
}
private showAlert(type: FuseAlertType, message: string): void {
@ -752,4 +781,26 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
this._changeDetectorRef.markForCheck();
}, 5000);
}
private async showConfirmAlert(
title: string,
message: string
): Promise<boolean> {
this.fuseAlertConfirmConfigForm.get('title')?.setValue(title);
this.fuseAlertConfirmConfigForm.get('message')?.setValue(message);
return new Promise<boolean>((resolve, reject) => {
const dialogRef = this._fuseConfirmationService.open(
this.fuseAlertConfirmConfigForm.value
);
dialogRef.afterClosed().subscribe((result) => {
if (result === 'confirmed') {
resolve(true);
} else {
resolve(false);
}
});
});
}
}