|
@@ -10,7 +10,7 @@ Page({
|
|
|
title:'',
|
|
|
url:'',
|
|
|
time:0,
|
|
|
- currentTime:0
|
|
|
+ duration:0
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -26,27 +26,25 @@ Page({
|
|
|
id:options.id
|
|
|
})
|
|
|
},
|
|
|
- pause: function (event){
|
|
|
- console.log(event)
|
|
|
+ end: function (event){
|
|
|
+ wx.request({
|
|
|
+ url: host + '/api/wx/savevtime',
|
|
|
+ method: 'post',
|
|
|
+ data: {
|
|
|
+ video_id: this.data.id,
|
|
|
+ time: this.data.duration
|
|
|
+ },
|
|
|
+ success: function (res) {
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
timeupdate: function (event){
|
|
|
- console.log(event)
|
|
|
- let cur = event.detail.currentTime
|
|
|
- if (cur - this.data.currentTime>=10){
|
|
|
+ if (!this.data.duration){
|
|
|
this.setData({
|
|
|
- currentTime:cur
|
|
|
- })
|
|
|
- wx.request({
|
|
|
- url: host+'/api/wx/savevtime',
|
|
|
- method:'post',
|
|
|
- data:{
|
|
|
- video_id: this.data.id,
|
|
|
- time: cur
|
|
|
- },
|
|
|
- success:function(res){
|
|
|
-
|
|
|
- }
|
|
|
+ duration: event.detail.duration
|
|
|
})
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
/**
|