|
@@ -148,7 +148,15 @@
|
|
import ARow from 'ant-design-vue/es/grid/Row'
|
|
import ARow from 'ant-design-vue/es/grid/Row'
|
|
import ACol from 'ant-design-vue/es/grid/Col'
|
|
import ACol from 'ant-design-vue/es/grid/Col'
|
|
import axios from 'axios'
|
|
import axios from 'axios'
|
|
-import { getLoginQr, getUserList, getLoginStatus, getVideoList, getCommentList, commentDelete,getAccountReport } from '@api/video.js'
|
|
|
|
|
|
+import {
|
|
|
|
+ getLoginQr,
|
|
|
|
+ getUserList,
|
|
|
|
+ getLoginStatus,
|
|
|
|
+ getVideoList,
|
|
|
|
+ getCommentList,
|
|
|
|
+ commentDelete,
|
|
|
|
+ getAccountReport
|
|
|
|
+} from '@api/video.js'
|
|
export default {
|
|
export default {
|
|
name: 'videoList',
|
|
name: 'videoList',
|
|
components: {
|
|
components: {
|
|
@@ -181,6 +189,7 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
handleChange(value) {
|
|
handleChange(value) {
|
|
this.ksid = value
|
|
this.ksid = value
|
|
|
|
+ this.dataShow = []
|
|
this.getVideoList(value, null)
|
|
this.getVideoList(value, null)
|
|
// this.getTest()
|
|
// this.getTest()
|
|
},
|
|
},
|
|
@@ -212,38 +221,52 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
getVideoList(ksid, pcursor) {
|
|
getVideoList(ksid, pcursor) {
|
|
- if (pcursor) {
|
|
|
|
- } else {
|
|
|
|
- this.dataShow = []
|
|
|
|
- }
|
|
|
|
|
|
+ var that = this
|
|
getVideoList({ ksid: ksid, pcursor: pcursor }).then(res => {
|
|
getVideoList({ ksid: ksid, pcursor: pcursor }).then(res => {
|
|
if (res.code == 0) {
|
|
if (res.code == 0) {
|
|
- var data = res.result.data.publicFeeds.list
|
|
|
|
|
|
+ var data = res.result.data.publicFeeds.list.map(item => {
|
|
|
|
+ return {
|
|
|
|
+ ...item,
|
|
|
|
+ commentList: []
|
|
|
|
+ }
|
|
|
|
+ })
|
|
this.pcursor = res.result.data.publicFeeds.pcursor
|
|
this.pcursor = res.result.data.publicFeeds.pcursor
|
|
- for (let i = 0; i < data.length; i++) {
|
|
|
|
- this.getCommentList(ksid, data[i].photoId).then(dataOne => {
|
|
|
|
- if (dataOne) {
|
|
|
|
- var a = { ...data[i], ...dataOne }
|
|
|
|
- } else {
|
|
|
|
- var a = { ...data[i], commentList: [] }
|
|
|
|
- }
|
|
|
|
|
|
+ this.dataShow.push(...data)
|
|
|
|
+ var i = 0
|
|
|
|
+ // for (let i = 0; i < data.length; i++) {
|
|
|
|
+ setInterval(() => {
|
|
|
|
+ if (i < that.dataShow.length) {
|
|
|
|
+ setTimeout(
|
|
|
|
+ that.getCommentList(ksid, that.dataShow[i].photoId).then(dataOne => {
|
|
|
|
+ console.log(dataOne)
|
|
|
|
+ if (dataOne) {
|
|
|
|
+ that.dataShow[i].commentList = dataOne
|
|
|
|
+ }
|
|
|
|
+ // commentList
|
|
|
|
+ i++
|
|
|
|
+ }),
|
|
|
|
+ 0
|
|
|
|
+ )
|
|
|
|
+ } else {
|
|
|
|
+ }
|
|
|
|
+ }, 3000)
|
|
|
|
|
|
- // commentList
|
|
|
|
- this.dataShow.push(a)
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
getCommentList(ksid, photoId) {
|
|
getCommentList(ksid, photoId) {
|
|
return new Promise(function(resolve) {
|
|
return new Promise(function(resolve) {
|
|
- getCommentList({ ksid: ksid, photoId: photoId }).then(res => {
|
|
|
|
|
|
+ getCommentList({ ksid: ksid, photoId: photoId, pcursor: null }).then(res => {
|
|
if (res.code == 0) {
|
|
if (res.code == 0) {
|
|
- resolve(res.result.data.shortVideoCommentList)
|
|
|
|
|
|
+ resolve(res.result.data.shortVideoCommentList.commentList)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ sleep(d) {
|
|
|
|
+ return new Promise(resolve => setTimeout(resolve, d))
|
|
|
|
+ },
|
|
remove(allItem, item, index) {
|
|
remove(allItem, item, index) {
|
|
console.log(allItem, item)
|
|
console.log(allItem, item)
|
|
allItem.commentList.splice(index, 1)
|
|
allItem.commentList.splice(index, 1)
|
|
@@ -308,16 +331,16 @@ export default {
|
|
// 其他时候把下拉刷新置为true
|
|
// 其他时候把下拉刷新置为true
|
|
_this.pullRefreshss = true
|
|
_this.pullRefreshss = true
|
|
}
|
|
}
|
|
- },
|
|
|
|
|
|
+ }
|
|
},
|
|
},
|
|
watch: {},
|
|
watch: {},
|
|
mounted: function() {
|
|
mounted: function() {
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
var that = this
|
|
var that = this
|
|
this.getUserList()
|
|
this.getUserList()
|
|
- getAccountReport().then(res=>{
|
|
|
|
- console.log(res)
|
|
|
|
- })
|
|
|
|
|
|
+ // getAccountReport().then(res => {
|
|
|
|
+ // console.log(res)
|
|
|
|
+ // })
|
|
window.setInterval(() => {
|
|
window.setInterval(() => {
|
|
if (that.showCode) {
|
|
if (that.showCode) {
|
|
setTimeout(function() {
|
|
setTimeout(function() {
|
|
@@ -346,7 +369,7 @@ export default {
|
|
}, 1000)
|
|
}, 1000)
|
|
window.onscroll = function() {
|
|
window.onscroll = function() {
|
|
if (that.ksid) {
|
|
if (that.ksid) {
|
|
- if (that.pcursor != 'nor_mal') {
|
|
|
|
|
|
+ if (that.pcursor != 'no_more') {
|
|
that.scrollChange()
|
|
that.scrollChange()
|
|
}
|
|
}
|
|
}
|
|
}
|