import React, { Component } from 'react';
import './index.less';
import { Popover } from 'antd';
import { Carousel } from 'antd-mobile';
import Assets from '@src/components/Assets';
import { formatDate } from '@src/services/Tools';
import Button from '../Button';
import Tabs from '../Tabs';
import { User } from '../../stores/user';
export class CommentFalls extends Component {
createLayout() {
const msnry = new Masonry('.comment-falls', {
itemSelector: '.grid-item',
});
msnry.layout();
}
render() {
const { list = [] } = this.props;
return (
{list.map(row => {
return (
{row.user ? row.user.nickname : row.nickname}
{formatDate(row.createTime, 'yyyy年mm月dd日')}
{row.content}
);
})}
);
}
}
export class AnswerCarousel extends Component {
constructor(props) {
super(props);
this.state = { index: 1 };
}
onNext() {
const index = this.state.index + 1;
const { list = [] } = this.props;
if (index >= list.length - 1) return;
this.setState({ index });
}
onPrev() {
const index = this.state.index - 1;
if (index < 1) return;
this.setState({ index });
}
render() {
const { onFaq, tabActive, tabs = [], onTabChange } = this.props;
const { index } = this.state;
const { list = [], hideBtn = false } = this.props;
return (
{tabs.length > 0 && (
onTabChange && onTabChange(key)}
/>
)}
{list.length > 0 && (
{list.map(item => {
return (
);
})}
)}
{!tabs && }
this.onNext()} />
this.onPrev()} />
{!hideBtn && (
)}
);
}
}
export class Consultation extends Component {
render() {
const { data = {} } = this.props;
return (
);
}
}
export class Contact extends Component {
render() {
const { data = {} } = this.props;
return (
联系我们
{data.phone}
{data.email}
{data.wechat}
);
}
}
export class Comment extends Component {
render() {
const { data } = this.props;
return (
{data.user ? data.user.nickname : data.nickname}
{formatDate(data.createTime, 'YYYY-MM-DD')}
{data.content}
);
}
}