You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.3 KiB
54 lines
1.3 KiB
// pages/topics/common/goodIdea/cell/index.js
|
|
import { TopicModel } from '../../../../models/topic.js'
|
|
let topicModel = new TopicModel()
|
|
|
|
Component({
|
|
/**
|
|
* 组件的属性列表
|
|
*/
|
|
properties: {
|
|
itemData:Object,
|
|
itemIndex:Number
|
|
},
|
|
|
|
/**
|
|
* 组件的初始数据
|
|
*/
|
|
data: {
|
|
unPraise: '/images/common/zan.png',
|
|
praise: '/images/common/star_light.png',
|
|
currentPage:1
|
|
},
|
|
|
|
/**
|
|
* 组件的方法列表
|
|
*/
|
|
methods: {
|
|
onTap() {
|
|
this.triggerEvent('clickListItem', { itemData: this.properties.itemData })
|
|
},
|
|
onClickPraise(e) {
|
|
const sIndex = e.currentTarget.dataset.index
|
|
// var selectItem = e.currentTarget.dataset.item
|
|
// var isPraise = "itemData.isPraise"
|
|
// this.setData({
|
|
// [isPraise]:!isPraise
|
|
// })
|
|
|
|
this.triggerEvent('tapGoodIdeaPraise', {index:sIndex})
|
|
// const commentList = this.data.commentList
|
|
// const tempList = []
|
|
// commentList.forEach((item, index) => {
|
|
// if (sIndex === index) {
|
|
// item.isPraise = !item.isPraise
|
|
// }
|
|
// tempList.push(item)
|
|
// })
|
|
// this.setData({
|
|
// commentList: tempList,
|
|
// })
|
|
// this.fetchGoodIdeaPraise(selectItem.id)
|
|
// 评论点赞
|
|
}
|
|
}
|
|
})
|
|
|