导演:麦贯之
主演:韩栋 张予曦 王艺曈 李若天 肖向飞 陶慧敏 温海波
关键词:爱情 悬疑 奇幻
';
var commentMaxLen = 140; // 评论最长140个
var classMap = [
'action
';
var commentMaxLen = 140; // 评论最长140个
var classMap = [
'action', 'comedy', 'sci-fi', 'fantasy', 'romance', 'drama'
];
class AC extends React.Component {
constructor(props) {
super(props);
this.state = {
show: false
};
}
render() {
var show = this.state.show;
var atvclass = show ? 'active pointer' : 'pointer';
var cls = 'activity-item ' atvclass;
return (
<div className={cls} onClick={this.clickHandler.bind(this)} >
<img src={this.props.src} /><span>{this.props.text}</span>
</div>
);
}
clickHandler() {
this.setState({
show: !this.state.show
});
}
}
class Comment extends React.Component {
constructor(props) {
super(props);
this.state = {
value: '',
len: commentMaxLen
};
}
render() {
var value = this.state.value;
var len = this.state.len;
return (
<div className="comment">
<textarea ref="comment" placeholder="不超过140字" maxLength={commentMaxLen} value={value} onChange={this.changeHandler.bind(this)} ></textarea>
<div className="measure">
剩余<span>{len}</span>字
</div>
<button onClick={this.submit.bind(this)} >确定</button>
</div>
);
}
changeHandler(event) {
var val = event.target.value;
var newval = omnify(val);
// 保持光标
var sLen = 0, sIndex = this.refs.comment.selectionStart;
for (var i = 0; i < sIndex; i ) {
var char = val.charAt(i);
if (escape(char).length > 4) {
sLen = 2;
} else {
sLen = 1;
}
}
this.setState({
value: newval,
len: commentMaxLen - sLen
}, function () {
this.refs.comment.selectionStart = sIndex;
this.refs.comment.selectionEnd = sIndex;
})
}
submit() {
var value = this.state.value;
this.props.submit(value);
}
}
class ClassSelect extends React.Component {
constructor(props) {
super(props);
this.state = {
show: false
};
}
render() {
if (this.state.show) {
var showtype = 'active';
} else {
var showtype = '';
}
var text = this.props.children || '选择类型';
return (
<div className="class-select">
<div className="select-type" onClick={this.toggleClass.bind(this)}>{text}</div>
<div className={'select-mask ' showtype } onClick={this.hideClassSelect
详情