import Taro, { Component } from '@tarojs/taro'
import { View, Image, Text } from '@tarojs/components'
import './index.scss'
import { ComponentClass } from 'react'
type PageOwnProps = {
className?: string
text: string,
images: string[],
title?: string,
editable?: boolean
onEdit?: any,
onDelete?: any,
itemId?: any,
onClickImage?: (event: any) => any,
}
type IProps = PageOwnProps
interface Index {
props: IProps;
}
class Index extends Component {
static options = {
addGlobalClass: true
}
viewImage = (e) => {
if (this.props.onClickImage) {
this.props.onClickImage(e)
}
}
handleOnEdit = () => {
this.props.onEdit(this.props.itemId)
}
handleOnDelete = () => {
this.props.onDelete(this.props.itemId)
}
render() {
const { text, images, title, editable } = this.props
const imageClassName = (images && images.length > 1) ? 'sd-graphic2-image-small' : 'sd-graphic2-image-big'
return (
{
title && {this.props.title}
}
{
text.length > 0 &&
{text}
}
{
images.length > 0 &&
{
images.map((item, index) => {
return
})
}
}
{
editable &&
编辑
删除
}
)
}
}
export default Index as ComponentClass