From e08e01276caefacdb8473d2e9d0e20d7ba17242a Mon Sep 17 00:00:00 2001 From: anlyyao Date: Thu, 23 Feb 2023 11:24:52 +0800 Subject: [PATCH] chore(CountDown): remove hightlight theme --- src/count-down/README.md | 2 +- .../__test__/__snapshots__/demo.test.js.snap | 44 +------------------ .../__virtualHostSnapshot__/demo.test.js.snap | 44 +------------------ src/count-down/_example/base/index.wxml | 8 +++- src/count-down/_example/base/index.wxss | 12 +++++ src/count-down/_example/size/index.wxml | 13 ------ src/count-down/count-down.less | 35 ++++----------- src/count-down/count-down.wxml | 2 +- src/count-down/type.ts | 2 +- 9 files changed, 34 insertions(+), 128 deletions(-) diff --git a/src/count-down/README.md b/src/count-down/README.md index 64945f457..12cd2247a 100644 --- a/src/count-down/README.md +++ b/src/count-down/README.md @@ -37,7 +37,7 @@ format | String | HH:mm:ss | 时间格式,DD-日,HH-时,mm-分,ss-秒, millisecond | Boolean | false | 是否开启毫秒级渲染 | N size | String `v0.5.1` | 'medium' | 倒计时尺寸。可选项:small/medium/large | N split-with-unit `v0.5.1` | Boolean | false | 使用时间单位分割 | N -theme | String `v0.5.1` | 'default' | 倒计时风格。可选项:default/round/square/hightlight | N +theme | String `v0.5.1` | 'default' | 倒计时风格。可选项:default/round/square | N time | Number | - | 必需。倒计时时长,单位毫秒 | Y external-classes | Array | - | 组件类名,分别用于设置 组件外层类名、计时器类型、分隔线类名 等。`['t-class', 't-class-count', 't-class-split']` | N diff --git a/src/count-down/__test__/__snapshots__/demo.test.js.snap b/src/count-down/__test__/__snapshots__/demo.test.js.snap index 512d78dd8..c9ffeb78e 100644 --- a/src/count-down/__test__/__snapshots__/demo.test.js.snap +++ b/src/count-down/__test__/__snapshots__/demo.test.js.snap @@ -105,7 +105,8 @@ exports[`CountDown CountDown base demo works fine 1`] = ` @@ -302,46 +303,5 @@ exports[`CountDown CountDown size demo works fine 1`] = ` /> - - - 无底色带单位 - - - - - - - - - - - `; diff --git a/src/count-down/__test__/__virtualHostSnapshot__/demo.test.js.snap b/src/count-down/__test__/__virtualHostSnapshot__/demo.test.js.snap index 512d78dd8..c9ffeb78e 100644 --- a/src/count-down/__test__/__virtualHostSnapshot__/demo.test.js.snap +++ b/src/count-down/__test__/__virtualHostSnapshot__/demo.test.js.snap @@ -105,7 +105,8 @@ exports[`CountDown CountDown base demo works fine 1`] = ` @@ -302,46 +303,5 @@ exports[`CountDown CountDown size demo works fine 1`] = ` /> - - - 无底色带单位 - - - - - - - - - - - `; diff --git a/src/count-down/_example/base/index.wxml b/src/count-down/_example/base/index.wxml index 3e3c384c2..dbfa40914 100644 --- a/src/count-down/_example/base/index.wxml +++ b/src/count-down/_example/base/index.wxml @@ -36,6 +36,12 @@ 无底色带单位 - + diff --git a/src/count-down/_example/base/index.wxss b/src/count-down/_example/base/index.wxss index 611490f9f..61d646179 100644 --- a/src/count-down/_example/base/index.wxss +++ b/src/count-down/_example/base/index.wxss @@ -6,3 +6,15 @@ .demo-count-down-content { margin: 32rpx 0 48rpx; } + +.external-count { + color: #e34d59; + font-size: 36rpx; + line-height: 48rpx; + vertical-align: middle; +} + +.external-split { + font-size: 20rpx; + margin: 0 10rpx; +} diff --git a/src/count-down/_example/size/index.wxml b/src/count-down/_example/size/index.wxml index 07b7e1ccb..6fb7ee817 100644 --- a/src/count-down/_example/size/index.wxml +++ b/src/count-down/_example/size/index.wxml @@ -62,16 +62,3 @@ - - - 无底色带单位 - - - - - - - - - - diff --git a/src/count-down/count-down.less b/src/count-down/count-down.less index f4b91d973..478b45b8f 100644 --- a/src/count-down/count-down.less +++ b/src/count-down/count-down.less @@ -1,44 +1,38 @@ @import '../common/style/index.less'; -@countdown-small-unit-margin: calc(@spacer * 0.5); // 'small'尺寸单位分割文本左右间距 -@countdown-medium-unit-margin: calc(@spacer * 0.625); // 'medium'尺寸单位分割文本左右间距 -@countdown-large-unit-margin: calc(@spacer * 0.75); // 'large'尺寸单位分割文本左右间距 +@countdown-small-unit-margin: 8rpx; // 'small'尺寸单位分割文本左右间距 +@countdown-medium-unit-margin: 10rpx; // 'medium'尺寸单位分割文本左右间距 +@countdown-large-unit-margin: 12rpx; // 'large'尺寸单位分割文本左右间距 @countdown-unit-color: @font-gray-1; // 带单位分割线文本颜色 @countdown-no-unit-color: @error-color-6; // 无单位分割线文本颜色 -@countdown-large-no-unit-margin: calc(@spacer * 0.75); // 'large'尺寸无单位分割文本左右间距 -@countdown-medium-no-unit-margin: calc(@spacer * 0.375); // 'medium'尺寸无单位分割文本左右间距 -@countdown-small-no-unit-margin: calc(@spacer * 0.25); // 'small'尺寸无单位分割文本左右间距 +@countdown-large-no-unit-margin: 12rpx; // 'large'尺寸无单位分割文本左右间距 +@countdown-medium-no-unit-margin: 6rpx; // 'medium'尺寸无单位分割文本左右间距 +@countdown-small-no-unit-margin: 4rpx; // 'small'尺寸无单位分割文本左右间距 @countdown-small-bg-width: 40rpx; // 'small'尺寸方/圆底背景宽高 @countdown-medium-bg-width: 48rpx; // 'medium'尺寸方/圆底背景宽高 @countdown-large-bg-width: 56rpx; // 'large'尺寸方/圆底背景宽高 @countdown-small-default-font-size: @font-size-base; // 'small'尺寸纯数字倒计时文本大小 @countdown-small-square-font-size: @font-size-s; // 'small'尺寸带方形底倒计时文本大小 @countdown-small-round-font-size: @font-size-s; // 'small'尺寸带圆形底倒计时文本大小 -@countdown-small-hightlight-font-size: @font-size-m; // 'small'尺寸高亮倒计时文本大小 @countdown-small-unit-font-size: @font-size; // 'small'尺寸单位分割文本大小 @countdown-small-no-unit-font-size: @font-size-base; // 'small'尺寸无单位分割文本大小 @countdown-medium-default-font-size: @font-size-m; // 'medium'尺寸纯数字倒计时文本大小 @countdown-medium-square-font-size: @font-size-base; // 'medium'尺寸带方形底倒计时文本大小 @countdown-medium-round-font-size: @font-size-base; // 'medium'尺寸带圆形底倒计时文本大小 -@countdown-medium-hightlight-font-size: 36rpx; // 'medium'尺寸高亮倒计时文本大小 @countdown-medium-unit-font-size: @font-size-s; // 'medium'尺寸单位分割文本大小 @countdown-medium-no-unit-font-size: @font-size-m; // 'medium'尺寸无单位分割文本大小 @countdown-large-default-font-size: 36rpx; // 'large'尺寸纯数字倒计时文本大小 @countdown-large-square-font-size: @font-size-m; // 'large'尺寸带方形底倒计时文本大小 @countdown-large-round-font-size: @font-size-m; // 'large'尺寸带圆形底倒计时文本大小 -@countdown-large-hightlight-font-size: 36rpx; // 'large'尺寸高亮倒计时文本大小 @countdown-large-unit-font-size: @font-size-base; // 'large'尺寸单位分割文本大小 @countdown-large-no-unit-font-size: 36rpx; // 'large'尺寸无单位分割文本大小 // 纯数字倒计时文本颜色 @countdown-default-text-color: var(--td-countdown-default-color, @font-gray-1); -// 高亮倒计时文本颜色 -@countdown-hightlight-color: var(--td-countdown-hightlight-color, @error-color-6); // 方形/圆形底倒计时文本颜色 @countdown-text-color: var(--td-countdown-round-color, @font-white-1); // 方形/圆形底背景颜色 @countdown-bg-color: var(--td-countdown-bg-color, @error-color-6); - // 带方形底倒计时圆角大小 @countdown-square-border-radius: var(--td-countdown-square-border-radius, @radius-small); // 带圆形底倒计时圆角大小 @@ -53,7 +47,6 @@ @defaultFontSize: 'countdown-@{size}-default-font-size'; @roundFontSize: 'countdown-@{size}-round-font-size'; @squareFontSize: 'countdown-@{size}-square-font-size'; - @hightlightFontSize: 'countdown-@{size}-hightlight-font-size'; @width: 'countdown-@{size}-bg-width'; @height: 'countdown-@{size}-bg-width'; @dotMargin: 'countdown-@{size}-no-unit-margin'; @@ -78,12 +71,6 @@ } } - &.@{countdown}--hightlight { - > .@{item} { - font-size: @@hightlightFontSize; - } - } - &.@{countdown}--round, &.@{countdown}--square { > .@{item} { @@ -93,8 +80,7 @@ } &.@{countdown}--round, - &.@{countdown}--square, - &.@{countdown}--hightlight { + &.@{countdown}--square { > .@{split}--dot { margin: 0 @@dotMargin; font-size: @@dotFontSize; @@ -125,8 +111,7 @@ } &--square, - &--round, - &--hightlight { + &--round { > .@{split}--dot { color: @countdown-no-unit-color; } @@ -157,8 +142,4 @@ background: @countdown-bg-color; } } - - &--hightlight { - color: @countdown-hightlight-color; - } } diff --git a/src/count-down/count-down.wxml b/src/count-down/count-down.wxml index d9ad87d17..7add47e99 100644 --- a/src/count-down/count-down.wxml +++ b/src/count-down/count-down.wxml @@ -8,7 +8,7 @@ > - {{formattedTime}} + {{formattedTime}} {{this.format(timeData[timeRange[index]])}} diff --git a/src/count-down/type.ts b/src/count-down/type.ts index d1e3260fb..31b0fdf11 100644 --- a/src/count-down/type.ts +++ b/src/count-down/type.ts @@ -67,7 +67,7 @@ export interface TdCountDownProps { */ theme?: { type: StringConstructor; - value?: 'default' | 'round' | 'square' | 'hightlight'; + value?: 'default' | 'round' | 'square'; }; /** * 倒计时时长,单位毫秒