nvue直播间需要调整分享样式
This commit is contained in:
@@ -116,6 +116,41 @@
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<!-- 直播信息 -->
|
||||
<template
|
||||
v-else-if="customData.businessID === CHAT_MSG_CUSTOM_TYPE.LIVE"
|
||||
>
|
||||
<view @click="onLive" class="live-box">
|
||||
<!-- 直播状态 -->
|
||||
<view class="top-state">
|
||||
<uni-icons
|
||||
type="circle-filled"
|
||||
color="#fff"
|
||||
size="36rpx"
|
||||
></uni-icons>
|
||||
<text class="state">直播间</text>
|
||||
</view>
|
||||
<image
|
||||
:src="goodsData.cover"
|
||||
mode="scaleToFill"
|
||||
class="live-img"
|
||||
/>
|
||||
<view class="live-text">
|
||||
<view class="live_box">
|
||||
<view class="avatar">
|
||||
<image
|
||||
v-if="goodsData.userLiveData?.avatarUrl"
|
||||
:src="goodsData.userLiveData?.avatarUrl"
|
||||
mode="scaleToFill"
|
||||
class="avatar-img"
|
||||
/>
|
||||
<uni-icons v-else type="contact" size="76rpx"></uni-icons>
|
||||
</view>
|
||||
<text class="text-box">{{ goodsData.title }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span v-html="content.custom" />
|
||||
</template>
|
||||
@@ -141,7 +176,7 @@
|
||||
import star from '../../../../assets/icon/star-light.png'
|
||||
import unopenedEnvelope from '../../../../assets/icon/unopened-envelope.svg'
|
||||
import kaiEnvelope from '../../../../assets/icon/kai-unopened-envelope.svg'
|
||||
import { navigateTo } from '../../../../../utils/router'
|
||||
import { navigateTo } from '../../../../../utils/router'
|
||||
|
||||
interface Props {
|
||||
messageItem: IMessageModel
|
||||
@@ -200,6 +235,21 @@ import { navigateTo } from '../../../../../utils/router'
|
||||
navigateTo('/pages/mall/detail', { productId: goodsData.value.id })
|
||||
}
|
||||
|
||||
/** 点击跳转直播间 */
|
||||
const onLive = () => {
|
||||
// #ifdef APP-PLUS
|
||||
navigateTo('/pages/audience/index', {
|
||||
liveID: goodsData.value.id
|
||||
})
|
||||
// #endif
|
||||
|
||||
// #ifdef H5
|
||||
navigateTo('/pages/discover/livelist/h5-live-player', {
|
||||
liveId: goodsData.value.id
|
||||
})
|
||||
// #endif
|
||||
}
|
||||
|
||||
watchEffect(() => {
|
||||
custom.value = props.content
|
||||
message.value = props.messageItem
|
||||
@@ -359,4 +409,62 @@ import { navigateTo } from '../../../../../utils/router'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.live-box {
|
||||
width: 300rpx;
|
||||
height: 380rpx;
|
||||
position: relative;
|
||||
.top-state {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: 20rpx;
|
||||
left: 20rpx;
|
||||
background: #e15636;
|
||||
padding: 6rpx 18rpx 6rpx 10rpx;
|
||||
border-radius: 50rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
line-height: 1;
|
||||
.state {
|
||||
font-size: 26rpx;
|
||||
color: #fff;
|
||||
margin-left: 6rpx;
|
||||
}
|
||||
}
|
||||
.live-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
.live-text {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
bottom: 20rpx;
|
||||
.live_box {
|
||||
padding: 0 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.avatar {
|
||||
flex-shrink: 0;
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
.avatar-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.text-box {
|
||||
margin-left: 10rpx;
|
||||
width: calc(100% - 64rpx);
|
||||
color: #fff;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user