import { ComponentClass } from 'react'
import Taro, { Component } from '@tarojs/taro'
import { View, Image, Text } from '@tarojs/components'
import './index.scss'
import SdFormid from '../sdFormid';
interface DataInterface {
buildingSiteId: string
name: string
process: string
image: string
time?: string
status?: number; // 0 | 1 | 2 | 发布 | 草稿 | 隐藏
getRedPacket?: number // 领取红包数量
isHasRedPacket?: number // 是否有红包 0 无 1 有
redPacket?: number // 红包总数
}
type PageOwnProps = {
className?: string
item: DataInterface
onClick?: any
editable?: boolean
onEdit?: any
onPublic?: any
onConfig?: any
}
type PageState = {}
type DvaProps = {}
type IProps = PageOwnProps & DvaProps
interface Index {
props: IProps;
}
class Index extends Component {
static options = {
addGlobalClass: true
}
navigateTo = () => {
if (this.props.onClick) {
this.props.onClick(this.props.item.buildingSiteId)
}
}
handleOnEdit = () => {
if (this.props.onEdit) {
this.props.onEdit(this.props.item.buildingSiteId)
}
}
handleOnConfig = () => {
if (this.props.item.isHasRedPacket === 1) {
return
}
this.props.onConfig(this.props.item.buildingSiteId)
}
handleOnPublic = () => {
this.props.onPublic(this.props.item.buildingSiteId, this.props.item.status)
}
render() {
const { item } = this.props
return (
{item.name}
{item.process}
{item.time}
)
}
}
export default Index as ComponentClass