From abad8571554a64f8abfb614d4068a4d9ad655c92 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Wed, 18 Aug 2021 10:50:37 +0800 Subject: [PATCH] build: compile 1.8.1 --- dist/calendar/calendar.wxml | 1 + dist/calendar/components/header/index.js | 3 ++ dist/calendar/components/header/index.wxml | 2 +- dist/calendar/index.js | 3 ++ dist/circle/index.js | 32 ++++++++++++---------- dist/picker/index.wxml | 4 +-- dist/search/index.js | 2 +- lib/calendar/calendar.wxml | 1 + lib/calendar/components/header/index.js | 3 ++ lib/calendar/components/header/index.wxml | 2 +- lib/calendar/index.js | 3 ++ lib/circle/index.js | 32 ++++++++++++---------- lib/picker/index.wxml | 4 +-- 13 files changed, 55 insertions(+), 37 deletions(-) diff --git a/dist/calendar/calendar.wxml b/dist/calendar/calendar.wxml index 4872e191..808f739e 100644 --- a/dist/calendar/calendar.wxml +++ b/dist/calendar/calendar.wxml @@ -5,6 +5,7 @@ subtitle="{{ subtitle }}" showSubtitle="{{ showSubtitle }}" firstDayOfWeek="{{ firstDayOfWeek }}" + bind:click-subtitle="onClickSubtitle" > diff --git a/dist/calendar/components/header/index.js b/dist/calendar/components/header/index.js index 6d20df0f..a1898dd7 100644 --- a/dist/calendar/components/header/index.js +++ b/dist/calendar/components/header/index.js @@ -30,5 +30,8 @@ VantComponent({ ], }); }, + onClickSubtitle(event) { + this.$emit('click-subtitle', event); + }, }, }); diff --git a/dist/calendar/components/header/index.wxml b/dist/calendar/components/header/index.wxml index eb8e4b47..7e56c83e 100644 --- a/dist/calendar/components/header/index.wxml +++ b/dist/calendar/components/header/index.wxml @@ -4,7 +4,7 @@ {{ title }} - + {{ subtitle }} diff --git a/dist/calendar/index.js b/dist/calendar/index.js index 7fa6a5d0..fbc5b6d3 100644 --- a/dist/calendar/index.js +++ b/dist/calendar/index.js @@ -339,5 +339,8 @@ VantComponent({ this.$emit('confirm', copyDates(this.data.currentDate)); }); }, + onClickSubtitle(event) { + this.$emit('click-subtitle', event); + }, }, }); diff --git a/dist/circle/index.js b/dist/circle/index.js index 706d5caf..d42da08e 100644 --- a/dist/circle/index.js +++ b/dist/circle/index.js @@ -152,28 +152,30 @@ VantComponent({ this.drawCircle(value); return; } - this.clearInterval(); + this.clearMockInterval(); this.currentValue = this.currentValue || 0; - this.interval = setInterval(() => { - if (this.currentValue !== value) { - if (Math.abs(this.currentValue - value) < STEP) { - this.currentValue = value; - } else { - if (this.currentValue < value) { + const run = () => { + this.interval = setTimeout(() => { + if (this.currentValue !== value) { + if (Math.abs(this.currentValue - value) < STEP) { + this.currentValue = value; + } else if (this.currentValue < value) { this.currentValue += STEP; } else { this.currentValue -= STEP; } + this.drawCircle(this.currentValue); + run(); + } else { + this.clearMockInterval(); } - this.drawCircle(this.currentValue); - } else { - this.clearInterval(); - } - }, 1000 / speed); + }, 1000 / speed); + }; + run(); }, - clearInterval() { + clearMockInterval() { if (this.interval) { - clearInterval(this.interval); + clearTimeout(this.interval); this.interval = null; } }, @@ -185,6 +187,6 @@ VantComponent({ }); }, destroyed() { - this.clearInterval(); + this.clearMockInterval(); }, }); diff --git a/dist/picker/index.wxml b/dist/picker/index.wxml index dbf12492..8564ccc1 100644 --- a/dist/picker/index.wxml +++ b/dist/picker/index.wxml @@ -1,7 +1,7 @@ - + @@ -33,5 +33,5 @@ /> - + diff --git a/dist/search/index.js b/dist/search/index.js index 48f32b76..da3d958b 100644 --- a/dist/search/index.js +++ b/dist/search/index.js @@ -74,7 +74,7 @@ VantComponent({ onClear(event) { this.$emit('clear', event.detail); }, - onClickInput: function (event) { + onClickInput(event) { this.$emit('click-input', event.detail); }, }, diff --git a/lib/calendar/calendar.wxml b/lib/calendar/calendar.wxml index 4872e191..808f739e 100644 --- a/lib/calendar/calendar.wxml +++ b/lib/calendar/calendar.wxml @@ -5,6 +5,7 @@ subtitle="{{ subtitle }}" showSubtitle="{{ showSubtitle }}" firstDayOfWeek="{{ firstDayOfWeek }}" + bind:click-subtitle="onClickSubtitle" > diff --git a/lib/calendar/components/header/index.js b/lib/calendar/components/header/index.js index 314ca9ad..08f230cd 100644 --- a/lib/calendar/components/header/index.js +++ b/lib/calendar/components/header/index.js @@ -39,5 +39,8 @@ component_1.VantComponent({ ), }); }, + onClickSubtitle: function (event) { + this.$emit('click-subtitle', event); + }, }, }); diff --git a/lib/calendar/components/header/index.wxml b/lib/calendar/components/header/index.wxml index eb8e4b47..7e56c83e 100644 --- a/lib/calendar/components/header/index.wxml +++ b/lib/calendar/components/header/index.wxml @@ -4,7 +4,7 @@ {{ title }} - + {{ subtitle }} diff --git a/lib/calendar/index.js b/lib/calendar/index.js index 1dafdad3..2962b66d 100644 --- a/lib/calendar/index.js +++ b/lib/calendar/index.js @@ -375,5 +375,8 @@ component_1.VantComponent({ _this.$emit('confirm', utils_1.copyDates(_this.data.currentDate)); }); }, + onClickSubtitle: function (event) { + this.$emit('click-subtitle', event); + }, }, }); diff --git a/lib/circle/index.js b/lib/circle/index.js index e4f02479..416c0bd3 100644 --- a/lib/circle/index.js +++ b/lib/circle/index.js @@ -176,28 +176,30 @@ component_1.VantComponent({ this.drawCircle(value); return; } - this.clearInterval(); + this.clearMockInterval(); this.currentValue = this.currentValue || 0; - this.interval = setInterval(function () { - if (_this.currentValue !== value) { - if (Math.abs(_this.currentValue - value) < STEP) { - _this.currentValue = value; - } else { - if (_this.currentValue < value) { + var run = function () { + _this.interval = setTimeout(function () { + if (_this.currentValue !== value) { + if (Math.abs(_this.currentValue - value) < STEP) { + _this.currentValue = value; + } else if (_this.currentValue < value) { _this.currentValue += STEP; } else { _this.currentValue -= STEP; } + _this.drawCircle(_this.currentValue); + run(); + } else { + _this.clearMockInterval(); } - _this.drawCircle(_this.currentValue); - } else { - _this.clearInterval(); - } - }, 1000 / speed); + }, 1000 / speed); + }; + run(); }, - clearInterval: function () { + clearMockInterval: function () { if (this.interval) { - clearInterval(this.interval); + clearTimeout(this.interval); this.interval = null; } }, @@ -210,6 +212,6 @@ component_1.VantComponent({ }); }, destroyed: function () { - this.clearInterval(); + this.clearMockInterval(); }, }); diff --git a/lib/picker/index.wxml b/lib/picker/index.wxml index dbf12492..8564ccc1 100644 --- a/lib/picker/index.wxml +++ b/lib/picker/index.wxml @@ -1,7 +1,7 @@ - + @@ -33,5 +33,5 @@ /> - +