베팅히스토리 디자인

This commit is contained in:
byung eun park 2019-10-02 22:22:27 +09:00
parent 227bdfd2d4
commit 6dff6de9bd
9 changed files with 670 additions and 14 deletions

View File

@ -0,0 +1,110 @@
<div id="bet-history-tables" class="page-layout carded fullwidth inner-scroll">
<!-- CONTENT CARD -->
<div class="content-card">
<mat-table
class="service-center"
#table
[dataSource]="dataSource"
matSort
[@animateStagger]="{ value: '50' }"
fusePerfectScrollbar
>
<ng-container matColumnDef="idx">
<mat-header-cell *matHeaderCellDef mat-sort-header
>경기시간</mat-header-cell
>
<mat-cell *matCellDef="let serviceCenter; let i = index">
<p class="text-truncate">{{ i }}</p>
</mat-cell>
</ng-container>
<!-- ID/Nickname Column -->
<ng-container matColumnDef="title">
<mat-header-cell *matHeaderCellDef mat-sort-header
>종목/리그</mat-header-cell
>
<mat-cell *matCellDef="let serviceCenter">
<p class="text-truncate">{{ serviceCenter.title }}</p>
</mat-cell>
</ng-container>
<!-- Phone Column -->
<ng-container matColumnDef="contents">
<mat-header-cell *matHeaderCellDef mat-sort-header fxHide fxShow.gt-sm
>홈팀승/핸디오버</mat-header-cell
>
<mat-cell *matCellDef="let serviceCenter" fxHide fxShow.gt-sm>
<!-- <p class="text-truncate">{{ serviceCenter.contents }}</p> -->
<p class="text-truncate">010-3004-2001</p>
</mat-cell>
</ng-container>
<!-- Total Price Column -->
<ng-container matColumnDef="register">
<mat-header-cell *matHeaderCellDef mat-sort-header fxHide fxShow.gt-md
>무/기준점</mat-header-cell
>
<mat-cell *matCellDef="let serviceCenter" fxHide fxShow.gt-md>
<p class="total-price text-truncate">
<!-- {{ user.totalprice | currency: 'USD':'symbol' }} -->
1,000,000
</p>
</mat-cell>
</ng-container>
<!-- Point Column -->
<ng-container matColumnDef="createdAt">
<mat-header-cell *matHeaderCellDef mat-sort-header fxHide fxShow.gt-sm
>원정/패/핸디/언더</mat-header-cell
>
<mat-cell *matCellDef="let serviceCenter" fxHide fxShow.gt-sm>
<p class="text-truncate">
<!-- {{ user.point }} -->
5000
</p>
</mat-cell>
</ng-container>
<!-- Level Column -->
<ng-container matColumnDef="contactStatus">
<mat-header-cell *matHeaderCellDef mat-sort-header
>게임결과</mat-header-cell
>
<mat-cell *matCellDef="let serviceCenter">
<!-- <p class="status text-truncate h6 p-4" [ngClass]="order.status[0].color"> -->
<p class="text-truncate">
<!-- {{ user.level }} -->
브론즈
</p>
</mat-cell>
</ng-container>
<!-- Charge Money Column -->
<ng-container matColumnDef="removeBtn">
<mat-header-cell *matHeaderCellDef mat-sort-header
>적중여부</mat-header-cell
>
<mat-cell *matCellDef="let user">
<p class="text-truncate ">
<button mat-raised-button class="mat-accent">
삭제
</button>
</p>
</mat-cell>
</ng-container>
<mat-header-row
*matHeaderRowDef="displayedColumns; sticky: true"
></mat-header-row>
<mat-row
*matRowDef="let user; columns: displayedColumns"
class="user"
matRipple
[routerLink]="'/pages/users/management/list/' + user.id"
>
</mat-row>
</mat-table>
</div>
<!-- / CONTENT CARD -->
</div>

View File

