提交签活动功能

This commit is contained in:
bobobobo
2026-01-13 23:43:41 +08:00
parent c139fcf501
commit 07f9501c0f
9 changed files with 577 additions and 88 deletions

View File

@@ -75,6 +75,10 @@
<image class="action-button-icon" src="/static/images/host-pk.png" mode="aspectFit" />
<text class="action-button-text">主播pk</text>
</view> -->
<view class="action-button-item" @tap="isShowActivity = true">
<image class="action-button-icon" src="/static/images/activity.png" mode="aspectFit" />
<text class="action-button-text">活动</text>
</view>
<view class="action-button-item" @tap="showCoGuestPanel('requests')">
<image class="action-button-icon" src="/static/images/link-guest.png" mode="aspectFit" />
<text class="action-button-text">连观众</text>
@@ -86,7 +90,8 @@
<Like role="anchor" />
</view>
</view>
<!-- 活动弹框 -->
<Activity v-model="isShowActivity" :roomId="roomDataId" :groupID="groupId"></Activity>
<LiveAudienceList v-model="isShowAudienceList"></LiveAudienceList>
<AudienceActionPanel v-if="liveID" v-model="isShowAudienceActionPanel" :userInfo="selectedAudience"
:liveID="liveID"></AudienceActionPanel>
@@ -153,6 +158,8 @@
import { useGiftState } from "@/uni_modules/tuikit-atomic-x/state/GiftState";
import { useLiveSummaryState } from '@/uni_modules/tuikit-atomic-x/state/LiveSummaryState'
import ActionSheet from '@/components/ActionSheet.nvue'
import Activity from './components/activity.nvue'
const dom = uni.requireNativePlugin('dom')
const { loginUserInfo } = useLoginState();
uni.$liveID = `live_${uni.$userID}`
@@ -187,7 +194,8 @@
height: 750,
});
const beforeLivePanelRef = ref();
// 活动弹框状态
const isShowActivity = ref(false);
const isShowUserInfoPanel = ref(false);
const isShowAudienceList = ref(false);
const isShowCoHostPanel = ref(false);
@@ -573,65 +581,65 @@
const roomDataId = ref('')
const startLive = async () => {
try {
console.log('点击开始直播')
const data = {
coverUrl: coverURL.value,
roomName: liveTitle.value,
groupId: groupId.value
}
const roomData = await imAddLive(data)
const roomId = roomData.data.roomId
uni.$liveID = roomId
liveID.value = roomId
const res = await imDataStartLive(roomId)
console.log(roomData, '========11111')
console.log(res, '========22222')
roomDataId.value = roomId
const params = {
cursor: "", // 首次拉起传空不能是null),然后根据回调数据的cursor确认是否拉完
count: 20, // 分页拉取的个数
};
joinLive({ liveID: roomId })
fetchLiveList(params);
openLocalCamera({ isFront: isFrontCamera.value });
openLocalMicrophone();
setLocalVideoMuteImage();
isStartLive.value = true;
} catch (err) {
console.log(err, '====22')
}
// try {
// console.log('点击开始直播')
// const data = {
// coverUrl: coverURL.value,
// roomName: liveTitle.value,
// groupId: groupId.value
// }
// const roomData = await imAddLive(data)
// const roomId = roomData.data.roomId
// uni.$liveID = roomId
// liveID.value = roomId
// const res = await imDataStartLive(roomId)
// console.log(roomData, '========11111')
// console.log(res, '========22222')
// roomDataId.value = roomId
// const params = {
// cursor: "", // 首次拉起传空不能是null),然后根据回调数据的cursor确认是否拉完
// count: 20, // 分页拉取的个数
// };
// joinLive({ liveID: roomId })
// fetchLiveList(params);
// openLocalCamera({ isFront: isFrontCamera.value });
// openLocalMicrophone();
// setLocalVideoMuteImage();
// isStartLive.value = true;
// } catch (err) {
// console.log(err, '====22')
// }
// ======================原本代码
createLive({
liveInfo: {
liveID: uni?.$liveID,
liveName: liveTitle.value,
coverURL: coverURL.value,
isSeatEnabled: true,
seatMode: 'APPLY',
maxSeatCount: 0,
isPublicVisible: liveMode.value === '公开',
keepOwnerOnSeat: true,
seatLayoutTemplateID: templateLayout.value,
},
success: () => {
const params = {
cursor: "", // 首次拉起传空不能是null),然后根据回调数据的cursor确认是否拉完
count: 20, // 分页拉取的个数
};
fetchLiveList(params);
// createLive({
// liveInfo: {
// liveID: uni?.$liveID,
// liveName: liveTitle.value,
// coverURL: coverURL.value,
// isSeatEnabled: true,
// seatMode: 'APPLY',
// maxSeatCount: 0,
// isPublicVisible: liveMode.value === '公开',
// keepOwnerOnSeat: true,
// seatLayoutTemplateID: templateLayout.value,
// },
// success: () => {
// const params = {
// cursor: "", // 首次拉起传空不能是null),然后根据回调数据的cursor确认是否拉完
// count: 20, // 分页拉取的个数
// };
// fetchLiveList(params);
// openLocalCamera({ isFront: isFrontCamera.value });
// openLocalMicrophone();
// setLocalVideoMuteImage();
// },
// fail: (errCode, errMsg) => {
// uni.showToast({
// title: '创建直播间失败',
// });
// },
// });
// isStartLive.value = true;
openLocalCamera({ isFront: isFrontCamera.value });
openLocalMicrophone();
setLocalVideoMuteImage();
},
fail: (errCode, errMsg) => {
uni.showToast({
title: '创建直播间失败',
});
},
});
isStartLive.value = true;
};
const ShowAnchorViewClickPanel = (userInfo) => {