From ec2b119172a0932c67e6ceee243a6e90e24da507 Mon Sep 17 00:00:00 2001 From: wzdwc Date: Wed, 13 May 2020 01:03:41 +0800 Subject: [PATCH] client ui --- client/src/App.vue | 138 +++++---- client/src/components/BuyIn.vue | 76 +++++ client/src/components/SitList.vue | 125 +++++--- client/src/components/cardList.vue | 6 +- client/src/components/range.vue | 142 ++++----- client/src/interface/{user.ts => IPlayer.ts} | 27 +- client/src/interface/ISit.ts | 6 + client/src/interface/IUser.ts | 7 + client/src/interface/sit.ts | 6 - client/src/main.ts | 33 +- client/src/utils/init.ts | 13 + client/src/views/Home.vue | 136 ++++---- client/src/views/game.vue | 177 +++++------ server/logs/ELKLog/error.log | 8 +- server/logs/ELKLog/error.log.2020-05-12 | 7 + server/logs/ELKLog/info.log | 21 +- server/logs/ELKLog/info.log.2020-05-12 | 17 + server/logs/game-node-center/agent.log | 15 +- .../game-node-center/agent.log.2020-05-12 | 291 ++++++++++++++++++ server/logs/game-node-center/app.log | 111 ++++++- .../logs/game-node-center/app.log.2020-05-12 | 115 +++++++ server/logs/game-node-center/core.log | 103 ++++++- .../logs/game-node-center/core.log.2020-05-12 | 144 +++++++++ server/logs/game-node-center/egg-schedule.log | 18 ++ .../egg-schedule.log.2020-05-12 | 45 +++ server/logs/game-node-center/error.log | 34 +- .../game-node-center/error.log.2020-05-12 | 190 ++++++++++++ server/src/app/core/Player.ts | 4 +- server/src/app/io/controller/game.ts | 4 +- server/src/app/io/middleware/join.ts | 18 +- server/src/lib/baseSocketController.ts | 1 + 31 files changed, 1630 insertions(+), 408 deletions(-) create mode 100644 client/src/components/BuyIn.vue rename client/src/interface/{user.ts => IPlayer.ts} (62%) create mode 100644 client/src/interface/ISit.ts create mode 100644 client/src/interface/IUser.ts delete mode 100644 client/src/interface/sit.ts create mode 100644 client/src/utils/init.ts create mode 100644 server/logs/ELKLog/error.log.2020-05-12 create mode 100644 server/logs/ELKLog/info.log.2020-05-12 create mode 100644 server/logs/game-node-center/agent.log.2020-05-12 create mode 100644 server/logs/game-node-center/app.log.2020-05-12 create mode 100644 server/logs/game-node-center/core.log.2020-05-12 create mode 100644 server/logs/game-node-center/egg-schedule.log.2020-05-12 create mode 100644 server/logs/game-node-center/error.log.2020-05-12 diff --git a/client/src/App.vue b/client/src/App.vue index 6a82e92..39b0cf3 100644 --- a/client/src/App.vue +++ b/client/src/App.vue @@ -1,68 +1,70 @@ - - - - - + + + + + diff --git a/client/src/components/BuyIn.vue b/client/src/components/BuyIn.vue new file mode 100644 index 0000000..3fc3bda --- /dev/null +++ b/client/src/components/BuyIn.vue @@ -0,0 +1,76 @@ + + + + + + diff --git a/client/src/components/SitList.vue b/client/src/components/SitList.vue index ef5d730..87c660b 100644 --- a/client/src/components/SitList.vue +++ b/client/src/components/SitList.vue @@ -1,4 +1,3 @@ -y - - - + + + + + + diff --git a/client/src/interface/user.ts b/client/src/interface/IPlayer.ts similarity index 62% rename from client/src/interface/user.ts rename to client/src/interface/IPlayer.ts index 44f99bb..fca903e 100644 --- a/client/src/interface/user.ts +++ b/client/src/interface/IPlayer.ts @@ -1,10 +1,17 @@ -export interface IUser { - counter: number; - nickName: string; - actionSize: number; - actionCommand: string; - type: string; - userId?: number; - handCard?: string[]; - buyIn: number; -} +enum PlayerType { + READY, + SIT_DOWN, + GAMING, +} + +export interface IPlayer { + counter: number; + nickName: string; + actionSize: number; + actionCommand: string; + type: string; + userId?: number; + handCard?: string[]; + buyIn: number; + status: number; +} diff --git a/client/src/interface/ISit.ts b/client/src/interface/ISit.ts new file mode 100644 index 0000000..6da9839 --- /dev/null +++ b/client/src/interface/ISit.ts @@ -0,0 +1,6 @@ +import { IPlayer } from '@/interface/IPlayer'; + +export default interface ISit { + player: IPlayer | null; + position: number; +} diff --git a/client/src/interface/IUser.ts b/client/src/interface/IUser.ts new file mode 100644 index 0000000..6320fc7 --- /dev/null +++ b/client/src/interface/IUser.ts @@ -0,0 +1,7 @@ +export interface IUser { + nickName: string; + counter: number; + userId?: number; + buyIn: number; + account: string; +} diff --git a/client/src/interface/sit.ts b/client/src/interface/sit.ts deleted file mode 100644 index 6802328..0000000 --- a/client/src/interface/sit.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IUser } from '@/interface/user'; - -export default interface ISit { - player: IUser | null; - position: number; -} diff --git a/client/src/main.ts b/client/src/main.ts index 9fa3a90..5ae6e16 100644 --- a/client/src/main.ts +++ b/client/src/main.ts @@ -1,16 +1,17 @@ -import Vue from 'vue'; -import App from './App.vue'; -import router from './router'; -import store from './store'; -import VConsole from 'vconsole'; - -Vue.config.productionTip = false; - -// tslint:disable-next-line:no-unused-expression -new VConsole(); - -new Vue({ - router, - store, - render: (h) => h(App), -}).$mount('#app'); +import Vue from 'vue'; +import App from './App.vue'; +import router from './router'; +import store from './store'; +import VConsole from 'vconsole'; +import './utils/init'; + +Vue.config.productionTip = false; + +// tslint:disable-next-line:no-unused-expression +new VConsole(); + +new Vue({ + router, + store, + render: (h) => h(App), +}).$mount('#app'); diff --git a/client/src/utils/init.ts b/client/src/utils/init.ts new file mode 100644 index 0000000..3d3a944 --- /dev/null +++ b/client/src/utils/init.ts @@ -0,0 +1,13 @@ +let setRem = () => { + let curWidth = document.documentElement.clientWidth || window.screen.width; + const basicWidth = 375; + const basicFontSize = 20; + let calcFontSize = 0; + curWidth = curWidth > 640 ? 640 : curWidth < 320 ? 320 : curWidth; + calcFontSize = (curWidth / basicWidth) * basicFontSize; + document.documentElement.style.fontSize = calcFontSize + 'px'; +}; +setRem(); +window.addEventListener('resize', () => { + setRem(); +}); diff --git a/client/src/views/Home.vue b/client/src/views/Home.vue index ac37833..e43ff18 100644 --- a/client/src/views/Home.vue +++ b/client/src/views/Home.vue @@ -1,68 +1,68 @@ - - - - + + + + diff --git a/client/src/views/game.vue b/client/src/views/game.vue index 4fca103..c0b2793 100644 --- a/client/src/views/game.vue +++ b/client/src/views/game.vue @@ -3,23 +3,24 @@ + @buyIn="buyIn" + :isPlay = 'isPlay' + :hand-card="handCardString">
-
- - - - - - - - -
- {{joinMsg}} -
-
+ + + + + + + + + + + + +
pot: {{pot}}
@@ -39,8 +40,8 @@
- {{pot / 3}} - {{pot / 2}} + {{Math.floor(pot / 3)}} + {{Math.floor(pot / 2)}} {{pot}} {{2*pot}}
@@ -52,30 +53,21 @@ buy in
-
-
-
-
-
buy in: {{buyInSize}}
- -
-
buy in
-
-
+