|
|
@@ -128,7 +128,7 @@
|
|
|
v-if="currentCardItem && currentCardItem.images"
|
|
|
style="width:150px;height:150px;object-fit:cover;"
|
|
|
:src="currentCardItem.images"
|
|
|
- mode="aspectFit"
|
|
|
+ mode="aspectFill"
|
|
|
></image>
|
|
|
</view>
|
|
|
<view class="goods-cover-info">
|
|
|
@@ -264,11 +264,11 @@
|
|
|
<view class="rating-ques-block" v-for="(item,index) in quesList" :key="index">
|
|
|
<view class="title">{{item.title}}</view>
|
|
|
<view class="sat-box">
|
|
|
- <view class="sat" v-for="(option,idx) in item.questionOption" :key="idx" :class="aindex==option.indexId?'sat--active':''" @click="handleAnswer(item,option)">
|
|
|
- <view class="sat-img-wrap" :class="rateBounceIndex==option.indexId?'sat-img-bounce':''">
|
|
|
- <image :src="aindex==option.indexId?rateList[option.indexId].selIcon:rateList[option.indexId].icon" mode="aspectFit"></image>
|
|
|
+ <view class="sat" v-for="(option,idx) in item.questionOption" :key="idx" :class="isRateOptionSelected(item, option)?'sat--active':''" @click="handleAnswer(item,option,index)">
|
|
|
+ <view class="sat-img-wrap" :class="rateBounceIndex===(index + '_' + option.indexId)?'sat-img-bounce':''">
|
|
|
+ <image :src="getRateOptionIcon(option, isRateOptionSelected(item, option), idx)" mode="aspectFit"></image>
|
|
|
</view>
|
|
|
- <text :class="aindex==option.indexId?'active':''">{{option.name}}</text>
|
|
|
+ <text :class="isRateOptionSelected(item, option)?'active':''">{{option.name}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -308,17 +308,13 @@
|
|
|
<view class="rating-msg-text">{{ getCommentTextOnly(it) }}</view>
|
|
|
<view v-if="getCommentVideoUrl(it)" class="rating-msg-media rating-msg-media--video">
|
|
|
<view class="rating-msg-video-wrap">
|
|
|
- <video
|
|
|
- :id="getFeaturedCommentVideoId(it, idx)"
|
|
|
- class="rating-msg-video"
|
|
|
- :src="getCommentVideoUrl(it)"
|
|
|
+ <featured-comment-xg-player
|
|
|
+ ref="featuredCommentXg"
|
|
|
+ :ref-in-for="true"
|
|
|
+ :player-id="getFeaturedCommentVideoId(it, idx)"
|
|
|
+ :video-url="getCommentVideoUrl(it)"
|
|
|
:poster="getCommentVideoPoster(it)"
|
|
|
- :controls="false"
|
|
|
- object-fit="fill"
|
|
|
- :show-play-btn="false"
|
|
|
- :show-center-play-btn="false"
|
|
|
- :enable-progress-gesture="false"
|
|
|
- ></video>
|
|
|
+ />
|
|
|
<view
|
|
|
class="rating-msg-video-play-cover"
|
|
|
@tap.stop="openFeaturedCommentMediaPreview(it, idx, 'video')"
|
|
|
@@ -467,11 +463,11 @@
|
|
|
<view class="action-label">我的订单</view>
|
|
|
</view>
|
|
|
<view class="more-action-item"
|
|
|
- @click="navgetTo('/pages_user/user/integralLogsList')">
|
|
|
+ @click="navgetTo('/pages_points/integralLogsList')">
|
|
|
<u-icon name="calendar" color="#FF233C" size="40"></u-icon>
|
|
|
<view class="action-label">积分记录</view>
|
|
|
</view>
|
|
|
- <view class="more-action-item" @click="navgetTo('/pages_user/user/integralGoodsList')">
|
|
|
+ <view class="more-action-item" @click="navgetTo('/pages_points/integralGoodsList')">
|
|
|
<u-icon name="gift" color="#FF233C" size="40"></u-icon>
|
|
|
<view class="action-label">兑换好礼</view>
|
|
|
</view>
|
|
|
@@ -539,7 +535,7 @@
|
|
|
<image src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/video/upimg.png"></image>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="author-cart" v-show="!(tabIndex === 0 && showTabFeaturedComments && isLogin && isAddKf == 1 && !isquestion && !isShu)">
|
|
|
+ <view class="author-cart" v-show="isLogin && isAddKf==1">
|
|
|
<view class="more-box">
|
|
|
<image src="/static/images/course/more24.png" @click="showMore"></image>
|
|
|
<view class="tips">更多</view>
|
|
|
@@ -698,6 +694,7 @@
|
|
|
} from 'vuex';
|
|
|
import ykscreenRecord from "@/components/yk-screenRecord/yk-screenRecord.vue"
|
|
|
import courseExpiration from './components/courseExpiration.vue'
|
|
|
+ import FeaturedCommentXgPlayer from './components/FeaturedCommentXgPlayer.vue'
|
|
|
import {
|
|
|
getErrMsg,
|
|
|
getH5CourseByVideoId,
|
|
|
@@ -719,7 +716,8 @@
|
|
|
components: {
|
|
|
ykscreenRecord,
|
|
|
courseExpiration,
|
|
|
- goodsList
|
|
|
+ goodsList,
|
|
|
+ FeaturedCommentXgPlayer
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -727,7 +725,6 @@
|
|
|
isMore:false,//更多
|
|
|
isCart:false,//购物车
|
|
|
isShu:false,//竖屏默认
|
|
|
- aindex:null,
|
|
|
rateBounceIndex: null,
|
|
|
_rateBounceTimer: null,
|
|
|
rateList:[{
|
|
|
@@ -839,7 +836,7 @@
|
|
|
/** 当前是否处于播放中 */
|
|
|
videoPlaying: false,
|
|
|
// 是否允许拖动进度条
|
|
|
- linkType: 0,
|
|
|
+ // linkType: 0,
|
|
|
ip: null,
|
|
|
checked: true,
|
|
|
isFinish: 0, // 是否完课
|
|
|
@@ -1020,6 +1017,7 @@
|
|
|
return this.$store.state.imgpath
|
|
|
},
|
|
|
appid() {
|
|
|
+ console.log('this.$store.state.appid',this.$store.state.appid)
|
|
|
return this.$store.state.appid
|
|
|
},
|
|
|
// 格式化后的倒计时
|
|
|
@@ -1095,7 +1093,7 @@
|
|
|
hasVisibleRatingTab() {
|
|
|
return this.visibleRatingTabCount > 0
|
|
|
},
|
|
|
- ...mapGetters(['coureLogin']),
|
|
|
+ //...mapGetters(['coureLogin']),
|
|
|
/** 小黄车商品中「最早上架」时间点(秒),用于跑马灯起始展示 */
|
|
|
firstShelfSecondsAmongProducts() {
|
|
|
const list = this.treatmentPackage || []
|
|
|
@@ -1127,7 +1125,7 @@
|
|
|
return !!(this.isShu || this.isFull)
|
|
|
},
|
|
|
videovipVideoConfig() {
|
|
|
- const allowSeek = this.linkType == 1 || this.isFinish == 1 || this.isEnded
|
|
|
+ const allowSeek = this.isFinish == 1 || this.isEnded
|
|
|
return {
|
|
|
url: this.videoUrl || '',
|
|
|
poster: this.poster || '',
|
|
|
@@ -1135,23 +1133,24 @@
|
|
|
isFast: allowSeek ? 1 : 0,
|
|
|
videoReloadKey: this.videoReloadKey,
|
|
|
displayType: this.displayType || 'landscape',
|
|
|
+ layoutShuKey: this.isShu ? 1 : 0,
|
|
|
time: Date.now()
|
|
|
}
|
|
|
},
|
|
|
},
|
|
|
watch: {
|
|
|
- coureLogin: {
|
|
|
- immediate: true, // 页面一进入就检查一次
|
|
|
- handler(val) {
|
|
|
- console.log(val, '----')
|
|
|
- if (val == 2 && this.isLogin) {
|
|
|
- console.log("看课AppToken失效,请重新登录")
|
|
|
- this.isLogin = false
|
|
|
- this.isAddKf = 0
|
|
|
- this.$showLoginPage()
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
+ // coureLogin: {
|
|
|
+ // immediate: true, // 页面一进入就检查一次
|
|
|
+ // handler(val) {
|
|
|
+ // console.log(val, '----')
|
|
|
+ // if (val == 2 && this.isLogin) {
|
|
|
+ // console.log("看课AppToken失效,请重新登录")
|
|
|
+ // this.isLogin = false
|
|
|
+ // this.isAddKf = 0
|
|
|
+ // this.$showLoginPage()
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // },
|
|
|
isTripleMarqueeMode(now, was) {
|
|
|
if (!now || was) return
|
|
|
if (!this.fakeMarqueeEligible || !this._fakeMarqueeStarted) return
|
|
|
@@ -1211,7 +1210,7 @@
|
|
|
})
|
|
|
this.getVideoContainerHeight()
|
|
|
this._lockAppPortrait()
|
|
|
- this.code = option.code
|
|
|
+ // this.code = option.code
|
|
|
this.userInfo = this.$getUserInfo()
|
|
|
this.appToken = uni.getStorageSync('companyUserInfo')
|
|
|
console.log('option', option)
|
|
|
@@ -1309,6 +1308,7 @@
|
|
|
// 页面隐藏时停止完课积分倒计时
|
|
|
this.stopCountdown()
|
|
|
this.stopProductHotTimer()
|
|
|
+ this._flushWatchProgress()
|
|
|
// if (this.interval != null) {
|
|
|
// clearInterval(this.interval)
|
|
|
// this.interval = null
|
|
|
@@ -1340,6 +1340,7 @@
|
|
|
this.clearIntegral()
|
|
|
this.stopFakeMarqueeLoop()
|
|
|
this.fakeOrderPool = []
|
|
|
+ this._flushWatchProgress()
|
|
|
// #ifndef H5
|
|
|
if (this._featuredCommentKbHandler) {
|
|
|
uni.offKeyboardHeightChange(this._featuredCommentKbHandler)
|
|
|
@@ -1369,6 +1370,7 @@
|
|
|
this.stopProductHotTimer()
|
|
|
this.clearIntegral()
|
|
|
this.stopFakeMarqueeLoop()
|
|
|
+ this._flushWatchProgress()
|
|
|
// #ifndef H5
|
|
|
if (this._featuredCommentKbHandler) {
|
|
|
uni.offKeyboardHeightChange(this._featuredCommentKbHandler)
|
|
|
@@ -1836,6 +1838,15 @@
|
|
|
getFeaturedCommentVideoId(it, idx) {
|
|
|
return 'feat-comment-video-' + this.getFeaturedCommentRowKey(it, idx)
|
|
|
},
|
|
|
+ /** 暂停精选留言列表内所有西瓜/原生内联播放器(弹窗预览仍用独立 video) */
|
|
|
+ _pauseFeaturedCommentListInlinePlayers() {
|
|
|
+ const refs = this.$refs.featuredCommentXg
|
|
|
+ if (!refs) return
|
|
|
+ const arr = Array.isArray(refs) ? refs : [refs]
|
|
|
+ arr.forEach((r) => {
|
|
|
+ if (r && typeof r.pause === 'function') r.pause()
|
|
|
+ })
|
|
|
+ },
|
|
|
openFeaturedCommentMediaPreview(it, listIdx, mode, imageIndex) {
|
|
|
const m = mode === 'video' ? 'video' : 'image'
|
|
|
if (m === 'image') {
|
|
|
@@ -1846,13 +1857,7 @@
|
|
|
urls.length - 1
|
|
|
)
|
|
|
this._pauseCourseVideo()
|
|
|
- try {
|
|
|
- if (this.getCommentVideoUrl(it)) {
|
|
|
- const id = this.getFeaturedCommentVideoId(it, listIdx)
|
|
|
- const c = uni.createVideoContext(id, this)
|
|
|
- if (c && c.pause) c.pause()
|
|
|
- }
|
|
|
- } catch (e) {}
|
|
|
+ this._pauseFeaturedCommentListInlinePlayers()
|
|
|
this.featuredCommentMediaPreviewMode = 'image'
|
|
|
this.featuredCommentMediaPreviewUrls = urls
|
|
|
this.featuredCommentMediaPreviewIndex = i
|
|
|
@@ -1864,11 +1869,7 @@
|
|
|
const vurl = this.getCommentVideoUrl(it)
|
|
|
if (!vurl) return
|
|
|
this._pauseCourseVideo()
|
|
|
- try {
|
|
|
- const id = this.getFeaturedCommentVideoId(it, listIdx)
|
|
|
- const c = uni.createVideoContext(id, this)
|
|
|
- if (c && c.pause) c.pause()
|
|
|
- } catch (e) {}
|
|
|
+ this._pauseFeaturedCommentListInlinePlayers()
|
|
|
this.featuredCommentMediaPreviewMode = 'video'
|
|
|
this.featuredCommentMediaPreviewUrls = []
|
|
|
this.featuredCommentMediaPreviewIndex = 0
|
|
|
@@ -1919,16 +1920,7 @@
|
|
|
},
|
|
|
onFeaturedMediaPreviewModalVideoPlay() {
|
|
|
this._pauseCourseVideo()
|
|
|
- const list = this.featuredCommentDisplayList || []
|
|
|
- for (let i = 0; i < list.length; i++) {
|
|
|
- const row = list[i]
|
|
|
- if (!this.getCommentVideoUrl(row)) continue
|
|
|
- const vid = this.getFeaturedCommentVideoId(row, i)
|
|
|
- try {
|
|
|
- const c = uni.createVideoContext(vid, this)
|
|
|
- if (c && c.pause) c.pause()
|
|
|
- } catch (e) {}
|
|
|
- }
|
|
|
+ this._pauseFeaturedCommentListInlinePlayers()
|
|
|
},
|
|
|
_featuredMediaMaxBytes() {
|
|
|
return 100 * 1024 * 1024
|
|
|
@@ -2063,6 +2055,44 @@
|
|
|
closeFeaturedMediaActionSheet() {
|
|
|
this.featuredMediaActionSheetShow = false
|
|
|
},
|
|
|
+ /** 精选留言选相册视频:小程序用 chooseMedia,App/H5 用 chooseVideo */
|
|
|
+ _pickFeaturedAlbumVideo(clearIfStillArmed) {
|
|
|
+ const onFail = () => {
|
|
|
+ // 勿在此处清 suppress:须由 onShow 消费,避免先于 onShow 清标志导致停跑马灯
|
|
|
+ this._resumeCourseVideoAfterFeaturedJob()
|
|
|
+ }
|
|
|
+ const onSuccess = (path, size, thumbTempPath) => {
|
|
|
+ if (!path) return
|
|
|
+ const sz = size != null ? size : 0
|
|
|
+ this._applyFeaturedMediaIfSizeOk('video', path, sz, thumbTempPath || '')
|
|
|
+ }
|
|
|
+ // #ifdef MP-WEIXIN
|
|
|
+ wx.chooseMedia({
|
|
|
+ count: 1,
|
|
|
+ mediaType: ['video'],
|
|
|
+ sourceType: ['album'],
|
|
|
+ maxDuration: 30,
|
|
|
+ success: (res) => {
|
|
|
+ const f0 = res.tempFiles && res.tempFiles[0]
|
|
|
+ if (!f0) return
|
|
|
+ onSuccess(f0.tempFilePath, f0.size, f0.thumbTempFilePath)
|
|
|
+ },
|
|
|
+ fail: onFail,
|
|
|
+ complete: clearIfStillArmed
|
|
|
+ })
|
|
|
+ // #endif
|
|
|
+ // #ifndef MP-WEIXIN
|
|
|
+ uni.chooseVideo({
|
|
|
+ sourceType: ['album'],
|
|
|
+ maxDuration: 30,
|
|
|
+ success: (res) => {
|
|
|
+ onSuccess(res.tempFilePath, res.size, res.thumbTempFilePath)
|
|
|
+ },
|
|
|
+ fail: onFail,
|
|
|
+ complete: clearIfStillArmed
|
|
|
+ })
|
|
|
+ // #endif
|
|
|
+ },
|
|
|
onFeaturedMediaSheetPick(tapIndex) {
|
|
|
this.closeFeaturedMediaActionSheet()
|
|
|
// 立即调起相册/视频会与 u-popup 遮罩关闭叠加,小程序端易残留半透明层;对齐关闭动画后再打开系统选择器
|
|
|
@@ -2100,24 +2130,7 @@
|
|
|
(this.videoPlaying || this._courseWasPlayingBeforeFeaturedCommentOpen)
|
|
|
this._pauseCourseVideo()
|
|
|
const clearIfStillArmed = this._armFeaturedMediaPickerOnShowSuppress()
|
|
|
- wx.chooseMedia({
|
|
|
- count: 1,
|
|
|
- mediaType: ['video'],
|
|
|
- sourceType: ['album'],
|
|
|
- maxDuration: 30,
|
|
|
- success: (res) => {
|
|
|
- const path = res.tempFiles[0].tempFilePath
|
|
|
- if (!path) return
|
|
|
- const size = res.tempFiles[0].size != null ? res.tempFiles[0].size : 0
|
|
|
- this._applyFeaturedMediaIfSizeOk('video', path, size, res.tempFiles[0].thumbTempFilePath || '')
|
|
|
- },
|
|
|
- fail: (err) => {
|
|
|
- //console.log('huoqu122221212122222222', err)
|
|
|
- // 勿在此处清 suppress:须由 onShow 消费,避免先于 onShow 清标志导致停跑马灯
|
|
|
- this._resumeCourseVideoAfterFeaturedJob()
|
|
|
- },
|
|
|
- complete: clearIfStillArmed
|
|
|
- })
|
|
|
+ this._pickFeaturedAlbumVideo(clearIfStillArmed)
|
|
|
}
|
|
|
}, afterSheetCloseMs)
|
|
|
},
|
|
|
@@ -2562,15 +2575,41 @@
|
|
|
this.marqueeTripleSwitching = false
|
|
|
this._stopSelfMarqueeClock()
|
|
|
},
|
|
|
- goRate(index){
|
|
|
- this.aindex = index
|
|
|
+ getRateByIndexId(indexId, optionIdx) {
|
|
|
+ const list = this.rateList || []
|
|
|
+ if (!list.length) return null
|
|
|
+ const n = Number(indexId)
|
|
|
+ if (Number.isFinite(n)) {
|
|
|
+ const byId = list.find((r) => r && Number(r.id) === n)
|
|
|
+ if (byId) return byId
|
|
|
+ if (list[n]) return list[n]
|
|
|
+ }
|
|
|
+ const i = Number(optionIdx)
|
|
|
+ if (Number.isFinite(i) && list[i]) return list[i]
|
|
|
+ return list[0]
|
|
|
+ },
|
|
|
+ getRateOptionIcon(option, active, optionIdx) {
|
|
|
+ const rate = this.getRateByIndexId(option && option.indexId, optionIdx)
|
|
|
+ if (!rate) return ''
|
|
|
+ return active ? (rate.selIcon || rate.icon || '') : (rate.icon || '')
|
|
|
+ },
|
|
|
+ isRateOptionSelected(item, option) {
|
|
|
+ if (!item || !option) return false
|
|
|
+ if (Number(item.type) === 2) {
|
|
|
+ const answer = item.answer ? item.answer.split(',') : []
|
|
|
+ return answer.indexOf(option.name) !== -1
|
|
|
+ }
|
|
|
+ return item.answer === option.name
|
|
|
+ },
|
|
|
+ goRate(questionIndex, optionIndexId) {
|
|
|
+ const bounceKey = `${questionIndex}_${optionIndexId}`
|
|
|
if (this._rateBounceTimer) {
|
|
|
clearTimeout(this._rateBounceTimer)
|
|
|
this._rateBounceTimer = null
|
|
|
}
|
|
|
this.rateBounceIndex = null
|
|
|
this.$nextTick(() => {
|
|
|
- this.rateBounceIndex = index
|
|
|
+ this.rateBounceIndex = bounceKey
|
|
|
this._rateBounceTimer = setTimeout(() => {
|
|
|
this.rateBounceIndex = null
|
|
|
this._rateBounceTimer = null
|
|
|
@@ -2608,16 +2647,16 @@
|
|
|
// 只在“进入全屏”时切换,避免 exitFullScreen 触发的 false 事件二次反转
|
|
|
if (!isFullScreen || this.fullscreenToggleLock) return;
|
|
|
this.fullscreenToggleLock = true;
|
|
|
- this.isShu = !this.isShu
|
|
|
- setTimeout(() => {
|
|
|
+ this.isShu = !this.isShu;
|
|
|
+ this.$nextTick(() => {
|
|
|
this._xgExitFullscreen();
|
|
|
this.isFull = false;
|
|
|
this._lockAppPortrait();
|
|
|
this.fullscreenToggleTimer = setTimeout(() => {
|
|
|
this.fullscreenToggleLock = false;
|
|
|
this.fullscreenToggleTimer = null;
|
|
|
- }, 220);
|
|
|
- }, 40);
|
|
|
+ }, 280);
|
|
|
+ });
|
|
|
return;
|
|
|
}
|
|
|
// 横屏课程:全屏锁横屏,退出全屏锁竖屏并恢复顶部小窗布局
|
|
|
@@ -2791,7 +2830,7 @@
|
|
|
} else {
|
|
|
// console.log(this.isFinish)
|
|
|
const suppressAntiSeek = Date.now() < (this._antiSeekSuppressExpireAt || 0)
|
|
|
- if (!suppressAntiSeek && this.linkType != 1 && (currentTime - this.playTime > 3 || currentTime - this
|
|
|
+ if (!suppressAntiSeek && (currentTime - this.playTime > 3 || currentTime - this
|
|
|
.playTime < -3) && this
|
|
|
.isFinish != 1) {
|
|
|
uni.showToast({
|
|
|
@@ -2990,15 +3029,24 @@
|
|
|
// 商品卡片跳转
|
|
|
goBuy(item) {
|
|
|
if (!item || !item.productId) return
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/shopping/productDetails?productId=' + item.productId +
|
|
|
- '&companyId=' + (this.urlOption.companyId || '') +
|
|
|
- '&companyUserId=' + (this.urlOption.companyUserId || '') +
|
|
|
- '&courseId=' + (this.urlOption.courseId || '') +
|
|
|
- '&videoId=' + (this.urlOption.videoId || '') +
|
|
|
- '&projectId=' + (this.urlOption.projectId || '') +
|
|
|
- '&periodId=' + (this.urlOption.periodId || '')
|
|
|
- })
|
|
|
+ const url = '/pages/shopping/productDetails?productId=' + item.productId +
|
|
|
+ '&companyId=' + (this.urlOption.companyId || '') +
|
|
|
+ '&companyUserId=' + (this.urlOption.companyUserId || '') +
|
|
|
+ '&courseId=' + (this.urlOption.courseId || '') +
|
|
|
+ '&videoId=' + (this.urlOption.videoId || '') +
|
|
|
+ '&projectId=' + (this.urlOption.projectId || '') +
|
|
|
+ '&periodId=' + (this.urlOption.periodId || '')
|
|
|
+ // 横屏全屏下先退出全屏再跳转,避免视频层遮挡商品详情页
|
|
|
+ if (this.isFull) {
|
|
|
+ this._xgExitFullscreen()
|
|
|
+ this._lockAppPortrait()
|
|
|
+ this.isFull = false
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.navigateTo({ url })
|
|
|
+ }, 100)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ uni.navigateTo({ url })
|
|
|
},
|
|
|
// 当开始/继续播放时触发play事件
|
|
|
getPlay() {
|
|
|
@@ -3227,7 +3275,16 @@
|
|
|
rej => {}
|
|
|
)
|
|
|
},
|
|
|
- handleAnswer(item, option, idx) {
|
|
|
+ handleAnswer(itemOrPayload, option, questionIndex) {
|
|
|
+ let item = itemOrPayload
|
|
|
+ let opt = option
|
|
|
+ if (itemOrPayload && itemOrPayload.item && itemOrPayload.option) {
|
|
|
+ item = itemOrPayload.item
|
|
|
+ opt = itemOrPayload.option
|
|
|
+ questionIndex = this.quesList.indexOf(item)
|
|
|
+ } else if (questionIndex == null || questionIndex < 0) {
|
|
|
+ questionIndex = this.quesList.indexOf(item)
|
|
|
+ }
|
|
|
// 以“完课积分倒计时”结束作为答题资格
|
|
|
// if (!this.remainTimeReady) {
|
|
|
// uni.showToast({
|
|
|
@@ -3236,7 +3293,9 @@
|
|
|
// })
|
|
|
// return
|
|
|
// }
|
|
|
- this.goRate(option.indexId)
|
|
|
+ if (questionIndex >= 0 && opt) {
|
|
|
+ this.goRate(questionIndex, opt.indexId)
|
|
|
+ }
|
|
|
if (Number(this.remainTime || 0) > 0) {
|
|
|
uni.showToast({
|
|
|
title: "完课倒计时结束再评分",
|
|
|
@@ -3247,15 +3306,15 @@
|
|
|
|
|
|
if (item.type == 1) {
|
|
|
// 单选option
|
|
|
- item.answer = option.name
|
|
|
+ item.answer = opt.name
|
|
|
} else if (item.type == 2) {
|
|
|
// 多选
|
|
|
let answer = item.answer ? item.answer.split(',') : []
|
|
|
- if (answer.indexOf(option.name) === -1) {
|
|
|
- answer.push(option.name)
|
|
|
+ if (answer.indexOf(opt.name) === -1) {
|
|
|
+ answer.push(opt.name)
|
|
|
item.answer = answer.join(',')
|
|
|
} else {
|
|
|
- answer.splice(answer.indexOf(option.name), 1)
|
|
|
+ answer.splice(answer.indexOf(opt.name), 1)
|
|
|
item.answer = answer.join(',')
|
|
|
}
|
|
|
}
|
|
|
@@ -3626,13 +3685,22 @@
|
|
|
// this.$refs.kfPopup.close()
|
|
|
// this.kfPopup=!this.kfPopup
|
|
|
},
|
|
|
+ /** 离开页面前补上报,避免 60s 定时未到导致再次进入从头播放 */
|
|
|
+ _flushWatchProgress() {
|
|
|
+ if (!this.playTime || !this.isLogin || this.isAddKf != 1) return
|
|
|
+ const baseDuration = this.playDuration >= this.duration ? 0 : (Number(this.playDuration) || 0)
|
|
|
+ if (this.playTime <= baseDuration && this.isFinish != 1) return
|
|
|
+ this.getFinishCourseVideo()
|
|
|
+ this.getInternetTraffic()
|
|
|
+ },
|
|
|
getFinishCourseVideo() {
|
|
|
- if (!this.playTime) return
|
|
|
- // {videoId: this.videoId,duration:this.playTime}
|
|
|
+ if (!this.playTime || !this.isLogin || this.isAddKf != 1) return
|
|
|
+ const userId = this.userInfo && this.userInfo.userId
|
|
|
+ if (!userId) return
|
|
|
const param = {
|
|
|
duration: this.playTime,
|
|
|
videoId: this.videoId,
|
|
|
- userId: this.userInfo.userId,
|
|
|
+ userId,
|
|
|
companyUserId: this.companyUserId
|
|
|
}
|
|
|
getFinishCourseVideo(param)
|
|
|
@@ -3770,25 +3838,40 @@
|
|
|
return document.querySelector('.videovip-video-container') || document.body;
|
|
|
},
|
|
|
_ensureXgVideoStyles() {
|
|
|
- if (document.querySelector('style[data-xg-videovip-fix]')) return;
|
|
|
+ const attr = 'data-xg-videovip-fix-v2';
|
|
|
+ const old = document.querySelector('style[data-xg-videovip-fix]');
|
|
|
+ if (old) old.remove();
|
|
|
+ if (document.querySelector('style[' + attr + ']')) return;
|
|
|
const style = document.createElement('style');
|
|
|
- style.setAttribute('data-xg-videovip-fix', '1');
|
|
|
+ style.setAttribute(attr, '1');
|
|
|
style.textContent = [
|
|
|
'.videovip-xg-player, .videovip-xg-player .xgplayer {',
|
|
|
' width: 100% !important;',
|
|
|
' height: 100% !important;',
|
|
|
'}',
|
|
|
- '.videovip-xg-player video {',
|
|
|
- ' position: absolute !important;',
|
|
|
- ' top: 0 !important;',
|
|
|
- ' left: 0 !important;',
|
|
|
+ '.videovip-xg-player video, .videovip-xg-player .xgplayer-video video {',
|
|
|
' width: 100% !important;',
|
|
|
' height: 100% !important;',
|
|
|
+ ' object-fit: contain !important;',
|
|
|
' background: #000;',
|
|
|
+ '}',
|
|
|
+ '.xgplayer-is-fullscreen video,',
|
|
|
+ '.xgplayer-is-cssfullscreen video,',
|
|
|
+ '.xgplayer.xgplayer-is-fullscreen video,',
|
|
|
+ '.xgplayer.xgplayer-is-cssfullscreen video {',
|
|
|
+ ' object-fit: contain !important;',
|
|
|
'}'
|
|
|
].join('\n');
|
|
|
document.head.appendChild(style);
|
|
|
},
|
|
|
+ _applyVideoFillMode(isFullscreen) {
|
|
|
+ if (!this.player) return;
|
|
|
+ const mode = isFullscreen ? 'contain' : 'cover';
|
|
|
+ try {
|
|
|
+ if (this.player.config) this.player.config.videoFillMode = mode;
|
|
|
+ if (typeof this.player.resize === 'function') this.player.resize();
|
|
|
+ } catch (e) {}
|
|
|
+ },
|
|
|
_destroyPlayer() {
|
|
|
if (!this.player) return;
|
|
|
if (this.isFullscreen) {
|
|
|
@@ -3803,11 +3886,39 @@
|
|
|
} catch (e) {}
|
|
|
this.player = null;
|
|
|
},
|
|
|
+ _resizePlayerLayout() {
|
|
|
+ const run = () => {
|
|
|
+ if (!this.player) return;
|
|
|
+ try {
|
|
|
+ this._applyVideoFillMode(!!this.isFullscreen);
|
|
|
+ if (typeof this.player.resize === 'function') this.player.resize();
|
|
|
+ } catch (e) {}
|
|
|
+ };
|
|
|
+ setTimeout(run, 0);
|
|
|
+ setTimeout(run, 80);
|
|
|
+ setTimeout(run, 220);
|
|
|
+ },
|
|
|
+ _notifyFullscreenToVue(isFullscreen) {
|
|
|
+ if (!this.ownerInstance) return;
|
|
|
+ const portrait = this.lastConfig && this.lastConfig.displayType === 'portrait';
|
|
|
+ if (portrait) {
|
|
|
+ const now = Date.now();
|
|
|
+ if (this._fsNotifyVal === isFullscreen && now - (this._fsNotifyAt || 0) < 150) return;
|
|
|
+ this._fsNotifyVal = isFullscreen;
|
|
|
+ this._fsNotifyAt = now;
|
|
|
+ }
|
|
|
+ this.ownerInstance.callMethod('onXgFullscreenChange', {
|
|
|
+ isFullscreen
|
|
|
+ });
|
|
|
+ },
|
|
|
initJs(newValue, oldValue, ownerInstance) {
|
|
|
if (!newValue || !newValue.url) return;
|
|
|
if (!this._shouldReinitPlayer(newValue, oldValue)) {
|
|
|
this.lastConfig = newValue;
|
|
|
this._syncProgressLock(!!newValue.isFast);
|
|
|
+ if (oldValue && newValue.layoutShuKey !== oldValue.layoutShuKey) {
|
|
|
+ this._resizePlayerLayout();
|
|
|
+ }
|
|
|
return;
|
|
|
}
|
|
|
const bootstrap = () => {
|
|
|
@@ -3845,10 +3956,17 @@
|
|
|
if (!this.player) return;
|
|
|
const progress = this.player.getPlugin && this.player.getPlugin('progress');
|
|
|
if (!progress) return;
|
|
|
- if (allowSeek) {
|
|
|
- progress.show && progress.show();
|
|
|
- } else {
|
|
|
- progress.hide && progress.hide();
|
|
|
+ progress.show && progress.show();
|
|
|
+ const lockSeek = !allowSeek;
|
|
|
+ if (progress.config) {
|
|
|
+ progress.config.isCloseClickSeek = lockSeek;
|
|
|
+ progress.config.closeMoveSeek = lockSeek;
|
|
|
+ progress.config.isDraggingSeek = false;
|
|
|
+ }
|
|
|
+ if (this.player.config && this.player.config.progress) {
|
|
|
+ this.player.config.progress.isCloseClickSeek = lockSeek;
|
|
|
+ this.player.config.progress.closeMoveSeek = lockSeek;
|
|
|
+ this.player.config.progress.isDraggingSeek = false;
|
|
|
}
|
|
|
},
|
|
|
initPlayer(newValue, oldValue, ownerInstance) {
|
|
|
@@ -3878,7 +3996,7 @@
|
|
|
poster: newValue.poster || '',
|
|
|
'x5-video-player-type': 'h5',
|
|
|
playsinline: true,
|
|
|
- videoFillMode: 'fill',
|
|
|
+ videoFillMode: 'cover',
|
|
|
ignores: ['volume', 'miniscreen', 'keyboard', 'playbackrate'],
|
|
|
disableGesture: true,
|
|
|
closeVideoTouch: true,
|
|
|
@@ -3935,20 +4053,23 @@
|
|
|
});
|
|
|
this.player.on(Events.FULLSCREEN_CHANGE, (isFullscreen) => {
|
|
|
if (this.isFullscreen == isFullscreen) return;
|
|
|
+ const portrait = this.lastConfig && this.lastConfig.displayType === 'portrait';
|
|
|
+ if (portrait) return;
|
|
|
this.isFullscreen = isFullscreen;
|
|
|
+ this._applyVideoFillMode(isFullscreen);
|
|
|
this._syncAppOrientationForFullscreen(isFullscreen);
|
|
|
- owner.callMethod('onXgFullscreenChange', {
|
|
|
- isFullscreen
|
|
|
- });
|
|
|
+ this._notifyFullscreenToVue(isFullscreen);
|
|
|
});
|
|
|
this.player.on(Events.CSS_FULLSCREEN_CHANGE, (isFullscreen) => {
|
|
|
if (this.isFullscreen == isFullscreen) return;
|
|
|
this.isCSSFull = true;
|
|
|
this.isFullscreen = isFullscreen;
|
|
|
- this._syncAppOrientationForFullscreen(isFullscreen);
|
|
|
- owner.callMethod('onXgFullscreenChange', {
|
|
|
- isFullscreen
|
|
|
- });
|
|
|
+ const portrait = this.lastConfig && this.lastConfig.displayType === 'portrait';
|
|
|
+ if (!portrait) {
|
|
|
+ this._applyVideoFillMode(isFullscreen);
|
|
|
+ this._syncAppOrientationForFullscreen(isFullscreen);
|
|
|
+ }
|
|
|
+ this._notifyFullscreenToVue(isFullscreen);
|
|
|
});
|
|
|
},
|
|
|
_syncAppOrientationForFullscreen(isFullscreen) {
|
|
|
@@ -4430,14 +4551,17 @@
|
|
|
}
|
|
|
.rating-msg-video-wrap {
|
|
|
position: relative;
|
|
|
- max-width: 320rpx;
|
|
|
- // background: #000;
|
|
|
+ width: 320rpx;
|
|
|
+ max-width: 100%;
|
|
|
+ height: 180rpx;
|
|
|
+ min-height: 180rpx;
|
|
|
+ background: #000;
|
|
|
+ overflow: hidden;
|
|
|
}
|
|
|
.rating-msg-video {
|
|
|
width: 100%;
|
|
|
+ height: 100%;
|
|
|
display: block;
|
|
|
- max-height: 240rpx;
|
|
|
- // background: #000;
|
|
|
}
|
|
|
/* 小程序列表内用封面图代替 video,固定比例避免布局抖动 */
|
|
|
.rating-msg-video--poster {
|