From 2820d90a85bcbc61bfcb29c0330c8957b21feff1 Mon Sep 17 00:00:00 2001 From: Park Byung Eun Date: Mon, 29 Aug 2022 10:49:07 +0000 Subject: [PATCH] bug fix --- .../beteran/component/home.component.ts | 169 ++++-------------- 1 file changed, 30 insertions(+), 139 deletions(-) diff --git a/src/app/modules/beteran/component/home.component.ts b/src/app/modules/beteran/component/home.component.ts index 55be425..340af5a 100644 --- a/src/app/modules/beteran/component/home.component.ts +++ b/src/app/modules/beteran/component/home.component.ts @@ -17,7 +17,9 @@ import { SignInComposeComponent } from 'app/modules/beteran/compose/compose/sign import { SignUpComposeComponent } from 'app/modules/beteran/compose/compose/sign-up-compose.component'; import { WithdrawComposeComponent } from 'app/modules/beteran/compose/compose/withdraw-compose.component'; import { WithdrawHistoryComposeComponent } from 'app/modules/beteran/compose/compose/withdraw-history-compose.component'; +import { GameService } from 'app/modules/polyglot/api/services/game.service'; import { VendorService } from 'app/modules/polyglot/api/services/vendor.service'; +import { ListGamesResponse } from 'app/modules/proto/c2se/api/game_pb'; import { Vendor } from 'app/modules/proto/models/api/vendor_pb'; export enum ComposeMenuType { @@ -48,137 +50,6 @@ export class HomeComponent implements OnInit { hotelCasinos!: Vendor[]; slotGames!: Vendor[]; - components = [ - { - id: 'ag(1)', - name: '에볼루션', - summary: 'Evolution', - exampleSpecs: { - prefix: 'autocomplete-', - }, - additionalApiDocs: [ - { - name: 'Testing', - path: 'material-autocomplete-testing.html', - }, - ], - }, - { - id: 'allbet', - name: '프라그메틱', - summary: 'PragmaticPlay.', - exampleSpecs: { - prefix: 'badge-', - }, - additionalApiDocs: [ - { - name: 'Testing', - path: 'material-badge-testing.html', - }, - ], - }, - { - id: 'elysium', - name: '드림게이밍', - summary: 'DreamGaming', - exampleSpecs: { - prefix: 'bottom-sheet-', - }, - additionalApiDocs: [ - { - name: 'Testing', - path: 'material-bottom-sheet-testing.html', - }, - ], - }, - { - id: 'elysium', - name: '마이크로게이밍', - summary: 'MicroGaming', - exampleSpecs: { - prefix: 'button-', - exclude: ['button-toggle-'], - }, - additionalApiDocs: [ - { - name: 'Testing', - path: 'material-button-testing.html', - }, - ], - }, - { - id: 'evolution', - name: '오리엔탈플러스', - summary: 'OrientalPlus', - exampleSpecs: { - prefix: 'button-toggle-', - }, - additionalApiDocs: [ - { - name: 'Testing', - path: 'material-button-toggle-testing.html', - }, - ], - }, - { - id: 'ezugi', - name: '아시안게이밍', - summary: 'AsiaGaming', - exampleSpecs: { - prefix: 'card-', - }, - additionalApiDocs: [ - { - name: 'Testing', - path: 'material-card-testing.html', - }, - ], - }, - { - id: 'ezugi', - name: 'CQ9LIVE', - summary: 'CQ9LIVE', - exampleSpecs: { - prefix: 'checkbox-', - }, - additionalApiDocs: [ - { - name: 'Testing', - path: 'material-checkbox-testing.html', - }, - ], - }, - { - id: 'ezugi', - name: '이주기', - summary: 'Ezugi', - exampleSpecs: { - prefix: 'chips-', - }, - additionalApiDocs: [ - { - name: 'Testing', - path: 'material-chips-testing.html', - }, - ], - }, - - // { - // id: 'ezugi', - // name: '비보카지노', - // summary: 'VIVO', - // exampleSpecs: { - // prefix: 'core-', - // }, - // additionalApiDocs: [ - // { - // name: 'Testing', - // path: 'material-core-testing.html', - // }, - // ], - // }, - ]; - data = { schedule: { today: [ @@ -212,7 +83,8 @@ export class HomeComponent implements OnInit { private _changeDetectorRef: ChangeDetectorRef, private _router: Router, private _matDialog: MatDialog, - private _vendorService: VendorService + private _vendorService: VendorService, + private _gameService: GameService ) {} ngOnInit(): void { @@ -298,13 +170,32 @@ export class HomeComponent implements OnInit { console.log('Compose dialog was closed!'); }); } + private async getGameByParentId( + parenId: number + ): Promise { + return await this._gameService.listGames(parenId); + } - onClickGame(game: Vendor): void { - console.log(game.toString()); - window.open( - '/game/?vendor_key=pragmatic_casino&game_key=101', - 'gamepopup', - 'width=1400, height=900, toolbar=no, menubar=no, scrollbars=no, resizable=yes' - ); + onClickGame(vendor: Vendor): void { + console.log(vendor.toString()); + this.getGameByParentId(vendor.getId()).then((result) => { + const gameList = result.getGamesList(); + + if (gameList.length === 0) { + return; + } + const game = gameList[0]; + const url = `/game/?vendor_key=${vendor.getKey()}&game_key=${game.getKey()}`; + window.open( + url, + 'gamepopup', + 'width=1400, height=900, toolbar=no, menubar=no, scrollbars=no, resizable=yes' + ); + }); + // window.open( + // '/game/?vendor_key=pragmatic_casino&game_key=101', + // 'gamepopup', + // 'width=1400, height=900, toolbar=no, menubar=no, scrollbars=no, resizable=yes' + // ); } }