|
@@ -7,6 +7,7 @@ import {
|
|
|
getLikeNote
|
|
|
} from '~/api/video'
|
|
|
import reachBottom from '~/mixins/reachBottom'
|
|
|
+let that = this
|
|
|
Component({
|
|
|
behaviors: [reachBottom],
|
|
|
properties: {
|
|
@@ -22,6 +23,7 @@ Component({
|
|
|
type: 'comment',
|
|
|
commentId: '',
|
|
|
totalSize: 0,
|
|
|
+ firstData: {},
|
|
|
list: [],
|
|
|
detailDesc: '',
|
|
|
postId: '',
|
|
@@ -31,7 +33,8 @@ Component({
|
|
|
animation: {}
|
|
|
},
|
|
|
methods: {
|
|
|
- open(columnId, type = 'comment') {
|
|
|
+ open(columnId, type = 'comment', onceId) {
|
|
|
+ console.log(columnId, type, onceId);
|
|
|
// 背景遮罩层
|
|
|
var animation = wx.createAnimation({
|
|
|
duration: 300,
|
|
@@ -45,14 +48,17 @@ Component({
|
|
|
type,
|
|
|
show: true,
|
|
|
})
|
|
|
- console.log(type);
|
|
|
setTimeout(() => {
|
|
|
animation.translateY(0).step()
|
|
|
this.setData({
|
|
|
animationData: animation.export()
|
|
|
})
|
|
|
}, 100)
|
|
|
- this.resetData()
|
|
|
+ if (onceId) {
|
|
|
+ this.topping(onceId)
|
|
|
+ } else {
|
|
|
+ this.resetData()
|
|
|
+ }
|
|
|
},
|
|
|
changeType({
|
|
|
currentTarget
|
|
@@ -82,22 +88,44 @@ Component({
|
|
|
})
|
|
|
},
|
|
|
loadMore() {
|
|
|
+ console.log(this);
|
|
|
if (this.data.type == 'like') {
|
|
|
- this.getData(getLikeNotes, {
|
|
|
+ this.getData(this.getLikeNotes, {
|
|
|
+ userReadId: this.data.columnId,
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.getData(getComment, {
|
|
|
columnId: this.data.columnId,
|
|
|
})
|
|
|
- return
|
|
|
- }
|
|
|
- let params = {
|
|
|
- columnId: this.data.columnId,
|
|
|
}
|
|
|
- this.getData(getComment, params)
|
|
|
+ },
|
|
|
+ getLikeNotes(data) {
|
|
|
+ console.log(that);
|
|
|
+ return new Promise(async (reslove) => {
|
|
|
+ let res = await getLikeNotes(data)
|
|
|
+ if (this.data.firstData) {
|
|
|
+ res.list = res.list.filter(item => {
|
|
|
+ return item.id != this.data.firstData.id
|
|
|
+ })
|
|
|
+ res.list.unshift(this.data.firstData)
|
|
|
+ }
|
|
|
+ console.log(res);
|
|
|
+ reslove(res)
|
|
|
+ })
|
|
|
},
|
|
|
bindKeyInput(e) {
|
|
|
this.setData({
|
|
|
detailDesc: e.detail.value
|
|
|
})
|
|
|
},
|
|
|
+ async topping(id) {
|
|
|
+ let res = await getLikeNote(id)
|
|
|
+ console.log(res);
|
|
|
+ this.setData({
|
|
|
+ firstData: res
|
|
|
+ })
|
|
|
+ this.loadMore()
|
|
|
+ },
|
|
|
async quickRemark({
|
|
|
currentTarget
|
|
|
}) {
|