diff --git a/view/BaseDialog.js b/view/BaseDialog.js index 75e6ef0..4591bbd 100644 --- a/view/BaseDialog.js +++ b/view/BaseDialog.js @@ -35,11 +35,11 @@ export default class BaseDialog extends BaseComponent { show(callback, state = {}) { this.setState({ _isShow: true, ...state }, () => { if (!this.props.showAnimationType || this.props.showAnimationType == 'spring') { - Animated.spring(this._path, { toValue: 1 }).start(() => { + Animated.spring(this._path, { toValue: 1, useNativeDriver: true }).start(() => { callback && callback(); }); } else { - Animated.timing(this._path, { toValue: 1 }).start(() => { + Animated.timing(this._path, { toValue: 1, useNativeDriver: true }).start(() => { callback && callback(); }); } @@ -47,7 +47,7 @@ export default class BaseDialog extends BaseComponent { } dismiss(callback) { - Animated.timing(this._path, { toValue: 0, duration: 200 }).start(() => { + Animated.timing(this._path, { toValue: 0, duration: 200, useNativeDriver: true }).start(() => { this.setState({ _isShow: false }, () => { callback && callback(); }); diff --git a/view/DatePicker.js b/view/DatePicker.js index 68be142..9d3a768 100644 --- a/view/DatePicker.js +++ b/view/DatePicker.js @@ -97,39 +97,39 @@ class DatePicker extends BaseDialog { if (this.props.HH) { let hours = []; for (let i = 0; i < 24; i++) { - hours.push((i + 1) + '时'); + hours.push(i + '时'); } pickerData.push(hours); if (this.props.selectedValue) { - selectedIndex.push((this.props.selectedValue[3] ? parseInt(this.props.selectedValue[3]) : new Date().getHours()) - 1); + selectedIndex.push((this.props.selectedValue[3] ? parseInt(this.props.selectedValue[3]) : new Date().getHours())); } else { - selectedIndex.push((new Date().getHours() - 1)); + selectedIndex.push((new Date().getHours())); } - this.props.selectedValue[3] = (selectedIndex[3] + 1) + '时'; + this.props.selectedValue[3] = (selectedIndex[3]) + '时'; if (this.props.mm) { let minutes = []; for (let i = 0; i < 60; i++) { - minutes.push((i + 1) + '分'); + minutes.push(i + '分'); } pickerData.push(minutes); if (this.props.selectedValue) { - selectedIndex.push((this.props.selectedValue[4] ? parseInt(this.props.selectedValue[4]) : new Date().getMinutes()) - 1); + selectedIndex.push((this.props.selectedValue[4] ? parseInt(this.props.selectedValue[4]) : new Date().getMinutes())); } else { - selectedIndex.push((new Date().getMinutes() - 1)); + selectedIndex.push((new Date().getMinutes())); } - this.props.selectedValue[4] = (selectedIndex[4] + 1) + '分'; + this.props.selectedValue[4] = (selectedIndex[4]) + '分'; if (this.props.ss) { let seconds = []; for (let i = 0; i < 60; i++) { - seconds.push((i + 1) + '秒'); + seconds.push(i + '秒'); } pickerData.push(seconds); if (this.props.selectedValue) { - selectedIndex.push((this.props.selectedValue[5] ? parseInt(this.props.selectedValue[5]) : 1) - 1); + selectedIndex.push((this.props.selectedValue[5] ? parseInt(this.props.selectedValue[5]) : 1)); } else { - selectedIndex.push(1); + selectedIndex.push(0); } - this.props.selectedValue[5] = (selectedIndex[5] + 1) + '秒'; + this.props.selectedValue[5] = (selectedIndex[5]) + '秒'; } } } @@ -203,4 +203,4 @@ class DatePicker extends BaseDialog { } } -export default DatePicker; \ No newline at end of file +export default DatePicker;