Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
tswj
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2022-05-06 09:32:18 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ac658bf65f4fb3ec4b744c1d95e483281af5bce7
ac658bf6
1 parent
a99dfd57
✨ feat(视频播放组件): 初始化视频时机调整
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
20 deletions
src/components/AuditVideoCard/index.vue
src/components/BVideoCard/index.vue
src/components/VideoCard/index.vue
src/components/VideoDetail/index.vue
src/components/AuditVideoCard/index.vue
View file @
ac658bf
...
...
@@ -82,6 +82,7 @@ export default {
created() {
},
mounted() {
setTimeout(() => {
var mp = new MuiPlayer({
container: '#mui-player-' + this.item.case_id,
title: this.item.title,
...
...
@@ -95,6 +96,7 @@ export default {
]
})
this.detail = _.cloneDeep(this.item)
}, 500);
},
methods: {
setLike() {
...
...
src/components/BVideoCard/index.vue
View file @
ac658bf
...
...
@@ -153,6 +153,7 @@ export default {
created() {
},
mounted() {
setTimeout(() => {
var mp = new MuiPlayer({
container: '#mui-player-' + this.item.case_id,
title: this.item.title,
...
...
@@ -166,6 +167,7 @@ export default {
]
})
this.detail = _.cloneDeep(this.item)
}, 500);
},
methods: {
setLike() {
...
...
src/components/VideoCard/index.vue
View file @
ac658bf
...
...
@@ -42,12 +42,6 @@ import { useRoute, useRouter } from 'vue-router'
const $route = useRoute();
const $router = useRouter();
const goTo = () => { // 跳转作品详情页
$router.push({
path: '/client/videoDetail'
});
}
onMounted(() => {
})
...
...
@@ -64,6 +58,7 @@ export default {
created() {
},
mounted() {
setTimeout(() => {
var mp = new MuiPlayer({
container: '#mui-player-' + this.item.id,
title: this.item.title,
...
...
@@ -77,8 +72,17 @@ export default {
]
})
this.detail = _.cloneDeep(this.item)
}, 500);
},
methods: {
goTo () { // 跳转作品详情页
this.$router.push({
path: '/client/videoDetail',
query: {
prod_id: this.item.id
}
});
},
setLike() {
this.detail.is_like = !this.detail.is_like
},
...
...
@@ -106,9 +110,7 @@ export default {
color: #713610;
padding: 1rem;
padding-bottom: 0.5rem;
.avatar {
}
}
}
</style>
\ No newline at end of file
...
...
src/components/VideoDetail/index.vue
View file @
ac658bf
<template>
<div class="video-wrapper">
<div class="video-div" :id="'mui-player-' + item.
case_
id"></div>
<div class="video-div" :id="'mui-player-' + item.id"></div>
<div class="video-bar">
<van-row style="text-align: center;">
<van-col span="7">
<span style="color: #777777;">
3068
次播放
{{ item.play_num }}
次播放
</span>
</van-col>
<van-col span="1" style="color: #EEEDED;">
...
...
@@ -13,9 +13,9 @@
</van-col>
<van-col span="8">
<span @click="setCollect">
<van-icon v-if="!detail.
collected
" :name="icon_shoucang1" size="1.2rem" style="vertical-align: bottom;" />
<van-icon v-if="!detail.
is_favor
" :name="icon_shoucang1" size="1.2rem" style="vertical-align: bottom;" />
<van-icon v-else :name="icon_shoucang2" size="1.2rem" style="vertical-align: bottom;" />
10086
{{ item.favor_num }}
</span>
</van-col>
<van-col span="1" style="color: #EEEDED;">
...
...
@@ -23,9 +23,9 @@
</van-col>
<van-col span="7">
<span @click="setLike()">
<van-icon v-if="!detail.
liked
" :name="icon_dianzan1" size="1.2rem" style="vertical-align: bottom;" />
<van-icon v-if="!detail.
is_like
" :name="icon_dianzan1" size="1.2rem" style="vertical-align: bottom;" />
<van-icon v-else :name="icon_dianzan2" size="1.2rem" style="vertical-align: bottom;" />
10086
{{ item.like_num }}
</span>
</van-col>
</van-row>
...
...
@@ -70,11 +70,12 @@ export default {
created() {
},
mounted() {
setTimeout(() => {
var mp = new MuiPlayer({
container: '#mui-player-' + this.item.case_
id,
container: '#mui-player-' + this.item.
id,
title: this.item.title,
src: this.item.video.url
,
poster: this.item.cover.url
,
src: this.item.video
,
poster: this.item.cover
,
autoFit: false,
videoAttribute: [ // 声明启用同层播放, 不让会自动全屏播放
{attrKey:'webkit-playsinline',attrValue:'webkit-playsinline'},
...
...
@@ -83,17 +84,20 @@ export default {
]
})
this.detail = _.cloneDeep(this.item)
}, 500)
},
methods: {
setCollect() {
this.detail.collected = !this.detail.collected
console.warn(this.detail.is_favor);
// this.detail.is_favor = this.detail.is_favor ? 1 : 0
},
setLike() {
this.detail.liked = !this.detail.liked
console.warn(this.detail.is_like);
// this.detail.is_like = this.detail.is_like ? 1 : 0
},
setCommit() {
console.warn('跳转详情页,移动到留言页');
console.warn(this.detail.
case_
id);
console.warn(this.detail.id);
}
}
}
...
...
Please
register
or
login
to post a comment