관리-쿠폰머니지급회수 팝업생성
This commit is contained in:
parent
a05c3c59e6
commit
922ed5377b
|
@ -102,7 +102,9 @@
|
|||
<button mat-menu-item (click)="__onClickComp($event)">
|
||||
콤프지급/회수
|
||||
</button>
|
||||
<button mat-menu-item>쿠폰머니지급/회수</button>
|
||||
<button mat-menu-item (click)="__onClickCoupon($event)">
|
||||
쿠폰머니지급/회수
|
||||
</button>
|
||||
<button mat-menu-item>쪽지보내기</button>
|
||||
<button mat-menu-item>배팅리스트</button>
|
||||
</mat-menu>
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -0,0 +1,88 @@
|
|||
<div class="flex flex-col max-w-240 md:min-w-160 max-h-screen -m-6">
|
||||
<!-- Header -->
|
||||
<div
|
||||
class="flex flex-0 items-center justify-between h-16 pr-3 sm:pr-5 pl-6 sm:pl-8 bg-primary text-on-primary"
|
||||
>
|
||||
<div class="text-lg font-medium">쿠폰금액 지급/회수</div>
|
||||
<button mat-icon-button (click)="saveAndClose()" [tabIndex]="-1">
|
||||
<mat-icon
|
||||
class="text-current"
|
||||
[svgIcon]="'heroicons_outline:x'"
|
||||
></mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Compose form -->
|
||||
<form
|
||||
class="flex flex-col flex-auto p-6 sm:p-8 overflow-y-auto"
|
||||
[formGroup]="composeForm"
|
||||
>
|
||||
<div>
|
||||
<span class="font-semibold mb-2">쿠폰구분</span>
|
||||
<mat-radio-group
|
||||
class="flex flex-col w-1/3 pr-2"
|
||||
[color]="'primary'"
|
||||
[value]="'coupon'"
|
||||
>
|
||||
<mat-radio-button class="mb-2" [value]="'coupon'">
|
||||
쿠폰
|
||||
</mat-radio-button>
|
||||
</mat-radio-group>
|
||||
</div>
|
||||
<div>
|
||||
<span class="font-semibold mb-2">추가/삭제</span>
|
||||
<mat-radio-group
|
||||
class="flex flex-col w-1/3 pr-2"
|
||||
[color]="'primary'"
|
||||
[value]="'give'"
|
||||
>
|
||||
<mat-radio-button class="mb-2" [value]="'give'">
|
||||
지급
|
||||
</mat-radio-button>
|
||||
<mat-radio-button class="mb-2" [value]="'take'">
|
||||
회수
|
||||
</mat-radio-button>
|
||||
</mat-radio-group>
|
||||
</div>
|
||||
<!-- To -->
|
||||
<mat-form-field>
|
||||
<mat-label>입력쿠폰금액</mat-label>
|
||||
<input matInput [formControlName]="'couponPrice'" />
|
||||
</mat-form-field>
|
||||
|
||||
<!-- <div *ngFor="let f of sites">{{ f.getUrl() }}</div> -->
|
||||
<!-- Cc -->
|
||||
<mat-form-field>
|
||||
<mat-label>쿠폰제목</mat-label>
|
||||
<input matInput [formControlName]="'couponTitle'" />
|
||||
</mat-form-field>
|
||||
|
||||
<!-- Body -->
|
||||
<!-- <quill-editor
|
||||
class="mt-2"
|
||||
[formControlName]="'body'"
|
||||
[modules]="quillModules"
|
||||
></quill-editor> -->
|
||||
|
||||
<!-- Actions -->
|
||||
<div
|
||||
class="flex flex-col sm:flex-row sm:items-center justify-between mt-4 sm:mt-6"
|
||||
>
|
||||
<div class="flex items-center mt-4 sm:mt-0">
|
||||
<!-- Send -->
|
||||
<button
|
||||
class="order-first sm:order-last"
|
||||
mat-flat-button
|
||||
[color]="'primary'"
|
||||
(click)="send()"
|
||||
>
|
||||
쿠폰 지급/회수
|
||||
</button>
|
||||
<!-- Save as draft -->
|
||||
<button class="sm:mx-3" mat-stroked-button (click)="saveAsDraft()">
|
||||
<span>닫기</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
|
@ -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<CouponComposeComponent>,
|
||||
@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 {}
|
||||
}
|
|
@ -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,
|
||||
];
|
||||
|
|
Loading…
Reference in New Issue
Block a user