@ -0,0 +1,110 @@
@import 'src/@fuse/scss/fuse';
app-bet-history-table {
#bet-history-tables {
.top-bg {
@include media-breakpoint('xs') {
height: 224px;
}
}
> .center {
> .header {
.search-wrapper {
width: 100%;
max-width: 480px;
border-radius: 28px;
overflow: hidden;
@include mat-elevation(1);
@include media-breakpoint('xs') {
width: 100%;
}
.search {
width: 100%;
height: 48px;
line-height: 48px;
padding: 0 18px;
input {
width: 100%;
height: 48px;
min-height: 48px;
max-height: 48px;
padding: 0 16px;
border: none;
outline: none;
}
}
}
@include media-breakpoint('xs') {
padding: 8px 0;
height: 160px !important;
min-height: 160px !important;
max-height: 160px !important;
}
}
}
}
.bet-history-table {
flex: 1 1 auto;
border-bottom: 1px solid rgba(0, 0, 0, 0.12);
overflow: auto;
-webkit-overflow-scrolling: touch;
.mat-header-row {
min-height: 64px;
}
.bet-history {
position: relative;
cursor: pointer;
height: 84px;
}
.mat-cell {
min-width: 0;
display: flex;
align-items: center;
}
.mat-column-id {
flex: 0 1 84px;
}
.mat-column-image {
flex: 0 1 84px;
.product-image {
width: 52px;
height: 52px;
border: 1px solid rgba(0, 0, 0, 0.12);
}
}
.mat-column-buttons {
flex: 0 1 80px;
}
.quantity-indicator {
display: inline-block;
vertical-align: middle;
width: 8px;
height: 8px;
border-radius: 4px;
margin-right: 8px;
& + span {
display: inline-block;
vertical-align: middle;
}
}
.active-icon {
border-radius: 50%;
}
}
}

View File

@ -0,0 +1,82 @@
import {
Component,
ElementRef,
OnDestroy,
OnInit,
ViewChild,
ViewEncapsulation,
AfterViewInit
} from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { fuseAnimations } from 'src/@fuse/animations';
@Component({
selector: 'app-bet-history-table',
templateUrl: './bet-history-table.component.html',
styleUrls: ['./bet-history-table.component.scss'],
encapsulation: ViewEncapsulation.None,
animations: fuseAnimations
})
export class BetHistoryTableComponent
implements OnInit, OnDestroy, AfterViewInit {
// dataSource: ServiceCenterDataSource | null;
displayedColumns = [
'idx',
'title',
'contents',
'register',
'createdAt',
'contactStatus'
];
private unsubscribeAll: Subject<any>;
@ViewChild(MatPaginator, { static: true })
paginator: MatPaginator;
@ViewChild('filter', { static: true })
filter: ElementRef;
@ViewChild(MatSort, { static: true })
sort: MatSort;
constructor(
private fb: FormBuilder // private serviceCenterService: ServiceCenterService
) {
// Set the private defaults
this.unsubscribeAll = new Subject();
}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void {
// Subscribe to update order on changes
// this.dataSource = new ServiceCenterDataSource(
// this.serviceCenterService,
// this.paginator,
// this.sort
// );
}
/**
* On destroy
*/
ngOnDestroy(): void {
// Unsubscribe from all subscriptions
this.unsubscribeAll.next();
this.unsubscribeAll.complete();
}
ngAfterViewInit(): void {}
}

View File

@ -1 +1,65 @@
<p>bet-history works!</p> <div id="bet-history" class="page-layout carded fullwidth inner-scroll">
<!-- TOP BACKGROUND -->
<div class="top-bg accent"></div>
<!-- / TOP BACKGROUND -->
<!-- CENTER -->
<div class="center">
<!-- HEADER -->
<div
class="header accent"
fxLayout="column"
fxLayoutAlign="center center"
fxLayout.gt-xs="row"
fxLayoutAlign.gt-xs="space-between center"
>
<!-- APP TITLE -->
<div
class="logo mb-24 mb-sm-0"
fxLayout="row"
fxLayoutAlign="start center"
>
<mat-icon
class="logo-icon s-32 mr-16"
[@animate]="{ value: '*', params: { delay: '50ms', scale: '0.2' } }"
>
shopping_basket
</mat-icon>
<span
class="logo-text h1"
[@animate]="{ value: '*', params: { delay: '100ms', x: '-25px' } }"
>베팅내역</span
>
</div>
<!-- / APP TITLE -->
<!-- SEARCH -->
<!-- <div class="search-wrapper ml-sm-32">
<div class="search" fxFlex fxLayout="row" fxLayoutAlign="start center">
<mat-icon>search</mat-icon>
<input #filter placeholder="Search for an order" />
</div>
</div> -->
<!-- / SEARCH -->
</div>
<!-- / HEADER -->
<!-- CONTENT CARD -->
<div class="content-card">
<app-bet-history-table></app-bet-history-table>
<app-bet-history-table></app-bet-history-table>
<app-bet-history-table></app-bet-history-table>
<mat-paginator
#paginator
[pageIndex]="0"
[pageSize]="10"
[pageSizeOptions]="[5, 10, 25, 100]"
>
</mat-paginator>
</div>
<!-- / CONTENT CARD -->
</div>
<!-- / CENTER -->
</div>

