更新readme
This commit is contained in:
parent
5c9d1fc435
commit
abc5b15ff5
32
README.md
32
README.md
@ -6,10 +6,38 @@
|
|||||||
|
|
||||||
## 开发进度
|
## 开发进度
|
||||||
|
|
||||||
|
☑
|
||||||
|
|
||||||
页面|进度
|
页面|进度
|
||||||
---|---
|
---|---
|
||||||
首页| ☑
|
首页|50%
|
||||||
首页|<input type="checkbox" checked>
|
-- 音乐|☑
|
||||||
|
-- 抖音音乐榜|☑
|
||||||
|
-- 搜索|50%;
|
||||||
|
-- 直播|50%;
|
||||||
|
朋友|0%
|
||||||
|
消息|80%
|
||||||
|
我|90%
|
||||||
|
-- 关注|0
|
||||||
|
-- 粉丝|0
|
||||||
|
-- 编辑资料|☑
|
||||||
|
-- 添加朋友|☑
|
||||||
|
-- 我的音乐|30%
|
||||||
|
-- 抖音商城|0
|
||||||
|
-- 我的订单|0
|
||||||
|
-- 钱包|0
|
||||||
|
-- 我的二维码|☑
|
||||||
|
-- 我的二维码|☑
|
||||||
|
-- 设置|30%
|
||||||
|
首页|
|
||||||
|
首页|
|
||||||
|
首页|
|
||||||
|
首页|
|
||||||
|
首页|
|
||||||
|
首页|
|
||||||
|
首页|
|
||||||
|
首页|
|
||||||
|
首页|
|
||||||
|
|
||||||
## 目标功能
|
## 目标功能
|
||||||
|
|
||||||
|
|||||||
@ -20,4 +20,10 @@ export default {
|
|||||||
recommended(params, data) {
|
recommended(params, data) {
|
||||||
return request({url: '/video/recommended', method: 'get', params, data})
|
return request({url: '/video/recommended', method: 'get', params, data})
|
||||||
},
|
},
|
||||||
|
historyVideo(params, data) {
|
||||||
|
return request({url: '/video/historyVideo', method: 'get', params, data})
|
||||||
|
},
|
||||||
|
historyOther(params, data) {
|
||||||
|
return request({url: '/video/historyOther', method: 'get', params, data})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
@ -1,4 +1,5 @@
|
|||||||
@footer-height: 6rem;
|
@footer-height: 6rem;
|
||||||
@header-height: 6rem;
|
@header-height: 6.1rem;
|
||||||
|
@indicator-height: 5rem;
|
||||||
|
|
||||||
@padding-page: 1.5rem;
|
@padding-page: 1.5rem;
|
||||||
@ -123,7 +123,7 @@ export default {
|
|||||||
.indicator-ctn {
|
.indicator-ctn {
|
||||||
font-size: 1.4rem;
|
font-size: 1.4rem;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 5rem;
|
height: @indicator-height;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
|
|||||||
@ -35,52 +35,53 @@ Mock.mock(/recommended/, options => {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
Mock.Random.extend({
|
// Mock.Random.extend({
|
||||||
imgs: function (date) {
|
// imgs: function (date) {
|
||||||
return this.pick([
|
// return this.pick([
|
||||||
require('../assets/img/poster/1.jpg'),
|
// require('../assets/img/poster/1.jpg'),
|
||||||
require('../assets/img/poster/2.jpg'),
|
// require('../assets/img/poster/2.jpg'),
|
||||||
require('../assets/img/poster/3.jpg'),
|
// require('../assets/img/poster/3.jpg'),
|
||||||
require('../assets/img/poster/4.jpg'),
|
// require('../assets/img/poster/4.jpg'),
|
||||||
require('../assets/img/poster/5.jpg'),
|
// require('../assets/img/poster/5.jpg'),
|
||||||
require('../assets/img/poster/6.jpg'),
|
// require('../assets/img/poster/6.jpg'),
|
||||||
require('../assets/img/poster/7.jpg'),
|
// require('../assets/img/poster/7.jpg'),
|
||||||
require('../assets/img/poster/8.jpg'),
|
// require('../assets/img/poster/8.jpg'),
|
||||||
require('../assets/img/poster/9.jpg'),
|
// require('../assets/img/poster/9.jpg'),
|
||||||
require('../assets/img/poster/10.jpg'),
|
// require('../assets/img/poster/10.jpg'),
|
||||||
require('../assets/img/poster/11.jpg'),
|
// require('../assets/img/poster/11.jpg'),
|
||||||
])
|
// ])
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
!(function me() {
|
// !(function me() {
|
||||||
let my = {total: Mock.Random.natural(1, 20)}
|
// let my = {total: Mock.Random.natural(1, 20)}
|
||||||
my[`list|${my.total > 10 ? 10 : my.total}`] = [{'like|10000-990000': 1000000, src: '@imgs'}]
|
// my[`list|${my.total > 10 ? 10 : my.total}`] = [{'like|10000-990000': 1000000, src: '@imgs'}]
|
||||||
|
//
|
||||||
let private1 = {total: Mock.Random.natural(1, 20)}
|
// let private1 = {total: Mock.Random.natural(1, 20)}
|
||||||
private1[`list|${private1.total > 10 ? 10 : private1.total}`] = [{'like|10000-990000': 1000000, src: '@imgs'}]
|
// private1[`list|${private1.total > 10 ? 10 : private1.total}`] = [{'like|10000-990000': 1000000, src: '@imgs'}]
|
||||||
|
//
|
||||||
let like = {total: Mock.Random.natural(1, 20)}
|
// let like = {total: Mock.Random.natural(1, 20)}
|
||||||
like[`list|${like.total > 10 ? 10 : like.total}`] = [{'like|10000-990000': 1000000, src: '@imgs'}]
|
// like[`list|${like.total > 10 ? 10 : like.total}`] = [{'like|10000-990000': 1000000, src: '@imgs'}]
|
||||||
|
//
|
||||||
let collect = {total: Mock.Random.natural(1, 20)}
|
// let collect = {total: Mock.Random.natural(1, 20)}
|
||||||
collect[`list|${collect.total > 10 ? 10 : collect.total}`] = [{'like|10000-990000': 1000000, src: '@imgs'}]
|
// collect[`list|${collect.total > 10 ? 10 : collect.total}`] = [{'like|10000-990000': 1000000, src: '@imgs'}]
|
||||||
|
//
|
||||||
const data = Mock.mock({
|
// const data = Mock.mock({
|
||||||
'data': {
|
// 'data': {
|
||||||
my,
|
// my,
|
||||||
private: private1,
|
// private: private1,
|
||||||
like,
|
// like,
|
||||||
collect
|
// collect
|
||||||
},
|
// },
|
||||||
code: 200,
|
// code: 200,
|
||||||
msg: '',
|
// msg: '',
|
||||||
})
|
// })
|
||||||
Mock.mock('me', data)
|
// Mock.mock('me', data)
|
||||||
}())
|
// }())
|
||||||
|
|
||||||
|
|
||||||
Mock.mock(/my/, options => {
|
Mock.mock(/my/, options => {
|
||||||
let page = getPage(options)
|
let page = getPage(options)
|
||||||
|
console.log('mock', page)
|
||||||
return Mock.mock({
|
return Mock.mock({
|
||||||
data: {
|
data: {
|
||||||
pageNo: page.pageNo,
|
pageNo: page.pageNo,
|
||||||
@ -94,7 +95,7 @@ Mock.mock(/like/, options => {
|
|||||||
return Mock.mock({
|
return Mock.mock({
|
||||||
data: {
|
data: {
|
||||||
pageNo: page.pageNo,
|
pageNo: page.pageNo,
|
||||||
total: resource.my.length,
|
total: resource.like.length,
|
||||||
list: resource.like.slice(page.offset, page.limit),
|
list: resource.like.slice(page.offset, page.limit),
|
||||||
}, code: 200, msg: '',
|
}, code: 200, msg: '',
|
||||||
})
|
})
|
||||||
@ -104,7 +105,7 @@ Mock.mock(/private1/, options => {
|
|||||||
return Mock.mock({
|
return Mock.mock({
|
||||||
data: {
|
data: {
|
||||||
pageNo: page.pageNo,
|
pageNo: page.pageNo,
|
||||||
total: resource.my.length,
|
total: resource.private1.length,
|
||||||
list: resource.private1.slice(page.offset, page.limit),
|
list: resource.private1.slice(page.offset, page.limit),
|
||||||
}, code: 200, msg: '',
|
}, code: 200, msg: '',
|
||||||
})
|
})
|
||||||
@ -125,3 +126,24 @@ Mock.mock(/collect/, options => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Mock.mock(/historyVideo/, options => {
|
||||||
|
let page = getPage(options)
|
||||||
|
return Mock.mock({
|
||||||
|
data: {
|
||||||
|
pageNo: page.pageNo,
|
||||||
|
// total: resource.my.length,
|
||||||
|
total: 50,
|
||||||
|
list: resource.my.slice(page.offset, page.limit),
|
||||||
|
}, code: 200, msg: '',
|
||||||
|
})
|
||||||
|
})
|
||||||
|
Mock.mock(/historyOther/, options => {
|
||||||
|
let page = getPage(options)
|
||||||
|
return Mock.mock({
|
||||||
|
data: {
|
||||||
|
pageNo: page.pageNo,
|
||||||
|
total: 0,
|
||||||
|
list: [],
|
||||||
|
}, code: 200, msg: '',
|
||||||
|
})
|
||||||
|
})
|
||||||
@ -43,6 +43,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<Posters mode="music" :list="videos"/>
|
<Posters mode="music" :list="videos"/>
|
||||||
<Loading :is-full-screen="false" v-if="loading"/>
|
<Loading :is-full-screen="false" v-if="loading"/>
|
||||||
|
<NoMore v-else/>
|
||||||
</Scroll>
|
</Scroll>
|
||||||
</div>
|
</div>
|
||||||
<div class="options">
|
<div class="options">
|
||||||
@ -124,8 +125,10 @@ export default {
|
|||||||
|
|
||||||
showDouyinCode: false,
|
showDouyinCode: false,
|
||||||
audio: new Audio(),
|
audio: new Audio(),
|
||||||
|
total: 0,
|
||||||
videos: resource.my,
|
pageNo: 0,
|
||||||
|
pageSize: 15,
|
||||||
|
videos: [],
|
||||||
|
|
||||||
music: {
|
music: {
|
||||||
name: '发如雪',
|
name: '发如雪',
|
||||||
@ -159,17 +162,28 @@ export default {
|
|||||||
if (this.$route.query.name) {
|
if (this.$route.query.name) {
|
||||||
this.music = this.$route.query
|
this.music = this.$route.query
|
||||||
}
|
}
|
||||||
|
this.loadData(true)
|
||||||
},
|
},
|
||||||
computed: {},
|
computed: {},
|
||||||
methods: {
|
methods: {
|
||||||
toggleCollect() {
|
toggleCollect() {
|
||||||
this.isCollect = !this.isCollect
|
this.isCollect = !this.isCollect
|
||||||
},
|
},
|
||||||
async loadData() {
|
async loadData(init = false) {
|
||||||
|
if (this.loading) return
|
||||||
|
if (!init) {
|
||||||
|
if (this.total <= this.videos.length) {
|
||||||
|
return this.$notice('暂时没有更多了')
|
||||||
|
}
|
||||||
|
this.pageNo++
|
||||||
|
}
|
||||||
this.loading = true
|
this.loading = true
|
||||||
await this.$sleep(1500)
|
let res = await this.$api.videos.my({pageNo: this.pageNo, pageSize: this.pageSize,})
|
||||||
this.videos = this.videos.concat(this.videos2)
|
|
||||||
this.loading = false
|
this.loading = false
|
||||||
|
if (res.code === this.SUCCESS) {
|
||||||
|
this.videos = this.videos.concat(res.data.list)
|
||||||
|
this.total = res.data.total
|
||||||
|
}
|
||||||
},
|
},
|
||||||
togglePlay() {
|
togglePlay() {
|
||||||
this.isPlay = !this.isPlay
|
this.isPlay = !this.isPlay
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
<template v-slot:center>
|
<template v-slot:center>
|
||||||
<span class="f16">观看历史</span>
|
<span class="f16">观看历史</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:right v-if="list">
|
<template v-slot:right v-if="isClear">
|
||||||
<span class="second-text-color f13" @click="clear">清空</span>
|
<span class="second-text-color f13" @click="clear">清空</span>
|
||||||
</template>
|
</template>
|
||||||
</BaseHeader>
|
</BaseHeader>
|
||||||
@ -12,23 +12,28 @@
|
|||||||
<Indicator
|
<Indicator
|
||||||
style="width: calc(100vw - 2rem); margin-left: 1rem;"
|
style="width: calc(100vw - 2rem); margin-left: 1rem;"
|
||||||
tabStyleWidth="50%"
|
tabStyleWidth="50%"
|
||||||
:tabTexts="['熟人列表','发现熟人']"
|
:tabTexts="['视频','影视综']"
|
||||||
v-model:active-index="currentSlideItemIndex">
|
v-model:active-index="currentSlideItemIndex">
|
||||||
</Indicator>
|
</Indicator>
|
||||||
<SlideRowList v-model:active-index="currentSlideItemIndex" style="height: calc(100vh - 12rem);">
|
<SlideRowList v-model:active-index="currentSlideItemIndex" class="SlideRowList">
|
||||||
<SlideItem class="tab1" style="overflow:auto;">
|
<SlideItem class="tab1" style="overflow:auto;">
|
||||||
<Posters :list="list" v-if="list"></Posters>
|
<Scroll class="Scroll"
|
||||||
|
@pulldown="getHistoryVideo">
|
||||||
|
<Posters :list="historyVideo.list" v-if="historyVideo.total"></Posters>
|
||||||
|
<Loading :is-full-screen="false" v-if="loadingVideo"/>
|
||||||
|
<template v-else>
|
||||||
|
<NoMore v-if="historyVideo.list.length"/>
|
||||||
<div class="empty" v-else>
|
<div class="empty" v-else>
|
||||||
<img src="../../../assets/img/icon/head-image.jpeg" alt="">
|
<img src="../../../assets/img/icon/none-bg1.webp" alt="">
|
||||||
<div class="title">暂无内容</div>
|
<div class="title">暂无观看历史记录</div>
|
||||||
<div class="subtitle">暂无观看历史记录</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</template>
|
||||||
|
</Scroll>
|
||||||
</SlideItem>
|
</SlideItem>
|
||||||
<SlideItem class="tab2">
|
<SlideItem class="tab2">
|
||||||
<div class="empty">
|
<div class="empty">
|
||||||
<img src="../../../assets/img/icon/head-image.jpeg" alt="">
|
<img src="../../../assets/img/icon/none-bg1.webp" alt="">
|
||||||
<div class="title">暂无内容</div>
|
<div class="title">暂无观影历史记录</div>
|
||||||
<div class="subtitle">暂无观影历史记录</div>
|
|
||||||
</div>
|
</div>
|
||||||
</SlideItem>
|
</SlideItem>
|
||||||
</SlideRowList>
|
</SlideRowList>
|
||||||
@ -37,26 +42,88 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import Posters from "../../../components/Posters";
|
import Posters from "../../../components/Posters";
|
||||||
|
import Scroll from "../../../components/Scroll";
|
||||||
|
import NoMore from "../../../components/NoMore";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "lookHistory",
|
name: "lookHistory",
|
||||||
components: {
|
components: {
|
||||||
Posters
|
NoMore,
|
||||||
|
Posters,
|
||||||
|
Scroll
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
loadingVideo: false,
|
||||||
|
loadingOther: false,
|
||||||
|
isClearHistoryVideo: false,
|
||||||
|
isClearHistoryOther: false,
|
||||||
currentSlideItemIndex: 0,
|
currentSlideItemIndex: 0,
|
||||||
list: 2,
|
pageSize: 15,
|
||||||
|
historyVideo: {
|
||||||
|
total: 0,
|
||||||
|
pageNo: 0,
|
||||||
|
list: []
|
||||||
|
},
|
||||||
|
historyOther: {
|
||||||
|
total: 0,
|
||||||
|
pageNo: 0,
|
||||||
|
list: []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
isClear() {
|
||||||
|
if (this.currentSlideItemIndex === 0) {
|
||||||
|
return this.historyVideo.list = []
|
||||||
|
}
|
||||||
|
return this.historyOther.list = []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {},
|
|
||||||
created() {
|
created() {
|
||||||
|
this.getHistoryVideo(true)
|
||||||
|
this.getHistoryOther(true)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async getHistoryVideo(init = false) {
|
||||||
|
if (this.loadingVideo) return
|
||||||
|
if (this.isClearHistoryVideo) return
|
||||||
|
if (!init) {
|
||||||
|
if (this.historyVideo.total <= this.historyVideo.list.length) return
|
||||||
|
this.historyVideo.pageNo++
|
||||||
|
}
|
||||||
|
this.loadingVideo = true
|
||||||
|
let res = await this.$api.videos.historyVideo({pageNo: this.historyVideo.pageNo, pageSize: this.pageSize,})
|
||||||
|
console.log(res)
|
||||||
|
this.loadingVideo = false
|
||||||
|
if (res.code === this.SUCCESS) {
|
||||||
|
this.historyVideo.list = this.historyVideo.list.concat(res.data.list)
|
||||||
|
this.historyVideo.total = res.data.total
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async getHistoryOther(init = false) {
|
||||||
|
if (this.loadingOther) return
|
||||||
|
if (this.isClearHistoryOther) return
|
||||||
|
this.loadingOther = true
|
||||||
|
if (!init) {
|
||||||
|
this.historyOther.pageNo++
|
||||||
|
}
|
||||||
|
let res = await this.$api.videos.historyOther({pageNo: this.historyOther.pageNo, pageSize: this.pageSize,})
|
||||||
|
this.loadingOther = false
|
||||||
|
if (res.code === this.SUCCESS) {
|
||||||
|
this.historyOther.list = this.historyOther.list.concat(res.data.list)
|
||||||
|
this.historyOther.total = res.data.total
|
||||||
|
}
|
||||||
|
},
|
||||||
clear() {
|
clear() {
|
||||||
this.$showConfirmDialog('确定清空?', '清空后,以往观看记录不再展示', 'gray', () => {
|
this.$showConfirmDialog('确定清空?', '清空后,以往观看记录不再展示', 'gray', () => {
|
||||||
this.list = 0
|
if (this.currentSlideItemIndex === 0) {
|
||||||
console.log(this.list)
|
this.historyVideo.list = []
|
||||||
|
this.isClearHistoryVideo = true
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.historyOther.list = []
|
||||||
|
this.isClearHistoryVideo = true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -79,19 +146,22 @@ export default {
|
|||||||
.content {
|
.content {
|
||||||
padding-top: 6rem;
|
padding-top: 6rem;
|
||||||
|
|
||||||
|
.SlideRowList, .Scroll {
|
||||||
|
height: calc(100vh - @indicator-height - @header-height) !important;
|
||||||
|
}
|
||||||
|
|
||||||
.empty {
|
.empty {
|
||||||
height: 100%;
|
height: 70vh;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
.title {
|
img {
|
||||||
margin-top: 1rem;
|
height: 12rem;
|
||||||
font-size: 1.5rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.subtitle {
|
.title {
|
||||||
font-size: 1.3rem;
|
font-size: 1.3rem;
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
color: @second-text-color;
|
color: @second-text-color;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user