From 46baa83458cc714b5f367e4003674ed790f77f13 Mon Sep 17 00:00:00 2001 From: John Smith Date: Sat, 22 Jun 2019 16:15:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0SC=E8=B4=B4=E7=BA=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blivedm | 2 +- .../components/ChatRenderer/PaidMessage.vue | 70 +---- .../src/components/ChatRenderer/Ticker.vue | 241 ++++++++++++++++++ .../src/components/ChatRenderer/constants.js | 101 ++++++++ .../src/components/ChatRenderer/index.vue | 27 +- frontend/src/views/Room.vue | 26 +- frontend/src/views/StyleGenerator/index.vue | 22 +- 7 files changed, 392 insertions(+), 97 deletions(-) create mode 100644 frontend/src/components/ChatRenderer/Ticker.vue diff --git a/blivedm b/blivedm index 0d63944..003d89e 160000 --- a/blivedm +++ b/blivedm @@ -1 +1 @@ -Subproject commit 0d63944da4558981cd55c1fdbfb11b97837780ff +Subproject commit 003d89e9765d1deed8ccbe78755df837541e6295 diff --git a/frontend/src/components/ChatRenderer/PaidMessage.vue b/frontend/src/components/ChatRenderer/PaidMessage.vue index ef75e6b..d03aeae 100644 --- a/frontend/src/components/ChatRenderer/PaidMessage.vue +++ b/frontend/src/components/ChatRenderer/PaidMessage.vue @@ -32,66 +32,7 @@ + + + + + + diff --git a/frontend/src/components/ChatRenderer/constants.js b/frontend/src/components/ChatRenderer/constants.js index bc04ca0..dce1769 100644 --- a/frontend/src/components/ChatRenderer/constants.js +++ b/frontend/src/components/ChatRenderer/constants.js @@ -1,3 +1,4 @@ +export const AUTHRO_TYPE_NORMAL = 0 export const AUTHRO_TYPE_MEMBER = 1 export const AUTHRO_TYPE_ADMIN = 2 export const AUTHRO_TYPE_OWNER = 3 @@ -15,3 +16,103 @@ export const GUARD_LEVEL_TO_TEXT = [ '提督', '舰长' ] + +export const MESSAGE_TYPE_TEXT = 0 +export const MESSAGE_TYPE_MEMBER = 1 +export const MESSAGE_TYPE_GIFT = 2 + +export const PRICE_CONFIGS = [ + { // $100红 + price: 1245, // >= 1245,小电视飞船 + colors: { + contentBg: 'rgba(230,33,23,1)', + headerBg: 'rgba(208,0,0,1)', + header: 'rgba(255,255,255,1)', + authorName: 'rgba(255,255,255,0.701961)', + time: 'rgba(255,255,255,0.501961)', + content: 'rgba(255,255,255,1)' + }, + pinTime: 60 + }, + { // $50品红 + price: 450, // 450~1245,摩天大楼 + colors: { + contentBg: 'rgba(233,30,99,1)', + headerBg: 'rgba(194,24,91,1)', + header: 'rgba(255,255,255,1)', + authorName: 'rgba(255,255,255,0.701961)', + time: 'rgba(255,255,255,0.501961)', + content: 'rgba(255,255,255,1)' + }, + pinTime: 30 + }, + { // $20橙 + price: 100, // 100~450,节奏风暴、天空之翼 + colors: { + contentBg: 'rgba(245,124,0,1)', + headerBg: 'rgba(230,81,0,1)', + header: 'rgba(255,255,255,0.87451)', + authorName: 'rgba(255,255,255,0.701961)', + time: 'rgba(255,255,255,0.501961)', + content: 'rgba(255,255,255,0.87451)' + }, + pinTime: 10 + }, + { // $10黄 + price: 52, // 52~100,疯狂打call + colors: { + contentBg: 'rgba(255,202,40,1)', + headerBg: 'rgba(255,179,0,1)', + header: 'rgba(0,0,0,0.87451)', + authorName: 'rgba(0,0,0,0.541176)', + time: 'rgba(0,0,0,0.501961)', + content: 'rgba(0,0,0,0.87451)' + }, + pinTime: 5 + }, + { // $5绿 + price: 28, // 28~52,礼花 + colors: { + contentBg: 'rgba(29,233,182,1)', + headerBg: 'rgba(0,191,165,1)', + header: 'rgba(0,0,0,1)', + authorName: 'rgba(0,0,0,0.541176)', + time: 'rgba(0,0,0,0.501961)', + content: 'rgba(0,0,0,1)' + }, + pinTime: 2 + }, + { // $2浅蓝 + price: 9.9, // 9.9~28,B坷垃 + colors: { + contentBg: 'rgba(0,229,255,1)', + headerBg: 'rgba(0,184,212,1)', + header: 'rgba(0,0,0,1)', + authorName: 'rgba(0,0,0,0.701961)', + time: 'rgba(0,0,0,0.501961)', + content: 'rgba(0,0,0,1)' + }, + pinTime: 0 + }, + { // $1蓝 + price: 0, // 0~9.9,丢人 + colors: { + contentBg: 'rgba(30,136,229,1)', + headerBg: 'rgba(21,101,192,1)', + header: 'rgba(255,255,255,1)', + authorName: 'rgba(255,255,255,0.701961)', + time: 'rgba(255,255,255,0.501961)', + content: 'rgba(255,255,255,1)' + }, + pinTime: 0 + } +] + +export function getPriceConfig (price) { + for (const config of PRICE_CONFIGS) { + if (price >= config.price) { + return config + } + } + return PRICE_CONFIGS[PRICE_CONFIGS.length - 1] +} diff --git a/frontend/src/components/ChatRenderer/index.vue b/frontend/src/components/ChatRenderer/index.vue index ad9a519..a2b1c16 100644 --- a/frontend/src/components/ChatRenderer/index.vue +++ b/frontend/src/components/ChatRenderer/index.vue @@ -1,31 +1,18 @@