Browse Source

Merge branch 'feature/association' of http://git.elinkit.com.cn:7070/r/epdc-resident-mp-js into feature/association

master
ZhaoTongYao 5 years ago
parent
commit
815599f084
  1. 54
      subpages/associationNew/pages/eventlist/eventlist.js

54
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) {
// <!-- 用户是否已点赞 0否;1是 -->
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,

Loading…
Cancel
Save