提交 c7d27b64 authored 作者: 钟是志's avatar 钟是志

移动端代码优化

上级 31d1a691
...@@ -21,6 +21,7 @@ export default class MobileDate extends Component { ...@@ -21,6 +21,7 @@ export default class MobileDate extends Component {
} }
triggerChange = changedValue => { triggerChange = changedValue => {
console.log(changedValue);
// Should provide an event to pass value to Form. // Should provide an event to pass value to Form.
const onChange = this.props.onChange; const onChange = this.props.onChange;
// console.log(changedValue); // console.log(changedValue);
...@@ -57,9 +58,9 @@ export default class MobileDate extends Component { ...@@ -57,9 +58,9 @@ export default class MobileDate extends Component {
} }
this.triggerChange(dates); this.triggerChange(dates);
}; };
handelEndChange = date => { handelEndChange = date => {
const { dates } = this.state; const { dates } = this.state;
if (dates.length === 0) { if (dates.length === 0) {
dates.push(null); dates.push(null);
dates.push(moment(date.valueOf())); dates.push(moment(date.valueOf()));
...@@ -68,7 +69,6 @@ export default class MobileDate extends Component { ...@@ -68,7 +69,6 @@ export default class MobileDate extends Component {
Toast.fail('结束时间必须在开始时间之后', 1); Toast.fail('结束时间必须在开始时间之后', 1);
return false; return false;
} }
dates.push(moment(date.valueOf())); dates.push(moment(date.valueOf()));
} else { } else {
if (dates[0].isAfter(moment(date.valueOf()), 'second')) { if (dates[0].isAfter(moment(date.valueOf()), 'second')) {
...@@ -95,7 +95,7 @@ export default class MobileDate extends Component { ...@@ -95,7 +95,7 @@ export default class MobileDate extends Component {
formatDateShow = (v) => { formatDateShow = (v) => {
} };
render() { render() {
let { dates } = this.state; let { dates } = this.state;
...@@ -107,12 +107,11 @@ export default class MobileDate extends Component { ...@@ -107,12 +107,11 @@ export default class MobileDate extends Component {
if (!showTime) { if (!showTime) {
mode = 'date'; mode = 'date';
} }
console.log(formatDiy);
const startTime = dates.length > 0 ? dates[0] && dates[0].valueOf() : null; const startTime = dates.length > 0 ? dates[0] && dates[0].valueOf() : null;
const endTime = dates.length > 1 ? dates[1] && dates[1].valueOf() : null; const endTime = dates.length > 1 ? dates[1] && dates[1].valueOf() : null;
const MustSpan = this.MustSpan(); const MustSpan = this.MustSpan();
// console.log(startTime, endTime, dates);
// return null; // console.log(startTime, endTime);
return ( return (
<div> <div>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论