|
@@ -61,6 +61,7 @@ Page({
|
|
|
this.setData({
|
|
|
title: res.data.data.userRead.title,
|
|
|
videoUrl: res.data.data.userRead.videoPath,
|
|
|
+ videoPathTemp: res.data.data.userRead.videoPath,
|
|
|
originVideo: res.data.data.userRead.originVideo,
|
|
|
img: res.data.data.userRead.iconImg,
|
|
|
id: res.data.data.userRead.id,
|
|
@@ -504,6 +505,17 @@ Page({
|
|
|
} */
|
|
|
},
|
|
|
|
|
|
+ exampleVideoPlay: function () {
|
|
|
+ if (this.data.videoPathTemp == this.data.videoUrl) {
|
|
|
+ // 播放记录增加一条
|
|
|
+ httpRequestApi.playLogReport({
|
|
|
+ userReadId: this.data.id,
|
|
|
+ playStopTime: 1000
|
|
|
+ }).success(res => {
|
|
|
+ console.log('播放记录', res)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
videoComplete: function () {
|
|
|
this.setData({
|
|
|
recordFlag: 1,
|
|
@@ -679,20 +691,20 @@ Page({
|
|
|
commentTap: function (e) {
|
|
|
console.log('点击评论区', e)
|
|
|
if (e.target.dataset.type === 'blank') {
|
|
|
- if (this.data.commentShow && this.data.commentId) {
|
|
|
- httpRequestApi.getClassDetail(this.data.commentId).success(res => {
|
|
|
- console.log('评论回显', res.data.data.userRead.commentAmount)
|
|
|
- let str = `videoList[${this.data.commentIndex}].commentAmount`;
|
|
|
- this.setData({
|
|
|
- [str]:res.data.data.userRead.commentAmount
|
|
|
- })
|
|
|
+ if (this.data.commentShow && this.data.commentId) {
|
|
|
+ httpRequestApi.getClassDetail(this.data.commentId).success(res => {
|
|
|
+ console.log('评论回显', res.data.data.userRead.commentAmount)
|
|
|
+ let str = `videoList[${this.data.commentIndex}].commentAmount`;
|
|
|
+ this.setData({
|
|
|
+ [str]: res.data.data.userRead.commentAmount
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ commentShow: false
|
|
|
})
|
|
|
- }
|
|
|
- this.setData({
|
|
|
- commentShow: false
|
|
|
- })
|
|
|
}
|
|
|
- },
|
|
|
+ },
|
|
|
scrollToLower: function (e) {
|
|
|
console.log('滑动到底部', e)
|
|
|
this.setData({
|
|
@@ -777,10 +789,10 @@ Page({
|
|
|
let str2 = `videoList[${index}].favoritesAmount`;
|
|
|
let favoritesAmount = e.detail.isCollect ? this.data.videoList[index].favoritesAmount + 1 : this.data.videoList[index].favoritesAmount - 1
|
|
|
this.setData({
|
|
|
- [str]: e.detail.isCollect,
|
|
|
- [str2]: favoritesAmount
|
|
|
+ [str]: e.detail.isCollect,
|
|
|
+ [str2]: favoritesAmount
|
|
|
})
|
|
|
- },
|
|
|
+ },
|
|
|
likeTap: function (e) {
|
|
|
console.log('点赞', e)
|
|
|
const index = e.detail.index;
|
|
@@ -814,7 +826,7 @@ Page({
|
|
|
console.log('+++++1', e)
|
|
|
let str = `videoList[${e.detail.index}].shareAmount`;
|
|
|
this.setData({
|
|
|
- [str]: this.data.videoList[e.detail.index].shareAmount + 1
|
|
|
+ [str]: this.data.videoList[e.detail.index].shareAmount + 1
|
|
|
})
|
|
|
- }
|
|
|
+ }
|
|
|
})
|