|
@@ -26,7 +26,7 @@ Page({
|
|
|
lazyVideoUrl: '',
|
|
|
isIOS: app.globalData.isIOS,
|
|
|
modalType: "text",
|
|
|
-
|
|
|
+
|
|
|
modalText: [{
|
|
|
text: '您还不是本课程的会员',
|
|
|
type: 'bigOrange'
|
|
@@ -36,9 +36,10 @@ Page({
|
|
|
type: 'normal'
|
|
|
}
|
|
|
],
|
|
|
- modalBtnText:'去开团',
|
|
|
+ modalBtnText: '去开团',
|
|
|
isModalShow: false,
|
|
|
productId: 0,
|
|
|
+ videoPlayTime: 0
|
|
|
},
|
|
|
onLoad: function (option) {
|
|
|
console.log(option);
|
|
@@ -58,8 +59,8 @@ Page({
|
|
|
httpRequestApi.getClassDetail(this.uid, option.id).success(res => {
|
|
|
console.log(res);
|
|
|
const classId = this.data.id;
|
|
|
- httpRequestApi.userIntoPage('pages/main/class/class','官方课程页面').success((res)=>{
|
|
|
-
|
|
|
+ httpRequestApi.userIntoPage('pages/main/class/class', '官方课程页面').success((res) => {
|
|
|
+
|
|
|
})
|
|
|
this.setData({
|
|
|
title: res.data.data.lesson.title,
|
|
@@ -159,7 +160,7 @@ Page({
|
|
|
url: `../../groupPage/grade-details/grade-details?productId=${this.data.productId}`
|
|
|
})
|
|
|
},
|
|
|
- modalCloseHandler: function (){
|
|
|
+ modalCloseHandler: function () {
|
|
|
this.setData({
|
|
|
isModalShow: false
|
|
|
})
|
|
@@ -255,8 +256,29 @@ Page({
|
|
|
this.getReadInfo();
|
|
|
}
|
|
|
},
|
|
|
+ // 视频时间变动
|
|
|
+ videoTimeChange: function (e) {
|
|
|
+ this.videoPlayTime = e.detail.currentTime;
|
|
|
+ },
|
|
|
onHide: function () {
|
|
|
let videoCtx = wx.createVideoContext('classVideo', this);
|
|
|
videoCtx.stop();
|
|
|
},
|
|
|
+ onUnload: function () {
|
|
|
+ if (this.videoPlayTime) {
|
|
|
+ const data = {
|
|
|
+ "title": this.data.title,
|
|
|
+ "lessonId": this.data.id,
|
|
|
+ "productId": this.data.productId,
|
|
|
+ "playStopTime": this.videoPlayTime || 0,
|
|
|
+ "type": 'EXAMPLE',
|
|
|
+ }
|
|
|
+
|
|
|
+ httpRequestApi.playLogReport(data).success(res => {
|
|
|
+ console.log(res)
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
})
|