View File

@ -0,0 +1,110 @@
@import 'src/@fuse/scss/fuse';
app-bet-history {
#bet-history {
.top-bg {
@include media-breakpoint('xs') {
height: 224px;
}
}
> .center {
> .header {
.search-wrapper {
width: 100%;
max-width: 480px;
border-radius: 28px;
overflow: hidden;
@include mat-elevation(1);
@include media-breakpoint('xs') {
width: 100%;
}
.search {
width: 100%;
height: 48px;
line-height: 48px;
padding: 0 18px;
input {
width: 100%;
height: 48px;
min-height: 48px;
max-height: 48px;
padding: 0 16px;
border: none;
outline: none;
}
}
}
@include media-breakpoint('xs') {
padding: 8px 0;
height: 160px !important;
min-height: 160px !important;
max-height: 160px !important;
}
}
}
}
.bet-history-table {
flex: 1 1 auto;
border-bottom: 1px solid rgba(0, 0, 0, 0.12);
overflow: auto;
-webkit-overflow-scrolling: touch;
.mat-header-row {
min-height: 64px;
}
.bet-history {
position: relative;
cursor: pointer;
height: 84px;
}
.mat-cell {
min-width: 0;
display: flex;
align-items: center;
}
.mat-column-id {
flex: 0 1 84px;
}
.mat-column-image {
flex: 0 1 84px;
.product-image {
width: 52px;
height: 52px;
border: 1px solid rgba(0, 0, 0, 0.12);
}
}
.mat-column-buttons {
flex: 0 1 80px;
}
.quantity-indicator {
display: inline-block;
vertical-align: middle;
width: 8px;
height: 8px;
border-radius: 4px;
margin-right: 8px;
& + span {
display: inline-block;
vertical-align: middle;
}
}
.active-icon {
border-radius: 50%;
}
}
}

View File

@ -1,15 +1,81 @@
import { Component, OnInit } from '@angular/core'; import {
Component,
ElementRef,
OnDestroy,
OnInit,
ViewChild,
ViewEncapsulation,
AfterViewInit
} from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { fuseAnimations } from 'src/@fuse/animations';
@Component({ @Component({
selector: 'app-bet-history', selector: 'app-bet-history',
templateUrl: './bet-history.component.html', templateUrl: './bet-history.component.html',
styleUrls: ['./bet-history.component.scss'] styleUrls: ['./bet-history.component.scss'],
encapsulation: ViewEncapsulation.None,
animations: fuseAnimations
}) })
export class BetHistoryComponent implements OnInit { export class BetHistoryComponent implements OnInit, OnDestroy, AfterViewInit {
// dataSource: ServiceCenterDataSource | null;
constructor() { } displayedColumns = [
'idx',
'title',
'contents',
'register',
'createdAt',
'contactStatus'
];
private unsubscribeAll: Subject<any>;
ngOnInit() { @ViewChild(MatPaginator, { static: true })
paginator: MatPaginator;
@ViewChild('filter', { static: true })
filter: ElementRef;
@ViewChild(MatSort, { static: true })
sort: MatSort;
constructor(
private fb: FormBuilder // private serviceCenterService: ServiceCenterService
) {
// Set the private defaults
this.unsubscribeAll = new Subject();
} }
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void {
// Subscribe to update order on changes
// this.dataSource = new ServiceCenterDataSource(
// this.serviceCenterService,
// this.paginator,
// this.sort
// );
}
/**
* On destroy
*/
ngOnDestroy(): void {
// Unsubscribe from all subscriptions
this.unsubscribeAll.next();
this.unsubscribeAll.complete();
}
ngAfterViewInit(): void {}
} }

View File

