From 9ceb5c09e66a1da7ada7034f4675da9bfa3b87d0 Mon Sep 17 00:00:00 2001 From: magic Date: Mon, 25 May 2020 23:33:22 +0800 Subject: [PATCH 1/3] Update DatePicker.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复 小时存在24时,分、秒存在60秒的问题 --- view/DatePicker.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/view/DatePicker.js b/view/DatePicker.js index 68be142..d135454 100644 --- a/view/DatePicker.js +++ b/view/DatePicker.js @@ -97,7 +97,7 @@ 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) { @@ -109,7 +109,7 @@ class DatePicker extends BaseDialog { 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) { @@ -121,7 +121,7 @@ class DatePicker extends BaseDialog { 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) { @@ -203,4 +203,4 @@ class DatePicker extends BaseDialog { } } -export default DatePicker; \ No newline at end of file +export default DatePicker; From 8b76723b1991aa6f11eb09a81bf272a87f1d60ec Mon Sep 17 00:00:00 2001 From: magic Date: Tue, 26 May 2020 05:43:17 +0800 Subject: [PATCH 2/3] Update DatePicker.js --- view/DatePicker.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/view/DatePicker.js b/view/DatePicker.js index d135454..9d3a768 100644 --- a/view/DatePicker.js +++ b/view/DatePicker.js @@ -101,11 +101,11 @@ class DatePicker extends BaseDialog { } 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++) { @@ -113,11 +113,11 @@ class DatePicker extends BaseDialog { } 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++) { @@ -125,11 +125,11 @@ class DatePicker extends BaseDialog { } 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]) + '秒'; } } } From 0373d363682d2bbf032a8d9df18f399fe07ad410 Mon Sep 17 00:00:00 2001 From: magic Date: Fri, 5 Jun 2020 13:34:15 +0800 Subject: [PATCH 3/3] Update BaseDialog.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加动画参数 --- view/BaseDialog.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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(); });