|
@@ -320,14 +320,22 @@ Component({
|
|
},
|
|
},
|
|
// 点赞
|
|
// 点赞
|
|
likeTap: function likeTap(e) {
|
|
likeTap: function likeTap(e) {
|
|
|
|
+
|
|
if (!wx.getStorageSync('user').wechatName) {
|
|
if (!wx.getStorageSync('user').wechatName) {
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
url: `../../pages/login/login`
|
|
url: `../../pages/login/login`
|
|
});
|
|
});
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ const isLike = e.target.dataset.islike ? e.target.dataset.islike : e.currentTarget.dataset.islike;
|
|
|
|
+ console.log('isLike', isLike)
|
|
|
|
+ if (isLike) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ const id = e.target.dataset.id ? e.target.dataset.id : e.currentTarget.dataset.id;
|
|
|
|
+ const index = e.target.dataset.index ? e.target.dataset.index : e.currentTarget.dataset.index;
|
|
this.setData({
|
|
this.setData({
|
|
- addComeOut: 'add-one-come-out'
|
|
|
|
|
|
+ addComeOut: index
|
|
})
|
|
})
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
if (this.data.addComeOut) {
|
|
if (this.data.addComeOut) {
|
|
@@ -336,13 +344,6 @@ Component({
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}, 1100)
|
|
}, 1100)
|
|
- const isLike = e.target.dataset.islike ? e.target.dataset.islike : e.currentTarget.dataset.islike;
|
|
|
|
- console.log('isLike', isLike)
|
|
|
|
- if (isLike) {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- const id = e.target.dataset.id ? e.target.dataset.id : e.currentTarget.dataset.id;
|
|
|
|
- const index = e.target.dataset.index ? e.target.dataset.index : e.currentTarget.dataset.index;
|
|
|
|
console.log('视频index', index);
|
|
console.log('视频index', index);
|
|
if (this.data.isSwiper) {
|
|
if (this.data.isSwiper) {
|
|
let likeStr = `curQueue[${index}].isLike`;
|
|
let likeStr = `curQueue[${index}].isLike`;
|
|
@@ -372,10 +373,10 @@ Component({
|
|
},
|
|
},
|
|
addShareAmount: function (e) {
|
|
addShareAmount: function (e) {
|
|
console.log('+++++1', e.detail.index);
|
|
console.log('+++++1', e.detail.index);
|
|
- let str = `videoList[${e.detail.index}].shareAmount`;
|
|
|
|
- this.setData({
|
|
|
|
- [str]: this.data.videoList[e.detail.index].shareAmount + 1
|
|
|
|
- })
|
|
|
|
|
|
+
|
|
|
|
+ this.triggerEvent('addShareAmount', {
|
|
|
|
+ index:e.detail.index
|
|
|
|
+ })
|
|
},
|
|
},
|
|
// 下载视频
|
|
// 下载视频
|
|
download: function (e) {
|
|
download: function (e) {
|