Commit a9f2aa1b by MichaelJier

feature

1. 礼物和现金支持单个显示
2. 更换被赠送礼物名字字段
parent b9125e40
......@@ -129,6 +129,7 @@ export default {
text-align: center;
line-height: .4rem;
transition: all .3s;
margin-bottom: 0.25rem;
}
.btn-active {
background: linear-gradient(180deg, #FF6868 0%, #F43D3D 100%);
......
......@@ -5,27 +5,29 @@
<div style="background: rgba(0, 0, 0, 0.9); width:100%;height: auto" @click.stop>
<div class="top-box">
<div class="tab-box">
<div :class="{ 'z-active': tabIndex == 0 }" @click.stop="_tabSwitch(0)">
<div :class="{ 'z-active': list[tabIndex].nameKey === 'gift' }" @click.stop="_tabSwitch(0)"
v-if="list.some(item => item.nameKey === 'gift')">
礼物
</div>
<div :class="{ 'z-active': tabIndex == 1 }" @click.stop="_tabSwitch(1)">
<div :class="{ 'z-active': list[tabIndex].nameKey === 'cash' }" @click.stop="_tabSwitch(1)"
v-if="list.some(item => item.nameKey === 'cash')">
现金打赏
</div>
</div>
<div class="sendName-box">
<div class="text">送给</div>
<div class="header"><img :src="channelInfo.chatAdminAvaUrl"/></div>
<div class="name">{{ channelInfo.chatAdminName || '管理员' }}</div>
<div class="header"><img :src="channelInfo.rewardPhotoUrl || channelInfo.chatAdminAvaUrl"/></div>
<div class="name">{{ channelInfo.rewardName || channelInfo.chatAdminName || '管理员' }}</div>
<div class="icon"></div>
</div>
</div>
<div class="swiper-container" ref="swiper">
<div class="swiper-wrapper">
<div class="swiper-slide" v-for="item in list" :key="item.index">
<template v-if="item.index === 0" @click.stop>
<div class="swiper-slide" v-for="item in list" :key="item.nameKey">
<template v-if="item.nameKey === 'gift'" @click.stop>
<reward-gift :show="value"/>
</template>
<template v-if="item.index === 1" @click.stop>
<template v-if="item.nameKey === 'cash'" @click.stop>
<reward-cash />
</template>
</div>
......@@ -53,10 +55,6 @@ export default {
showAni: true,
tabIndex: 0,
defaultIcon: require('./img/icon-reward.png'),
list: [
{name:'礼物', index: 0},
{name:'现金打赏', index: 1}
],
swiper: null
};
},
......@@ -74,6 +72,16 @@ export default {
channelInfo: 'channelInfo',
userInfo: 'userInfo'
}),
list() {
const list = []
if (this.channelInfo.rewardGiftStatus === 1){
list.push({name:'礼物', nameKey: 'gift'})
}
if (this.channelInfo.rewardStatus === 1) {
list.push({name:'现金打赏', nameKey: 'cash'})
}
return list
}
},
methods: {
close() {
......@@ -144,7 +152,7 @@ export default {
width: 50%;
display: flex;
justify-content: space-around;
align-items: flex-end;
align-items: center;
div {
display: inline-block;
margin-right: 0.1rem;
......
......@@ -140,8 +140,8 @@ const testApi = {
// getAddressForGet: '' // 防盗链接口
};
const privateApi = {
getMenuList: '/go/live/menu/list', // 获取菜单配置 // /go/live/menu/list
getImagetext: '/go/live/menu/imagetext', // 获取富文本
getMenuList: '/live/menu/list', // 获取菜单配置 // /go/live/menu/list // /node/live/menuList
getImagetext: '/live/menu/imagetext', // 获取富文本
getChannelInfo: '/go/live/getinfo', // 获取直播间配置
getChannelConfig: '/node/index/channelConfig', // 获取直播间配置
getAdvertList: '/node/live/advertList', // 获取广告配置
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment