diff --git a/src/date-time-picker/__test__/__snapshots__/index.test.js.snap b/src/date-time-picker/__test__/__snapshots__/index.test.js.snap index 134e5a7fe..1f93a4c51 100644 --- a/src/date-time-picker/__test__/__snapshots__/index.test.js.snap +++ b/src/date-time-picker/__test__/__snapshots__/index.test.js.snap @@ -34,10 +34,13 @@ exports[`date-time-picker :base 1`] = ` class="t-picker__toolbar" > - 取消 + + 取消 + - 确定 + + 确定 + @@ -317,6 +324,39 @@ exports[`date-time-picker :base 1`] = ` 2030年 + + + + + + - + + + + + - + + + + + - + @@ -334,6 +374,7 @@ exports[`date-time-picker :base 1`] = ` bind:touchstart="onTouchStart" > @@ -432,6 +473,39 @@ exports[`date-time-picker :base 1`] = ` 12月 + + + + + + - + + + + + - + + + + + - + diff --git a/src/date-time-picker/__test__/__virtualHostSnapshot__/index.test.js.snap b/src/date-time-picker/__test__/__virtualHostSnapshot__/index.test.js.snap index 134e5a7fe..4ce86081a 100644 --- a/src/date-time-picker/__test__/__virtualHostSnapshot__/index.test.js.snap +++ b/src/date-time-picker/__test__/__virtualHostSnapshot__/index.test.js.snap @@ -448,9 +448,38 @@ exports[`date-time-picker :base 1`] = ` + class="t-picker-item__accessible" + > + + + - + + + + + - + + + + + - + + + options.length - 1)) { return; } - // 调整偏移量 - const index = range(Math.round(-offset / this.itemHeight), 0, this.getCount() - 1); + + if (index === undefined) { + if (offset === this.StartOffset) { + return; + } + // 调整偏移量 + index = range(Math.round(-offset / this.itemHeight), 0, this.getCount() - 1); + } + this.setData({ curIndex: index, offset: -index * this.itemHeight, @@ -104,6 +112,16 @@ export default class PickerItem extends SuperComponent { }); }, + onClickPrev() { + const { curIndex } = this.data; + this.onTouchEnd(null, curIndex - 1); + }, + + onClickNext() { + const { curIndex } = this.data; + this.onTouchEnd(null, curIndex + 1); + }, + // 刷新选中状态 update() { const { options, value, labelAlias, valueAlias } = this.data; diff --git a/src/picker-item/picker-item.wxml b/src/picker-item/picker-item.wxml index d89affaa7..9e227721b 100644 --- a/src/picker-item/picker-item.wxml +++ b/src/picker-item/picker-item.wxml @@ -10,6 +10,7 @@ > + + + + - + + + - + + + - + + diff --git a/src/picker/__test__/__snapshots__/index.test.js.snap b/src/picker/__test__/__snapshots__/index.test.js.snap index 99a15b9d9..89b041edf 100644 --- a/src/picker/__test__/__snapshots__/index.test.js.snap +++ b/src/picker/__test__/__snapshots__/index.test.js.snap @@ -31,10 +31,13 @@ exports[`picker :base 1`] = ` class="t-picker__toolbar" > - 取消 + + 取消 + - 确认 + + 确认 + @@ -87,6 +94,39 @@ exports[`picker :base 1`] = ` 2019年 + + + + + + - + + + + + - + + + + + - + @@ -101,6 +141,7 @@ exports[`picker :base 1`] = ` bind:touchstart="onTouchStart" > @@ -135,6 +176,39 @@ exports[`picker :base 1`] = ` 冬 + + + + + + - + + + + + - + + + + + - + diff --git a/src/picker/__test__/__virtualHostSnapshot__/index.test.js.snap b/src/picker/__test__/__virtualHostSnapshot__/index.test.js.snap index 99a15b9d9..81f1f164e 100644 --- a/src/picker/__test__/__virtualHostSnapshot__/index.test.js.snap +++ b/src/picker/__test__/__virtualHostSnapshot__/index.test.js.snap @@ -149,6 +149,39 @@ exports[`picker :base 1`] = ` class="t-picker__indicator" /> + + + + - + + + + + - + + + + + - + + + - {{cancelBtn}} + {{cancelBtn}} + {{title}} - {{confirmBtn}} + {{confirmBtn}} + diff --git a/src/rate/rate.ts b/src/rate/rate.ts index c2826794e..90e642ee5 100644 --- a/src/rate/rate.ts +++ b/src/rate/rate.ts @@ -77,7 +77,7 @@ export default class Rate extends SuperComponent { }, onTouchMove(e: WechatMiniprogram.TouchEvent) { this.onTouch(e, 'move'); - this.showAlertText() + this.showAlertText(); }, onTouchEnd() { this.touchEnd = true; diff --git a/src/swiper-nav/swiper-nav.wxml b/src/swiper-nav/swiper-nav.wxml index 35ed33a4a..0598edb54 100644 --- a/src/swiper-nav/swiper-nav.wxml +++ b/src/swiper-nav/swiper-nav.wxml @@ -1,6 +1,5 @@ -