添加音乐页面,吐槽下bscroll并不好用

This commit is contained in:
zyronon 2021-09-14 00:46:24 +08:00
parent 22e6e74a1f
commit 835b8f6a48
58 changed files with 2532 additions and 149 deletions

View File

@ -1,6 +1,13 @@
# 此代码仅供学习,请勿用于商业用途
# 使用 Vue 模仿抖音, 本项目持续更新
### 开源不易,麻烦给个 Star★ 吧(☺️ 右上角点击 ★Star轻轻松松一秒钟 🤣)!我会根据大家的关注度和个人时间持续更新代码!
目前由于视频没有上传到github需要自己src/assets/video目录下 创建名字为1-10的mp4
TODO
#### 图片懒加载
#### 点击喜欢,特效

View File

@ -41,6 +41,8 @@
<script crossorigin="anonymous"
integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ=="
src="https://lib.baomitu.com/jquery/3.6.0/jquery.min.js"></script>
<script src="https://unpkg.com/better-scroll@latest/dist/better-scroll.min.js"></script>
</head>
<body>
<noscript>

Binary file not shown.

After

Width:  |  Height:  |  Size: 458 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 577 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 596 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 543 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 595 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 560 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 547 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 557 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 613 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 486 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 532 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 506 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 510 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 458 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 418 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 438 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 434 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 476 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 486 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 480 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 410 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 434 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 808 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -1 +0,0 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1539708547888" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1476" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M739.584 70.592c-92.224 0-177.792 63.04-228.224 109.568C460.864 133.632 375.36 70.592 283.008 70.592 108.48 70.592 0 176.96 0 348.16 0 492.8 130.688 608.256 131.2 608.64l340.544 328.512c10.432 10.432 24.448 16.256 39.552 16.256s29.056-5.824 39.296-16l341.248-328.64c30.656-29.376 130.752-134.848 130.752-260.544C1022.656 176.96 914.176 70.592 739.584 70.592z" p-id="1477" fill="#e73a57"></path></svg>

Before

Width:  |  Height:  |  Size: 786 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

@ -1 +0,0 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1539615220711" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="14876" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M621.110023 141.28277c-10.939143-10.93505-26.768667-15.935947-40.191374-6.538927-12.669554 8.868995-12.56313 19.051915-12.56313 29.986965l0 158.582785c-224.199225 0-437.464423 185.92041-437.464423 410.119635 0 60.151985 27.340695 136.708592 54.682413 164.048263 32.810267-169.514765 202.328102-300.755832 382.78201-300.755832l0 160.538323c0 5.469572-0.460488 25.329898 10.044774 31.383778 16.101723 9.278317 28.231995-0.530073 33.701566-5.999644l270.0239-291.62487c10.93505-10.939143 14.326287-22.706141 14.326287-31.006178 0-12.707416-9.071609-25.953092-14.541181-31.422663L621.110023 141.28277z" p-id="14877" fill="#ffffff"></path></svg>

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

@ -8,7 +8,7 @@
<img class="love" src="../assets/img/icon/love.svg" alt="">
<span>{{ $likeNum(i.digg_count) }}</span>
</div>
<div v-else class="date">
<div class="date" v-if="mode === 'date'">
<div class="day">{{ getDay(i.create_time) }}</div>
<div class="month">{{ getMonth(i.create_time) }}</div>
</div>
@ -29,7 +29,7 @@ export default {
},
mode: {
type: String,
default: 'normal'
default: 'normal'//date,none
}
},
methods: {

43
src/components/Scroll.vue Normal file
View File

@ -0,0 +1,43 @@
<template>
<div class="scroll-wrapper" ref="wrapper" @scroll="scroll">
<div class="scroll-content">
<slot></slot>
</div>
</div>
</template>
<script>
export default {
name: "Scroll",
props: {
fixedHeight: {
type: Number,
default: -1
}
},
data() {
return {}
},
computed: {},
created() {
},
methods: {
async scroll() {
let wrapper = this.$refs.wrapper
if (this.fixedHeight !== -1) {
this.$emit('fixed', this.fixedHeight < wrapper.scrollTop)
}
if (wrapper.scrollHeight - wrapper.clientHeight < wrapper.scrollTop + 60) {
this.$emit('pulldown')
}
},
}
}
</script>
<style scoped lang="less">
@import "../assets/scss/index";
.scroll-wrapper {
overflow: auto;
}
</style>

View File

@ -27,11 +27,7 @@
<div class="love mb2r" @click.stop="loved($event)">
<div>
<img src="../assets/img/icon/love.svg" class="love-image" v-if="!lVideo.isLoved">
<img src="../assets/img/icon/loved.svg" class="love-image" v-else>
<!-- <transition name="love">-->
<!-- </transition>-->
<!-- <transition name="loved">-->
<!-- </transition>-->
<img src="../assets/img/icon/loved.svg" class="love-image" v-if="lVideo.isLoved">
</div>
<span>{{ $likeNum(lVideo.digg_count) }}</span>
</div>
@ -41,11 +37,11 @@
<span>{{ $likeNum(lVideo.comment_count) }}</span>
</div>
<div v-if="!isMy" class="share mb4r" @click.stop="$emit('showShare')">
<img src="../assets/img/icon/share.svg" alt="" class="share-image">
<img src="../assets/img/icon/share-white-full.png" alt="" class="share-image">
<span>{{ $likeNum(lVideo.share_count) }}</span>
</div>
<div v-else class="share mb4r" @click.stop="$emit('showShare')">
<img src="../assets/img/icon/share.svg" alt="" class="share-image">
<img src="../assets/img/icon/share-white-full.png" alt="" class="share-image">
</div>
<BaseMusic
:cover="lVideo.music.cover"
@ -364,19 +360,6 @@ export default {
transform: scale(0);
}
.comment-status-enter-active,
.comment-status-leave-active {
transition: transform 0.5s linear;
}
.comment-status-move {
transition: transform 0.5s ease;
}
.comment-status-enter-from,
.comment-status-leave-to {
transform: scale(0);
}
.video-wrapper {
position: relative;

View File

@ -1,8 +1,8 @@
export default {
// baseUrl: 'http://192.168.0.103/index.php/v1',
// filePreview:'http://192.168.0.103/static/uploads/',
baseUrl: 'http://192.168.10.164/index.php/v1',
filePreview:'http://192.168.10.164/static/uploads/'
baseUrl: 'http://192.168.0.105/index.php/v1',
filePreview:'http://192.168.0.105/static/uploads/',
// baseUrl: 'http://192.168.10.164/index.php/v1',
// filePreview:'http://192.168.10.164/static/uploads/'
// baseUrl: 'http://localhost/index.php/v1',
// filePreview:'http://localhost/static/uploads/'
}

View File

@ -1,7 +1,7 @@
<template>
<div class="Test">
<Video1
:play="true"
:is-play="false"
:video="item"
:index="0"
/>

File diff suppressed because it is too large Load Diff

View File

@ -132,7 +132,7 @@
<img src="../../assets/img/icon/me/lock-gray.png" alt="">
<span>只有你能看到设为私密的作品和日常</span>
</div>
<Posters v-if="videos.private.total !== -1" mode="private" :list="videos.private.list"></Posters>
<Posters v-if="videos.private.total !== -1" mode="date" :list="videos.private.list"></Posters>
<Loading v-if="loadings.loading1" :is-full-screen="false"></Loading>
<no-more v-else/>
</SlideItem>