|
@@ -148,6 +148,7 @@
|
|
|
import ARow from 'ant-design-vue/es/grid/Row'
|
|
|
import ACol from 'ant-design-vue/es/grid/Col'
|
|
|
import axios from 'axios'
|
|
|
+var interval
|
|
|
import {
|
|
|
getLoginQr,
|
|
|
getUserList,
|
|
@@ -190,6 +191,7 @@ export default {
|
|
|
handleChange(value) {
|
|
|
this.ksid = value
|
|
|
this.dataShow = []
|
|
|
+ clearInterval(interval)
|
|
|
this.getVideoList(value, null)
|
|
|
// this.getTest()
|
|
|
},
|
|
@@ -222,6 +224,7 @@ export default {
|
|
|
},
|
|
|
getVideoList(ksid, pcursor) {
|
|
|
var that = this
|
|
|
+
|
|
|
getVideoList({ ksid: ksid, pcursor: pcursor }).then(res => {
|
|
|
if (res.code == 0) {
|
|
|
var data = res.result.data.publicFeeds.list.map(item => {
|
|
@@ -233,25 +236,29 @@ export default {
|
|
|
this.pcursor = res.result.data.publicFeeds.pcursor
|
|
|
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
|
|
|
+ interval = setInterval(() => {
|
|
|
+ if (i <= that.dataShow.length) {
|
|
|
+ ;(function(a) {
|
|
|
+ setTimeout(function() {
|
|
|
+ that.getCommentList(ksid, that.dataShow[a].photoId).then(dataOne => {
|
|
|
+ if (dataOne && that.dataShow[a]) {
|
|
|
+ that.dataShow[a].commentList = dataOne.commentList
|
|
|
+ } else {
|
|
|
+ that.dataShow[a].commentList = []
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }, 0)
|
|
|
+ if (that.dataShow.length == 0) {
|
|
|
+ clearInterval(interval)
|
|
|
+ i = 0
|
|
|
+ } else {
|
|
|
i++
|
|
|
- }),
|
|
|
- 0
|
|
|
- )
|
|
|
+ }
|
|
|
+ })(i)
|
|
|
} else {
|
|
|
+ clearInterval(interval)
|
|
|
}
|
|
|
- }, 3000)
|
|
|
-
|
|
|
- // }
|
|
|
+ }, 10000)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -259,7 +266,7 @@ export default {
|
|
|
return new Promise(function(resolve) {
|
|
|
getCommentList({ ksid: ksid, photoId: photoId, pcursor: null }).then(res => {
|
|
|
if (res.code == 0) {
|
|
|
- resolve(res.result.data.shortVideoCommentList.commentList)
|
|
|
+ resolve(res.result.data.shortVideoCommentList)
|
|
|
}
|
|
|
})
|
|
|
})
|
|
@@ -268,12 +275,12 @@ export default {
|
|
|
return new Promise(resolve => setTimeout(resolve, d))
|
|
|
},
|
|
|
remove(allItem, item, index) {
|
|
|
- console.log(allItem, item)
|
|
|
- allItem.commentList.splice(index, 1)
|
|
|
- // String ksid,String photoId,Long commentId
|
|
|
- commentDelete({ ksid: this.ksid, photoId: allItem.photoId, commentId: item.commentId }).then(res => {
|
|
|
- console.log(res)
|
|
|
- })
|
|
|
+ // console.log(allItem, item)
|
|
|
+ // allItem.commentList.splice(index, 1)
|
|
|
+ // // String ksid,String photoId,Long commentId
|
|
|
+ // commentDelete({ ksid: this.ksid, photoId: allItem.photoId, commentId: item.commentId }).then(res => {
|
|
|
+ // console.log(res)
|
|
|
+ // })
|
|
|
},
|
|
|
getScrollTop: function() {
|
|
|
var scrollTop = 0,
|