From 183e70fc1603a9162045d2820982db80ad6a6fc4 Mon Sep 17 00:00:00 2001 From: zhaoyongnian <541231643@qq.com> Date: Fri, 5 Jun 2020 20:59:33 +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 | 54 +++++++++++-------- 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/subpages/associationNew/pages/eventlist/eventlist.js b/subpages/associationNew/pages/eventlist/eventlist.js index 65f6c28..a4502fe 100644 --- a/subpages/associationNew/pages/eventlist/eventlist.js +++ b/subpages/associationNew/pages/eventlist/eventlist.js @@ -1,6 +1,6 @@ // subpages/associationNew/pages/eventlist/eventlist.js const app = getApp() -import { topiclist, commentSubmit,statement } from '../../utils/api' +import { topiclist, commentSubmit, statement } from '../../utils/api' import { getTimestamp } from '../../../../utils/common' @@ -33,16 +33,17 @@ Page({ partyGroupId: options.partyGroupId, topicType: options.topicType,//0:事好儿鼓个掌 1:话对捧个场 }) - if(options.topicType == 0){ + if (options.topicType == 0) { wx.setNavigationBarTitle({ - title: '事好儿鼓个掌' + title: '事好儿鼓个掌' }) - }else{ + } else { wx.setNavigationBarTitle({ - title: '话对捧个场' + title: '话对捧个场' }) } - + + }, // 查列表 topiclist() { @@ -146,17 +147,22 @@ Page({ this.topiclist() } }, - + //点赞 - clicklike(e){ - console.log(JSON.stringify(e)) + clicklike(e) { // - - console.log(e.currentTarget.dataset.likeflag) - let attitude ="" - if(e.currentTarget.dataset.likeflag == '0'){//点赞 + if (this.data.bannedFlag == '1') {//被禁言 + wx.showToast({ + title: '您已经被禁言', + icon: 'none', + duration: 2000 + }) + return false + } + let attitude = "" + if (e.currentTarget.dataset.likeflag == '0') {//点赞 attitude = 0 - }else{ + } else { attitude = 2 } let that = this; @@ -169,13 +175,20 @@ Page({ topiclist: [], }) this.topiclist() - console.log('点赞成功' + res) }).catch(err => { console.log(err) }) }, // Textarea获取焦点 clickTextarea(e) { + if (this.data.bannedFlag == '1') {//被禁言 + wx.showToast({ + title: '您已经被禁言', + icon: 'none', + duration: 2000 + }) + return false + } this.setData({ ifcomment: true, focus: true, @@ -188,18 +201,16 @@ Page({ 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 @@ -211,14 +222,11 @@ Page({ topiclist: [], }) this.topiclist() - console.log('评论成功' + res) }).catch(err => { console.log(err) }) - console.log('点击事件') }, - previewImage (e) { - console.log(JSON.stringify(e)) + previewImage(e) { app.globalData.previewImage = true wx.previewImage({ urls: e.currentTarget.dataset.imgarry,