This commit is contained in:
bobobobo
2026-02-01 17:01:16 +08:00
parent 69bb850559
commit f4a51db1ae
12 changed files with 1387 additions and 1100 deletions

View File

@@ -165,6 +165,7 @@
import { uploadSingleFile } from '../../../../utils/uploadFile'
import { validateGroupNumber } from '../../../../utils/validate'
import { useUI } from '../../../../utils/use-ui'
import { getRandomGroup } from '../../../../api'
const { showToast } = useUI()
const TUIGroupServer = Server.getInstance()
@@ -243,8 +244,7 @@
const submitDisabledStatus = computed(() => {
return (
groupInfo.profile.name === '' ||
(groupInfo.profile.groupID === '' && !groupInfo.isEdit)
groupInfo.profile.name === ''&& !groupInfo.isEdit
)
})
@@ -300,14 +300,17 @@
if (options.type === TUIChatEngine.TYPES.GRP_COMMUNITY) {
delete options.groupID
}
const isGroupID = validateGroupNumber(options.groupID)
// const isGroupID = validateGroupNumber(options.groupID)
// if (!isGroupID.valid) {
// return showToast(isGroupID.message)
// }
const id = await getRandomGroup()
if (!isGroupID.valid) {
return showToast(isGroupID.message)
}
const res = await TUIGroupService.createGroup({
...options,
groupID: '',
groupID: id.data,
avatar: groupAvatar.value
})
const { type } = res.data.group

View File

@@ -174,21 +174,28 @@
* @param data
*/
const onConfirm = async (state, item) => {
const show = await showDialog(
'提示',
`确定分享${props.type == 1 ? '直播间' : '商品'}吗?`
)
if (!show) {
return
}
if (state) {
multiSelectShare()
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
}
} else {
showLoading()
await sendCustomData(item)
hideLoading()
await showToast('分享成功', 'success')
isShow.value = false
await showDialog(
'提示',
`UI需要调整`
)
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -14,7 +14,7 @@
<template>
<UIKitProvider language="zh-CN">
<div @click="handleLiveRoomClick()">点击</div>
<!-- <div @click="handleLiveRoomClick()">点击</div> -->
<LiveList @live-room-click="handleLiveRoomClick" />
</UIKitProvider>
</template>

View File

@@ -34,6 +34,7 @@
getLiveActivityDetail,
getLiveActivityRecord
} from '../../../api/tui-kit'
import { LIVE_BUSINESS } from '@/constants/live-keys'
const { t } = useUIKit()
@@ -69,6 +70,7 @@
const activityData = ref({})
/** 是否显示活动按钮 */
const isShowActivity = ref(false)
const shareDialog = ref(false)
const audienceListTitle = computed(
() => `在线人数 (${audienceList.value.length})`
@@ -80,9 +82,17 @@
showLeaveLiveDialog('您已被踢出房间')
}
watch(messageList, (newVal, oldVal) => {
console.log('收到弹幕消息====:', newVal) // 实时更新的全量消息列表
})
watch(
() => messageList.value,
newMessages => {
if (newMessages.length > 0) {
console.log('弹幕消息列表更新:', newMessages)
if (newMessages.some(v => v.businessID === LIVE_BUSINESS.ADMIN)) {
}
}
},
{ deep: true }
)
watch(
() => currentLive.value?.liveId,
@@ -112,7 +122,7 @@
*/
const handleLeaveLive = () => {
leaveLiveDialogVisible.value = false
// navigateBack()
navigateBack()
}
/**
@@ -195,12 +205,20 @@
}
onLoad(async (e: any) => {
await setSelfInfo({
userName: userInfo.value?.userName || userInfo.value?.mobile,
avatarUrl: userInfo.value?.avatar || ''
})
subscribeEvent(LiveListEvent.onKickedOutOfLive, handleKickedOutOfLive)
await handleJoinLive(e.liveId)
try {
await setSelfInfo({
userName: userInfo.value?.userName || userInfo.value?.mobile,
avatarUrl: userInfo.value?.avatar || ''
})
subscribeEvent(
LiveListEvent.onKickedOutOfLive,
handleKickedOutOfLive
)
await handleJoinLive(e.liveId)
} catch (err) {
console.error('Failed to join live room, error:', err)
showLeaveLiveDialog('没有直播间')
}
})
</script>
@@ -273,6 +291,13 @@
src="/static/images/activity.png"
mode="aspectFit"
/>
<image
class="action-button-icon"
src="/static/images/fengxiang.png"
mode="aspectFit"
style="margin-left: 14rpx"
@click="shareDialog = true"
/>
<!-- <LiveGift class="bottom-operate-button-icon" /> -->
</div>
</div>
@@ -309,6 +334,11 @@
</div>
</template>
</TUIDialog>
<!-- 分享弹框 -->
<!-- 分享弹窗 :id="productId"
:cover="viewData.mainImage" -->
<share-popup v-model:show="shareDialog" type="1"></share-popup>
</UIKitProvider>
</template>

View File

@@ -137,17 +137,23 @@
<view class="left-img">
<text>拼单</text>
<image
src="/static/images/public/random1.png"
:src="`/static/images/public/random${
Math.floor(Math.random() * 7) + 1
}.png`"
mode="scaleToFill"
class="avatar"
></image>
<image
src="/static/images/public/random2.png"
:src="`/static/images/public/random${
Math.floor(Math.random() * 7) + 1
}.png`"
mode="scaleToFill"
class="avatar"
></image>
<image
src="/static/images/public/random3.png"
:src="`/static/images/public/random${
Math.floor(Math.random() * 7) + 1
}.png`"
mode="scaleToFill"
class="avatar"
></image>
@@ -159,7 +165,7 @@
<!-- 去拼团 -->
<view class="bottom-name">
<view class="count-down">
<text>拼单倒计时:</text>
<text>距离结束:</text>
<uni-countdown
:day="parseDateTime(item.endTime).day"
:hour="parseDateTime(item.endTime).hour"

BIN
static/images/fengxiang.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -101,6 +101,7 @@ export const useUserStore = defineStore('user', () => {
useUploadPlugin: true // 使用文件上传插件
})
// #ifdef H5
console.log('11111======')
await useLoginState().login({
SDKAppID: tencentUserSig.value.sdkappID,
userID: tencentUserSig.value.userId,
@@ -109,18 +110,31 @@ export const useUserStore = defineStore('user', () => {
// #endif
// #ifdef APP-PLUS
await useLoginState().login({
SDKAppID: tencentUserSig.value.sdkappID,
userID: tencentUserSig.value.userId,
userSig: tencentUserSig.value.userSig
})
console.log('222222222======')
try {
await useLoginState().login({
SDKAppID: tencentUserSig.value.sdkappID,
userID: tencentUserSig.value.userId,
userSig: tencentUserSig.value.userSig
})
console.log('===========1111')
} catch (err) {
console.log(err, '===========1111')
}
uni.$TUICallKit = uni.requireNativePlugin('TencentCloud-TUICallKit')
uni.$TUICallKit.login({
SDKAppID: tencentUserSig.value.sdkappID,
userID: tencentUserSig.value.userId,
userSig: tencentUserSig.value.userSig
})
console.log(uni.$TUICallKit, "TUICallKit ok"); // 本地日志
// try {
// await uni.$TUICallKit.login({
// SDKAppID: tencentUserSig.value.sdkappID,
// userID: tencentUserSig.value.userId,
// userSig: tencentUserSig.value.userSig
// })
// } catch (err) {
// console.log(err, '===========2222222222')
// }
// #endif
}