import { ComponentClass } from 'react'
import Taro, { Component } from '@tarojs/taro'
import { View, Image, Label, Button } from '@tarojs/components'
import './index.scss'
import SdFormid from '../sdFormid';
interface DataInterface {
caseId: any,
homeicName: any,
area: any,
price: any,
styleName: any,
backgroudurl: any,
title: any,
shopName: any,
shopLogo: any,
isClaim: any,
ownerId: any,
select: any,
}
type PageOwnProps = {
className?: string
item: DataInterface,
onClick?: any,
onClaim?: any,
showShop?: boolean
hidePrice?: boolean
}
type IProps = PageOwnProps
interface Index {
props: IProps;
}
class Index extends Component {
static options = {
addGlobalClass: true
}
// navigateToCase = () => {
// if (this.props.disabled) {
// return
// }
// if (this.props.openWzs) {
// Taro.navigateToMiniProgram({
// appId: process.env.WZS_MINI,
// path: '/pages/case/index?scene=' + this.props.item.caseId
// })
// } else {
// Taro.navigateTo({
// url: `/pages/case/index?caseId=${this.props.item.caseId}`
// })
// }
// }
handleClick = () => {
this.props.onClick(this.props.item.caseId)
}
// claim(e) {
// e.stopPropagation()
// Taro.navigateToMiniProgram({
// appId: process.env.WZS_MINI,
// path: '/pages/claimCase/index?scene=' + this.props.item.caseId
// })
// }
handleClaim = (e) => {
e.stopPropagation()
this.props.onClaim(this.props.item.caseId)
}
render() {
const item = this.props.item || {}
const showInfo = item.homeicName || item.area || item.price || item.styleName
const { hidePrice } = this.props
return (
{item.title || '未命名'}
{
showInfo &&
{
item.homeicName &&
}
{
item.area &&
}
{
item.styleName &&
}
{
(item.price && !hidePrice) &&
}
{
(item.price && hidePrice) &&
}
}
{
(this.props.showShop && item.shopName) &&
}
{
this.props.onClaim &&
}
{
item.ownerId &&
已认领
}
{
item.select &&
}
)
}
}
export default Index as ComponentClass