@ -0,0 +1,119 @@
import { DataSource } from '@angular/cdk/table';
import { BehaviorSubject, Observable, merge, of } from 'rxjs';
import { map } from 'rxjs/operators';
import { CollectionViewer } from '@angular/cdk/collections';
import { BetHistory } from 'src/modules/infos/popup-set/model/popup-set.model';
import { BetHistoryService } from 'src/modules/infos/popup-set/service/popup-set.service';
import { FormControl, FormGroup, Validators, FormArray } from '@angular/forms';
const ELEMENT_DATA: BetHistory[] = [
{
id: 1,
thumbNail: '/images/thumbname/1.jpg',
title: '오픈기념 이벤트',
imageWidth: 200,
imageHeight: 200,
imageX: 100,
imageY: 100,
openStatus: true,
updatedAt: null,
createdAt: null
},
{
id: 2,
thumbNail: '/images/thumbname/2.jpg',
title: '첫충전 이벤트',
imageWidth: 200,
imageHeight: 200,
imageX: 100,
imageY: 100,
openStatus: true,
updatedAt: null,
createdAt: null
},
{
id: 3,
thumbNail: '/images/thumbname/3.jpg',
title: '친구초대 이벤트',
imageWidth: 200,
imageHeight: 200,
imageX: 100,
imageY: 100,
openStatus: true,
updatedAt: null,
createdAt: null
}
];
export class PopupSetDataSource extends DataSource<BetHistory> {
private _objectStore: BetHistory[] = [];
private _ObjectsSubject$ = new BehaviorSubject<BetHistory[]>([]);
private _loadingSubject$ = new BehaviorSubject<boolean>(false);
public loading$ = this._loadingSubject$.asObservable();
public formg: FormGroup;
constructor(private fixBonusService: PopupSetService) {
super();
}
connect(collectionViewer: CollectionViewer): Observable<BetHistory[]> {
// return this.fixBonusService.getAll().pipe(
// map(res => {
// res.forEach(m => this._objectStore.push(m as FixBonus));
// this._ObjectsSubject$.next(this._objectStore);
// let fa = <FormArray>this.formg.get('formarray');
// res.forEach(r => fa.push(this.createRowFormGroup(r)));
// return res;
// })
// );
return of(ELEMENT_DATA).pipe(
map(res => {
res.forEach(m => this._objectStore.push(m as PopupSet));
this._ObjectsSubject$.next(this._objectStore);
let fa = <FormArray>this.formg.get('formarray');
res.forEach(r => fa.push(this.createRowFormGroup(r)));
return res;
})
);
}
// id: 3,
// thumbNail: '/images/thumbname/3.jpg',
// title: '친구초대 이벤트',
// imageWidth: 200,
// imageHeight: 200,
// imageX: 100,
// imageY: 100,
// openStatus: true,
// updatedAt: null,
// createdAt: null
createRowFormGroup(r: PopupSet): FormGroup {
let f = new FormGroup({
title: this.createNewFormContorl(r, 'title'),
imageWidth: this.createNewFormContorl(r, 'imageWidth'),
imageHeight: this.createNewFormContorl(r, 'imageHeight'),
imageX: this.createNewFormContorl(r, 'imageX'),
imageY: this.createNewFormContorl(r, 'imageY'),
openStatus: this.createNewFormContorl(r, 'openStatus')
});
return f;
}
createNewFormContorl(r: PopupSet, propName: string): FormControl {
let m = new FormControl(r[propName], Validators.required);
m.valueChanges.subscribe(val => {
r[propName] = val;
});
return m;
}
disconnect(collectionViewer: CollectionViewer): void {
this._ObjectsSubject$.complete();
this._loadingSubject$.complete();
}
}

View File

@ -8,6 +8,7 @@ import { SettlementComponent } from './settlement.component';
import { ItemManagementComponent } from './item-management.component'; import { ItemManagementComponent } from './item-management.component';
import { LeagueManagementComponent } from './league-management.component'; import { LeagueManagementComponent } from './league-management.component';
import { ExceptAutoRegistComponent } from './except-auto-regist.component'; import { ExceptAutoRegistComponent } from './except-auto-regist.component';
import { BetHistoryTableComponent } from './bet-history-table/bet-history-table.component';
export const COMPONENTS = [ export const COMPONENTS = [
SportResultComponent, SportResultComponent,
@ -19,5 +20,6 @@ export const COMPONENTS = [
SettlementComponent, SettlementComponent,
ItemManagementComponent, ItemManagementComponent,
LeagueManagementComponent, LeagueManagementComponent,
ExceptAutoRegistComponent ExceptAutoRegistComponent,
BetHistoryTableComponent
]; ];

View File

@ -49,13 +49,6 @@ app-service-center {
} }
} }
.mat-tab-group,
.mat-tab-body-wrapper,
.tab-content {
flex: 1 1 auto;
max-width: 100%;
}
.service-center-table { .service-center-table {
flex: 1 1 auto; flex: 1 1 auto;
border-bottom: 1px solid rgba(0, 0, 0, 0.12); border-bottom: 1px solid rgba(0, 0, 0, 0.12);