diff --git a/src/app/modules/admin/member/user/components/view.component.html b/src/app/modules/admin/member/user/components/view.component.html index eebcb80..0eb18a7 100644 --- a/src/app/modules/admin/member/user/components/view.component.html +++ b/src/app/modules/admin/member/user/components/view.component.html @@ -40,7 +40,7 @@ 가입일자 {{ - selectedUser?.getCreatedAt() | date: "yyyy/MM/dd HH:mm" + currentMember?.getCreatedAt() | date: "yyyy/MM/dd HH:mm" }}
@@ -130,33 +130,36 @@ -
- -
- -
- - + +
+ +
+ + - -
- {{ getPanelInfo(selectedPanel).title }} -
+ +
+ {{ getPanelInfo(selectedPanel).title }}
+
- -
- - - + +
+ + + +
아이디 @@ -174,14 +177,6 @@ [formControlName]="'signinPw'" /> - - 환전비밀번호 - -
@@ -242,49 +237,7 @@
-
- - 은행명 - - - {{ bank.getName() }} - - - - - - - - 계좌번호 - - - - 예금주 - - -
콤프 @@ -318,7 +271,7 @@ 사이트변경
+ + + +
+ +
+
+ + 환전비밀번호 + + + + 은행명 + + + + {{ bank.getName() }} + + + + + +
+
+ + 계좌번호 + + + + 예금주 + + +
+ 메모 - + - - - + + +
+ + +
바카라 요율 @@ -403,6 +423,7 @@
+
기타 게임 요율 @@ -475,9 +496,15 @@
-
- - + + + + + +
@@ -510,15 +537,30 @@ / 0원(이전일: 0원)
- - -
내역
-
+
+
-
+ +
내역
+
+
- +
+ + +
+ + +
+
diff --git a/src/app/modules/admin/member/user/components/view.component.ts b/src/app/modules/admin/member/user/components/view.component.ts index ce442f8..a83494a 100644 --- a/src/app/modules/admin/member/user/components/view.component.ts +++ b/src/app/modules/admin/member/user/components/view.component.ts @@ -32,7 +32,10 @@ import { FuseConfirmationService } from '@fuse/services/confirmation'; import { User } from '../models/user'; import { UserService } from '../services/user.service'; import { ActivatedRoute } from '@angular/router'; -import { GetMemberResponse } from 'app/modules/proto/c2se/member_pb'; +import { + GetMemberResponse, + UpdateMemberRequest, +} from 'app/modules/proto/c2se/member_pb'; import { MemberModel } from 'app/modules/proto/models/member_pb'; import { MemberService } from 'app/modules/polyglot/member/services/member.service'; import { MemberLevelService } from 'app/modules/polyglot/member_level/services/member_level.service'; @@ -44,6 +47,7 @@ import { Site } from 'app/modules/proto/models/site_pb'; import { MatDrawer } from '@angular/material/sidenav'; import { FuseMediaWatcherService } from '@fuse/services/media-watcher'; +import { UpdateBankRequest } from 'app/modules/proto/c2se/bank_pb'; @Component({ selector: 'user-view', @@ -82,12 +86,17 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy { isLoading = false; searchInputControl = new FormControl(); - memberViewForm!: FormGroup; - /* selectedUser?: User; */ - selectedUser?: MemberModel; + + memberDefaultForm!: FormGroup; + memberBankForm!: FormGroup; + memberSettleForm!: FormGroup; + memberGameSettingForm!: FormGroup; + + /* currentMember?: User; */ + currentMember?: MemberModel; panels: any[] = []; - selectedPanel: string = 'account'; + selectedPanel: string = 'accountInfo'; memberLevels!: MemberLevel[]; banks!: Bank[]; @@ -119,29 +128,34 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy { * On init */ ngOnInit(): void { - this.memberViewForm = this._formBuilder.group({ + this.memberDefaultForm = this._formBuilder.group({ id: [''], username: [{ value: '', disabled: true }], signinPw: [{ value: '' }], - exchangePw: [''], - description: [''], - tags: [[]], + nickname: [{ value: '', disabled: true }], ownCash: [''], mobilePhoneNumber: [''], levelId: [''], state: [''], isExcahngeMoney: [''], - bankId: [''], - accountNumber: [''], - accountHolder: [''], comp: [''], coupon: [''], recommender: [{ value: '', disabled: true }], - changeSite: [''], + siteId: [''], recommendCount: [''], hodingGameMoney: [{ value: '0', disabled: true }], - memo: [''], + }); + + this.memberBankForm = this._formBuilder.group({ + bankId: [''], + accountNumber: [''], + accountHolder: [''], + exchangePw: [''], + description: [''], + }); + + this.memberSettleForm = this._formBuilder.group({ bacaraRate: [], rulletRate: [], dragonRate: [], @@ -151,28 +165,36 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy { slotRusingRate: [], }); + this.memberGameSettingForm = this._formBuilder.group({}); + this.panels = [ { - id: 'account', + id: 'accountInfo', icon: 'heroicons_outline:user-circle', title: '기본정보', description: 'Manage your public profile and private information', }, { - id: 'security', + id: 'bankInfo', + icon: 'heroicons_outline:user-circle', + title: '계좌정보', + description: 'Manage your public profile and private information', + }, + { + id: 'settleInfo', icon: 'heroicons_outline:lock-closed', title: '정산설정', description: 'Manage your password and 2-step verification preferences', }, { - id: 'plan-billing', + id: 'gameInfo', icon: 'heroicons_outline:credit-card', title: '게임설정', description: 'Manage your subscription plan, payment method and billing information', }, { - id: 'notifications', + id: 'historyInfo', icon: 'heroicons_outline:bell', title: '내역', description: "Manage when you'll be notified on which channels", @@ -211,18 +233,18 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy { this._activatedRoute.data.subscribe((data) => { let member: GetMemberResponse.Result = data['member']; - this.selectedUser = member.getMember(); + this.currentMember = member.getMember(); /* console.log('dddd', listMemberResult.getMembersList()); */ - this.memberViewForm.patchValue({ - username: this.selectedUser?.getUsername(), + this.memberDefaultForm.patchValue({ + username: this.currentMember?.getUsername(), signinPw: '', exchangePw: '', - mobilePhoneNumber: this.selectedUser?.getMobilePhoneNumber(), - levelId: this.selectedUser?.getMemberLevel()?.getId(), - state: this.selectedUser?.getState(), - nickname: this.selectedUser?.getNickname(), - bankId: this.selectedUser?.getBankAccount()?.getId(), + mobilePhoneNumber: this.currentMember?.getMobilePhoneNumber(), + levelId: this.currentMember?.getMemberLevel()?.getId(), + state: this.currentMember?.getState(), + nickname: this.currentMember?.getNickname(), + bankId: this.currentMember?.getBankAccount()?.getId(), }); // Mark for check this._changeDetectorRef.markForCheck(); @@ -274,15 +296,77 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy { } __modifyMember(): void { - const valueForm = this.memberViewForm.value; - console.log('v: ', valueForm); - /* this._memberService.updateMember( - this.selectedUser!.getId(), - this.selectedUser!.getSite()!.getId(), - this.selectedUser!.getMemberLevel()!.getId(), - 'beteran', - valueForm.mobilePhoneNumber - ); */ + if (!this.currentMember?.getId()) { + return; + } + + const req = new UpdateMemberRequest(); + req.setId(this.currentMember?.getId()); + + switch (this.selectedPanel) { + case 'accountInfo': + { + const { + username, + signinPw, + nickname, + ownCash, + mobilePhoneNumber, + levelId, + state, + isExcahngeMoney, + comp, + coupon, + siteId, + hodingGameMoney, + } = this.memberDefaultForm.value; + if (!!signinPw && signinPw == '') { + req.setPassword(signinPw); + } + if (!!levelId && levelId == '') { + req.setMemberLevelId(levelId); + } + if (!!mobilePhoneNumber && mobilePhoneNumber == '') { + req.setMobilePhoneNumber(mobilePhoneNumber); + } + if (!!siteId && siteId == '') { + req.setSiteId(siteId); + } + } + + break; + case 'bankInfo': + { + if (!this.memberBankForm.valid) { + return; + } + const { exchangePw, accountHolder, accountNumber, description } = + this.memberBankForm.value; + + const bank = new UpdateMemberRequest.BankAccount(); + const bankId = this.currentMember?.getBankAccount()?.getId(); + if (!!bankId) { + bank.setId(bankId); + bank.setAccountNumber(accountNumber); + bank.setName(accountHolder); + bank.setExchangePassword(exchangePw); + } + req.setBankAccount(bank); + } + + break; + case 'settleInfo': + break; + case 'gameInfo': + break; + case 'historyInfo': + break; + default: + break; + } + this._memberService.updateMember(req).then((result) => { + console.log(result); + }); } /** diff --git a/src/app/modules/polyglot/member/services/member.service.ts b/src/app/modules/polyglot/member/services/member.service.ts index 307cf46..991ea74 100644 --- a/src/app/modules/polyglot/member/services/member.service.ts +++ b/src/app/modules/polyglot/member/services/member.service.ts @@ -117,30 +117,8 @@ export class MemberService { ); } - updateMember( - id: string, - siteId: string, - memberLevelId: string, - password: string, - mobilePhoneNumber: string - ): Promise { + updateMember(req: UpdateMemberRequest): Promise { return new Promise((resolve, reject) => { - let req = new UpdateMemberRequest(); - req.setId(id); - - if (!!siteId) { - req.setSiteId(siteId); - } - if (!!memberLevelId) { - req.setMemberLevelId(memberLevelId); - } - if (!!password) { - req.setPassword(password); - } - if (!!mobilePhoneNumber) { - req.setMobilePhoneNumber(mobilePhoneNumber); - } - this.__natsService .request( SUBJECT_UPDATE_MEMBER,