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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

@@ -137,17 +137,23 @@
<view class="left-img"> <view class="left-img">
<text>拼单</text> <text>拼单</text>
<image <image
src="/static/images/public/random1.png" :src="`/static/images/public/random${
Math.floor(Math.random() * 7) + 1
}.png`"
mode="scaleToFill" mode="scaleToFill"
class="avatar" class="avatar"
></image> ></image>
<image <image
src="/static/images/public/random2.png" :src="`/static/images/public/random${
Math.floor(Math.random() * 7) + 1
}.png`"
mode="scaleToFill" mode="scaleToFill"
class="avatar" class="avatar"
></image> ></image>
<image <image
src="/static/images/public/random3.png" :src="`/static/images/public/random${
Math.floor(Math.random() * 7) + 1
}.png`"
mode="scaleToFill" mode="scaleToFill"
class="avatar" class="avatar"
></image> ></image>
@@ -159,7 +165,7 @@
<!-- 去拼团 --> <!-- 去拼团 -->
<view class="bottom-name"> <view class="bottom-name">
<view class="count-down"> <view class="count-down">
<text>拼单倒计时:</text> <text>距离结束:</text>
<uni-countdown <uni-countdown
:day="parseDateTime(item.endTime).day" :day="parseDateTime(item.endTime).day"
:hour="parseDateTime(item.endTime).hour" :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 // 使用文件上传插件 useUploadPlugin: true // 使用文件上传插件
}) })
// #ifdef H5 // #ifdef H5
console.log('11111======')
await useLoginState().login({ await useLoginState().login({
SDKAppID: tencentUserSig.value.sdkappID, SDKAppID: tencentUserSig.value.sdkappID,
userID: tencentUserSig.value.userId, userID: tencentUserSig.value.userId,
@@ -109,18 +110,31 @@ export const useUserStore = defineStore('user', () => {
// #endif // #endif
// #ifdef APP-PLUS // #ifdef APP-PLUS
await useLoginState().login({ console.log('222222222======')
SDKAppID: tencentUserSig.value.sdkappID, try {
userID: tencentUserSig.value.userId, await useLoginState().login({
userSig: tencentUserSig.value.userSig 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 = uni.requireNativePlugin('TencentCloud-TUICallKit')
uni.$TUICallKit.login({
SDKAppID: tencentUserSig.value.sdkappID, console.log(uni.$TUICallKit, "TUICallKit ok"); // 本地日志
userID: tencentUserSig.value.userId, // try {
userSig: tencentUserSig.value.userSig // await uni.$TUICallKit.login({
}) // SDKAppID: tencentUserSig.value.sdkappID,
// userID: tencentUserSig.value.userId,
// userSig: tencentUserSig.value.userSig
// })
// } catch (err) {
// console.log(err, '===========2222222222')
// }
// #endif // #endif
} }