|
@ -10,7 +10,7 @@ Page({ |
|
|
*/ |
|
|
*/ |
|
|
data: { |
|
|
data: { |
|
|
topiclist: [], |
|
|
topiclist: [], |
|
|
timestamp: getTimestamp(), |
|
|
timestamp: '', |
|
|
pageIndex: 1, |
|
|
pageIndex: 1, |
|
|
pageSize: 10, |
|
|
pageSize: 10, |
|
|
partyGroupId: '',//党群id
|
|
|
partyGroupId: '',//党群id
|
|
@ -24,77 +24,6 @@ Page({ |
|
|
topicId: '',//被评论的话题ID
|
|
|
topicId: '',//被评论的话题ID
|
|
|
commentContent: '', |
|
|
commentContent: '', |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
//点赞
|
|
|
|
|
|
clicklike(e){ |
|
|
|
|
|
console.log(JSON.stringify(e)) |
|
|
|
|
|
// <!-- 用户是否已点赞 0否;1是 -->
|
|
|
|
|
|
|
|
|
|
|
|
console.log(e.currentTarget.dataset.likeflag) |
|
|
|
|
|
let attitude ="" |
|
|
|
|
|
if(e.currentTarget.dataset.likeflag == '0'){//点赞
|
|
|
|
|
|
attitude = 0 |
|
|
|
|
|
}else{ |
|
|
|
|
|
attitude = 2 |
|
|
|
|
|
} |
|
|
|
|
|
let that = this; |
|
|
|
|
|
const para = { |
|
|
|
|
|
topicId: e.currentTarget.dataset.id,//被评论的话题ID
|
|
|
|
|
|
attitude: attitude,//表态 0赞;1踩;2取消赞;3取消踩
|
|
|
|
|
|
} |
|
|
|
|
|
statement(para).then(res => { |
|
|
|
|
|
that.setData({ |
|
|
|
|
|
topiclist: [], |
|
|
|
|
|
}) |
|
|
|
|
|
this.topiclist() |
|
|
|
|
|
console.log('点赞成功' + res) |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
// Textarea获取焦点
|
|
|
|
|
|
clickTextarea(e) { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
ifcomment: true, |
|
|
|
|
|
focus: true, |
|
|
|
|
|
topicId: e.currentTarget.dataset.id |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 失去焦点
|
|
|
|
|
|
bindAddressInput(e) { |
|
|
|
|
|
this.setData({ //失去焦点以后view隐藏
|
|
|
|
|
|
ifcomment: false |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
console.log(this.data.commentContent) |
|
|
|
|
|
}, |
|
|
|
|
|
// 身份证号 双向绑定
|
|
|
|
|
|
bindIdentity(e) { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
commentContent: e.detail.value |
|
|
|
|
|
}) |
|
|
|
|
|
console.log(this.data.commentContent) |
|
|
|
|
|
}, |
|
|
|
|
|
// 评论按钮点击事件
|
|
|
|
|
|
commentSubmit() { |
|
|
|
|
|
let that = this; |
|
|
|
|
|
const para = { |
|
|
|
|
|
topicId: this.data.topicId,//被评论的话题ID
|
|
|
|
|
|
faCommentId: '',//父评论(被评论)ID
|
|
|
|
|
|
content: this.data.commentContent,//评论内容
|
|
|
|
|
|
} |
|
|
|
|
|
commentSubmit(para).then(res => { |
|
|
|
|
|
that.setData({ |
|
|
|
|
|
topiclist: [], |
|
|
|
|
|
}) |
|
|
|
|
|
this.topiclist() |
|
|
|
|
|
console.log('评论成功' + res) |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
|
|
|
console.log('点击事件') |
|
|
|
|
|
}, |
|
|
|
|
|
/** |
|
|
/** |
|
|
* 生命周期函数--监听页面加载 |
|
|
* 生命周期函数--监听页面加载 |
|
|
*/ |
|
|
*/ |
|
@ -120,7 +49,7 @@ Page({ |
|
|
const para = { |
|
|
const para = { |
|
|
pageIndex: this.data.pageIndex, |
|
|
pageIndex: this.data.pageIndex, |
|
|
pageSize: this.data.pageSize, |
|
|
pageSize: this.data.pageSize, |
|
|
timestamp: this.data.timestamp, |
|
|
timestamp: getTimestamp(), |
|
|
topicType: this.data.topicType, |
|
|
topicType: this.data.topicType, |
|
|
partyGroupId: this.data.partyGroupId, //党群id
|
|
|
partyGroupId: this.data.partyGroupId, //党群id
|
|
|
} |
|
|
} |
|
@ -216,6 +145,77 @@ Page({ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//点赞
|
|
|
|
|
|
clicklike(e){ |
|
|
|
|
|
console.log(JSON.stringify(e)) |
|
|
|
|
|
// <!-- 用户是否已点赞 0否;1是 -->
|
|
|
|
|
|
|
|
|
|
|
|
console.log(e.currentTarget.dataset.likeflag) |
|
|
|
|
|
let attitude ="" |
|
|
|
|
|
if(e.currentTarget.dataset.likeflag == '0'){//点赞
|
|
|
|
|
|
attitude = 0 |
|
|
|
|
|
}else{ |
|
|
|
|
|
attitude = 2 |
|
|
|
|
|
} |
|
|
|
|
|
let that = this; |
|
|
|
|
|
const para = { |
|
|
|
|
|
topicId: e.currentTarget.dataset.id,//被评论的话题ID
|
|
|
|
|
|
attitude: attitude,//表态 0赞;1踩;2取消赞;3取消踩
|
|
|
|
|
|
} |
|
|
|
|
|
statement(para).then(res => { |
|
|
|
|
|
that.setData({ |
|
|
|
|
|
topiclist: [], |
|
|
|
|
|
}) |
|
|
|
|
|
this.topiclist() |
|
|
|
|
|
console.log('点赞成功' + res) |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
// Textarea获取焦点
|
|
|
|
|
|
clickTextarea(e) { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
ifcomment: true, |
|
|
|
|
|
focus: true, |
|
|
|
|
|
topicId: e.currentTarget.dataset.id |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 失去焦点
|
|
|
|
|
|
bindAddressInput(e) { |
|
|
|
|
|
this.setData({ //失去焦点以后view隐藏
|
|
|
|
|
|
ifcomment: false |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
console.log(this.data.commentContent) |
|
|
|
|
|
}, |
|
|
|
|
|
// 身份证号 双向绑定
|
|
|
|
|
|
bindIdentity(e) { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
commentContent: e.detail.value |
|
|
|
|
|
}) |
|
|
|
|
|
console.log(this.data.commentContent) |
|
|
|
|
|
}, |
|
|
|
|
|
// 评论按钮点击事件
|
|
|
|
|
|
commentSubmit() { |
|
|
|
|
|
let that = this; |
|
|
|
|
|
const para = { |
|
|
|
|
|
topicId: this.data.topicId,//被评论的话题ID
|
|
|
|
|
|
faCommentId: '',//父评论(被评论)ID
|
|
|
|
|
|
content: this.data.commentContent,//评论内容
|
|
|
|
|
|
} |
|
|
|
|
|
commentSubmit(para).then(res => { |
|
|
|
|
|
that.setData({ |
|
|
|
|
|
topiclist: [], |
|
|
|
|
|
}) |
|
|
|
|
|
this.topiclist() |
|
|
|
|
|
console.log('评论成功' + res) |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
|
|
|
console.log('点击事件') |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 用户点击右上角分享 |
|
|
* 用户点击右上角分享 |
|
|
*/ |
|
|
*/ |
|
|