优化评论和分享
This commit is contained in:
parent
826ac2322b
commit
c308189a6e
Binary file not shown.
Binary file not shown.
47
src/components/AutoInput.vue
Normal file
47
src/components/AutoInput.vue
Normal file
@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="edit" contenteditable @input="changeText">{{ innerText }}</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "AutoInput",
|
||||
props: {
|
||||
modelValue: String,
|
||||
},
|
||||
data: function () {
|
||||
return {
|
||||
innerText: this.modelValue,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeText(e) {
|
||||
this.$emit('update:modelValue', this.$el.innerText);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.edit {
|
||||
width: 100%;
|
||||
max-height: 70px;
|
||||
background: #eee;
|
||||
overflow-y: scroll;
|
||||
padding: 8px 10px;
|
||||
border-radius: 30px;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.edit::-webkit-scrollbar {
|
||||
width: 0 !important
|
||||
}
|
||||
|
||||
.edit:empty::before {
|
||||
content: "留下你的精彩评论吧";
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.edit:focus::before {
|
||||
content: none;
|
||||
}
|
||||
</style>
|
||||
@ -1,211 +1,168 @@
|
||||
<template>
|
||||
<transition name="comment">
|
||||
<div class="comment f14" v-if="isCommenting">
|
||||
<div class="title mt10p">
|
||||
<p>2.7w条评论</p>
|
||||
<img src="../assets/img/icon/close.svg" @click.stop="$emit('update:is-commenting',false)">
|
||||
</div>
|
||||
<div class="items">
|
||||
<div class="item pl5p pr15p mb5p oh">
|
||||
<div class="content pull-left ">
|
||||
<img src="../assets/img/icon/head-image.jpeg" alt="" class="head-image pull-left">
|
||||
<div class="pull-right comment-container">
|
||||
<div class="name">@ttentau</div>
|
||||
<div class="detail">其实我也不知道评论点什么啊啊啊看吧看吧看吧</div>
|
||||
<div class="time mt10p">10-02</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="love pull-right">
|
||||
<img src="../assets/img/icon/love-gray.svg" alt="" class="love-image">
|
||||
<span class="f14 block">3453</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item pl5p pr15p mb5p oh">
|
||||
<div class="content pull-left ">
|
||||
<img src="../assets/img/icon/head-image.jpeg" alt="" class="head-image pull-left">
|
||||
<div class="pull-right comment-container">
|
||||
<div class="name">@ttentau</div>
|
||||
<div class="detail">其实我也不知道评论点什么啊啊啊看吧看吧看吧</div>
|
||||
<div class="time mt10p">10-02</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="love pull-right">
|
||||
<img src="../assets/img/icon/love-gray.svg" alt="" class="love-image">
|
||||
<span class="f14 block">3453</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item pl5p pr15p mb5p oh">
|
||||
<div class="content pull-left ">
|
||||
<img src="../assets/img/icon/head-image.jpeg" alt="" class="head-image pull-left">
|
||||
<div class="pull-right comment-container">
|
||||
<div class="name">@ttentau</div>
|
||||
<div class="detail">其实我也不知道评论点什么啊啊啊看吧看吧看吧</div>
|
||||
<div class="time mt10p">10-02</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="love pull-right">
|
||||
<img src="../assets/img/icon/love-gray.svg" alt="" class="love-image">
|
||||
<span class="f14 block">3453</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item pl5p pr15p mb5p oh">
|
||||
<div class="content pull-left ">
|
||||
<img src="../assets/img/icon/head-image.jpeg" alt="" class="head-image pull-left">
|
||||
<div class="pull-right comment-container">
|
||||
<div class="name">@ttentau</div>
|
||||
<div class="detail">其实我也不知道评论点什么啊啊啊看吧看吧看吧</div>
|
||||
<div class="time mt10p">10-02</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="love pull-right">
|
||||
<img src="../assets/img/icon/love-gray.svg" alt="" class="love-image">
|
||||
<span class="f14 block">3453</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item pl5p pr15p mb5p oh">
|
||||
<div class="content pull-left ">
|
||||
<img src="../assets/img/icon/head-image.jpeg" alt="" class="head-image pull-left">
|
||||
<div class="pull-right comment-container">
|
||||
<div class="name">@ttentau</div>
|
||||
<div class="detail">其实我也不知道评论点什么啊啊啊看吧看吧看吧</div>
|
||||
<div class="time mt10p">10-02</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="love pull-right">
|
||||
<img src="../assets/img/icon/love-gray.svg" alt="" class="love-image">
|
||||
<span class="f14 block">3453</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item pl5p pr15p mb5p oh">
|
||||
<div class="content pull-left ">
|
||||
<img src="../assets/img/icon/head-image.jpeg" alt="" class="head-image pull-left">
|
||||
<div class="pull-right comment-container">
|
||||
<div class="name">@ttentau</div>
|
||||
<div class="detail">其实我也不知道评论点什么啊啊啊看吧看吧看吧</div>
|
||||
<div class="time mt10p">10-02</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="love pull-right">
|
||||
<img src="../assets/img/icon/love-gray.svg" alt="" class="love-image">
|
||||
<span class="f14 block">3453</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item pl5p pr15p mb5p oh">
|
||||
<div class="content pull-left ">
|
||||
<img src="../assets/img/icon/head-image.jpeg" alt="" class="head-image pull-left">
|
||||
<div class="pull-right comment-container">
|
||||
<div class="name">@ttentau</div>
|
||||
<div class="detail">其实我也不知道评论点什么啊啊啊看吧看吧看吧</div>
|
||||
<div class="time mt10p">10-02</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="love pull-right">
|
||||
<img src="../assets/img/icon/love-gray.svg" alt="" class="love-image">
|
||||
<span class="f14 block">3453</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-comment">
|
||||
<input type="text" placeholder="留下你的精彩评论哦">
|
||||
<span>@</span>
|
||||
<transition name="comment">
|
||||
<div class="comment f14" v-if="isCommenting">
|
||||
<div class="title mt10p">
|
||||
<p>2.7w条评论</p>
|
||||
<img src="../assets/img/icon/close.svg" @click.stop="$emit('update:is-commenting',false)">
|
||||
</div>
|
||||
<div class="items">
|
||||
<div class="item pl5p pr15p mb5p oh"
|
||||
v-for="item in 2"
|
||||
>
|
||||
<div class="content pull-left ">
|
||||
<img src="../assets/img/icon/head-image.jpeg" alt="" class="head-image pull-left">
|
||||
<div class="pull-right comment-container">
|
||||
<div class="name">@ttentau</div>
|
||||
<div class="detail">其实我也不知道评论点什么啊啊啊看吧看吧看吧</div>
|
||||
<div class="time mt10p">10-02</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="love pull-right">
|
||||
<img src="../assets/img/icon/love-gray.svg" alt="" class="love-image">
|
||||
<span class="f14 block">3453</span>
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
<p class="no-more">暂时没有更多了</p>
|
||||
</div>
|
||||
<div class="input-comment">
|
||||
<AutoInput v-model="commit"></AutoInput>
|
||||
<div class="options">
|
||||
<img src="../assets/img/icon/add.svg" alt="" @click="call">
|
||||
<img src="../assets/img/icon/add.svg" alt="">
|
||||
<img src="../assets/img/icon/add.svg" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "Comment",
|
||||
props: ['isCommenting'],
|
||||
methods: {
|
||||
// showComment() {
|
||||
// this.isCommenting = !this.isCommenting;
|
||||
// console.log(666)
|
||||
// }
|
||||
}
|
||||
import AutoInput from "./AutoInput";
|
||||
|
||||
export default {
|
||||
name: "Comment",
|
||||
components: {AutoInput},
|
||||
props: ['isCommenting'],
|
||||
data() {
|
||||
return {
|
||||
commit: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// showComment() {
|
||||
// this.isCommenting = !this.isCommenting;
|
||||
// console.log(666)
|
||||
// }
|
||||
call(){
|
||||
console.log(this.commit)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.comment {
|
||||
position: fixed;
|
||||
/*top: 200px;*/
|
||||
width: 100%;
|
||||
bottom: 0;
|
||||
background: #fff;
|
||||
z-index: 5;
|
||||
border-radius: 10px 10px 0 0;
|
||||
.title {
|
||||
position: relative;
|
||||
p {
|
||||
text-align: center;
|
||||
}
|
||||
img {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
.input-comment {
|
||||
height: 30px;
|
||||
border-top: 1px solid #e2e1e1;
|
||||
input {
|
||||
height: 100%;
|
||||
width: 90%;
|
||||
}
|
||||
span {
|
||||
color: #999;
|
||||
font-size: 22px;
|
||||
}
|
||||
}
|
||||
.items {
|
||||
overflow-y: scroll;
|
||||
max-height: 300px;
|
||||
.item {
|
||||
.head-image {
|
||||
width: 40px;
|
||||
border-radius: 50%;
|
||||
float: left;
|
||||
}
|
||||
.content {
|
||||
float: left;
|
||||
width: 85%;
|
||||
.head-image {
|
||||
width: 15%;
|
||||
}
|
||||
.comment-container {
|
||||
width: 80%;
|
||||
.time {
|
||||
color: gray;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
.love {
|
||||
text-align: center;
|
||||
.love-image {
|
||||
width: 30px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
}
|
||||
.comment {
|
||||
position: fixed;
|
||||
/*top: 200px;*/
|
||||
width: 100%;
|
||||
bottom: 0;
|
||||
background: #fff;
|
||||
z-index: 5;
|
||||
border-radius: 10px 10px 0 0;
|
||||
|
||||
.title {
|
||||
position: relative;
|
||||
|
||||
p {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.items {
|
||||
overflow-y: scroll;
|
||||
height: 60vh;
|
||||
|
||||
.item {
|
||||
.head-image {
|
||||
width: 40px;
|
||||
border-radius: 50%;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.content {
|
||||
float: left;
|
||||
width: 85%;
|
||||
|
||||
.head-image {
|
||||
width: 15%;
|
||||
}
|
||||
|
||||
.comment-container {
|
||||
width: 80%;
|
||||
|
||||
.time {
|
||||
color: gray;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.love {
|
||||
text-align: center;
|
||||
|
||||
.love-image {
|
||||
width: 30px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.comment-enter-active {
|
||||
transition: all .3s ease;
|
||||
.no-more{
|
||||
margin: 10px;
|
||||
text-align: center;
|
||||
color: #ccc;
|
||||
}
|
||||
}
|
||||
|
||||
.comment-leave-active {
|
||||
transition: all .3s ease;
|
||||
}
|
||||
.input-comment {
|
||||
padding: 10px;
|
||||
border-top: 1px solid #e2e1e1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.comment-enter, .comment-leave-to {
|
||||
transform: translateY(300px);
|
||||
.options {
|
||||
display: flex;
|
||||
|
||||
img {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin: 0 5px;
|
||||
|
||||
&:nth-last-child(1) {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.comment-enter-active,
|
||||
.comment-leave-active {
|
||||
transition: all .15s ease;
|
||||
}
|
||||
|
||||
.comment-enter-from, .comment-leave-to {
|
||||
transform: translateY(60vh);
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@ -35,11 +35,11 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
move(e) {
|
||||
this.mitt.emit(this.$store.state.currentVideoId, {isMove: true, e: e.touches[0].pageX})
|
||||
this.mitt.emit(this.$store.state.currentVideoId, {isMove: true, e})
|
||||
this.$stopPropagation(e)
|
||||
},
|
||||
end(e) {
|
||||
this.mitt.emit(this.$store.state.currentVideoId, {isMove: false,})
|
||||
this.mitt.emit(this.$store.state.currentVideoId, {isMove: false, e})
|
||||
},
|
||||
tab(index) {
|
||||
this.currentTab = index
|
||||
|
||||
@ -79,7 +79,7 @@
|
||||
</div>
|
||||
<div class="content oh">
|
||||
<div class="video-container" v-for="item of videos" v-bind:style="{'height':width/3*1.2+'px'}">
|
||||
<video src="../assets/video/吴三二的光年之外.mp4" poster="../assets/img/poster/src1-bg.png"></video>
|
||||
<video src="../assets/video/1.mp4" poster="../assets/img/poster/src1-bg.png"></video>
|
||||
<div class="love">
|
||||
<img src="../assets/img/icon/love.svg" alt="">
|
||||
<span class="ml5p">72.3w</span>
|
||||
|
||||
@ -1,115 +1,86 @@
|
||||
<template>
|
||||
<transition name="comment">
|
||||
<transition name="share">
|
||||
<div class="share" v-if="isSharing">
|
||||
<div class="friends oh p10p ">
|
||||
<div class="title tac pb10p">私信给</div>
|
||||
<div class="w200">
|
||||
<div class="friend pr10p">
|
||||
<img src="../assets/img/icon/head-image.jpeg" alt="">
|
||||
<span>ttentau</span>
|
||||
</div>
|
||||
<div class="friend pr10p">
|
||||
<img src="../assets/img/icon/head-image.jpeg" alt="">
|
||||
<span>ttentau</span>
|
||||
</div>
|
||||
<div class="friend pr10p">
|
||||
<img src="../assets/img/icon/head-image.jpeg" alt="">
|
||||
<span>ttentau</span>
|
||||
</div>
|
||||
<div class="friend pr10p">
|
||||
<img src="../assets/img/icon/head-image.jpeg" alt="">
|
||||
<span>ttentau</span>
|
||||
</div>
|
||||
<div class="friend pr10p">
|
||||
<img src="../assets/img/icon/head-image.jpeg" alt="">
|
||||
<span>ttentau</span>
|
||||
</div>
|
||||
<div class="friend pr10p">
|
||||
<img src="../assets/img/icon/head-image.jpeg" alt="">
|
||||
<span>ttentau</span>
|
||||
</div>
|
||||
<div class="friend pr10p">
|
||||
<img src="../assets/img/icon/head-image.jpeg" alt="">
|
||||
<span>ttentau</span>
|
||||
</div>
|
||||
<div class="friend pr10p">
|
||||
<img src="../assets/img/icon/next.svg" alt="">
|
||||
<span>更多</span>
|
||||
</div>
|
||||
<div class="title">
|
||||
<span>私信给朋友</span>
|
||||
<img src="../assets/img/icon/close.svg" @click="closeShare">
|
||||
</div>
|
||||
<div class="friends pl10p pb20p">
|
||||
<div class="friend pr10p pl10p" v-for="item in 10">
|
||||
<img src="../assets/img/icon/head-image.jpeg" alt="">
|
||||
<span>ttenu</span>
|
||||
</div>
|
||||
<div class="friend pr10p">
|
||||
<img src="../assets/img/icon/next.svg" alt="">
|
||||
<span>更多</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="shares oh pl20p pr20p pt10p pb10p">
|
||||
<div class="title tac pb10p">分享到</div>
|
||||
<div class="w200">
|
||||
<div class="share-to pr10p">
|
||||
<img src="../assets/img/icon/friend_circle.svg" alt="">
|
||||
<span>朋友圈</span>
|
||||
</div>
|
||||
<div class="share-to pr10p">
|
||||
<img src="../assets/img/icon/wechat.svg" alt="">
|
||||
<span>微信</span>
|
||||
</div>
|
||||
<div class="share-to pr10p">
|
||||
<img src="../assets/img/icon/sq-share-qqzone-01.svg">
|
||||
<span>QQ空间</span>
|
||||
</div>
|
||||
<div class="share-to pr10p">
|
||||
<img src="../assets/img/icon/QQ.svg">
|
||||
<span>QQ</span>
|
||||
</div>
|
||||
<div class="share-to pr10p">
|
||||
<img src="../assets/img/icon/sina.svg">
|
||||
<span>微博</span>
|
||||
</div>
|
||||
<div class="share-to pr10p">
|
||||
<img src="../assets/img/icon/more.svg">
|
||||
<span>更多</span>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
<div class="shares pl10p pb20p">
|
||||
<div class="share-to pr10p pl10p"
|
||||
v-for="item in 5"
|
||||
>
|
||||
<img src="../assets/img/icon/friend_circle.svg" alt="">
|
||||
<span>朋友圈</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="toolbar oh pl20p pr20p pt10p pb10p f11">
|
||||
<div class="w200">
|
||||
<div class="tool pr10p ">
|
||||
<img src="../assets/img/icon/举报.svg" alt="">
|
||||
<span>举报</span>
|
||||
</div>
|
||||
<div class="tool pr10p ">
|
||||
<img src="../assets/img/icon/download.svg" alt="">
|
||||
<span>保存本地</span>
|
||||
</div>
|
||||
<div class="tool pr10p ">
|
||||
<img src="../assets/img/icon/collect.svg" alt="">
|
||||
<span>收藏</span>
|
||||
</div>
|
||||
<div class="tool pr10p ">
|
||||
<img src="../assets/img/icon/qiangjing.svg" alt="">
|
||||
<span>抢镜</span>
|
||||
</div>
|
||||
<div class="tool pr10p">
|
||||
<img src="../assets/img/icon/qr_code.svg" alt="">
|
||||
<span>二维码</span>
|
||||
</div>
|
||||
<div class="tool pr10p">
|
||||
<img src="../assets/img/icon/dongtaibizhi.svg" alt="">
|
||||
<span>动态壁纸</span>
|
||||
</div>
|
||||
<div class="tool pr10p">
|
||||
<img src="../assets/img/icon/hepai.svg" alt="">
|
||||
<span>合拍</span>
|
||||
</div>
|
||||
<div class="tool pr10p">
|
||||
<img src="../assets/img/icon/dislike.svg" alt="">
|
||||
<span>不感兴趣</span>
|
||||
</div>
|
||||
<div class="tool pr10p">
|
||||
<img src="../assets/img/icon/href.svg" alt="">
|
||||
<span>复制链接</span>
|
||||
</div>
|
||||
<div class="share-to pr10p pl10p">
|
||||
<img src="../assets/img/icon/wechat.svg" alt="">
|
||||
<span>微信</span>
|
||||
</div>
|
||||
<div class="share-to pr10p pl10p">
|
||||
<img src="../assets/img/icon/sq-share-qqzone-01.svg">
|
||||
<span>QQ空间</span>
|
||||
</div>
|
||||
<div class="share-to pr10p pl10p">
|
||||
<img src="../assets/img/icon/QQ.svg">
|
||||
<span>QQ</span>
|
||||
</div>
|
||||
<div class="share-to pr10p pl10p">
|
||||
<img src="../assets/img/icon/sina.svg">
|
||||
<span>微博</span>
|
||||
</div>
|
||||
<div class="share-to pr10p pl10p">
|
||||
<img src="../assets/img/icon/more.svg">
|
||||
<span>更多</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dismiss" @click="closeShare()">
|
||||
取消
|
||||
<div class="toolbar pl10p pb20p">
|
||||
<div class="tool pr10p pl10p ">
|
||||
<img src="../assets/img/icon/举报.svg" alt="">
|
||||
<span>举报</span>
|
||||
</div>
|
||||
<div class="tool pr10p pl10p ">
|
||||
<img src="../assets/img/icon/download.svg" alt="">
|
||||
<span>保存本地</span>
|
||||
</div>
|
||||
<div class="tool pr10p pl10p ">
|
||||
<img src="../assets/img/icon/collect.svg" alt="">
|
||||
<span>收藏</span>
|
||||
</div>
|
||||
<div class="tool pr10p pl10p ">
|
||||
<img src="../assets/img/icon/qiangjing.svg" alt="">
|
||||
<span>抢镜</span>
|
||||
</div>
|
||||
<div class="tool pr10p pl10p">
|
||||
<img src="../assets/img/icon/qr_code.svg" alt="">
|
||||
<span>二维码</span>
|
||||
</div>
|
||||
<div class="tool pr10p pl10p">
|
||||
<img src="../assets/img/icon/dongtaibizhi.svg" alt="">
|
||||
<span>动态壁纸</span>
|
||||
</div>
|
||||
<div class="tool pr10p pl10p">
|
||||
<img src="../assets/img/icon/hepai.svg" alt="">
|
||||
<span>合拍</span>
|
||||
</div>
|
||||
<div class="tool pr10p pl10p">
|
||||
<img src="../assets/img/icon/dislike.svg" alt="">
|
||||
<span>不感兴趣</span>
|
||||
</div>
|
||||
<div class="tool pr10p pl10p">
|
||||
<img src="../assets/img/icon/href.svg" alt="">
|
||||
<span>复制链接</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
@ -130,51 +101,70 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.w200 {
|
||||
width: 200%;
|
||||
}
|
||||
|
||||
.share {
|
||||
position: fixed;
|
||||
/*top: 200px;*/
|
||||
width: 100%;
|
||||
bottom: 0;
|
||||
z-index: 5;
|
||||
background: #eaeaea;
|
||||
background: black;
|
||||
border-radius: 10px 10px 0 0;
|
||||
color: white;
|
||||
box-sizing: border-box;
|
||||
|
||||
|
||||
.title {
|
||||
padding: 20px;
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
img {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
.friends {
|
||||
overflow-x: scroll;
|
||||
display: flex;
|
||||
|
||||
.friend {
|
||||
float: left;
|
||||
width: 45px;
|
||||
|
||||
img {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
width: 45px;
|
||||
height: 45px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
span {
|
||||
display: block;
|
||||
text-align: center;
|
||||
word-break: break-all;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.line{
|
||||
height: 1px;
|
||||
background: #1c1c1c;
|
||||
margin-left: 20px;
|
||||
width: calc(100% - 40px);
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.shares {
|
||||
background: white;
|
||||
overflow-x: scroll;
|
||||
display: flex;
|
||||
|
||||
.share-to {
|
||||
float: left;
|
||||
width: 50px;
|
||||
|
||||
img {
|
||||
width: 27px;
|
||||
height: 27px;
|
||||
padding: 6px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
padding: 10px;
|
||||
border-radius: 50%;
|
||||
background: #1ace04;
|
||||
}
|
||||
@ -187,16 +177,16 @@ export default {
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
border-top: 1px solid #eaeaea;
|
||||
background: white;
|
||||
overflow-x: scroll;
|
||||
display: flex;
|
||||
|
||||
|
||||
.tool {
|
||||
float: left;
|
||||
|
||||
img {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
padding: 10px;
|
||||
border-radius: 50%;
|
||||
background: #eaeaea;
|
||||
@ -208,25 +198,15 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dismiss {
|
||||
background: white;
|
||||
border-top: 1px solid #eaeaea;
|
||||
text-align: center;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.comment-enter-active {
|
||||
transition: all .3s ease;
|
||||
.share-enter-active,
|
||||
.share-leave-active {
|
||||
transition: all .15s ease;
|
||||
}
|
||||
|
||||
.comment-leave-active {
|
||||
transition: all .3s ease;
|
||||
.share-enter-from, .share-leave-to {
|
||||
transform: translateY(60vh);
|
||||
}
|
||||
|
||||
.comment-enter, .comment-leave-to {
|
||||
transform: translateY(300px);
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -47,12 +47,14 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="process"
|
||||
:class="isMove ? '' : isPlaying && 'stop'"
|
||||
v-if="duration > 60"
|
||||
@touchmove="move"
|
||||
@touchend="end"
|
||||
>
|
||||
<div class="time" v-if="isMove">
|
||||
<span class="playDuration">{{ $duration(playDuration) }}</span>
|
||||
<span class="duration"> / {{ $duration(video.duration) }}</span>
|
||||
<span class="currentTime">{{ $duration(currentTime) }}</span>
|
||||
<span class="duration"> / {{ $duration(duration) }}</span>
|
||||
</div>
|
||||
<div class="line" :style="durationStyle" ref="line"></div>
|
||||
<div class="point" :style="durationStyle" ref="point"></div>
|
||||
@ -84,21 +86,35 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
durationStyle() {
|
||||
return {left: this.playDuration + 'px'}
|
||||
return {left: this.pageX + 'px'}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
disabled: {
|
||||
immediate: true,
|
||||
handler(v) {
|
||||
console.log('disabled', this.currentVideoId, v)
|
||||
// console.log('disabled', this.currentVideoId, v)
|
||||
this.isPlaying = !v
|
||||
if (!v) {
|
||||
this.$store.commit('setCurrentVideoId', this.currentVideoId)
|
||||
console.log(this.$refs)
|
||||
if (this.$refs.video) {
|
||||
this.$refs.video.play()
|
||||
}
|
||||
setTimeout(() => {
|
||||
let video = this.$refs.video
|
||||
video.currentTime = 0
|
||||
let fun = e => {
|
||||
this.currentTime = Math.ceil(e.target.currentTime)
|
||||
this.pageX = this.currentTime * this.step
|
||||
}
|
||||
video.addEventListener('timeupdate', fun)
|
||||
video.addEventListener('loadedmetadata', e => {
|
||||
this.duration = video.duration
|
||||
if (this.duration > 60) {
|
||||
this.step = this.width / Math.floor(this.duration)
|
||||
} else {
|
||||
video.removeEventListener('timeupdate', fun)
|
||||
}
|
||||
})
|
||||
video.play()
|
||||
})
|
||||
} else {
|
||||
if (this.$refs.video) {
|
||||
this.$refs.video.pause()
|
||||
@ -109,7 +125,10 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
playDuration: 30,
|
||||
duration: 0,
|
||||
step: 0,
|
||||
currentTime: 0,
|
||||
pageX: 0,
|
||||
index: 0,
|
||||
height: 0,
|
||||
width: 0,
|
||||
@ -120,7 +139,7 @@ export default {
|
||||
point: null,
|
||||
isMove: false,
|
||||
mitt: inject('mitt'),
|
||||
currentVideoId: 'a' + Date.now()
|
||||
currentVideoId: 'a' + Date.now(),
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -129,10 +148,15 @@ export default {
|
||||
this.line = this.$refs.line
|
||||
this.point = this.$refs.point
|
||||
this.mitt.on(this.currentVideoId, v => {
|
||||
if (this.duration < 60) return
|
||||
this.isMove = v.isMove
|
||||
this.playDuration = v.isMove ? v.e : this.playDuration
|
||||
// this.currentTime = v.isMove ? v.e : this.currentTime
|
||||
v.isMove ? this.move(v.e) : this.end(v.e)
|
||||
})
|
||||
},
|
||||
unmounted() {
|
||||
console.log('unmounted')
|
||||
},
|
||||
methods: {
|
||||
//划动到下一个视频
|
||||
swipingVideo() {
|
||||
@ -192,11 +216,20 @@ export default {
|
||||
},
|
||||
move(e) {
|
||||
this.isMove = true
|
||||
this.playDuration = e.touches[0].pageX
|
||||
let video = this.$refs.video
|
||||
video.pause()
|
||||
this.pageX = e.touches[0].pageX
|
||||
// console.log(this.step)
|
||||
this.currentTime = Math.ceil(Math.ceil(e.touches[0].pageX) / this.step)
|
||||
this.$stopPropagation(e)
|
||||
},
|
||||
end(e) {
|
||||
this.isMove = false
|
||||
setTimeout(()=>{
|
||||
this.isMove = false
|
||||
},1000)
|
||||
let video = this.$refs.video
|
||||
video.currentTime = this.currentTime
|
||||
video.play()
|
||||
this.$stopPropagation(e)
|
||||
},
|
||||
|
||||
@ -362,8 +395,8 @@ export default {
|
||||
position: absolute;
|
||||
top: -3px;
|
||||
height: 3px;
|
||||
width: 100vw;
|
||||
transform: translate3d(-100%, 0, 0);
|
||||
width: 200vw;
|
||||
transform: translate3d(-200vw, 0, 0);
|
||||
background: white;
|
||||
}
|
||||
|
||||
@ -378,6 +411,40 @@ export default {
|
||||
background: white;
|
||||
}
|
||||
}
|
||||
|
||||
& .stop {
|
||||
&:before {
|
||||
z-index: 9;
|
||||
content: ' ';
|
||||
height: 1.5px;
|
||||
width: 100vw;
|
||||
background: #333333;
|
||||
position: absolute;
|
||||
top: -3px;
|
||||
}
|
||||
|
||||
.line {
|
||||
z-index: 999;
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: -3px;
|
||||
height: 1px;
|
||||
width: 200vw;
|
||||
transform: translate3d(-200vw, 0, 0);
|
||||
background: gray;
|
||||
}
|
||||
|
||||
.point {
|
||||
z-index: 10;
|
||||
position: absolute;
|
||||
left: 10vw;
|
||||
top: -4px;
|
||||
height: 4px;
|
||||
width: 4px;
|
||||
border-radius: 50%;
|
||||
background: gray;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
<div class="tab" @click="toggleTab($event,1)">最新</div>
|
||||
</div>
|
||||
<div class="video-container" v-for="(item,index) of videos" v-bind:style="{'height':width/3*1.2+'px'}">
|
||||
<video src="../../assets/video/吴三二的光年之外.mp4" poster="../../assets/img/poster/src1-bg.png"></video>
|
||||
<video src="../../assets/video/1.mp4" poster="../../assets/img/poster/src1-bg.png"></video>
|
||||
<div class="no" v-if="index===1||index===2">
|
||||
NO. <span>{{index+1}}</span>
|
||||
</div>
|
||||
|
||||
@ -85,7 +85,7 @@
|
||||
return {
|
||||
data: [
|
||||
{
|
||||
videoUrl: require('../../assets/video/吴三二的光年之外.mp4'),
|
||||
videoUrl: require('../../assets/video/1.mp4'),
|
||||
// videoUrl: 'http://babylife.qiniudn.com/FtRVyPQHHocjVYjeJSrcwDkApTLQ',
|
||||
videoPoster: require('../../assets/img/poster/src1-bg.png'),
|
||||
isLoved: false,
|
||||
|
||||
@ -75,7 +75,7 @@ import Comment from '../../components/Comment.vue'
|
||||
import Other from '../../components/Other.vue'
|
||||
import Share from '../../components/Share.vue'
|
||||
import Footer from "../../components/Footer.vue"
|
||||
import mp1 from '../../assets/video/吴三二的光年之外.mp4'
|
||||
import mp1 from '../../assets/video/1.mp4'
|
||||
import src1Bg from '../../assets/img/poster/src1-bg.png'
|
||||
export default {
|
||||
name: "HomeIndex",
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
<span>无敌浩克</span>
|
||||
</div>
|
||||
<div class="video-container mb10p ">
|
||||
<video src="../../assets/video/吴三二的光年之外.mp4" poster="../../assets/img/poster/src1-bg.png"></video>
|
||||
<video src="../../assets/video/1.mp4" poster="../../assets/img/poster/src1-bg.png"></video>
|
||||
<div class="music">
|
||||
<img src="../../assets/img/icon/music.svg" alt="" class="music-image">
|
||||
<marquee behavior=scroll direction=left align=middle scrollamount=4> 吴三二 - 光年之外</marquee>
|
||||
|
||||
@ -259,7 +259,7 @@ import Comment from '../../components/Comment.vue'
|
||||
import Other from '../../components/Other.vue'
|
||||
import Share from '../../components/Share.vue'
|
||||
import Footer from "../../components/Footer.vue"
|
||||
import mp1 from '../../assets/video/吴三二的光年之外.mp4'
|
||||
import mp1 from '../../assets/video/1.mp4'
|
||||
import src1Bg from '../../assets/img/poster/src1-bg.png'
|
||||
import SlideItem from './SlideItem.vue'
|
||||
import SlideList from './SlideList.vue'
|
||||
|
||||
@ -1,23 +1,23 @@
|
||||
<template>
|
||||
<div id="home-index">
|
||||
<div class="toolbar-ctn">
|
||||
<div class="toolbar" :style="toolbarStyle">
|
||||
<div class="left">直播</div>
|
||||
<div class="tab-ctn">
|
||||
<div class="tabs" ref="tabs">
|
||||
<div class="tab"><span>双流</span></div>
|
||||
<div class="tab"><span>关注</span></div>
|
||||
<div class="tab"><span>推荐</span></div>
|
||||
</div>
|
||||
<div class="index" :style="tabIndexStyle"></div>
|
||||
</div>
|
||||
<div class="right" :style="{opacity:loading ? 0 : 1}">搜索</div>
|
||||
</div>
|
||||
<div class="notice" :style="noticeStyle"><span>下拉刷新内容</span></div>
|
||||
<div class="loading" :style="loadingStyle">AA</div>
|
||||
</div>
|
||||
<SlideList v-model:active-index="baseActiveIndex">
|
||||
<SlideItem>
|
||||
<div class="toolbar-ctn">
|
||||
<div class="toolbar" :style="toolbarStyle">
|
||||
<div class="left">直播</div>
|
||||
<div class="tab-ctn">
|
||||
<div class="tabs" ref="tabs">
|
||||
<div class="tab"><span>双流</span></div>
|
||||
<div class="tab"><span>关注</span></div>
|
||||
<div class="tab"><span>推荐</span></div>
|
||||
</div>
|
||||
<div class="index" :style="tabIndexStyle"></div>
|
||||
</div>
|
||||
<div class="right" :style="{opacity:loading ? 0 : 1}">搜索</div>
|
||||
</div>
|
||||
<div class="notice" :style="noticeStyle"><span>下拉刷新内容</span></div>
|
||||
<div class="loading" :style="loadingStyle">AA</div>
|
||||
</div>
|
||||
<SlideList v-model:active-index="activeIndex"
|
||||
>
|
||||
<SlideItem style="overflow:auto;">
|
||||
@ -153,7 +153,7 @@
|
||||
@slide="slide">
|
||||
<SlideItem :style="itemTop" v-for="(item,index) of videos">
|
||||
<Video
|
||||
:disabled="videoActiveIndex !== index"
|
||||
:disabled="videoActiveIndex !== addCount + index"
|
||||
v-model:video="videos[index]"
|
||||
@showComments="isCommenting = !isCommenting"
|
||||
@showShare="isSharing = !isSharing"
|
||||
@ -220,7 +220,11 @@ import Comment from '../../components/Comment.vue'
|
||||
import Other from '../../components/Other.vue'
|
||||
import Share from '../../components/Share.vue'
|
||||
import Footer from "../../components/Footer.vue"
|
||||
import mp1 from '../../assets/video/吴三二的光年之外.mp4'
|
||||
import mp41 from '../../assets/video/10.mp4'
|
||||
import mp42 from '../../assets/video/2.mp4'
|
||||
import mp43 from '../../assets/video/3.mp4'
|
||||
import mp44 from '../../assets/video/4.mp4'
|
||||
import mp45 from '../../assets/video/5.mp4'
|
||||
import src1Bg from '../../assets/img/poster/src1-bg.png'
|
||||
import SlideItem from './SlideItem.vue'
|
||||
import SlideList from './SlideList.vue'
|
||||
@ -234,54 +238,54 @@ export default {
|
||||
list: [1, 2, 3, 4, 5],
|
||||
videos: [
|
||||
{
|
||||
videoUrl: mp1,
|
||||
videoUrl: mp41,
|
||||
// videoUrl: 'http://babylife.qiniudn.com/FtRVyPQHHocjVYjeJSrcwDkApTLQ',
|
||||
videoPoster: src1Bg,
|
||||
isLoved: true,
|
||||
loves: 1234,
|
||||
comments: 666,
|
||||
shared: 999,
|
||||
duration:99
|
||||
duration: 99
|
||||
},
|
||||
{
|
||||
videoUrl: mp1,
|
||||
videoUrl: mp42,
|
||||
// videoUrl: 'http://babylife.qiniudn.com/FtRVyPQHHocjVYjeJSrcwDkApTLQ',
|
||||
videoPoster: src1Bg,
|
||||
isLoved: false,
|
||||
loves: 1234,
|
||||
comments: 666,
|
||||
shared: 999,
|
||||
duration:99
|
||||
duration: 99
|
||||
},
|
||||
{
|
||||
videoUrl: mp1,
|
||||
videoUrl: mp43,
|
||||
// videoUrl: 'http://babylife.qiniudn.com/FtRVyPQHHocjVYjeJSrcwDkApTLQ',
|
||||
videoPoster: src1Bg,
|
||||
isLoved: false,
|
||||
loves: 1234,
|
||||
comments: 666,
|
||||
shared: 999,
|
||||
duration:99
|
||||
duration: 99
|
||||
},
|
||||
{
|
||||
videoUrl: mp1,
|
||||
videoUrl: mp44,
|
||||
// videoUrl: 'http://babylife.qiniudn.com/FtRVyPQHHocjVYjeJSrcwDkApTLQ',
|
||||
videoPoster: src1Bg,
|
||||
isLoved: false,
|
||||
loves: 1234,
|
||||
comments: 666,
|
||||
shared: 999,
|
||||
duration:99
|
||||
duration: 99
|
||||
},
|
||||
{
|
||||
videoUrl: mp1,
|
||||
videoUrl: mp45,
|
||||
// videoUrl: 'http://babylife.qiniudn.com/FtRVyPQHHocjVYjeJSrcwDkApTLQ',
|
||||
videoPoster: src1Bg,
|
||||
isLoved: false,
|
||||
loves: 1234,
|
||||
comments: 666,
|
||||
shared: 999,
|
||||
duration:99
|
||||
duration: 99
|
||||
},
|
||||
],
|
||||
addCount: 0,
|
||||
|
||||
@ -218,7 +218,7 @@ import Comment from '../../components/Comment.vue'
|
||||
import Other from '../../components/Other.vue'
|
||||
import Share from '../../components/Share.vue'
|
||||
import Footer from "../../components/Footer.vue"
|
||||
import mp1 from '../../assets/video/吴三二的光年之外.mp4'
|
||||
import mp1 from '../../assets/video/1.mp4'
|
||||
import src1Bg from '../../assets/img/poster/src1-bg.png'
|
||||
import SlideItem from './SlideItem.vue'
|
||||
import SlideList from './SlideList.vue'
|
||||
|
||||
@ -1,4 +1,7 @@
|
||||
// vue.config.js
|
||||
module.exports = {
|
||||
lintOnSave:false //关闭eslint检查
|
||||
lintOnSave:false, //关闭eslint检查
|
||||
devServer:{
|
||||
open: true,
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user