This commit is contained in:
zyronon 2018-10-25 01:34:33 +08:00
parent 3a7b742362
commit 44c3a59bc9
2 changed files with 17 additions and 6 deletions

View File

@ -6,7 +6,7 @@
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"build": "vue-cli-service build", "build": "vue-cli-service build",
"lint": "vue-cli-service lint", "lint": "vue-cli-service lint",
"push": "git add ./ & git commit -m 'dubug' & git push origin master" "push": "git add ./ && git commit -m 'dubug' && git push origin master"
}, },
"dependencies": { "dependencies": {
"vue": "^2.5.17", "vue": "^2.5.17",

View File

@ -94,6 +94,7 @@
}, },
data() { data() {
return { return {
currentPlayIndex: 0,
isPlaying: true, isPlaying: true,
isCommenting: false, isCommenting: false,
isSharing: false, isSharing: false,
@ -132,6 +133,16 @@
window.scrollTo(0, 0); window.scrollTo(0, 0);
self.isCommenting = false; self.isCommenting = false;
self.isSharing = false; self.isSharing = false;
if (self.isPlaying) {
let currentVideo = self.$refs.video[self.currentPlayIndex];
currentVideo.pause();
self.isPlaying = false;
}else {
let currentVideo = self.$refs.video[self.currentPlayIndex];
currentVideo.play();
self.isPlaying = true;
}
}, },
}, },
}, },
@ -143,7 +154,7 @@
on: { on: {
slideChange() { slideChange() {
let dateLength = self.data.length; let dateLength = self.data.length;
let index = this.activeIndex; let index = self.currentPlayIndex = this.activeIndex;
console.log(index); console.log(index);
console.log(dateLength) console.log(dateLength)
@ -221,21 +232,21 @@
}, },
showComment() { showComment() {
this.isCommenting = !this.isCommenting; this.isCommenting = !this.isCommenting;
setTimeout(()=>{ setTimeout(() => {
let comment = this.$refs.comment.$el; let comment = this.$refs.comment.$el;
this.commentHeight = comment.offsetHeight; this.commentHeight = comment.offsetHeight;
console.log(this.commentHeight); console.log(this.commentHeight);
console.log(this.height); console.log(this.height);
},50); }, 50);
}, },
showShare() { showShare() {
this.isSharing = !this.isSharing; this.isSharing = !this.isSharing;
setTimeout(()=>{ setTimeout(() => {
let share = this.$refs.share.$el; let share = this.$refs.share.$el;
this.shareHeight = share.offsetHeight; this.shareHeight = share.offsetHeight;
console.log(this.shareHeight); console.log(this.shareHeight);
console.log(this.height); console.log(this.height);
},50); }, 50);
}, },
loved(e, index) { loved(e, index) {
let img = e.target.parentNode.childNodes[0]; let img = e.target.parentNode.childNodes[0];