From 922ed5377bfcf2320b9a1899c638f95fed06d79f Mon Sep 17 00:00:00 2001 From: JUNG YI DAM Date: Sat, 13 Aug 2022 04:19:42 +0000 Subject: [PATCH] =?UTF-8?q?=EA=B4=80=EB=A6=AC-=EC=BF=A0=ED=8F=B0=EB=A8=B8?= =?UTF-8?q?=EB=8B=88=EC=A7=80=EA=B8=89=ED=9A=8C=EC=88=98=20=ED=8C=9D?= =?UTF-8?q?=EC=97=85=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../partner/components/list.component.html | 4 +- .../partner/components/list.component.ts | 10 ++ .../compose/coupon-compose.component.html | 88 +++++++++++++++++ .../compose/coupon-compose.component.ts | 94 +++++++++++++++++++ .../admin/member/partner/compose/index.ts | 2 + 5 files changed, 197 insertions(+), 1 deletion(-) create mode 100644 src/app/modules/admin/member/partner/compose/coupon-compose.component.html create mode 100644 src/app/modules/admin/member/partner/compose/coupon-compose.component.ts diff --git a/src/app/modules/admin/member/partner/components/list.component.html b/src/app/modules/admin/member/partner/components/list.component.html index e8e4ade..29cf4ef 100644 --- a/src/app/modules/admin/member/partner/components/list.component.html +++ b/src/app/modules/admin/member/partner/components/list.component.html @@ -102,7 +102,9 @@ - + diff --git a/src/app/modules/admin/member/partner/components/list.component.ts b/src/app/modules/admin/member/partner/components/list.component.ts index fdc2274..6faf88b 100644 --- a/src/app/modules/admin/member/partner/components/list.component.ts +++ b/src/app/modules/admin/member/partner/components/list.component.ts @@ -40,6 +40,7 @@ import { import { CashComposeComponent } from '../compose/cash-compose.component'; import { CommissionComposeComponent } from '../compose/commission-compose.component'; import { CompComposeComponent } from '../compose/comp-compose.component'; +import { CouponComposeComponent } from '../compose/coupon-compose.component'; import { MatDialog } from '@angular/material/dialog'; import { SiteService } from 'app/modules/polyglot/domain/services/site.service'; @@ -283,6 +284,15 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { console.log('Compose dialog was closed!'); }); } + __onClickCoupon(event: MouseEvent): void { + const dialogRef = this._matDialog.open(CouponComposeComponent, { + data: { price: '', memo: '' }, + }); + + dialogRef.afterClosed().subscribe((result) => { + console.log('Compose dialog was closed!'); + }); + } __getRateTooltop(): string { const tempRate = 0; diff --git a/src/app/modules/admin/member/partner/compose/coupon-compose.component.html b/src/app/modules/admin/member/partner/compose/coupon-compose.component.html new file mode 100644 index 0000000..edd8fa0 --- /dev/null +++ b/src/app/modules/admin/member/partner/compose/coupon-compose.component.html @@ -0,0 +1,88 @@ +
+ +
+
쿠폰금액 지급/회수
+ +
+ + +
+
+ 쿠폰구분 + + + 쿠폰 + + +
+
+ 추가/삭제 + + + 지급 + + + 회수 + + +
+ + + 입력쿠폰금액 + + + + + + + 쿠폰제목 + + + + + + + +
+
+ + + + +
+
+
+
diff --git a/src/app/modules/admin/member/partner/compose/coupon-compose.component.ts b/src/app/modules/admin/member/partner/compose/coupon-compose.component.ts new file mode 100644 index 0000000..6c2cb4f --- /dev/null +++ b/src/app/modules/admin/member/partner/compose/coupon-compose.component.ts @@ -0,0 +1,94 @@ +import { + ChangeDetectorRef, + Component, + Inject, + OnInit, + ViewEncapsulation, +} from '@angular/core'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { SiteService } from 'app/modules/polyglot/domain/services/site.service'; +import { IdentityService } from 'app/modules/polyglot/member/services/identity.service'; +import { Site } from 'app/modules/protobuf/models/domain/site_pb'; + +export interface CouponComposeData { + price: string; + memo: string; +} +export interface CouponComposeResult { + price: string; + memo: string; +} + +@Component({ + selector: 'app-coupon-compose', + templateUrl: './coupon-compose.component.html', + encapsulation: ViewEncapsulation.None, +}) +export class CouponComposeComponent implements OnInit { + composeForm!: FormGroup; + sites: any[] = []; + // quillModules: any = { + // toolbar: [ + // ['bold', 'italic', 'underline'], + // [{ align: [] }, { list: 'ordered' }, { list: 'bullet' }], + // ['clean'], + // ], + // }; + + /** + * Constructor + */ + constructor( + public matDialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: CouponComposeData, + private _formBuilder: FormBuilder, + private _identityService: IdentityService, + private _changeDetectorRef: ChangeDetectorRef + ) {} + + // ----------------------------------------------------------------------------------------------------- + // @ Lifecycle hooks + // ----------------------------------------------------------------------------------------------------- + + /** + * On init + */ + ngOnInit(): void { + // Create the form + this.composeForm = this._formBuilder.group({ + price: ['', [Validators.required]], + memo: ['', [Validators.required]], + }); + } + + // ----------------------------------------------------------------------------------------------------- + // @ Public methods + // ----------------------------------------------------------------------------------------------------- + + /** + * Save and close + */ + saveAndClose(): void { + // Save the message as a draft + this.saveAsDraft(); + + // Close the dialog + this.matDialogRef.close(); + } + + /** + * Discard the message + */ + discard(): void {} + + /** + * Save the message as a draft + */ + saveAsDraft(): void {} + + /** + * Send the message + */ + send(): void {} +} diff --git a/src/app/modules/admin/member/partner/compose/index.ts b/src/app/modules/admin/member/partner/compose/index.ts index a768fea..24f5d7c 100644 --- a/src/app/modules/admin/member/partner/compose/index.ts +++ b/src/app/modules/admin/member/partner/compose/index.ts @@ -2,10 +2,12 @@ import { RegistComposeComponent } from './regist-compose.component'; import { CashComposeComponent } from './cash-compose.component'; import { CommissionComposeComponent } from './commission-compose.component'; import { CompComposeComponent } from './comp-compose.component'; +import { CouponComposeComponent } from './coupon-compose.component'; export const COMPOSE = [ RegistComposeComponent, CashComposeComponent, CommissionComposeComponent, CompComposeComponent, + CouponComposeComponent, ];