This commit is contained in:
bobobobo
2026-02-05 01:09:52 +08:00
parent 8cefc2f670
commit a54dfee158
8 changed files with 163 additions and 226 deletions

View File

@@ -73,7 +73,14 @@
class="action-btn"
src="/static/images/fengxiang.png"
style="width: 72rpx; height: 72rpx;"
@click="shareDialog = true"
@click="navigateTo('/pages/shop-together/user', {
type: 1,
id: currentLive.liveID,
text: currentLive.liveName,
cover: currentLive.coverUrl,
avatarUrl: currentLive.liveOwner.avatarUrl
title: currentLive.liveOwner.title
})"
/>
<Like />
</view>
@@ -102,17 +109,10 @@
<ActionSheet v-model="isShowCoGuestSheet" :title="coGuestSheetTitle" :itemList="coGuestSheetItems"
@select="onCoGuestSheetSelect" />
<share-popup
v-model:show="shareDialog"
:id="currentLive.liveId"
:text="currentLive.liveName"
:cover="currentLive.coverUrl"
:userLiveData="currentLive.liveOwner"
type="1"
></share-popup>
</template>
<script setup lang="ts">
import { navigateTo } from '@/utils/router'
import { imDataEndLive, getLiveActivityDetail, getLiveActivityRecord } from '@/api/tui-kit'
import { onLoad } from '@dcloudio/uni-app';
import { ref, onMounted, computed, onUnmounted, watch, nextTick } from 'vue';

View File

@@ -91,12 +91,11 @@
></image>
</template>
<template #right>
<!-- shareDialog = true navigateTo -->
<image
src="/static/images/public/share-icon.png"
mode="heightFix"
class="right-icon"
@click="navigateTo('/pages/shop-together/user')"
@click="shareDialog = true"
></image>
</template>
</nav-bar>

View File

@@ -18,7 +18,17 @@
type: '2',
id: '',
/** 分享文本 */
text: ''
text: '',
/** 封面图 */
cover: '',
/** 多少钱 */
price: '',
/** 直播用户数据 */
userLiveData: {},
/** 直播用户头像 */
avatarUrl: '',
/** 直播用户名称 */
title: ''
})
/** 多选状态 */
@@ -32,7 +42,6 @@
const topBack = () => {
if (!isMultiple.value) {
console.log('返回')
navigateBack()
} else {
selectedList.value = []
@@ -47,7 +56,7 @@
/** 获取好友列表 */
const onFriendListUpdated = list => {
friendList.value = friendList.value.map(v => {
friendList.value = list.map(v => {
return {
...v,
...(v?.profile || {})
@@ -113,26 +122,30 @@
to = item.id.split('C2C')[1]
isGroup = false
}
const payload = {
data: JSON.stringify(
props.type == 1
propsData.type == 1
? {
id: props.id,
id: propsData.id,
businessID: CHAT_MSG_CUSTOM_TYPE.LIVE,
title: props.text,
cover: props.cover,
userLiveData: props.userLiveData
title: propsData.text,
cover: propsData.cover,
userLiveData: {
avatarUrl: propsData.avatarUrl,
title: propsData.title
}
}
: {
id: props.id,
id: propsData.id,
businessID: CHAT_MSG_CUSTOM_TYPE.GOODS,
title: props.text,
cover: props.cover,
price: props.price
title: propsData.text,
cover: propsData.cover,
price: propsData.price
}
),
description: props.text,
extension: props.text
description: propsData.text,
extension: propsData.text
}
const options = {
to,
@@ -153,6 +166,7 @@
hideLoading()
await showToast('分享成功', 'success')
isShow.value = false
navigateBack()
}
/**
@@ -161,9 +175,12 @@
* @param data
*/
const onConfirm = async (state, item) => {
if (state == 1 && selectedList.value.length == 0) {
return
}
const show = await showDialog(
'提示',
`确定分享${props.type == 1 ? '直播间' : '商品'}吗?`
`确定分享${propsData.type == 1 ? '直播间' : '商品'}吗?`
)
if (!show) {
return
@@ -176,10 +193,12 @@
hideLoading()
await showToast('分享成功', 'success')
isShow.value = false
navigateBack()
}
}
onLoad(() => {
onLoad(e => {
console.log('===', e)
TUIStore.watch(StoreName.GRP, {
groupList: onGroupListUpdated
})