|
|
@@ -169,18 +169,17 @@
|
|
|
</view>
|
|
|
<!-- v-if="!hasReachedTarget" -->
|
|
|
<!-- &&liveItem.completionPointsEnabled -->
|
|
|
- <view class="progress-countdown end" :class="liveItem.showType==2?' progress-vertical':''"
|
|
|
+ <!-- <view class="progress-countdown end" :class="liveItem.showType==2?' progress-vertical':''"
|
|
|
:style="{ 'display':isFocus?'none':''}"
|
|
|
v-if="countdownPercentage!=100&&!receiveStatus&&liveItem.status==2&&!hasReceived">
|
|
|
<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" }}
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
<view class="slide-group" v-if="!isFocus && !isFullscreen">
|
|
|
<view class="action-button-group end">
|
|
|
<view :class="[liveItem.showType === 1 ? 'horizontal' : 'vertical','icon-button','ml20']">
|
|
|
@@ -391,13 +390,12 @@
|
|
|
<!-- :show="!!integral.status" -->
|
|
|
<!-- :show="showPoints" -->
|
|
|
<!-- :show="shouldShowIntegralPopup" -->
|
|
|
- <u-popup :show="shouldShowIntegralPopup" round="20rpx" mode="center" bgColor="#ffffff" zIndex="10076">
|
|
|
+ <!-- <u-popup :show="shouldShowIntegralPopup" round="20rpx" mode="center" bgColor="#ffffff" zIndex="10076">
|
|
|
<view class="integral-popup color9">
|
|
|
<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-item" v-for="(item,index ) in receiveList" :key="index">
|
|
|
@@ -407,7 +405,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </u-popup>
|
|
|
+ </u-popup> -->
|
|
|
|
|
|
<!-- 积分弹窗(时长) -->
|
|
|
<u-popup :show="!!integral.status" round="20rpx" mode="center" bgColor="#ffffff" zIndex="10076">
|
|
|
@@ -735,6 +733,7 @@
|
|
|
remainingTime,
|
|
|
updateWatchDuration,
|
|
|
receivePoints,
|
|
|
+
|
|
|
integrallogs
|
|
|
} from '@/api/integral.js'
|
|
|
import dayjs from 'dayjs';
|
|
|
@@ -963,7 +962,8 @@
|
|
|
diffTotalTime: '',
|
|
|
address: '',
|
|
|
commonViewHeight: '',
|
|
|
- user: {}
|
|
|
+ user: {},
|
|
|
+ watchDuration:0,
|
|
|
};
|
|
|
},
|
|
|
async onLoad(options) {
|
|
|
@@ -1125,7 +1125,7 @@
|
|
|
},
|
|
|
async onShow() {
|
|
|
if (this.isVideoPlaying && this.pointsRemainingTime > 0) {
|
|
|
- this.startCountdown();
|
|
|
+ //this.startCountdown();
|
|
|
}
|
|
|
// 检查视频是否在播放状态
|
|
|
if (this.videoContext) {
|
|
|
@@ -1264,7 +1264,8 @@
|
|
|
},
|
|
|
computed: {
|
|
|
shouldShowIntegralPopup() {
|
|
|
- // 只有当 showPoints 为 true 且 receiveList 有数据时才显示
|
|
|
+ //只有当 showPoints 为 true 且 receiveList 有数据时才显示
|
|
|
+ return false;
|
|
|
return this.showPoints && this.receiveList && this.receiveList.length > 0;
|
|
|
},
|
|
|
// 格式化后的倒计时
|
|
|
@@ -1418,7 +1419,7 @@
|
|
|
onVideoStateChange(e) {
|
|
|
// 这里可以根据视频状态控制倒计时
|
|
|
if (e.detail.code === 2004) { // 视频开始播放
|
|
|
- this.startCountdown();
|
|
|
+ //this.startCountdown();
|
|
|
} else if (e.detail.code === 2006) { // 视频播放结束
|
|
|
this.stopCountdown();
|
|
|
}
|
|
|
@@ -1573,6 +1574,7 @@
|
|
|
this.pointsRemainingTime = res.data.remainingTime;
|
|
|
this.hasReceived = res.data.hasReceived;
|
|
|
this.videoDuration = res.data.videoDuration;
|
|
|
+ this.watchDuration = res.data.watchDuration; //停留时长
|
|
|
console.log("查询当前用户当前直播间领取积分的剩余时长", res)
|
|
|
}
|
|
|
}).catch((error) => {
|
|
|
@@ -1723,12 +1725,8 @@
|
|
|
// uni-app 不需要手动移除监听,生命周期自动管理
|
|
|
console.log('页面可见性监听已移除');
|
|
|
},
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
// 开始倒计时
|
|
|
startCountdown() {
|
|
|
-
|
|
|
if (this.countdownTimer) {
|
|
|
clearInterval(this.countdownTimer);
|
|
|
}
|
|
|
@@ -1738,10 +1736,9 @@
|
|
|
this.isCountdownActive = false;
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
this.isCountdownActive = true;
|
|
|
this.lastUpdateTime = Date.now();
|
|
|
-
|
|
|
this.countdownTimer = setInterval(() => {
|
|
|
console.log("进入倒计时")
|
|
|
this.updateCountdown();
|
|
|
@@ -1754,28 +1751,23 @@
|
|
|
this.stopCountdown();
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
const now = Date.now();
|
|
|
// 使用更精确的时间差计算(毫秒)
|
|
|
const elapsedMs = now - this.lastUpdateTime;
|
|
|
-
|
|
|
// 转换为秒(保留小数位避免累积误差)
|
|
|
const elapsedSeconds = elapsedMs / 1000;
|
|
|
-
|
|
|
console.log(`时间差: ${elapsedMs}ms, ${elapsedSeconds.toFixed(3)}秒`);
|
|
|
|
|
|
if (elapsedSeconds > 0) {
|
|
|
// 精确减少剩余时间
|
|
|
this.pointsRemainingTime = Math.max(0, this.pointsRemainingTime - elapsedSeconds);
|
|
|
+ console.log("qxj pointsRemainingTime",this.pointsRemainingTime);
|
|
|
this.lastUpdateTime = now;
|
|
|
-
|
|
|
// 更新显示
|
|
|
this.updateCountdownDisplay();
|
|
|
-
|
|
|
// 倒计时完成(使用小于等于0判断)
|
|
|
if (this.pointsRemainingTime <= 0) {
|
|
|
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -1859,7 +1851,6 @@
|
|
|
formatCountdown(seconds) {
|
|
|
// 1. 先校验输入:确保是有效正整数,避免负数/非数字导致计算错误
|
|
|
const totalSeconds = Math.max(0, Math.floor(Number(seconds) || 0));
|
|
|
-
|
|
|
// 2. 重新梳理计算逻辑(核心修复)
|
|
|
const hours = Math.floor(totalSeconds / 3600);
|
|
|
const remainingAfterHours = totalSeconds % 3600; // 小时取余后剩余的秒数
|
|
|
@@ -1907,7 +1898,6 @@
|
|
|
// 如果需要,可以在这里触发视图更新
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
-
|
|
|
// 补零函数
|
|
|
padZero(num) {
|
|
|
return num < 10 ? `0${num}` : num.toString();
|
|
|
@@ -2615,8 +2605,7 @@
|
|
|
// 延迟重新加载
|
|
|
setTimeout(() => {
|
|
|
// 重新设置视频源,强制清理缓存
|
|
|
- this.$set(this.liveItem, 'videoUrl', this.liveItem.videoUrl + '&t=' + Date
|
|
|
- .now());
|
|
|
+ this.$set(this.liveItem, 'videoUrl', this.liveItem.videoUrl + '&t=' + Date.now());
|
|
|
|
|
|
// 恢复播放位置
|
|
|
setTimeout(() => {
|
|
|
@@ -3905,7 +3894,7 @@
|
|
|
// 视频播放
|
|
|
onVideoPlay(e) {
|
|
|
if (this.liveItem.status == 2) {
|
|
|
- this.startCountdown();
|
|
|
+ //this.startCountdown();
|
|
|
// 启动观看时长统计
|
|
|
this.startWatchDurationTracking();
|
|
|
}
|
|
|
@@ -7610,16 +7599,13 @@
|
|
|
z-index: 5;
|
|
|
border-radius: 20rpx;
|
|
|
width: 320rpx;
|
|
|
-
|
|
|
.coupon-container {
|
|
|
width: 100%;
|
|
|
position: relative;
|
|
|
-
|
|
|
.coupon-background {
|
|
|
height: 452rpx;
|
|
|
width: 100%;
|
|
|
}
|
|
|
-
|
|
|
.coupon-header {
|
|
|
position: absolute;
|
|
|
height: 120rpx;
|
|
|
@@ -7628,7 +7614,6 @@
|
|
|
width: 100%;
|
|
|
z-index: 6;
|
|
|
}
|
|
|
-
|
|
|
.coupon-close-button {
|
|
|
position: absolute;
|
|
|
right: 10rpx;
|