|
|
@@ -19,19 +19,20 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- 积分倒计时 -->
|
|
|
- <view class="progress-countdown" :class="liveItem.showType==2?' progress-vertical':''"
|
|
|
- :style="{ 'display':isFocus?'none':''}"
|
|
|
- v-if="countdownPercentage!=100&&liveItem.completionPointsEnabled&&liveItem.status==2&&!isPreview">
|
|
|
+ <view class="progress-countdown" :class="liveItem.showType == 2 ? ' progress-vertical' : ''"
|
|
|
+ :style="{ 'display': isFocus ? 'none' : '' }"
|
|
|
+ v-if="countdownPercentage != 100 && liveItem.completionPointsEnabled && liveItem.status == 2 && !isPreview">
|
|
|
<image class="title" src="/static/images/points_title.png"></image>
|
|
|
<view class="progress-bar-bg">
|
|
|
<view class="progress-bar-fill" :style="{ width: countdownPercentage + '%' }"></view>
|
|
|
</view>
|
|
|
<view class="progress-text">
|
|
|
- 倒计时{{ formattedCountdown.hours||'00' }}:{{ formattedCountdown.minutes||'00' }}:{{ formattedCountdown.seconds||'00' }}
|
|
|
+ 倒计时{{ formattedCountdown.hours || '00' }}:{{ formattedCountdown.minutes || '00' }}:{{
|
|
|
+ formattedCountdown.seconds ||'00' }}
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<view class="end">
|
|
|
<view v-if="Array.isArray(filteredViewers)" class="align-center" @click="toggleViewerList"
|
|
|
style="margin-top: 88rpx">
|
|
|
@@ -45,7 +46,7 @@
|
|
|
</view>
|
|
|
<view class="sum">{{ formattedWatchCount || 0 }}</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<view class="complaint-box" @click="navgetTo('/pages_shopping/live/complaintList')">
|
|
|
<image class="image w32 h32 mr10" src="/static/images/complaint.png" mode="widthFix" />
|
|
|
<view class="fs26">投诉</view>
|
|
|
@@ -68,8 +69,9 @@
|
|
|
|
|
|
<!-- 右边的side -->
|
|
|
<view v-show="!isFocus" class="side-group" :class="{
|
|
|
- 'top2': (!isShowRed && !(isShowLottery && countdown)),
|
|
|
- 'top3': (isShowRed || (isShowLottery && countdown))}">
|
|
|
+ 'top2': (!isShowRed && !(isShowLottery && countdown)),
|
|
|
+ 'top3': (isShowRed || (isShowLottery && countdown))
|
|
|
+ }">
|
|
|
<view class="side-item" @click="onRed()" v-if="isShowRed">
|
|
|
<button class="button button-reset" style="height: 70rpx;">
|
|
|
<image class="image" style="width: 72rpx;" src="/static/images/redbag.png"
|
|
|
@@ -105,7 +107,7 @@
|
|
|
<view class="chat-area-container" :class="{ 'chat-area-focused': isFocus }"
|
|
|
:style="{ '--keyboard-height': keyboardHeight + 'rpx' }">
|
|
|
<view class="mt20 chat-content"
|
|
|
- :class="{ 'chat-content-focused': isFocus ,'chat-content-preview':liveItem.status==1}">
|
|
|
+ :class="{ 'chat-content-focused': isFocus, 'chat-content-preview': liveItem.status == 1 }">
|
|
|
<view v-if="showPurchasePrompt && orderUser && orderUser.count && liveItem.status == 2"
|
|
|
class="shop-prompt f30 mb20">
|
|
|
<image class="w32 h32 mr8" src="/static/images/shopping.png" />
|
|
|
@@ -134,12 +136,12 @@
|
|
|
:scroll-top="scrollTop" :scroll-into-view="scrollIntoView" @scroll="onScroll"
|
|
|
ref="scrollView" scroll-with-animation="true" :scroll-animation-duration="300">
|
|
|
<view class="list justify-start" v-for="(item, talkIndex) in talklist || []"
|
|
|
- :key="item.uniqueId || talkIndex" :id="`list_${item.uniqueId || talkIndex}`"
|
|
|
+ :key="talkIndex" :id="`list_${item.uniqueId || talkIndex}`"
|
|
|
v-show="item.cmd != 'red' && item.cmd != 'out' && item.cmd != 'entry'">
|
|
|
<view class="talk-list justify-start">
|
|
|
<view class="fs30 talk-item" style="max-width: 100%;">
|
|
|
- <text class="nickname"
|
|
|
- style="color: #ffda73;">{{ item.nickName || '未命名' }}:</text>
|
|
|
+ <text class="nickname" style="color: #ffda73;">{{ item.nickName || '未命名'
|
|
|
+ }}:</text>
|
|
|
<text class="message colorf">{{ item.msg }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -188,7 +190,8 @@
|
|
|
<view class="integral-header">
|
|
|
<view class="integral-title">观看视频领积分</view>
|
|
|
<image class="integral-background-image"
|
|
|
- src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/integral_bg.png" mode="widthFix" />
|
|
|
+ src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/integral_bg.png"
|
|
|
+ mode="widthFix" />
|
|
|
</view>
|
|
|
<view class="integral-content">
|
|
|
<view class="integral-message">积分发放成功</view>
|
|
|
@@ -219,7 +222,7 @@
|
|
|
</view>
|
|
|
<view class="tip">请填写收货地址,主播将会将奖品发给您</view>
|
|
|
<view class="button"
|
|
|
- @click="navgetTo('/pages_shopping/live/confirmCreateOrder?type=win&productId='+getCurrentUserPrizeProductId+'&liveId='+liveId+'&recordId='+getCurrentUserPrizeRecordId),confirm()">
|
|
|
+ @click="navgetTo('/pages_shopping/live/confirmCreateOrder?type=win&productId=' + getCurrentUserPrizeProductId + '&liveId=' + liveId + '&recordId=' + getCurrentUserPrizeRecordId), confirm()">
|
|
|
填写地址
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -235,8 +238,9 @@
|
|
|
@fill-address="handleFillAddress" />
|
|
|
|
|
|
<!-- 观众列表弹窗 -->
|
|
|
- <Viewer ref="viewer" :show="showViewerList" :viewers="liveViewers" :lookAudsCount="lookAudsCount" :loading="viewLoading" :scrollHeight="scrollHeight"
|
|
|
- @close="closeViewerList" @open="openViewerList" @loadMore="handleViewerLoadMore" />
|
|
|
+ <Viewer ref="viewer" :show="showViewerList" :viewers="liveViewers" :lookAudsCount="lookAudsCount"
|
|
|
+ :loading="viewLoading" :scrollHeight="scrollHeight" @close="closeViewerList" @open="openViewerList"
|
|
|
+ @loadMore="handleViewerLoadMore" />
|
|
|
|
|
|
<!-- 更多弹窗 -->
|
|
|
<u-popup :show="isMore" @close="closeMore" round="20rpx" bgColor="#f3f5f9" zIndex="10076">
|
|
|
@@ -266,11 +270,11 @@
|
|
|
<view class="gift">
|
|
|
<view class="gift-top">
|
|
|
<view class="left">
|
|
|
- 送花给<text class="ml8 orange">{{liveItem.liveName}}</text>
|
|
|
+ 送花给<text class="ml8 orange">{{ liveItem.liveName }}</text>
|
|
|
</view>
|
|
|
<view class="align-center" @click="navgetTo('/pages_shopping/live/integral')">
|
|
|
<image class="w32 h32" src="/static/images/coin.png" />
|
|
|
- <text class="ml6 mr6 f24">{{integralNum}}</text>
|
|
|
+ <text class="ml6 mr6 f24">{{ integralNum }}</text>
|
|
|
<image class="w24 h24" src="/static/images/arrow_white.png" />
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -286,6 +290,21 @@
|
|
|
</view>
|
|
|
</u-popup>
|
|
|
|
|
|
+ <!-- 微信昵称授权弹窗 -->
|
|
|
+ <u-popup :show="userlogo" mode="bottom" round='12'>
|
|
|
+ <view class="userlogo column">
|
|
|
+ <view class="bold fs36 mt42">授权你的昵称信息</view>
|
|
|
+ <view class=" justify-between align-center mt42">
|
|
|
+ <view class="button-container">
|
|
|
+ <input type="nickname" class="hidden-input"
|
|
|
+ placeholder-style="color:#ffffff; font-size:32rpx;" @blur="onNickNameInput"
|
|
|
+ placeholder="请点击授权微信昵称" @input="onNickNameInput" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="submitname" @click="confimrname">确定</view>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
+
|
|
|
<!-- 商品弹窗组件 -->
|
|
|
<ShopPopup class="shop" :show="shopping" :searchKeyword="inputInfo" :products="products"
|
|
|
:loading="loadingProducts" :boxHeight="boxHeight" @close="closeShop" @search="handleSearchInput"
|
|
|
@@ -356,10 +375,12 @@
|
|
|
receivePoints,
|
|
|
activeList,
|
|
|
sendliveGift,
|
|
|
- getUserIntegralInfo //芳华币
|
|
|
+ getUserIntegralInfo ,//芳华币
|
|
|
+ loginByMp
|
|
|
} from '@/api/living.js'
|
|
|
import {
|
|
|
- getUserInfo
|
|
|
+ getUserInfo,
|
|
|
+ editUser
|
|
|
} from '@/api/user'
|
|
|
import {
|
|
|
generateRandomString
|
|
|
@@ -463,7 +484,7 @@
|
|
|
pingTimeoutTimer: null,
|
|
|
heartBeatTimer: null,
|
|
|
liveViewDataTimer: null,
|
|
|
- lookAudsCount:0,//更多的观众人数
|
|
|
+ lookAudsCount: 0, //更多的观众人数
|
|
|
reconnectTimer: null,
|
|
|
scrollTimer: null,
|
|
|
lastScrollTime: 0,
|
|
|
@@ -577,7 +598,11 @@
|
|
|
userinfo: '',
|
|
|
userData: {},
|
|
|
diffTotalTime: '',
|
|
|
- virtualTotal:0,
|
|
|
+ virtualTotal: 0,
|
|
|
+ userlogo: false,
|
|
|
+ user: {},
|
|
|
+ userInfo: '',
|
|
|
+ urlOption: {},
|
|
|
}
|
|
|
},
|
|
|
async onLoad(options) {
|
|
|
@@ -601,35 +626,30 @@
|
|
|
if (options.companyId && options.companyUserId) {
|
|
|
this.qrFrom = `&companyId=${options.companyId}&companyUserId=${options.companyUserId}`
|
|
|
}
|
|
|
+
|
|
|
+ // 保存url参数
|
|
|
+ this.urlOption = options;
|
|
|
+
|
|
|
this.userinfo = uni.getStorageSync('userInfo')
|
|
|
this.userData = uni.getStorageSync('userData')
|
|
|
this.hasSubscribed = uni.getStorageSync('subscribe_status_' + this.liveId) || false;
|
|
|
try {
|
|
|
- const isLogin = await this.utils.isLogin()
|
|
|
+ const isLogin = await this.utils.checkLiveToken();
|
|
|
+ this.hasCheckedLogin = true;
|
|
|
if (isLogin) {
|
|
|
- await this.getUserInfo()
|
|
|
- this.initTime()
|
|
|
- if (this.liveId) {
|
|
|
- const res = await this.getliving(this.liveId)
|
|
|
- if (res && res.data) {
|
|
|
- if (res.data.videoFileSize) {
|
|
|
- this.liveItem.videoFileSize = res.data.videoFileSize
|
|
|
- }
|
|
|
- if (res.data.videoDuration) {
|
|
|
- this.liveItem.videoDuration = res.data.videoDuration
|
|
|
- }
|
|
|
- }
|
|
|
- this.isOnload = true
|
|
|
- await this.getLiveMsg(this.liveId)
|
|
|
- await this.getliveViewData()
|
|
|
- }
|
|
|
+ // 登录后:优先加载直播间信息,然后加载视频资源
|
|
|
+ await this.haveLogin();
|
|
|
+ } else {
|
|
|
+ // 未登录:先登录,登录成功后再加载数据
|
|
|
+ this.goLogin();
|
|
|
}
|
|
|
} catch (error) {
|
|
|
- console.error('初始化失败:', error)
|
|
|
+ console.error('初始化失败:', error);
|
|
|
+ this.hasCheckedLogin = true;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
this.startMemoryMonitor();
|
|
|
-
|
|
|
+
|
|
|
//获取礼物列表
|
|
|
this.getActiveList();
|
|
|
|
|
|
@@ -693,16 +713,12 @@
|
|
|
},
|
|
|
async onShow() {
|
|
|
try {
|
|
|
- const isLogin = await this.utils.isLogin()
|
|
|
+ const isLogin = await this.utils.checkLiveToken()
|
|
|
if (isLogin) {
|
|
|
- await this.getUserInfo()
|
|
|
- this.initTime()
|
|
|
- if (this.liveId) {
|
|
|
- await this.getliving(this.liveId)
|
|
|
- this.isOnload = true
|
|
|
- await this.getLiveMsg(this.liveItem)
|
|
|
- await this.getliveViewData()
|
|
|
- }
|
|
|
+ await this.haveLogin();
|
|
|
+ } else {
|
|
|
+ this.goLogin();
|
|
|
+
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.error('初始化失败:', error)
|
|
|
@@ -764,7 +780,7 @@
|
|
|
this.stayTime = 0
|
|
|
this.startTime = 0
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
if (this.trafficTimer) {
|
|
|
clearInterval(this.trafficTimer)
|
|
|
@@ -810,6 +826,9 @@
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
+ appid() {
|
|
|
+ return this.$store.state.appid
|
|
|
+ },
|
|
|
shouldShowIntegralPopup() {
|
|
|
//只有当 showPoints 为 true 且 receiveList 有数据时才显示
|
|
|
return this.showPoints;
|
|
|
@@ -914,6 +933,134 @@
|
|
|
}
|
|
|
},
|
|
|
methods: { // 芳华币
|
|
|
+ // 微信昵称授权相关方法
|
|
|
+ shouquan() {
|
|
|
+ if (this.user.nickname == '') {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: "请先授权微信昵称",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ confimrname() {
|
|
|
+ if (this.user.nickname == '') {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: "请授权微信昵称",
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.editUser();
|
|
|
+ uni.setStorageSync('userInfo', this.userInfo);
|
|
|
+
|
|
|
+ if (this.user.nickname) {
|
|
|
+ this.userlogo = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onNickNameInput(e) {
|
|
|
+ this.user.nickname = e.detail.value;
|
|
|
+ },
|
|
|
+ editUser() {
|
|
|
+ this.user.nickName = this.user.nickname;
|
|
|
+ editUser(this.user).then(
|
|
|
+ res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'success',
|
|
|
+ title: "修改成功",
|
|
|
+ });
|
|
|
+ this.getUserInfo()
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: res.msg,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ rej => {}
|
|
|
+ );
|
|
|
+ },
|
|
|
+ // 静默登录
|
|
|
+ goLogin(data) {
|
|
|
+ let provider = 'weixin'
|
|
|
+ uni.login({
|
|
|
+ provider: provider,
|
|
|
+ success: async loginRes => {
|
|
|
+ uni.getUserInfo({
|
|
|
+ provider: provider,
|
|
|
+ success: (infoRes) => {
|
|
|
+ uni.showToast({
|
|
|
+ title: '登录中...',
|
|
|
+ icon: 'loading'
|
|
|
+ });
|
|
|
+ loginByMp({
|
|
|
+ code: loginRes.code,
|
|
|
+ encryptedData: infoRes.encryptedData,
|
|
|
+ iv: infoRes.iv,
|
|
|
+ appId: this.appid
|
|
|
+ }).then(res => {
|
|
|
+ uni.hideLoading();
|
|
|
+ if (res.code == 200) {
|
|
|
+ uni.setStorageSync('AppToken', res
|
|
|
+ .token);
|
|
|
+ uni.setStorageSync('userInfo', JSON
|
|
|
+ .stringify(res
|
|
|
+ .user));
|
|
|
+ this.userInfo = uni.getStorageSync(
|
|
|
+ 'userInfo');
|
|
|
+ // uni.setStorageSync('auto_userInfo', JSON.stringify(res.user));
|
|
|
+ // this.user = res.user
|
|
|
+ this.$store.commit('setCoureLogin', 1);
|
|
|
+ this.isLogin = true
|
|
|
+ this.haveLogin()
|
|
|
+ this.userlogo = true
|
|
|
+ // console.log("TOKEN_KEYAuto",TOKEN_KEYAuto)
|
|
|
+ if (this.urlOption.qwUserId) {
|
|
|
+ this.getIsAddKf() //this.getIsAddKf()
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ uni.hideLoading();
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: "登录失败,请重新登录",
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async haveLogin() {
|
|
|
+ // 防止重复执行
|
|
|
+ if (this.isOnload) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.userInfo = uni.getStorageSync('userInfo');
|
|
|
+ if (this.userInfo) {
|
|
|
+ await this.getUserInfo();
|
|
|
+ }
|
|
|
+ if (this.liveId) {
|
|
|
+ // 优先加载直播间信息(包含视频资源URL)
|
|
|
+ this.isOnload = true;
|
|
|
+ await this.getliving(this.liveId);
|
|
|
+ Promise.all([
|
|
|
+ this.getLiveMsg(this.liveItem),
|
|
|
+ this.getliveViewData()
|
|
|
+ ]).catch(err => {
|
|
|
+ console.error('加载数据失败:', err);
|
|
|
+ });
|
|
|
+ // 其他非关键数据异步加载
|
|
|
+ this.getCurrentActivities();
|
|
|
+ this.getliveOrder();
|
|
|
+ this.initSocket();
|
|
|
+ }
|
|
|
+ },
|
|
|
getUserIntegralInfo() {
|
|
|
getUserIntegralInfo().then(res => {
|
|
|
if (res.code == 200) {
|
|
|
@@ -2507,7 +2654,7 @@
|
|
|
const totalTime = this.calculateTimeDiff(item)
|
|
|
}, 1000);
|
|
|
},
|
|
|
- toggleViewerList() { //加载直播间观众
|
|
|
+ toggleViewerList() { //加载直播间观众
|
|
|
const now = Date.now()
|
|
|
if (now - this.lastClickTime > this.clickDelay) {
|
|
|
this.showViewerList = !this.showViewerList
|
|
|
@@ -2537,10 +2684,10 @@
|
|
|
this.$nextTick(() => {
|
|
|
const query = uni.createSelectorQuery().in(this)
|
|
|
query.select('.view-box').boundingClientRect((data) => {
|
|
|
- if (data) {
|
|
|
- this.scrollHeight = data.height - 80
|
|
|
- }
|
|
|
- }).exec();
|
|
|
+ if (data) {
|
|
|
+ this.scrollHeight = data.height - 80
|
|
|
+ }
|
|
|
+ }).exec();
|
|
|
})
|
|
|
},
|
|
|
async handleViewerLoadMore(page) {
|
|
|
@@ -2600,52 +2747,54 @@
|
|
|
async getliveUser(isLoadMore = false) {
|
|
|
if (!isLoadMore) {
|
|
|
this.liveViewers = []
|
|
|
+ this.viewPageNum = 1
|
|
|
}
|
|
|
this.viewLoading = true;
|
|
|
try {
|
|
|
const res = await watchUserList(this.liveId, this.viewPageSize, this.viewPageNum, false);
|
|
|
- console.log("qxj watchUserList res",res);
|
|
|
+ console.log("qxj watchUserList res", res);
|
|
|
if (res.code === 200) {
|
|
|
const newRows = Array.isArray(res.rows) ? res.rows : []
|
|
|
-
|
|
|
+
|
|
|
const newViewers = newRows.map((item) => ({
|
|
|
- avatar: item.avatar || '',
|
|
|
- userId: item.userId || '',
|
|
|
- nickName: item.nickName || '未命名'
|
|
|
+ avatar: item.avatar || '',
|
|
|
+ userId: item.userId || '',
|
|
|
+ nickName: item.nickName || '未命名'
|
|
|
}));
|
|
|
|
|
|
let virtualData = [];
|
|
|
- let virtualTotal = res.total > 20 ? 20 : res.total;
|
|
|
- for (let i = 0; i < virtualTotal; i++) {
|
|
|
- let data = {
|
|
|
- avatar: '',
|
|
|
- userId: '8565' + i,
|
|
|
- nickName: this.generateRandomChineseName()
|
|
|
- }
|
|
|
- virtualData.push(data);
|
|
|
- }
|
|
|
-
|
|
|
if (!isLoadMore) {
|
|
|
+ // 首次加载时,固定生成10条虚拟数据,避免数量跳动
|
|
|
+ let virtualTotal = 10;
|
|
|
+ for (let i = 0; i < virtualTotal; i++) {
|
|
|
+ let data = {
|
|
|
+ avatar: '',
|
|
|
+ userId: '8565' + i,
|
|
|
+ nickName: this.generateRandomChineseName()
|
|
|
+ }
|
|
|
+ virtualData.push(data);
|
|
|
+ }
|
|
|
this.liveViewersData = [...newViewers, ...virtualData];
|
|
|
}
|
|
|
|
|
|
// 过滤掉旧列表中的虚拟数据,保留真实用户
|
|
|
- let currentRealViewers = isLoadMore ? this.liveViewers.filter(v => !String(v.userId).startsWith('8565')) : [];
|
|
|
-
|
|
|
+ let currentRealViewers = isLoadMore ? this.liveViewers.filter(v => !String(v.userId)
|
|
|
+ .startsWith('8565')) : [];
|
|
|
+
|
|
|
// 合并真实用户
|
|
|
let allRealViewers = [...currentRealViewers, ...newViewers];
|
|
|
-
|
|
|
- // 加上虚拟用户放在最后
|
|
|
- this.liveViewers = [...allRealViewers, ...virtualData];
|
|
|
-
|
|
|
- let hasMore = newRows.length > 0;
|
|
|
+
|
|
|
+ // 加上虚拟用户放在最后(只在首次加载时)
|
|
|
+ this.liveViewers = isLoadMore ? allRealViewers : [...allRealViewers, ...virtualData];
|
|
|
+
|
|
|
+ let hasMore = newRows.length >= this.viewPageSize;
|
|
|
if (this.liveViewers.length >= 100) {
|
|
|
hasMore = false;
|
|
|
this.lookAudsCount = this.liveUserTotal - 100;
|
|
|
} else {
|
|
|
this.lookAudsCount = 0;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (this.$refs.viewer) {
|
|
|
this.$refs.viewer.endSuccess(newRows.length, hasMore);
|
|
|
}
|
|
|
@@ -2662,7 +2811,7 @@
|
|
|
async getliveUserInit(isLoadMore = false) {
|
|
|
try {
|
|
|
const res = await watchUserList(this.liveId, this.viewPageSize, 1, false);
|
|
|
- console.log("qxj watchUserList res",res);
|
|
|
+ console.log("qxj watchUserList res", res);
|
|
|
if (res.code === 200) {
|
|
|
const userRows = Array.isArray(res.rows) ? res.rows : []
|
|
|
let array = userRows.map((item) => ({
|
|
|
@@ -2683,14 +2832,13 @@
|
|
|
// virtualData.push(data)
|
|
|
// }
|
|
|
this.liveTopViewersData = [...array];
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.error('获取观众列表失败:', error)
|
|
|
- } finally {
|
|
|
- }
|
|
|
+ } finally {}
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
showPurchaseMessage() {
|
|
|
if (this.purchasePromptTimer) {
|
|
|
clearTimeout(this.purchasePromptTimer)
|
|
|
@@ -3300,12 +3448,12 @@
|
|
|
'singleVisible') {} else if (socketMessage.cmd == 'entry') {
|
|
|
try {
|
|
|
//if (!this.liveUserCalled) {
|
|
|
- await this.getliveUserInit(false)
|
|
|
- this.liveUserCalled = true;
|
|
|
+ await this.getliveUserInit(false)
|
|
|
+ this.liveUserCalled = true;
|
|
|
//}
|
|
|
const userIdToEntry = socketMessage.userId
|
|
|
const existingIndex = this.liveViewersData.findIndex((item) => item.userId ===
|
|
|
-userIdToEntry);
|
|
|
+ userIdToEntry);
|
|
|
if (existingIndex === -1) {
|
|
|
const liveViewers = {
|
|
|
userId: socketMessage.userId,
|
|
|
@@ -3315,12 +3463,12 @@ userIdToEntry);
|
|
|
this.liveViewersData.push(liveViewers)
|
|
|
this.liveUserTotal++
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
const userData = JSON.parse(socketMessage.data || '{}')
|
|
|
const userId = userData.userId || socketMessage.userId
|
|
|
if (!userId) return
|
|
|
-
|
|
|
+
|
|
|
if (!this.shownEntryUsers.has(userId)) {
|
|
|
this.inAndOut = socketMessage;
|
|
|
this.showWelcomeMessage = true;
|
|
|
@@ -3654,6 +3802,7 @@ userIdToEntry);
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
justify-content: space-between;
|
|
|
+
|
|
|
.progress-countdown {
|
|
|
margin-top: 24rpx;
|
|
|
z-index: 9000;
|
|
|
@@ -3665,17 +3814,17 @@ userIdToEntry);
|
|
|
border-radius: 16rpx;
|
|
|
padding: 16rpx;
|
|
|
flex-direction: column;
|
|
|
-
|
|
|
+
|
|
|
&.progress-vertical {
|
|
|
top: 15%;
|
|
|
left: 24rpx;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.title {
|
|
|
width: 148rpx;
|
|
|
height: 28rpx;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.progress-bar-bg {
|
|
|
width: 148rpx;
|
|
|
height: 8rpx;
|
|
|
@@ -3684,7 +3833,7 @@ userIdToEntry);
|
|
|
border-radius: 6rpx;
|
|
|
overflow: hidden;
|
|
|
margin-bottom: 16rpx;
|
|
|
-
|
|
|
+
|
|
|
.progress-bar-fill {
|
|
|
height: 100%;
|
|
|
background: #face15;
|
|
|
@@ -3692,7 +3841,7 @@ userIdToEntry);
|
|
|
transition: width 1s linear;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.progress-text {
|
|
|
color: #fff;
|
|
|
font-size: 20rpx;
|
|
|
@@ -3763,7 +3912,7 @@ userIdToEntry);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
.side-group {
|
|
|
position: absolute;
|
|
|
@@ -4470,4 +4619,64 @@ userIdToEntry);
|
|
|
::v-deep .u-icon--right {
|
|
|
justify-content: flex-end !important;
|
|
|
}
|
|
|
+
|
|
|
+ /* 微信昵称授权弹窗样式 */
|
|
|
+ .userlogo {
|
|
|
+ padding: 36rpx 40rpx;
|
|
|
+ color: #000000;
|
|
|
+
|
|
|
+ .mt42 {
|
|
|
+ margin-top: 42rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .boxweixin {
|
|
|
+ width: 44rpx;
|
|
|
+ height: 44rpx;
|
|
|
+ border-radius: 50%;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 34rpx;
|
|
|
+ color: #0a0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .button-container {
|
|
|
+ position: relative;
|
|
|
+ margin: auto;
|
|
|
+
|
|
|
+ .hidden-input {
|
|
|
+ width: calc(100vw - 80rpx);
|
|
|
+ text-align: center;
|
|
|
+ height: 104rpx;
|
|
|
+ background: #07C160;
|
|
|
+ padding: 30rpx 0;
|
|
|
+ box-sizing: border-box;
|
|
|
+ border-radius: 12rpx;
|
|
|
+ font-size: 32rpx !important;
|
|
|
+ color: #FFFFFF !important;
|
|
|
+ /* 输入文字大小 */
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 针对 placeholder 的样式 */
|
|
|
+ .hidden-input::placeholder {
|
|
|
+ font-size: 44rpx !important;
|
|
|
+ color: #FFFFFF !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 兼容微信小程序的 placeholder 样式 */
|
|
|
+ .hidden-input .placeholder {
|
|
|
+ font-size: 44rpx !important;
|
|
|
+ color: #FFFFFF !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .submitname {
|
|
|
+ height: 104rpx;
|
|
|
+ line-height: 104rpx;
|
|
|
+ background: #F2F2F2;
|
|
|
+ border-radius: 12rpx;
|
|
|
+ font-size: 32rpx;
|
|
|
+ color: #07C160;
|
|
|
+ margin-top: 32rpx;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|