|
@@ -4,10 +4,9 @@ import {
|
|
|
ReplyComment,
|
|
|
likeReply
|
|
|
} from '~/api/video'
|
|
|
+import reachBottom from '~/mixins/reachBottom'
|
|
|
Component({
|
|
|
- /**
|
|
|
- * 组件的属性列表
|
|
|
- */
|
|
|
+ behaviors: [reachBottom],
|
|
|
properties: {
|
|
|
// 是否在tabbar页面使用,是的话就给个padding
|
|
|
tabBarPadding: {
|
|
@@ -22,6 +21,7 @@ Component({
|
|
|
data: {
|
|
|
show: false,
|
|
|
quickShow: true,
|
|
|
+ type: 'comment',
|
|
|
commentId: '',
|
|
|
totalSize: 0,
|
|
|
list: [],
|
|
@@ -52,15 +52,23 @@ Component({
|
|
|
animationData: animation.export()
|
|
|
})
|
|
|
}, 100)
|
|
|
- this.getComment()
|
|
|
+ this.resetData()
|
|
|
+ },
|
|
|
+ changeType({
|
|
|
+ currentTarget
|
|
|
+ }) {
|
|
|
+ let type = currentTarget.dataset.type
|
|
|
+ this.setData({
|
|
|
+ type
|
|
|
+ })
|
|
|
+ this.resetData()
|
|
|
+ console.log(currentTarget.dataset);
|
|
|
},
|
|
|
close() {
|
|
|
this.setData({
|
|
|
show: false,
|
|
|
- quickShow:true,
|
|
|
+ quickShow: true,
|
|
|
commentId: '',
|
|
|
- totalSize: 0,
|
|
|
- list: [],
|
|
|
detailDesc: '',
|
|
|
replyType: 'works',
|
|
|
postId: null,
|
|
@@ -73,20 +81,14 @@ Component({
|
|
|
quickShow: false
|
|
|
})
|
|
|
},
|
|
|
- async getComment() {
|
|
|
+ loadMore() {
|
|
|
+ if (this.data.type == 'like') {
|
|
|
+ return
|
|
|
+ }
|
|
|
let params = {
|
|
|
columnId: this.data.columnId,
|
|
|
- pageNo: 1,
|
|
|
- pageSize: 100
|
|
|
}
|
|
|
- let {
|
|
|
- totalSize,
|
|
|
- list
|
|
|
- } = await getComment(params)
|
|
|
- this.setData({
|
|
|
- totalSize,
|
|
|
- list
|
|
|
- })
|
|
|
+ this.getData(getComment, params)
|
|
|
},
|
|
|
bindKeyInput(e) {
|
|
|
this.setData({
|
|
@@ -103,7 +105,7 @@ Component({
|
|
|
await postReply(data)
|
|
|
// 评论数+1
|
|
|
this.triggerEvent('addCommentNum', this.data.columnId)
|
|
|
- this.getComment()
|
|
|
+ this.resetData()
|
|
|
},
|
|
|
// 评论作品
|
|
|
async sendReply() {
|
|
@@ -129,7 +131,7 @@ Component({
|
|
|
detailDesc: '',
|
|
|
replyType: 'works'
|
|
|
})
|
|
|
- this.getComment()
|
|
|
+ this.resetData()
|
|
|
},
|
|
|
async ReplyComment({
|
|
|
currentTarget
|