nvue直播间需要调整分享样式

This commit is contained in:
bobobobo
2026-02-03 00:45:33 +08:00
parent 10ceb6b476
commit ae36c4cf10
393 changed files with 753 additions and 147 deletions

View File

@@ -8,6 +8,7 @@
import { useUI } from '../../utils/use-ui'
import { CHAT_MSG_CUSTOM_TYPE } from '../../TUIKit/constant'
import { isEnabledMessageReadReceiptGlobal } from '../../TUIKit/components/TUIChat/utils/utils'
import { getFriendList, getGroupList } from '../../utils/storage'
const { showLoading, hideLoading, showToast, showDialog } = useUI()
@@ -40,6 +41,11 @@
price: {
type: [String, Number],
default: ''
},
/** 直播用户数据 */
userLiveData: {
type: Object,
default: () => ({})
}
})
@@ -72,14 +78,38 @@
/** 获取好友列表 */
const onFriendListUpdated = list => {
console.log('好友列表', list)
console.log('好友列表=======:', list)
// #ifdef APP-PLUS
friendList.value = getFriendList()
// #endif
// #ifdef H5
friendList.value = list
// #endif
friendList.value = friendList.value.map(v => {
return {
...v,
...(v?.profile || {})
}
})
console.log('好友列表:', friendList.value)
}
/** 获取群列表 */
const onGroupListUpdated = list => {
console.log('群列表', list)
console.log('群列表=======:', list)
// #ifdef APP-PLUS
groupList.value = getGroupList()
// #endif
// #ifdef H5
groupList.value = list
// #endif
console.log('群列表:', groupList.value)
}
/** 判断多选状态 */
@@ -137,13 +167,23 @@
isGroup = false
}
const payload = {
data: JSON.stringify({
id: props.id,
businessID: CHAT_MSG_CUSTOM_TYPE.GOODS,
title: props.text,
cover: props.cover,
price: props.price
}),
data: JSON.stringify(
props.type == 1
? {
id: props.id,
businessID: CHAT_MSG_CUSTOM_TYPE.LIVE,
title: props.text,
cover: props.cover,
userLiveData: props.userLiveData
}
: {
id: props.id,
businessID: CHAT_MSG_CUSTOM_TYPE.GOODS,
title: props.text,
cover: props.cover,
price: props.price
}
),
description: props.text,
extension: props.text
}
@@ -174,28 +214,21 @@
* @param data
*/
const onConfirm = async (state, item) => {
if (props.type == 2) {
const show = await showDialog(
'提示',
`确定分享${props.type == 1 ? '直播间' : '商品'}吗?`
)
if (!show) {
return
}
if (state) {
multiSelectShare()
} else {
showLoading()
await sendCustomData(item)
hideLoading()
await showToast('分享成功', 'success')
isShow.value = false
}
const show = await showDialog(
'提示',
`确定分享${props.type == 1 ? '直播间' : '商品'}吗?`
)
if (!show) {
return
}
if (state) {
multiSelectShare()
} else {
await showDialog(
'提示',
`UI需要调整`
)
showLoading()
await sendCustomData(item)
hideLoading()
await showToast('分享成功', 'success')
isShow.value = false
}
}
@@ -266,8 +299,8 @@
class="option-card"
>
<image
v-if="item.avatar"
:src="item.avatar"
v-if="item?.avatar"
:src="item?.avatar"
mode="aspectFill"
class="avatar"
></image>
@@ -276,9 +309,13 @@
</view>
</view>
</view>
<!-- 列表 -->
<view class="list-box">
<!-- 群聊列表 ================ -->
{{ groupList.length }} == {{ friendList.length }}
<view
v-for="(item, index) in groupList"
:key="index"
@@ -287,7 +324,7 @@
>
<view v-if="isMultiple" class="box">
<uni-icons
v-if="!multipleShow(`GROUP${item.groupID}`)"
v-if="!multipleShow(`GROUP${item?.groupID}`)"
type="circle"
color="#b7b7b7"
size="30"
@@ -301,8 +338,8 @@
</view>
<view class="card-box">
<image
v-if="item.avatar"
:src="item.avatar"
v-if="item?.avatar"
:src="item?.avatar"
mode="aspectFill"
class="head-img"
></image>
@@ -311,9 +348,9 @@
</view>
<view class="right-box">
<text class="name">
{{ item.name }}
{{ item?.name }}
</text>
<text class="num">({{ item.memberCount }})</text>
<text class="num">({{ item?.memberCount }})</text>
</view>
</view>
</view>
@@ -326,7 +363,7 @@
>
<view v-if="isMultiple" class="box">
<uni-icons
v-if="!multipleShow(`C2C${item.profile.userID}`)"
v-if="!multipleShow(`C2C${item?.userID}`)"
type="circle"
color="#b7b7b7"
size="30"
@@ -340,8 +377,8 @@
</view>
<view class="card-box">
<image
v-if="item.profile.avatar"
:src="item.profile.avatar"
v-if="item?.avatar"
:src="item?.avatar"
mode="aspectFill"
class="head-img"
></image>
@@ -350,7 +387,7 @@
</view>
<view class="right-box">
<text class="name">
{{ item.profile.nick || item.profile.userID }}
{{ item?.nick || item?.userID }}
</text>
</view>
</view>
@@ -400,6 +437,7 @@
.list-box {
padding: 22rpx 24rpx;
height: 46vh;
background: red;
overflow-y: auto;
.item-box + .item-box {
margin-top: 12rpx;