|
@@ -25,9 +25,6 @@ Component({
|
|
|
// value 为public时是默认公共样式,为my时为“我的”样式,展示下载删除是否公开
|
|
|
value: 'public'
|
|
|
},
|
|
|
- index: {
|
|
|
- type: Number,
|
|
|
- },
|
|
|
currentId: {
|
|
|
type: Number,
|
|
|
}
|
|
@@ -41,11 +38,6 @@ Component({
|
|
|
playVideo() {
|
|
|
this.triggerEvent('playVideo', this.properties.videoInfo.userRead.id)
|
|
|
},
|
|
|
- // 分享视频
|
|
|
- shareVideo() {
|
|
|
- let videoInfo = this.properties.videoInfo
|
|
|
- console.log(videoInfo);
|
|
|
- },
|
|
|
// 设置视频公开还是隐私
|
|
|
async setVideoPublic() {
|
|
|
let info = this.properties.videoInfo.userRead
|
|
@@ -61,13 +53,9 @@ Component({
|
|
|
duration: 2000
|
|
|
})
|
|
|
}
|
|
|
- let index = this.properties.index
|
|
|
- let status = `list[${index}].userRead.status`;
|
|
|
- let val = info.status === 'NORMAL' ? 'DISABLE' : 'NORMAL'
|
|
|
- let options = {
|
|
|
- [status]: val
|
|
|
- }
|
|
|
- this.triggerEvent('changStatus', options)
|
|
|
+ this.setData({
|
|
|
+ ['videoInfoCopy.userRead.status']:info.status === 'NORMAL' ? 'DISABLE' : 'NORMAL'
|
|
|
+ })
|
|
|
},
|
|
|
// 点赞
|
|
|
async likeVideo() {
|
|
@@ -78,14 +66,10 @@ Component({
|
|
|
return
|
|
|
}
|
|
|
await likeVideo(id)
|
|
|
- let index = this.properties.index
|
|
|
- let likeStr = `list[${index}].isLike`;
|
|
|
- let likeNumStr = `list[${index}].userRead.likeAmount`;
|
|
|
- let options = {
|
|
|
- [likeStr]: true,
|
|
|
- [likeNumStr]: this.properties.videoInfo.userRead.likeAmount + 1
|
|
|
- }
|
|
|
- this.triggerEvent('changStatus', options)
|
|
|
+ this.setData({
|
|
|
+ ['videoInfoCopy.isLike']: true,
|
|
|
+ ['videoInfoCopy.userRead.likeAmount']: this.data.videoInfoCopy.userRead.likeAmount + 1
|
|
|
+ })
|
|
|
},
|
|
|
// 下载视频
|
|
|
download() {
|
|
@@ -136,7 +120,6 @@ Component({
|
|
|
openComment() {
|
|
|
this.triggerEvent('openComment', this.properties.videoInfo.userRead.id)
|
|
|
},
|
|
|
-
|
|
|
// 删除
|
|
|
delete() {
|
|
|
let {
|
|
@@ -177,12 +160,9 @@ Component({
|
|
|
targetCode: id,
|
|
|
favoritesType: type
|
|
|
})
|
|
|
- let index = this.properties.index
|
|
|
- let isFavorites = `list[${index}].isFavorites`;
|
|
|
- let options = {
|
|
|
- [isFavorites]: !this.properties.videoInfo.isFavorites
|
|
|
- }
|
|
|
- this.triggerEvent('changStatus', options)
|
|
|
+ this.setData({
|
|
|
+ ['videoInfoCopy.isFavorites']: !this.data.videoInfoCopy.isFavorites
|
|
|
+ })
|
|
|
},
|
|
|
// 关注
|
|
|
async setFans() {
|
|
@@ -192,9 +172,7 @@ Component({
|
|
|
await setFans({
|
|
|
uid: this.properties.videoInfo.user.uid
|
|
|
})
|
|
|
- this.setData({
|
|
|
- ['videoInfoCopy.isFans']: true
|
|
|
- })
|
|
|
+ this.triggerEvent('setListFans', this.properties.videoInfo.user.uid)
|
|
|
}
|
|
|
}
|
|
|
})
|