diff --git a/src/components/slide/SlideColumnList.vue b/src/components/slide/SlideColumnList.vue
index 598a3a5..89b40ec 100644
--- a/src/components/slide/SlideColumnList.vue
+++ b/src/components/slide/SlideColumnList.vue
@@ -64,24 +64,33 @@ export default {
watchList: {
handler(newVal, oldVal) {
if (!this.virtual) return
- // console.log(this.currentSlideItemIndex)
- let endLength = newVal.length
- if (newVal.length - oldVal.length > (this.defaultVirtualItemTotal - 1) / 2) {
- endLength = oldVal.length + (this.defaultVirtualItemTotal - 1) / 2
- }
- let that = this
- newVal.slice(oldVal.length, endLength).map((item, index) => {
- this.slideList.appendChild(this.getInsEl(item, oldVal.length + index))
- this.appInsMap.get($("#base-slide-list .base-slide-item:first").data('index')).unmount()
- // $("#base-slide-list .base-slide-item:first").remove()
- $(".base-slide-item").each(function () {
- $(this).css('top',
- ((endLength - oldVal.length) > 1 ?
- (that.currentSlideItemIndex - 2) :
- (that.currentSlideItemIndex - 3)) *
- that.wrapperHeight)
+ if (oldVal.length === 0) {
+ this.list.slice(0, (this.defaultVirtualItemTotal + 1) / 2).map((item, index) => {
+ this.slideList.appendChild(this.getInsEl(item, index))
})
- })
+ } else {
+ // console.log(this.currentSlideItemIndex)
+ let endLength = newVal.length
+ if (newVal.length - oldVal.length > (this.defaultVirtualItemTotal - 1) / 2) {
+ endLength = oldVal.length + (this.defaultVirtualItemTotal - 1) / 2
+ }
+ let that = this
+ // newVal.slice(oldVal.length, endLength).map((item, index) => {
+ // this.slideList.appendChild(this.getInsEl(item, oldVal.length + index))
+ // let appIns = this.appInsMap.get($("#base-slide-list .base-slide-item:first").data('index'))
+ // if (appIns) {
+ // appIns.unmount()
+ // }
+ // // $("#base-slide-list .base-slide-item:first").remove()
+ // $(".base-slide-item").each(function () {
+ // $(this).css('top',
+ // ((endLength - oldVal.length) > 1 ?
+ // (that.currentSlideItemIndex - 2) :
+ // (that.currentSlideItemIndex - 3)) *
+ // that.wrapperHeight)
+ // })
+ // })
+ }
},
deep: true
}
@@ -185,13 +194,11 @@ export default {
if (Math.abs(this.moveYDistance) < 20) gapTime = 1000
if (Math.abs(this.moveYDistance) > (this.wrapperHeight / 3)) gapTime = 100
if (gapTime < 150) {
-
if (this.isDrawDown) {
this.currentSlideItemIndex += 1
} else {
this.currentSlideItemIndex -= 1
}
-
// console.log(this.slideItems.length)
let that = this
if (this.virtual) {
@@ -204,7 +211,7 @@ export default {
&& this.currentSlideItemIndex >= (this.defaultVirtualItemTotal + 1) / 2
&& this.currentSlideItemIndex <= this.list.length - 3
) {
- let videos = $(`#base-slide-list .video-slide-item[data-index=${addItemIndex}]`)
+ let res = $(`#base-slide-list .video-slide-item[data-index=${addItemIndex}]`)
// console.log(videos)
if (res.length === 0) {
this.slideList.appendChild(this.getInsEl(this.list[addItemIndex], addItemIndex))
diff --git a/src/main.js b/src/main.js
index c31cb6a..20e2531 100644
--- a/src/main.js
+++ b/src/main.js
@@ -10,6 +10,7 @@ import mixin from "./utils/mixin";
const app = Vue.createApp(App)
app.config.globalProperties.$api = {...api}
+// app.config.compilerOptions.isCustomElement = tag => tag.startsWith('video1')
app.provide('mitt', mitt())
app.mixin(mixin)
diff --git a/src/pages/home/Attention.vue b/src/pages/home/Attention.vue
index 2246599..4900aa9 100644
--- a/src/pages/home/Attention.vue
+++ b/src/pages/home/Attention.vue
@@ -278,8 +278,6 @@ export default {
}
this.items.push(temp)
}
- // this.$console(this.items)
-
setTimeout(() => {
this.refs.scroller = this.$refs["scroller"]
this.refs.wrapper = this.$refs["wrapper"]
@@ -288,9 +286,7 @@ export default {
},
methods: {
scrollToTop(e) {
- let current = e.currentTarget;
- console.log(current.getBoundingClientRect())
- console.log(current.offsetTop)
+ let current = e.currentTarget
this.refs.scroller.scrollTop = current.offsetTop - this.headerHeight - 30
},
start(e) {
diff --git a/src/pages/home/Index2.vue b/src/pages/home/Index2.vue
index d944165..2aae8f8 100644
--- a/src/pages/home/Index2.vue
+++ b/src/pages/home/Index2.vue
@@ -172,124 +172,15 @@ import Share from "../../components/Share";
import SlideColumnList from "../../components/slide/SlideColumnList";
import SlideRowList from "../../components/slide/SlideRowList";
import Me from '../me/Me'
+
export default {
name: "HomeIndex",
- components: {SlideColumnList, SlideRowList, Video1, Comment, Share,Me},
+ components: {SlideColumnList, SlideRowList, Video1, Comment, Share, Me},
data() {
return {
- videos1: [
- {
- // videoUrl: mp40,
- videoUrl: 'http://qvutp218u.hn-bkt.clouddn.com/0.mp4',
- videoPoster: src1Bg,
- isLoved: true,
- loves: 1234,
- comments: 666,
- shared: 999,
- duration: 99
- },
- {
- // videoUrl: mp41,
- videoUrl: 'http://qvutp218u.hn-bkt.clouddn.com/1.mp4',
- videoPoster: src1Bg,
- isLoved: true,
- loves: 1234,
- comments: 666,
- shared: 999,
- duration: 99
- },
- {
- // videoUrl: mp42,
- videoUrl: 'http://qvutp218u.hn-bkt.clouddn.com/2.mp4',
- videoPoster: src1Bg,
- isLoved: false,
- loves: 1234,
- comments: 666,
- shared: 999,
- duration: 99
- },
- {
- // videoUrl: mp43,
- videoUrl: 'http://qvutp218u.hn-bkt.clouddn.com/3.mp4',
- videoPoster: src1Bg,
- isLoved: false,
- loves: 1234,
- comments: 666,
- shared: 999,
- duration: 99
- },
- {
- // videoUrl: mp44,
- videoUrl: 'http://qvutp218u.hn-bkt.clouddn.com/4.mp4',
- videoPoster: src1Bg,
- isLoved: false,
- loves: 1234,
- comments: 666,
- shared: 999,
- duration: 99
- },
- {
- // videoUrl: mp45,
- videoUrl: 'http://qvutp218u.hn-bkt.clouddn.com/5.mp4',
- videoPoster: src1Bg,
- isLoved: false,
- loves: 1234,
- comments: 666,
- shared: 999,
- duration: 99
- },
- {
- // videoUrl: mp46,
- videoUrl: 'http://qvutp218u.hn-bkt.clouddn.com/6.mp4',
- videoPoster: src1Bg,
- isLoved: false,
- loves: 1234,
- comments: 666,
- shared: 999,
- duration: 99
- },
- {
- // videoUrl: mp47,
- videoUrl: 'http://qvutp218u.hn-bkt.clouddn.com/7.mp4',
- videoPoster: src1Bg,
- isLoved: false,
- loves: 1234,
- comments: 666,
- shared: 999,
- duration: 99
- },
- {
- // videoUrl: mp48,
- videoUrl: 'http://qvutp218u.hn-bkt.clouddn.com/8.mp4',
- videoPoster: src1Bg,
- isLoved: false,
- loves: 1234,
- comments: 666,
- shared: 999,
- duration: 99
- },
- {
- // videoUrl: mp49,
- videoUrl: 'http://qvutp218u.hn-bkt.clouddn.com/9.mp4',
- videoPoster: src1Bg,
- isLoved: false,
- loves: 1234,
- comments: 666,
- shared: 999,
- duration: 99
- },
- {
- // videoUrl: mp410,
- videoUrl: 'http://qvutp218u.hn-bkt.clouddn.com/10.mp4',
- videoPoster: src1Bg,
- isLoved: false,
- loves: 1234,
- comments: 666,
- shared: 999,
- duration: 99
- },
- ],
- videos: [
+ webVideos: [],
+ videos: [],
+ localVideos: [
{
videoUrl: mp40,
// videoUrl: 'http://qvutp218u.hn-bkt.clouddn.com/0.mp4',
@@ -406,6 +297,10 @@ export default {
videoActiveIndex: 0,
baseActiveIndex: 0,
activeIndex: 1,
+ totalSize: 52,
+ pageSize: 10,
+ pageNo: 1,
+ loading: false,
render: (item, itemIndex) => {
return (
@@ -424,7 +319,7 @@ export default {
},
watch: {
videoActiveIndex(newVal) {
- // console.log(newVal)
+ console.log(newVal)
$(".video-slide-item").each(function () {
let video = $(this).find('video')
if ($(this).data('index') === newVal) {
@@ -436,142 +331,39 @@ export default {
}, 100)
}
})
- // if (newVal >= this.videos.length - 3) {
- if (false) {
- [
- {
- videoUrl: mp40,
- // videoUrl: 'http://babylife.qiniudn.com/FtRVyPQHHocjVYjeJSrcwDkApTLQ',
- videoPoster: src1Bg,
- isLoved: true,
- loves: 1234,
- comments: 666,
- shared: 999,
- duration: 99
- },
- {
- videoUrl: mp41,
- // videoUrl: 'http://babylife.qiniudn.com/FtRVyPQHHocjVYjeJSrcwDkApTLQ',
- videoPoster: src1Bg,
- isLoved: true,
- loves: 1234,
- comments: 666,
- shared: 999,
- duration: 99
- },
- {
- videoUrl: mp42,
- // videoUrl: 'http://babylife.qiniudn.com/FtRVyPQHHocjVYjeJSrcwDkApTLQ',
- videoPoster: src1Bg,
- isLoved: false,
- loves: 1234,
- comments: 666,
- shared: 999,
- duration: 99
- },
- {
- videoUrl: mp43,
- // videoUrl: 'http://babylife.qiniudn.com/FtRVyPQHHocjVYjeJSrcwDkApTLQ',
- videoPoster: src1Bg,
- isLoved: false,
- loves: 1234,
- comments: 666,
- shared: 999,
- duration: 99
- },
- {
- videoUrl: mp44,
- // videoUrl: 'http://babylife.qiniudn.com/FtRVyPQHHocjVYjeJSrcwDkApTLQ',
- videoPoster: src1Bg,
- isLoved: false,
- loves: 1234,
- comments: 666,
- shared: 999,
- duration: 99
- },
- ].map(v => {
- this.videos.push(v)
- })
-
+ if (newVal >= this.videos.length - 3 && newVal < this.totalSize) {
+ if (this.loading) return
+ this.pageNo++
+ this.getData()
}
}
},
created() {
- if (process.env.NODE_ENV !== 'development') {
- this.videos = this.$clone(this.videos1)
- }
+ this.getData()
},
mounted() {
this.height = document.body.clientHeight
this.width = document.body.clientWidth
},
methods: {
+ async getData() {
+ this.loading = true
+ let res = await this.$api.videos.recommended({pageNo: this.pageNo, pageSize: this.pageSize})
+ this.loading = false
+ if (res.code === this.SUCCESS_CODE) {
+ this.totalSize = res.data.count
+ this.videos = this.videos.concat(res.data.list)
+ // this.videos = this.$clone(this.localVideos)
+ } else {
+ this.pageNo--
+ }
+ },
t(e) {
console.log(e)
},
end() {
console.log('end')
- setTimeout(() => {
- [
- {
- videoUrl: mp40,
- // videoUrl: 'http://babylife.qiniudn.com/FtRVyPQHHocjVYjeJSrcwDkApTLQ',
- videoPoster: src1Bg,
- isLoved: true,
- loves: 1234,
- comments: 666,
- shared: 999,
- duration: 99
- },
- // {
- // videoUrl: mp41,
- // // videoUrl: 'http://babylife.qiniudn.com/FtRVyPQHHocjVYjeJSrcwDkApTLQ',
- // videoPoster: src1Bg,
- // isLoved: true,
- // loves: 1234,
- // comments: 666,
- // shared: 999,
- // duration: 99
- // },
- // {
- // videoUrl: mp42,
- // // videoUrl: 'http://babylife.qiniudn.com/FtRVyPQHHocjVYjeJSrcwDkApTLQ',
- // videoPoster: src1Bg,
- // isLoved: false,
- // loves: 1234,
- // comments: 666,
- // shared: 999,
- // duration: 99
- // },
- // {
- // videoUrl: mp43,
- // // videoUrl: 'http://babylife.qiniudn.com/FtRVyPQHHocjVYjeJSrcwDkApTLQ',
- // videoPoster: src1Bg,
- // isLoved: false,
- // loves: 1234,
- // comments: 666,
- // shared: 999,
- // duration: 99
- // },
- // {
- // videoUrl: mp44,
- // // videoUrl: 'http://babylife.qiniudn.com/FtRVyPQHHocjVYjeJSrcwDkApTLQ',
- // videoPoster: src1Bg,
- // isLoved: false,
- // loves: 1234,
- // comments: 666,
- // shared: 999,
- // duration: 99
- // },
- ].map(v => {
- this.videos.push(v)
- })
- this.$refs.slideList.checkChildren()
-
- console.log('ok')
- }, 1000)
}
-
}
}
diff --git a/src/pages/home/Test.vue b/src/pages/home/Test.vue
deleted file mode 100644
index 367f46b..0000000
--- a/src/pages/home/Test.vue
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
- 分段拍
- 快拍
- 影集
- 开直播
-
-
-
-
-
-
diff --git a/src/pages/home/testt.vue b/src/pages/home/testt.vue
deleted file mode 100644
index 1567da2..0000000
--- a/src/pages/home/testt.vue
+++ /dev/null
@@ -1,191 +0,0 @@
-
-
-
-
-
- 下拉更新
- 松开更新
- 更新中
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/pages/me/Me.vue b/src/pages/me/Me.vue
index f9d56a6..e78040f 100644
--- a/src/pages/me/Me.vue
+++ b/src/pages/me/Me.vue
@@ -1,99 +1,213 @@
-
-
-
-
-
-

-
切换账号
-
-
-

-

+
+
+
+
+

+
切换账号
+
+
+
-
-
-
-

-