From 78863e3ab895b22cd400260b22c0e66cddf03caf Mon Sep 17 00:00:00 2001 From: zhaoyongnian <541231643@qq.com> Date: Fri, 5 Jun 2020 20:15:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/eventlist/eventlist.js | 146 +++++++++--------- 1 file changed, 73 insertions(+), 73 deletions(-) diff --git a/subpages/associationNew/pages/eventlist/eventlist.js b/subpages/associationNew/pages/eventlist/eventlist.js index bdbf605..6cb875d 100644 --- a/subpages/associationNew/pages/eventlist/eventlist.js +++ b/subpages/associationNew/pages/eventlist/eventlist.js @@ -10,7 +10,7 @@ Page({ */ data: { topiclist: [], - timestamp: getTimestamp(), + timestamp: '', pageIndex: 1, pageSize: 10, partyGroupId: '',//党群id @@ -24,77 +24,6 @@ Page({ topicId: '',//被评论的话题ID commentContent: '', }, - - //点赞 - clicklike(e){ - console.log(JSON.stringify(e)) - // - - 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 = { pageIndex: this.data.pageIndex, pageSize: this.data.pageSize, - timestamp: this.data.timestamp, + timestamp: getTimestamp(), topicType: this.data.topicType, partyGroupId: this.data.partyGroupId, //党群id } @@ -215,6 +144,77 @@ Page({ this.topiclist() } }, + + //点赞 + clicklike(e){ + console.log(JSON.stringify(e)) + // + + 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('点击事件') + }, /** * 用户点击右上角分享