|
@@ -11,7 +11,8 @@
|
|
|
<view class="course-content-border">
|
|
|
<view class="course-content-box">
|
|
|
<view class="course-title">第一节 时间的计算</view>
|
|
|
- <view v-for="(item,index) in progressMarkers" :key="index" @click="markersClick(item)" class="course-content-item">
|
|
|
+ <view v-for="(item,index) in progressMarkers" :key="index" @click="markersClick(item)"
|
|
|
+ class="course-content-item">
|
|
|
<view class="course-play-btn"></view>
|
|
|
<view class="course-content">
|
|
|
<text>{{item.title}}</text>
|
|
@@ -21,22 +22,24 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<uni-popup ref="popupRef" :animation="false" :is-mask-click="false"
|
|
|
- mask-background-color="rgba(255, 255, 255, 0.6);">
|
|
|
+ mask-background-color="rgba(255, 255, 255, 0.6);">
|
|
|
<view class="course-score-dialog">
|
|
|
<view class="text-score">20</view>
|
|
|
<view class="course-btn-box">
|
|
|
- <view class="return-btn"></view>
|
|
|
- <view class="continue-btn"></view>
|
|
|
+ <view @click="goBack" class="return-btn"></view>
|
|
|
+ <view @click="goNext" class="continue-btn"></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</uni-popup>
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { ref } from 'vue';
|
|
|
+ import {
|
|
|
+ ref
|
|
|
+ } from 'vue';
|
|
|
import {
|
|
|
onLoad,
|
|
|
onReady
|
|
@@ -46,6 +49,9 @@
|
|
|
getVideoAuth,
|
|
|
getVideoRefresh
|
|
|
} from "@/api/shipin.js"
|
|
|
+ import {
|
|
|
+ toast
|
|
|
+ } from "@/utils/common.js"
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -59,13 +65,28 @@
|
|
|
onLoad(options) {
|
|
|
let data = JSON.parse(options.studyData)
|
|
|
console.log(data);
|
|
|
- this.pageData = { ...data }
|
|
|
+ this.pageData = {
|
|
|
+ ...data
|
|
|
+ }
|
|
|
console.log(this.pageData);
|
|
|
this.videoId = data.videoId
|
|
|
this.progressMarkers = data.progressMarkers
|
|
|
this.getLive(); //获取播放凭证
|
|
|
+ uni.$on('playEnd', this.playEnd);
|
|
|
},
|
|
|
methods: {
|
|
|
+ playEnd(data) {
|
|
|
+ this.$refs.popupRef.open();
|
|
|
+ },
|
|
|
+ goBack() {
|
|
|
+ this.$refs.popupRef.close();
|
|
|
+ this.goUpPage()
|
|
|
+ },
|
|
|
+ goNext() {
|
|
|
+ this.$refs.popupRef.close();
|
|
|
+ toast("暂无此功能");
|
|
|
+ return false
|
|
|
+ },
|
|
|
getLive() {
|
|
|
let req = {
|
|
|
videoId: this.videoId
|
|
@@ -78,12 +99,12 @@
|
|
|
console.log(data)
|
|
|
this.seekTime = data.offset
|
|
|
},
|
|
|
- goUpPage(){
|
|
|
+ goUpPage() {
|
|
|
// this.$refs.popupRef.open();
|
|
|
uni.navigateTo({
|
|
|
- // url: `/pages/study/index?xueqi=${data.activeXueqi}&nianji=${data.activeNianji}&flag=selectGrades`
|
|
|
+ // url: `/pages/study/index?xueqi=${data.activeXueqi}&nianji=${data.activeNianji}&flag=selectGrades`
|
|
|
url: `/pages/study/index?xueqi=${this.pageData.xueqi}&nianji=${this.pageData.nianji}&zhangId=${this.pageData.zhangId}`
|
|
|
-
|
|
|
+
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -100,7 +121,6 @@
|
|
|
|
|
|
|
|
|
<script module="renderScript" lang="renderjs">
|
|
|
-
|
|
|
export default {
|
|
|
mounted() {
|
|
|
console.log("renderScript1")
|
|
@@ -117,13 +137,11 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- open(){
|
|
|
-
|
|
|
- },
|
|
|
+
|
|
|
receiveMsg(newValue, oldValue, ownerInstance, instance) {
|
|
|
- console.log('service层中的options发生变化')
|
|
|
- console.log('新值', newValue)
|
|
|
- console.log('旧值', oldValue)
|
|
|
+ // console.log('service层中的options发生变化')
|
|
|
+ // console.log('新值', newValue)
|
|
|
+ // console.log('旧值', oldValue)
|
|
|
// ownerInstance和this.$ownerInstance一样,可用来向service层通信
|
|
|
// instance和ownerInstance的区别是:
|
|
|
// instance.$el指向的是触发事件的那个节点;ownerInstance.$el指向当前vue文件中的根节点;
|
|
@@ -134,25 +152,13 @@
|
|
|
}
|
|
|
},
|
|
|
progressMarkersMsg(newValue, oldValue, ownerInstance, instance) {
|
|
|
- console.log('service层中的options发生变化222222222222')
|
|
|
- console.log('新值', newValue)
|
|
|
- console.log('旧值', oldValue)
|
|
|
- // ownerInstance和this.$ownerInstance一样,可用来向service层通信
|
|
|
- // instance和ownerInstance的区别是:
|
|
|
- // instance.$el指向的是触发事件的那个节点;ownerInstance.$el指向当前vue文件中的根节点;
|
|
|
- // instance的作用目前尚不明确,官方没有给出用法
|
|
|
+
|
|
|
if (newValue) {
|
|
|
this.progressMarkers = newValue
|
|
|
}
|
|
|
},
|
|
|
seekTimeFun(newValue, oldValue, ownerInstance, instance) {
|
|
|
- console.log('service层中的options发生变化3333333')
|
|
|
- console.log('新值', newValue)
|
|
|
- console.log('旧值', oldValue)
|
|
|
- // ownerInstance和this.$ownerInstance一样,可用来向service层通信
|
|
|
- // instance和ownerInstance的区别是:
|
|
|
- // instance.$el指向的是触发事件的那个节点;ownerInstance.$el指向当前vue文件中的根节点;
|
|
|
- // instance的作用目前尚不明确,官方没有给出用法
|
|
|
+
|
|
|
if (newValue) {
|
|
|
console.log(newValue, 'newValuenewValuenewValuenewValuenewValue')
|
|
|
console.log(this.player.getStatus(), 'newValuenewValuenewValuenewValuenewValue')
|
|
@@ -190,6 +196,7 @@
|
|
|
}
|
|
|
},
|
|
|
playAli() {
|
|
|
+ let that = this
|
|
|
//配置播放器
|
|
|
var player = new Aliplayer({
|
|
|
id: "wgy-player-test",
|
|
@@ -220,6 +227,12 @@
|
|
|
player.tag.play();
|
|
|
|
|
|
});
|
|
|
+ player.one('ended', function() {
|
|
|
+
|
|
|
+ uni.$emit('playEnd', {
|
|
|
+ data: 'end'
|
|
|
+ });
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
|