Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions view/BaseDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ 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();
});
}
});
}

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();
});
Expand Down
26 changes: 13 additions & 13 deletions view/DatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]) + '秒';
}
}
}
Expand Down Expand Up @@ -203,4 +203,4 @@ class DatePicker extends BaseDialog {
}
}

export default DatePicker;
export default DatePicker;