|
|
@@ -9,8 +9,9 @@
|
|
|
|
|
|
<view class="notice-marquee-wrap">
|
|
|
<view class="notice-marquee-track">
|
|
|
- <view class="notice-text"><image src="/static/images/notice.png"></image>央广网独家授权栏目 全品类100%经过国标检测</view>
|
|
|
- <view class="notice-text"><image src="/static/images/notice.png"></image>央广网独家授权栏目 全品类100%经过国标检测</view>
|
|
|
+ <view class="notice-text"><image src="/static/images/notice.png"></image>{{notice || '央广网独家溯源 全品类100%经过国标检测'}}</view>
|
|
|
+ <view class="notice-text"><image src="/static/images/notice.png"></image>{{notice || '央广网独家溯源 全品类100%经过国标检测'}}</view>
|
|
|
+ <!-- <view class="notice-text"><image src="/static/images/notice.png"></image>央广网独家溯源 全品类100%经过国标检测</view> -->
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -18,7 +19,7 @@
|
|
|
<image v-if="!isLogin || isAddKf!=1" class="video-poster" :src="courseInfo.imgUrl" mode="aspectFill">
|
|
|
</image>
|
|
|
<video @timeupdate="onTimeUpdate" @progress="progressChange" @error="videoErrorCallback" @play="getPlay"
|
|
|
- @pause="getPause" @ended="getEnded" @fullscreenchange="fullscreenchange" :title="courseInfo.title"
|
|
|
+ @pause="getPause" @ended="getEnded" @fullscreenchange="fullscreenchange" :title="courseInfo.title"
|
|
|
style="width: 100%;" :style="{'height':isShu?'100%':'420rpx'}" :poster="poster" id="video-content-box" controls
|
|
|
:auto-pause-if-open-native="true" :auto-pause-if-navigate="true" :enable-progress-gesture="false"
|
|
|
:show-progress="true" :picture-in-picture-mode="[]" :show-background-playback-button="false"
|
|
|
@@ -34,10 +35,51 @@
|
|
|
<cover-view style="font-size: 13px;">{{ formattedCountdown.hours||'00' }}:{{ formattedCountdown.minutes||'00' }}:{{ formattedCountdown.seconds||"00" }}</cover-view>
|
|
|
</cover-view>
|
|
|
</cover-view>
|
|
|
+ <cover-view
|
|
|
+ class="goods-cover"
|
|
|
+ :style="{ display:isFull&&cardPopup && currentCardItem ? 'block' : 'none'}"
|
|
|
+ @click.stop="goBuy(currentCardItem)"
|
|
|
+ >
|
|
|
+ <!-- 关闭按钮 -->
|
|
|
+ <cover-view class="close-box" @click.stop="closeCardPopup">
|
|
|
+ <cover-image src="/static/images/close.png"></cover-image>
|
|
|
+ </cover-view>
|
|
|
+
|
|
|
+ <cover-view class="goods-cover-inner">
|
|
|
+ <!-- 商品主图 -->
|
|
|
+ <cover-view class="goods-cover-img">
|
|
|
+ <cover-image
|
|
|
+ style="width:150px;height:150px;object-fit:cover;"
|
|
|
+ :src="currentCardItem.images"
|
|
|
+ mode="aspectFit"
|
|
|
+ ></cover-image>
|
|
|
+ </cover-view>
|
|
|
+ <cover-view class="goods-cover-info">
|
|
|
+ <cover-view class="goods-cover-title">{{ currentCardItem.productName || '-' }}</cover-view>
|
|
|
+
|
|
|
+ <cover-view class="goods-cover-bottom">
|
|
|
+ <cover-view class="goods-cover-tag">
|
|
|
+ <cover-image class="goods-cover-tag-bg" src="/static/images/pbg.png" mode="widthFix"></cover-image>
|
|
|
+ <cover-view class="goods-cover-tag-text">惊喜价</cover-view>
|
|
|
+ </cover-view>
|
|
|
+
|
|
|
+ <cover-view class="goods-cover-price">
|
|
|
+ <cover-view class="unit">¥</cover-view>
|
|
|
+ <cover-view class="price">
|
|
|
+ {{ currentCardItem.price || '0.00' }}
|
|
|
+ </cover-view>
|
|
|
+ </cover-view>
|
|
|
+ </cover-view>
|
|
|
+ </cover-view>
|
|
|
+ </cover-view>
|
|
|
+ </cover-view>
|
|
|
</video>
|
|
|
</view>
|
|
|
<!-- 商品卡片弹窗 -->
|
|
|
- <view class="goods-card" :style="{'bottom':isShu?'280rpx':'220rpx'}" v-if="cardPopup && currentCardItem" @click="goBuy(currentCardItem)">
|
|
|
+ <view class="goods-card" :style="{'bottom':isShu?'280rpx':'220rpx'}" v-if="!isFull&&cardPopup && currentCardItem" @click.stop="goBuy(currentCardItem)">
|
|
|
+ <view class="close-box" @click.stop="closeCardPopup">
|
|
|
+ <image src="/static/images/close.png"></image>
|
|
|
+ </view>
|
|
|
<view class="goods-card-inner">
|
|
|
<image class="goods-card-img" :src="currentCardItem.images" mode="aspectFill"></image>
|
|
|
<view class="goods-card-info">
|
|
|
@@ -50,7 +92,7 @@
|
|
|
<view class="goods-card-price">
|
|
|
<view class="unit">¥</view>
|
|
|
<text class="price">
|
|
|
- {{ currentCardItem.price && currentCardItem.price.toFixed ? currentCardItem.price.toFixed(2) : (currentCardItem.price || '0.00') }}
|
|
|
+ {{ currentCardItem.price || '0.00' }}
|
|
|
</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -115,7 +157,7 @@
|
|
|
</scroll-view> -->
|
|
|
<!-- 评价 -->
|
|
|
<view class="rating-box" v-if="isLogin&&isAddKf==1&&!isquestion&&!isShu">
|
|
|
- <image class="bg" src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/app/vip/bg-back.jpg" mode="widthFix"></image>
|
|
|
+ <image class="bg" src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/app/vip/bg-back.png" mode="widthFix"></image>
|
|
|
<view class="rating-body" v-for="(item,index) in quesList" :key="index" >
|
|
|
<view class="title">{{item.title}}</view>
|
|
|
<view class="sat-box">
|
|
|
@@ -570,6 +612,8 @@
|
|
|
// 商品卡片弹窗
|
|
|
cardPopup: false,
|
|
|
currentCardItem: null,
|
|
|
+ // 手动关闭后,当前卡片在其有效时段内不再重复弹出
|
|
|
+ dismissedCardKey: '',
|
|
|
// 完课积分倒计时(秒)
|
|
|
remainTime: 0,
|
|
|
// 完课积分总倒计时时长(秒),用于计算百分比
|
|
|
@@ -579,7 +623,9 @@
|
|
|
// 是否已从接口拉取到倒计时数据(避免 remainTime 初始为 0 时提前放开答题)
|
|
|
remainTimeReady: false,
|
|
|
// 倒计时结束后是否已补发过一次看课记录
|
|
|
- hasReportedAfterCountdown: false
|
|
|
+ hasReportedAfterCountdown: false,
|
|
|
+ notice:'',//跑马灯,
|
|
|
+ isHeight:false,
|
|
|
}
|
|
|
},
|
|
|
filters: {
|
|
|
@@ -661,6 +707,7 @@
|
|
|
});
|
|
|
})
|
|
|
this.videoContext = uni.createVideoContext('video-content-box', this)
|
|
|
+ this.getVideoContainerHeight()
|
|
|
this.code = option.code
|
|
|
if (uni.getStorageSync('userInfo') && JSON.stringify(uni.getStorageSync('userInfo')) != '{}') {
|
|
|
this.userInfo = uni.getStorageSync('userInfo')
|
|
|
@@ -748,6 +795,9 @@
|
|
|
// this.interval = null
|
|
|
// }
|
|
|
},
|
|
|
+ onPageResize(){
|
|
|
+ this.getVideoContainerHeight();
|
|
|
+ },
|
|
|
onUnload() {
|
|
|
if (this.interval != null) {
|
|
|
clearInterval(this.interval)
|
|
|
@@ -806,13 +856,36 @@
|
|
|
}, 480)
|
|
|
})
|
|
|
},
|
|
|
- fullscreenchange(e){
|
|
|
- const isFullScreen = !!(e && e.detail && e.detail.fullscreen);
|
|
|
- this.isFull = isFullScreen;
|
|
|
+ onVideoMetaLoaded(e) {
|
|
|
+ // const width = e.detail.width;
|
|
|
+ // const height = e.detail.height;
|
|
|
+ // const res = uni.getSystemInfoSync();
|
|
|
+ // const winH = res.windowHeight;
|
|
|
+ // const winW = res.windowWidth;
|
|
|
+ // //横屏
|
|
|
+ // const wW = (winW / winH) * 100;
|
|
|
+ // console.log(winH,winW,'高度')
|
|
|
+ // console.log(winH,winW,'高度')
|
|
|
+ // //竖屏
|
|
|
+ // if (height < width) {
|
|
|
+ // this.isHeight = true
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ // 获取视频容器高度
|
|
|
+ getVideoContainerHeight() {
|
|
|
+ const { windowWidth, windowHeight } = uni.getSystemInfoSync();
|
|
|
+ this.isHeight = windowWidth > windowHeight;
|
|
|
+ console.log('当前是否横屏:', this.isHeight);
|
|
|
+ },
|
|
|
+ fullscreenchange(event){
|
|
|
+ const isFullScreen = !!(event && event.detail && event.detail.fullScreen);
|
|
|
+ this.isFull = event.detail.fullScreen;
|
|
|
+ //this.getVideoContainerHeight();
|
|
|
+ //console.log(this.isFull,'this.isFull ')
|
|
|
// 竖屏课程下:把全屏按钮当作布局切换按钮,禁止原生全屏停留
|
|
|
if (this.displayType === 'portrait') {
|
|
|
- if (e && e.stopPropagation) e.stopPropagation();
|
|
|
- if (e && e.preventDefault) e.preventDefault();
|
|
|
+ if (event && event.stopPropagation) event.stopPropagation();
|
|
|
+ if (event && event.preventDefault) event.preventDefault();
|
|
|
// 只在“进入全屏”时切换,避免 exitFullScreen 触发的 false 事件二次反转
|
|
|
if (!isFullScreen || this.fullscreenToggleLock) return;
|
|
|
this.fullscreenToggleLock = true;
|
|
|
@@ -828,6 +901,7 @@
|
|
|
this.fullscreenToggleTimer = null;
|
|
|
}, 220);
|
|
|
}, 40);
|
|
|
+ //console.log(this.isFull,'this.isFull111 ')
|
|
|
}
|
|
|
},
|
|
|
//购物车
|
|
|
@@ -917,12 +991,12 @@
|
|
|
getRemainTime(data).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
const remain = Number(res.remainTime) || 0; // 积分看课剩余时间(秒)
|
|
|
- this.remainTime = remain;
|
|
|
+ this.remainTime = remain + 30;
|
|
|
this.remainTimeReady = true;
|
|
|
this.hasReportedAfterCountdown = remain <= 0;
|
|
|
// 初始化或刷新总时长,用于进度条百分比
|
|
|
if (!this.totalRemainTime || remain > this.totalRemainTime) {
|
|
|
- this.totalRemainTime = remain;
|
|
|
+ this.totalRemainTime = remain + 30;
|
|
|
}
|
|
|
} else {
|
|
|
this.remainTimeReady = false
|
|
|
@@ -940,7 +1014,8 @@
|
|
|
getConfigByKey(data).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
console.log("getConfigByKey====", JSON.parse(res.data))
|
|
|
- let data = JSON.parse(res.data, )
|
|
|
+ let data = JSON.parse(res.data)
|
|
|
+ this.notice = data.camelCase
|
|
|
uni.setStorageSync('setWebviewUrl', data.userCourseAuthDomain)
|
|
|
} else {
|
|
|
uni.showToast({
|
|
|
@@ -1375,9 +1450,23 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- this.cardPopup = !!activeCard
|
|
|
+ const activeCardKey = activeCard ?
|
|
|
+ `${activeCard.productId || ''}_${activeCard.cardPopupTime || ''}_${activeCard.cardCloseTime || ''}` :
|
|
|
+ ''
|
|
|
+ if (!activeCardKey) {
|
|
|
+ this.dismissedCardKey = ''
|
|
|
+ }
|
|
|
+ this.cardPopup = !!activeCard && this.dismissedCardKey !== activeCardKey
|
|
|
+ //this.getVideoContainerHeight()
|
|
|
this.currentCardItem = activeCard
|
|
|
},
|
|
|
+ closeCardPopup() {
|
|
|
+ if (this.currentCardItem) {
|
|
|
+ this.dismissedCardKey =
|
|
|
+ `${this.currentCardItem.productId || ''}_${this.currentCardItem.cardPopupTime || ''}_${this.currentCardItem.cardCloseTime || ''}`
|
|
|
+ }
|
|
|
+ this.cardPopup = false
|
|
|
+ },
|
|
|
changeTime(that, e) {
|
|
|
that.playDurationSeek = 0
|
|
|
},
|
|
|
@@ -1609,7 +1698,7 @@
|
|
|
} else {
|
|
|
this.isquestion = false
|
|
|
}
|
|
|
- console.log('题目', res.data.courseVideoDetails.questionBankList)
|
|
|
+ //console.log('题目', res.data.courseVideoDetails.questionBankList)
|
|
|
this.quesList = res.data.courseVideoDetails.questionBankList &&
|
|
|
res.data.courseVideoDetails.questionBankList.length > 0 ? res.data.courseVideoDetails
|
|
|
.questionBankList : [],
|
|
|
@@ -2266,7 +2355,7 @@
|
|
|
}
|
|
|
.rating-box{
|
|
|
position: relative;
|
|
|
- padding: 24rpx;
|
|
|
+ padding:40rpx 24rpx 24rpx;
|
|
|
z-index:0;
|
|
|
height: calc(100vh - 488rpx);
|
|
|
.bg {
|
|
|
@@ -2278,14 +2367,14 @@
|
|
|
z-index: 0;
|
|
|
}
|
|
|
.rating-body{
|
|
|
- margin-top: 110rpx;
|
|
|
+ //margin-top: 40rpx;
|
|
|
position: relative;
|
|
|
z-index: 1;
|
|
|
padding:30rpx;
|
|
|
box-sizing: border-box;
|
|
|
background: #FFFFFF;
|
|
|
border-radius: 24rpx;
|
|
|
- max-height: calc(100% - 300rpx);
|
|
|
+ max-height: calc(100% - 200rpx);
|
|
|
overflow-y: auto;
|
|
|
-webkit-overflow-scrolling: touch;
|
|
|
.title{
|
|
|
@@ -2794,7 +2883,7 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 商品卡片样式
|
|
|
.goods-card {
|
|
|
position: absolute;
|
|
|
@@ -2886,8 +2975,116 @@
|
|
|
color: #FF233C;
|
|
|
}
|
|
|
}
|
|
|
+ .close-box{
|
|
|
+ position: absolute;
|
|
|
+ top:20rpx;
|
|
|
+ right:20rpx;
|
|
|
+ image{
|
|
|
+ width: 30rpx;
|
|
|
+ height: 30rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
+ /* 商品卡片样式 */
|
|
|
+ .goods-cover {
|
|
|
+ /* cover-view 在 video 内使用 absolute 比 fixed 更稳定 */
|
|
|
+ position: absolute;
|
|
|
+ right: 12px;
|
|
|
+ width: 150px;
|
|
|
+ z-index: 99999;
|
|
|
+ background: #FFFFFF;
|
|
|
+ border-radius: 10px;
|
|
|
+ overflow: hidden;
|
|
|
+ bottom: 40px;
|
|
|
+ &-inner {
|
|
|
+ display: flex;
|
|
|
+ flex-direction:column;
|
|
|
+ }
|
|
|
+
|
|
|
+ &-img {
|
|
|
+ width:150px;
|
|
|
+ height:150px;
|
|
|
+ flex-shrink: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ &-info {
|
|
|
+ flex: 1;
|
|
|
+ padding: 6px;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: space-between;
|
|
|
+ }
|
|
|
+
|
|
|
+ &-title {
|
|
|
+ font-family: PingFangSC, PingFang SC;
|
|
|
+ font-weight: 600;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #000000D9;
|
|
|
+ line-height: 22px;
|
|
|
+ overflow: hidden;
|
|
|
+ width: 150px; /* 必须给宽度 */
|
|
|
+ white-space: nowrap; /* 关键 */
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ }
|
|
|
+ &-bottom {
|
|
|
+ margin-top: 6px;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ &-tag {
|
|
|
+ position: relative;
|
|
|
+ width: 60px;
|
|
|
+ height: 22px;
|
|
|
+ }
|
|
|
+
|
|
|
+ &-tag-bg {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ &-tag-text {
|
|
|
+ position: absolute;
|
|
|
+ left: 0;
|
|
|
+ top: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 22px;
|
|
|
+ font-size: 12px;
|
|
|
+ color: #FFFFFF;
|
|
|
+ font-weight: 500;
|
|
|
+ }
|
|
|
+
|
|
|
+ &-price{
|
|
|
+ margin-left: 7px;
|
|
|
+ display: flex;
|
|
|
+ align-items:baseline;
|
|
|
+ .unit{
|
|
|
+ font-family: PingFangSC, PingFang SC;
|
|
|
+ font-weight: 600;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #FF233C;
|
|
|
+ }
|
|
|
+ .price{
|
|
|
+ font-family: PingFangSC, PingFang SC;
|
|
|
+ font-weight: 600;
|
|
|
+ font-size: 24px;
|
|
|
+ color: #FF233C;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .close-box{
|
|
|
+ position: absolute;
|
|
|
+ top:10px;
|
|
|
+ right:10px;
|
|
|
+ z-index:9;
|
|
|
+ cover-image{
|
|
|
+ width: 15px;
|
|
|
+ height: 15px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
.video-controls-box {
|
|
|
width: 100%;
|
|
|
height: 300rpx;
|