This commit is contained in:
bobobobo
2026-02-10 22:58:31 +08:00
parent 89b7566aa1
commit 9245fefc9a
8 changed files with 113 additions and 41 deletions

View File

@@ -134,6 +134,7 @@
}
const res = await addLiveActivity(data)
console.log('=====发送活动====',res.data)
sendCustomMessage({
liveID: props.roomId,
businessID: LIVE_BUSINESS.SIGN,

View File

@@ -277,6 +277,8 @@
const { connected: hostConnected } = useCoHostState(uni?.$liveID)
import ActivityInfo from './components/activity-info.vue'
import { LIVE_BUSINESS } from '@/constants/live-keys'
import { useAuthUser } from '../../composables/useAuthUser'
import { getUserAdminList } from '../../api'
const dom = uni.requireNativePlugin('dom')
const shareDialog = ref(false)
@@ -291,6 +293,8 @@
width: 375,
height: 750
})
/** 当前是否管理员 true: 是管理员false: 不是管理员*/
const isAdmin = ref(false)
const isShowUserInfoPanel = ref(false)
const isShowAudienceList = ref(false)
const isShowCoGuestRequestPanel = ref(false)
@@ -313,6 +317,7 @@
return hostConnected.value.length > 0
})
const { tencentUserSig } = useAuthUser()
const liveID = ref('')
const isFollowed = ref(false)
const inputValue = ref('')
@@ -379,15 +384,28 @@
).data
}
if (newMessages.some(v => v.businessID === LIVE_BUSINESS.SIGN)) {
const list = newMessages.filter(
v => v.businessID === LIVE_BUSINESS.SIGN
)
activityData.value = {
...JSON.parse(
newMessages.find(v => v.businessID === LIVE_BUSINESS.SIGN)
?.data
),
...JSON.parse(list[list.length - 1]?.data),
isParticipated: false
}
isShowActivity.value = true
}
if (newMessages.some(v => v.businessID === LIVE_BUSINESS.ANCHOR)) {
const list = newMessages.filter(
v => v.businessID === LIVE_BUSINESS.ANCHOR
)
const e = list[list.length - 1]
if (e) {
console.log('==管理员状态===', JSON.parse(e.data))
isAdmin.value = JSON.parse(e.data).show
}
}
}
})
@@ -413,6 +431,12 @@
}
})
if (liveID.value) {
getUserAdminList(liveID.value).then(res => {
const adminList = res.data.Response?.Admin_Account || []
isAdmin.value = adminList?.some(
v => v === tencentUserSig.value.userId
)
})
joinLive({
liveID: liveID.value,
success: () => {
@@ -769,7 +793,9 @@
}
const showAudienceList = () => {
isShowAudienceList.value = true
if (isAdmin.value) {
isShowAudienceList.value = true
}
}
// 处理连麦按钮点击事件

View File

@@ -13,7 +13,7 @@
{ name: '线上商城', icon: 'mall' },
{ name: '我的拼团伙伴', icon: 'team' },
{ name: '购买记录', icon: 'shopping' },
{ name: '项目入口', icon: 'project' },
// { name: '项目入口', icon: 'project' },
{ name: '直播列表', icon: 'liveStream' }
]

View File

@@ -7,7 +7,7 @@
} from '@/api/mall'
import { ref, computed } from 'vue'
import { navigateTo, navigateBack } from '@/utils/router'
import { getRemainingTime, parseDateTime } from '../../utils/dateUtils'
import { calculateRemainingTime, parseDateTime } from '../../utils/dateUtils'
const viewData = ref({})
const productId = ref('')
@@ -27,14 +27,16 @@
viewData.value = res.data
if (res.data.groupActivities.length > 0) {
const c = await getParticipateList(res.data.groupActivities[0].id)
console.log(c.data, '====')
console.log(getRemainingTime('2026-01-28 23:46:40'))
console.log(calculateRemainingTime('2026-02-10 21:50:40'), '===')
pingtuanList.value = c.data.map(v => {
const date = calculateRemainingTime(v.endTime)
return {
...v,
showDate: true
showDate: true,
...date
}
})
console.log(pingtuanList.value)
isPingTuan.value = c.data.length > 0
} else {
isPingTuan.value = false
@@ -172,10 +174,10 @@
<view class="count-down">
<text>距离结束:</text>
<uni-countdown
:day="parseDateTime(item.endTime).day"
:hour="parseDateTime(item.endTime).hour"
:minute="parseDateTime(item.endTime).minute"
:second="parseDateTime(item.endTime).second"
:show-day="false"
:hour="item.hours"
:minute="item.minutes"
:second="item.seconds"
:show-colon="false"
@timeup="
() => {