import Taro, { Component } from '@tarojs/taro'
import { View, Image } from '@tarojs/components'
import { arrToObj } from '@utils'
import './index.scss'
export default class List extends Component {
constructor (props) {
super(props)
this.state = {
curList: [],
}
}
componentWillMount () {
this.props.onRef(this)
}
getData = (curList) => {
this.setState({
curList
})
}
viewHandle (cObj) {
Taro.api.other.apichannelsclick({id: cObj.id}).then((res) => {
wx.openChannelsActivity({
finderUserName: 'sphlZcWrHXeeW4s',
feedId: cObj.feed_id,
})
}).catch(() => {
wx.openChannelsActivity({
finderUserName: 'sphlZcWrHXeeW4s',
feedId: cObj.feed_id,
})
})
}
render () {
const { curList } = this.state
const curItems = curList.map((item, index) => {
return (
{item.title}
{item.create_at}
)
})
return (
{curItems}
)
}
}