Browse Source

取消footer可以滑动进度条的功能

pull/19/head
zyronon 4 years ago
parent
commit
210201fc0f
  1. 14
      src/components/Footer.vue
  2. 10
      src/components/Video.vue

14
src/components/Footer.vue

@ -1,7 +1,5 @@
<template> <template>
<div class="footer f16 " <div class="footer f16 ">
@touchmove="move"
@touchend="end">
<div class="button" @click="refresh()"> <div class="button" @click="refresh()">
<span v-if="!isRefresh" :class="{active:currentTab===1}">首页</span> <span v-if="!isRefresh" :class="{active:currentTab===1}">首页</span>
<img v-else src="../assets/img/icon/refresh.png" alt="" class="refresh"> <img v-else src="../assets/img/icon/refresh.png" alt="" class="refresh">
@ -21,8 +19,6 @@
</template> </template>
<script> <script>
import {inject} from "vue";
export default { export default {
name: "Footer", name: "Footer",
props: ['initTab'], props: ['initTab'],
@ -30,17 +26,9 @@ export default {
return { return {
isRefresh: false, isRefresh: false,
currentTab: this.initTab, currentTab: this.initTab,
mitt: inject('mitt'),
} }
}, },
methods: { methods: {
move(e) {
this.mitt.emit(this.$store.state.currentVideoId, {isMove: true, e})
this.$stopPropagation(e)
},
end(e) {
this.mitt.emit(this.$store.state.currentVideoId, {isMove: false, e})
},
tab(index) { tab(index) {
this.currentTab = index this.currentTab = index
switch (index) { switch (index) {

10
src/components/Video.vue

@ -105,8 +105,6 @@
<script> <script>
import {inject} from "vue";
export default { export default {
name: "Video", name: "Video",
props: { props: {
@ -184,7 +182,6 @@ export default {
line: null, line: null,
point: null, point: null,
isMove: false, isMove: false,
mitt: inject('mitt'),
currentVideoId: 'a' + Date.now(), currentVideoId: 'a' + Date.now(),
test: [1, 2] test: [1, 2]
} }
@ -194,13 +191,6 @@ export default {
this.width = document.body.clientWidth this.width = document.body.clientWidth
this.line = this.$refs.line this.line = this.$refs.line
this.point = this.$refs.point this.point = this.$refs.point
this.mitt.on(this.currentVideoId, v => {
if (this.duration < 60) return
this.isMove = v.isMove
// this.currentTime = v.isMove ? v.e : this.currentTime
v.isMove ? this.move(v.e) : this.end(v.e)
})
}, },
methods: { methods: {
attention() { attention() {

Loading…
Cancel
Save