QAQ
This commit is contained in:
@@ -243,9 +243,7 @@ import { getRandomGroup } from '../../../../api'
|
|||||||
})
|
})
|
||||||
|
|
||||||
const submitDisabledStatus = computed(() => {
|
const submitDisabledStatus = computed(() => {
|
||||||
return (
|
return groupInfo.profile.name === '' && !groupInfo.isEdit
|
||||||
groupInfo.profile.name === ''&& !groupInfo.isEdit
|
|
||||||
)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const selected = (type: any) => {
|
const selected = (type: any) => {
|
||||||
@@ -306,8 +304,7 @@ import { getRandomGroup } from '../../../../api'
|
|||||||
// return showToast(isGroupID.message)
|
// return showToast(isGroupID.message)
|
||||||
// }
|
// }
|
||||||
|
|
||||||
const id = await getRandomGroup()
|
getRandomGroup().then(async (id: any) => {
|
||||||
|
|
||||||
const res = await TUIGroupService.createGroup({
|
const res = await TUIGroupService.createGroup({
|
||||||
...options,
|
...options,
|
||||||
groupID: id.data,
|
groupID: id.data,
|
||||||
@@ -325,6 +322,7 @@ import { getRandomGroup } from '../../../../api'
|
|||||||
message: TUITranslateService.t('TUIGroup.群组创建成功'),
|
message: TUITranslateService.t('TUIGroup.群组创建成功'),
|
||||||
type: TOAST_TYPE.SUCCESS
|
type: TOAST_TYPE.SUCCESS
|
||||||
})
|
})
|
||||||
|
})
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
if (err.code === 10025) {
|
if (err.code === 10025) {
|
||||||
showToast('该群组号已存在', 'error')
|
showToast('该群组号已存在', 'error')
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
"name" : "密谈IM",
|
"name" : "密谈IM",
|
||||||
"appid" : "__UNI__D40A151",
|
"appid" : "__UNI__D40A151",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.1.3",
|
"versionName" : "1.1.4",
|
||||||
"versionCode" : 112,
|
"versionCode" : 113,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
|
|||||||
@@ -134,6 +134,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const res = await addLiveActivity(data)
|
const res = await addLiveActivity(data)
|
||||||
|
console.log('=====发送活动====',res.data)
|
||||||
sendCustomMessage({
|
sendCustomMessage({
|
||||||
liveID: props.roomId,
|
liveID: props.roomId,
|
||||||
businessID: LIVE_BUSINESS.SIGN,
|
businessID: LIVE_BUSINESS.SIGN,
|
||||||
|
|||||||
@@ -277,6 +277,8 @@
|
|||||||
const { connected: hostConnected } = useCoHostState(uni?.$liveID)
|
const { connected: hostConnected } = useCoHostState(uni?.$liveID)
|
||||||
import ActivityInfo from './components/activity-info.vue'
|
import ActivityInfo from './components/activity-info.vue'
|
||||||
import { LIVE_BUSINESS } from '@/constants/live-keys'
|
import { LIVE_BUSINESS } from '@/constants/live-keys'
|
||||||
|
import { useAuthUser } from '../../composables/useAuthUser'
|
||||||
|
import { getUserAdminList } from '../../api'
|
||||||
|
|
||||||
const dom = uni.requireNativePlugin('dom')
|
const dom = uni.requireNativePlugin('dom')
|
||||||
const shareDialog = ref(false)
|
const shareDialog = ref(false)
|
||||||
@@ -291,6 +293,8 @@
|
|||||||
width: 375,
|
width: 375,
|
||||||
height: 750
|
height: 750
|
||||||
})
|
})
|
||||||
|
/** 当前是否管理员 true: 是管理员,false: 不是管理员*/
|
||||||
|
const isAdmin = ref(false)
|
||||||
const isShowUserInfoPanel = ref(false)
|
const isShowUserInfoPanel = ref(false)
|
||||||
const isShowAudienceList = ref(false)
|
const isShowAudienceList = ref(false)
|
||||||
const isShowCoGuestRequestPanel = ref(false)
|
const isShowCoGuestRequestPanel = ref(false)
|
||||||
@@ -313,6 +317,7 @@
|
|||||||
return hostConnected.value.length > 0
|
return hostConnected.value.length > 0
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const { tencentUserSig } = useAuthUser()
|
||||||
const liveID = ref('')
|
const liveID = ref('')
|
||||||
const isFollowed = ref(false)
|
const isFollowed = ref(false)
|
||||||
const inputValue = ref('')
|
const inputValue = ref('')
|
||||||
@@ -379,15 +384,28 @@
|
|||||||
).data
|
).data
|
||||||
}
|
}
|
||||||
if (newMessages.some(v => v.businessID === LIVE_BUSINESS.SIGN)) {
|
if (newMessages.some(v => v.businessID === LIVE_BUSINESS.SIGN)) {
|
||||||
|
const list = newMessages.filter(
|
||||||
|
v => v.businessID === LIVE_BUSINESS.SIGN
|
||||||
|
)
|
||||||
|
|
||||||
activityData.value = {
|
activityData.value = {
|
||||||
...JSON.parse(
|
...JSON.parse(list[list.length - 1]?.data),
|
||||||
newMessages.find(v => v.businessID === LIVE_BUSINESS.SIGN)
|
|
||||||
?.data
|
|
||||||
),
|
|
||||||
isParticipated: false
|
isParticipated: false
|
||||||
}
|
}
|
||||||
isShowActivity.value = true
|
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) {
|
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({
|
joinLive({
|
||||||
liveID: liveID.value,
|
liveID: liveID.value,
|
||||||
success: () => {
|
success: () => {
|
||||||
@@ -769,8 +793,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const showAudienceList = () => {
|
const showAudienceList = () => {
|
||||||
|
if (isAdmin.value) {
|
||||||
isShowAudienceList.value = true
|
isShowAudienceList.value = true
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 处理连麦按钮点击事件
|
// 处理连麦按钮点击事件
|
||||||
const handleCoGuestButtonClick = () => {
|
const handleCoGuestButtonClick = () => {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
{ name: '线上商城', icon: 'mall' },
|
{ name: '线上商城', icon: 'mall' },
|
||||||
{ name: '我的拼团伙伴', icon: 'team' },
|
{ name: '我的拼团伙伴', icon: 'team' },
|
||||||
{ name: '购买记录', icon: 'shopping' },
|
{ name: '购买记录', icon: 'shopping' },
|
||||||
{ name: '项目入口', icon: 'project' },
|
// { name: '项目入口', icon: 'project' },
|
||||||
{ name: '直播列表', icon: 'liveStream' }
|
{ name: '直播列表', icon: 'liveStream' }
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
} from '@/api/mall'
|
} from '@/api/mall'
|
||||||
import { ref, computed } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
import { navigateTo, navigateBack } from '@/utils/router'
|
import { navigateTo, navigateBack } from '@/utils/router'
|
||||||
import { getRemainingTime, parseDateTime } from '../../utils/dateUtils'
|
import { calculateRemainingTime, parseDateTime } from '../../utils/dateUtils'
|
||||||
|
|
||||||
const viewData = ref({})
|
const viewData = ref({})
|
||||||
const productId = ref('')
|
const productId = ref('')
|
||||||
@@ -27,14 +27,16 @@
|
|||||||
viewData.value = res.data
|
viewData.value = res.data
|
||||||
if (res.data.groupActivities.length > 0) {
|
if (res.data.groupActivities.length > 0) {
|
||||||
const c = await getParticipateList(res.data.groupActivities[0].id)
|
const c = await getParticipateList(res.data.groupActivities[0].id)
|
||||||
console.log(c.data, '====')
|
console.log(calculateRemainingTime('2026-02-10 21:50:40'), '===')
|
||||||
console.log(getRemainingTime('2026-01-28 23:46:40'))
|
|
||||||
pingtuanList.value = c.data.map(v => {
|
pingtuanList.value = c.data.map(v => {
|
||||||
|
const date = calculateRemainingTime(v.endTime)
|
||||||
return {
|
return {
|
||||||
...v,
|
...v,
|
||||||
showDate: true
|
showDate: true,
|
||||||
|
...date
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
console.log(pingtuanList.value)
|
||||||
isPingTuan.value = c.data.length > 0
|
isPingTuan.value = c.data.length > 0
|
||||||
} else {
|
} else {
|
||||||
isPingTuan.value = false
|
isPingTuan.value = false
|
||||||
@@ -172,10 +174,10 @@
|
|||||||
<view class="count-down">
|
<view class="count-down">
|
||||||
<text>距离结束:</text>
|
<text>距离结束:</text>
|
||||||
<uni-countdown
|
<uni-countdown
|
||||||
:day="parseDateTime(item.endTime).day"
|
:show-day="false"
|
||||||
:hour="parseDateTime(item.endTime).hour"
|
:hour="item.hours"
|
||||||
:minute="parseDateTime(item.endTime).minute"
|
:minute="item.minutes"
|
||||||
:second="parseDateTime(item.endTime).second"
|
:second="item.seconds"
|
||||||
:show-colon="false"
|
:show-colon="false"
|
||||||
@timeup="
|
@timeup="
|
||||||
() => {
|
() => {
|
||||||
|
|||||||
@@ -25,7 +25,10 @@
|
|||||||
numberOfLines="1">{{ message?.sender?.userName || message?.sender?.userID }}:</text>
|
numberOfLines="1">{{ message?.sender?.userName || message?.sender?.userID }}:</text>
|
||||||
<!-- 主播发送消息 -->
|
<!-- 主播发送消息 -->
|
||||||
<text v-if="message?.businessID == 'anchor'" class="chat-content">
|
<text v-if="message?.businessID == 'anchor'" class="chat-content">
|
||||||
{{ getAnchorMessageText(message) }}
|
{{ getAnchorMessageText(message).count }}
|
||||||
|
</text>
|
||||||
|
<text v-if="message?.businessID == 'sign'" class="chat-content">
|
||||||
|
{{ getAnchorMessageText(message).title }}
|
||||||
</text>
|
</text>
|
||||||
<text v-else class="chat-content">
|
<text v-else class="chat-content">
|
||||||
{{ message?.textContent || '' }}
|
{{ message?.textContent || '' }}
|
||||||
@@ -185,8 +188,7 @@
|
|||||||
|
|
||||||
/** 主播发送自定义消息显示文本 */
|
/** 主播发送自定义消息显示文本 */
|
||||||
const getAnchorMessageText = (message: any) => {
|
const getAnchorMessageText = (message: any) => {
|
||||||
const data = JSON.parse(message.data)
|
return JSON.parse(message.data)
|
||||||
return data.count
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleReceiveGift = {
|
const handleReceiveGift = {
|
||||||
|
|||||||
@@ -102,6 +102,49 @@ export const parseDateTime = dateTimeStr => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算当前时间距离目标时间的剩余时、分、秒
|
||||||
|
* @param {string} targetTimeStr - 目标时间字符串,格式如 "2026-02-10 21:50:40"
|
||||||
|
* @returns {Object} 包含hours、minutes、seconds的对象,适配uni-countdown组件
|
||||||
|
*/
|
||||||
|
export const calculateRemainingTime = targetTimeStr => {
|
||||||
|
// 1. 处理目标时间,转换为时间戳(解决时区问题,手动拆分时间字符串)
|
||||||
|
const [datePart, timePart] = targetTimeStr.split(' ')
|
||||||
|
const [year, month, day] = datePart.split('-').map(Number)
|
||||||
|
const [hour, minute, second] = timePart.split(':').map(Number)
|
||||||
|
// 注意:月份是0开始的,所以要减1
|
||||||
|
const targetTime = new Date(
|
||||||
|
year,
|
||||||
|
month - 1,
|
||||||
|
day,
|
||||||
|
hour,
|
||||||
|
minute,
|
||||||
|
second
|
||||||
|
).getTime()
|
||||||
|
|
||||||
|
// 2. 获取当前时间戳
|
||||||
|
const currentTime = new Date().getTime()
|
||||||
|
|
||||||
|
// 3. 计算剩余总秒数(如果目标时间已过,剩余时间为0)
|
||||||
|
let remainingSeconds = Math.max(
|
||||||
|
0,
|
||||||
|
Math.floor((targetTime - currentTime) / 1000)
|
||||||
|
)
|
||||||
|
|
||||||
|
// 4. 转换为时、分、秒
|
||||||
|
const hours = Math.floor(remainingSeconds / 3600) // 1小时=3600秒
|
||||||
|
remainingSeconds = remainingSeconds % 3600 // 剩余的秒数
|
||||||
|
const minutes = Math.floor(remainingSeconds / 60) // 1分钟=60秒
|
||||||
|
const seconds = remainingSeconds % 60 // 最终剩余的秒数
|
||||||
|
|
||||||
|
// 5. 返回适配uni-countdown的格式
|
||||||
|
return {
|
||||||
|
hours,
|
||||||
|
minutes,
|
||||||
|
seconds
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export const getRemainingTime = endTimeStr => {
|
export const getRemainingTime = endTimeStr => {
|
||||||
const now = new Date().getTime() // 当前时间戳(毫秒)
|
const now = new Date().getTime() // 当前时间戳(毫秒)
|
||||||
const end = new Date(endTimeStr.replace(' ', 'T')).getTime() // 转为 ISO 格式并获取时间戳
|
const end = new Date(endTimeStr.replace(' ', 'T')).getTime() // 转为 ISO 格式并获取时间戳
|
||||||
|
|||||||
Reference in New Issue
Block a user