|
|
@@ -57,8 +57,10 @@
|
|
|
<!-- 顶部信息栏 -->
|
|
|
<view class="top-info-bar" :class="liveItem.showType == 1 ? 'horizontal-top' : ''">
|
|
|
<view class="user-info-section">
|
|
|
- <image v-if="!scene" @click="goBack" class="back-icon mr4"
|
|
|
+ <image v-if="!scene&&liveItem.showType==2" @click="goBack" class="back-icon mr4"
|
|
|
src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/return3.png" />
|
|
|
+ <image v-if="!scene&&liveItem.showType==1" @click="goBack" class="w42 h42 mr4"
|
|
|
+ src="/static/images/return_black.png" />
|
|
|
<view class="user-avatar-container">
|
|
|
<u-avatar
|
|
|
:src="liveItem.liveImgUrl || 'https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/avatar.png'"
|
|
|
@@ -687,7 +689,7 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- isNow:false,
|
|
|
+ isNow: false,
|
|
|
fakeAvatar: Array.from({
|
|
|
length: 11
|
|
|
}, (_, i) =>
|
|
|
@@ -1036,7 +1038,7 @@
|
|
|
this.totalTraffic = 0;
|
|
|
}
|
|
|
this.startTimer();
|
|
|
- if(!this.isNow){
|
|
|
+ if (!this.isNow) {
|
|
|
this.userlogo = true
|
|
|
}
|
|
|
},
|
|
|
@@ -1074,38 +1076,38 @@
|
|
|
formattedLikeCount() {
|
|
|
return this.formatNumber(this.liveViewData.like || 0);
|
|
|
},
|
|
|
- filteredViewers() {
|
|
|
- // 获取3个随机假头像,而不是显示真实观众
|
|
|
- const avatarCount = 3; // 需要显示的假头像数量
|
|
|
-
|
|
|
- // 如果fakeAvatar数组为空或不存在,返回空数组
|
|
|
- if (!this.fakeAvatar || !Array.isArray(this.fakeAvatar) || this.fakeAvatar.length === 0) {
|
|
|
- return [];
|
|
|
- }
|
|
|
-
|
|
|
- // 从fakeAvatar中随机选择3个不同的头像
|
|
|
- const randomAvatars = [];
|
|
|
- const availableAvatars = [...this.fakeAvatar]; // 创建副本避免修改原数组
|
|
|
-
|
|
|
- // 确保有足够的头像可选
|
|
|
- if (availableAvatars.length < avatarCount) {
|
|
|
- // 如果头像数量不足,可以重复使用
|
|
|
- for (let i = 0; i < avatarCount; i++) {
|
|
|
- const randomIndex = Math.floor(Math.random() * availableAvatars.length);
|
|
|
- randomAvatars.push(availableAvatars[randomIndex]);
|
|
|
- }
|
|
|
- } else {
|
|
|
- // 随机选择不重复的头像
|
|
|
- for (let i = 0; i < avatarCount; i++) {
|
|
|
- const randomIndex = Math.floor(Math.random() * availableAvatars.length);
|
|
|
- randomAvatars.push(availableAvatars[randomIndex]);
|
|
|
- availableAvatars.splice(randomIndex, 1); // 移除已选的头像,避免重复
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- console.log("随机选择的头像:", randomAvatars);
|
|
|
- return randomAvatars;
|
|
|
- },
|
|
|
+ filteredViewers() {
|
|
|
+ // 获取3个随机假头像,而不是显示真实观众
|
|
|
+ const avatarCount = 3; // 需要显示的假头像数量
|
|
|
+
|
|
|
+ // 如果fakeAvatar数组为空或不存在,返回空数组
|
|
|
+ if (!this.fakeAvatar || !Array.isArray(this.fakeAvatar) || this.fakeAvatar.length === 0) {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+
|
|
|
+ // 从fakeAvatar中随机选择3个不同的头像
|
|
|
+ const randomAvatars = [];
|
|
|
+ const availableAvatars = [...this.fakeAvatar]; // 创建副本避免修改原数组
|
|
|
+
|
|
|
+ // 确保有足够的头像可选
|
|
|
+ if (availableAvatars.length < avatarCount) {
|
|
|
+ // 如果头像数量不足,可以重复使用
|
|
|
+ for (let i = 0; i < avatarCount; i++) {
|
|
|
+ const randomIndex = Math.floor(Math.random() * availableAvatars.length);
|
|
|
+ randomAvatars.push(availableAvatars[randomIndex]);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 随机选择不重复的头像
|
|
|
+ for (let i = 0; i < avatarCount; i++) {
|
|
|
+ const randomIndex = Math.floor(Math.random() * availableAvatars.length);
|
|
|
+ randomAvatars.push(availableAvatars[randomIndex]);
|
|
|
+ availableAvatars.splice(randomIndex, 1); // 移除已选的头像,避免重复
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log("随机选择的头像:", randomAvatars);
|
|
|
+ return randomAvatars;
|
|
|
+ },
|
|
|
isCurrentUserWon() {
|
|
|
if (!Array.isArray(this.prizeInfo) || !this.userInfo?.userId) {
|
|
|
return false;
|
|
|
@@ -1127,10 +1129,10 @@
|
|
|
return userPrize ? userPrize.productId : null;
|
|
|
},
|
|
|
getCurrentUserPrizeRecordId() {
|
|
|
- console.log('=== getCurrentUserPrizeRecordId 调试信息 ===');
|
|
|
- console.log('this.prizeInfo:', this.prizeInfo);
|
|
|
- console.log('this.userInfo:', this.userInfo);
|
|
|
- console.log('this.userInfo.userId:', this.userInfo?.userId);
|
|
|
+ // console.log('=== getCurrentUserPrizeRecordId 调试信息 ===');
|
|
|
+ // console.log('this.prizeInfo:', this.prizeInfo);
|
|
|
+ // console.log('this.userInfo:', this.userInfo);
|
|
|
+ // console.log('this.userInfo.userId:', this.userInfo?.userId);
|
|
|
|
|
|
if (!Array.isArray(this.prizeInfo) || !this.userInfo?.userId) {
|
|
|
console.log('条件不满足,返回null');
|
|
|
@@ -1148,8 +1150,8 @@
|
|
|
return match;
|
|
|
});
|
|
|
|
|
|
- console.log('找到的用户奖品:', userPrize);
|
|
|
- console.log('最终返回的recordId:', userPrize ? userPrize.recordId : null);
|
|
|
+ // console.log('找到的用户奖品:', userPrize);
|
|
|
+ // console.log('最终返回的recordId:', userPrize ? userPrize.recordId : null);
|
|
|
|
|
|
return userPrize ? userPrize.recordId : null;
|
|
|
},
|
|
|
@@ -2120,7 +2122,7 @@
|
|
|
const now = Date.now();
|
|
|
// 防抖检查:如果距离上次滚动时间太短,则忽略
|
|
|
if (now - this.lastScrollTime < this.scrollDebounceDelay) {
|
|
|
- console.log('滚动防抖:忽略频繁调用');
|
|
|
+ // console.log('滚动防抖:忽略频繁调用');
|
|
|
return;
|
|
|
}
|
|
|
this.lastScrollTime = now;
|
|
|
@@ -3681,7 +3683,7 @@
|
|
|
wsUrl += this.qrFrom;
|
|
|
}
|
|
|
// if(this.address){
|
|
|
- console.log("this.address是什么>>>", this.address)
|
|
|
+ // console.log("this.address是什么>>>", this.address)
|
|
|
wsUrl += `&location=${this.address}`;
|
|
|
// wsUrl += `&location=${encodeURIComponent(liveWatchUser)}`;
|
|
|
// }
|