mirror of
https://github.com/xfgryujk/blivechat.git
synced 2025-01-15 06:41:12 +08:00
消息元素添加舰队等级、金额等级属性
This commit is contained in:
parent
c8bb109079
commit
1809fefd65
@ -1,5 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<yt-live-chat-membership-item-renderer class="style-scope yt-live-chat-item-list-renderer" show-only-header>
|
<yt-live-chat-membership-item-renderer class="style-scope yt-live-chat-item-list-renderer" show-only-header
|
||||||
|
:blc-guard-level="privilegeType"
|
||||||
|
>
|
||||||
<div id="card" class="style-scope yt-live-chat-membership-item-renderer">
|
<div id="card" class="style-scope yt-live-chat-membership-item-renderer">
|
||||||
<div id="header" class="style-scope yt-live-chat-membership-item-renderer">
|
<div id="header" class="style-scope yt-live-chat-membership-item-renderer">
|
||||||
<img-shadow id="author-photo" height="40" width="40" class="style-scope yt-live-chat-membership-item-renderer"
|
<img-shadow id="author-photo" height="40" width="40" class="style-scope yt-live-chat-membership-item-renderer"
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
'--yt-live-chat-paid-message-timestamp-color': color.time,
|
'--yt-live-chat-paid-message-timestamp-color': color.time,
|
||||||
'--yt-live-chat-paid-message-color': color.content
|
'--yt-live-chat-paid-message-color': color.content
|
||||||
}"
|
}"
|
||||||
|
:blc-price-level="priceConfig.priceLevel"
|
||||||
>
|
>
|
||||||
<div id="card" class="style-scope yt-live-chat-paid-message-renderer">
|
<div id="card" class="style-scope yt-live-chat-paid-message-renderer">
|
||||||
<div id="header" class="style-scope yt-live-chat-paid-message-renderer">
|
<div id="header" class="style-scope yt-live-chat-paid-message-renderer">
|
||||||
@ -47,8 +48,11 @@ export default {
|
|||||||
content: String
|
content: String
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
priceConfig() {
|
||||||
|
return constants.getPriceConfig(this.price)
|
||||||
|
},
|
||||||
color() {
|
color() {
|
||||||
return constants.getPriceConfig(this.price).colors
|
return this.priceConfig.colors
|
||||||
},
|
},
|
||||||
priceText() {
|
priceText() {
|
||||||
return `CN¥${utils.formatCurrency(this.price)}`
|
return `CN¥${utils.formatCurrency(this.price)}`
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<yt-live-chat-text-message-renderer :author-type="authorTypeText">
|
<yt-live-chat-text-message-renderer :author-type="authorTypeText" :blc-guard-level="privilegeType">
|
||||||
<img-shadow id="author-photo" height="24" width="24" class="style-scope yt-live-chat-text-message-renderer"
|
<img-shadow id="author-photo" height="24" width="24" class="style-scope yt-live-chat-text-message-renderer"
|
||||||
:imgUrl="avatarUrl"
|
:imgUrl="avatarUrl"
|
||||||
></img-shadow>
|
></img-shadow>
|
||||||
|
@ -40,7 +40,8 @@ export const CONTENT_TYPE_IMAGE = 1
|
|||||||
// 美元 -> 人民币 汇率
|
// 美元 -> 人民币 汇率
|
||||||
const EXCHANGE_RATE = 7
|
const EXCHANGE_RATE = 7
|
||||||
export const PRICE_CONFIGS = [
|
export const PRICE_CONFIGS = [
|
||||||
{ // $100红
|
// $100红
|
||||||
|
{
|
||||||
price: 100 * EXCHANGE_RATE,
|
price: 100 * EXCHANGE_RATE,
|
||||||
colors: {
|
colors: {
|
||||||
contentBg: 'rgba(230,33,23,1)',
|
contentBg: 'rgba(230,33,23,1)',
|
||||||
@ -50,9 +51,11 @@ export const PRICE_CONFIGS = [
|
|||||||
time: 'rgba(255,255,255,0.501961)',
|
time: 'rgba(255,255,255,0.501961)',
|
||||||
content: 'rgba(255,255,255,1)'
|
content: 'rgba(255,255,255,1)'
|
||||||
},
|
},
|
||||||
pinTime: 60
|
pinTime: 60,
|
||||||
|
priceLevel: 7,
|
||||||
},
|
},
|
||||||
{ // $50品红
|
// $50品红
|
||||||
|
{
|
||||||
price: 50 * EXCHANGE_RATE,
|
price: 50 * EXCHANGE_RATE,
|
||||||
colors: {
|
colors: {
|
||||||
contentBg: 'rgba(233,30,99,1)',
|
contentBg: 'rgba(233,30,99,1)',
|
||||||
@ -62,9 +65,11 @@ export const PRICE_CONFIGS = [
|
|||||||
time: 'rgba(255,255,255,0.501961)',
|
time: 'rgba(255,255,255,0.501961)',
|
||||||
content: 'rgba(255,255,255,1)'
|
content: 'rgba(255,255,255,1)'
|
||||||
},
|
},
|
||||||
pinTime: 30
|
pinTime: 30,
|
||||||
|
priceLevel: 6,
|
||||||
},
|
},
|
||||||
{ // $20橙
|
// $20橙
|
||||||
|
{
|
||||||
price: 20 * EXCHANGE_RATE,
|
price: 20 * EXCHANGE_RATE,
|
||||||
colors: {
|
colors: {
|
||||||
contentBg: 'rgba(245,124,0,1)',
|
contentBg: 'rgba(245,124,0,1)',
|
||||||
@ -74,9 +79,11 @@ export const PRICE_CONFIGS = [
|
|||||||
time: 'rgba(255,255,255,0.501961)',
|
time: 'rgba(255,255,255,0.501961)',
|
||||||
content: 'rgba(255,255,255,0.87451)'
|
content: 'rgba(255,255,255,0.87451)'
|
||||||
},
|
},
|
||||||
pinTime: 10
|
pinTime: 10,
|
||||||
|
priceLevel: 5,
|
||||||
},
|
},
|
||||||
{ // $10黄
|
// $10黄
|
||||||
|
{
|
||||||
price: 10 * EXCHANGE_RATE,
|
price: 10 * EXCHANGE_RATE,
|
||||||
colors: {
|
colors: {
|
||||||
contentBg: 'rgba(255,202,40,1)',
|
contentBg: 'rgba(255,202,40,1)',
|
||||||
@ -86,9 +93,11 @@ export const PRICE_CONFIGS = [
|
|||||||
time: 'rgba(0,0,0,0.501961)',
|
time: 'rgba(0,0,0,0.501961)',
|
||||||
content: 'rgba(0,0,0,0.87451)'
|
content: 'rgba(0,0,0,0.87451)'
|
||||||
},
|
},
|
||||||
pinTime: 5
|
pinTime: 5,
|
||||||
|
priceLevel: 4,
|
||||||
},
|
},
|
||||||
{ // $5绿
|
// $5绿
|
||||||
|
{
|
||||||
price: 5 * EXCHANGE_RATE,
|
price: 5 * EXCHANGE_RATE,
|
||||||
colors: {
|
colors: {
|
||||||
contentBg: 'rgba(29,233,182,1)',
|
contentBg: 'rgba(29,233,182,1)',
|
||||||
@ -98,9 +107,11 @@ export const PRICE_CONFIGS = [
|
|||||||
time: 'rgba(0,0,0,0.501961)',
|
time: 'rgba(0,0,0,0.501961)',
|
||||||
content: 'rgba(0,0,0,1)'
|
content: 'rgba(0,0,0,1)'
|
||||||
},
|
},
|
||||||
pinTime: 2
|
pinTime: 2,
|
||||||
|
priceLevel: 3,
|
||||||
},
|
},
|
||||||
{ // $2浅蓝
|
// $2浅蓝
|
||||||
|
{
|
||||||
price: 2 * EXCHANGE_RATE,
|
price: 2 * EXCHANGE_RATE,
|
||||||
colors: {
|
colors: {
|
||||||
contentBg: 'rgba(0,229,255,1)',
|
contentBg: 'rgba(0,229,255,1)',
|
||||||
@ -110,9 +121,11 @@ export const PRICE_CONFIGS = [
|
|||||||
time: 'rgba(0,0,0,0.501961)',
|
time: 'rgba(0,0,0,0.501961)',
|
||||||
content: 'rgba(0,0,0,1)'
|
content: 'rgba(0,0,0,1)'
|
||||||
},
|
},
|
||||||
pinTime: 0
|
pinTime: 0,
|
||||||
|
priceLevel: 2,
|
||||||
},
|
},
|
||||||
{ // $1蓝
|
// $1蓝
|
||||||
|
{
|
||||||
price: EXCHANGE_RATE,
|
price: EXCHANGE_RATE,
|
||||||
colors: {
|
colors: {
|
||||||
contentBg: 'rgba(30,136,229,1)',
|
contentBg: 'rgba(30,136,229,1)',
|
||||||
@ -122,8 +135,9 @@ export const PRICE_CONFIGS = [
|
|||||||
time: 'rgba(255,255,255,0.501961)',
|
time: 'rgba(255,255,255,0.501961)',
|
||||||
content: 'rgba(255,255,255,1)'
|
content: 'rgba(255,255,255,1)'
|
||||||
},
|
},
|
||||||
pinTime: 0
|
pinTime: 0,
|
||||||
}
|
priceLevel: 1,
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
export function getPriceConfig(price) {
|
export function getPriceConfig(price) {
|
||||||
|
Loading…
Reference in New Issue
Block a user