Skip to content

Commit 2379833

Browse files
irisSongxiaoyatong
andauthored
fix(countdown): update the v15 style (#2843)
* fix(countdown): 适配v14 && type增加text类型 * fix(countdown): 判断是否补0 * fix(countdown): add test * fix: cr update * fix: test update * feat: add v14适配标识 * fix: update icons-react-taro version * chore: update pnpm-lock.yaml * fix: modify ts * fix: delete harmony css * fix: delete harmony css * fix: types --------- Co-authored-by: hanyuxinting <[email protected]> Co-authored-by: xiaoyatong <[email protected]>
1 parent 8564857 commit 2379833

File tree

5 files changed

+31
-4
lines changed

5 files changed

+31
-4
lines changed

src/packages/countdown/countdown.scss

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,45 @@
1212
align-items: center;
1313
justify-content: center;
1414
height: $countdown-height;
15+
box-sizing: border-box;
1516
font-weight: $coutdown-font-weight;
1617
font-size: $countdown-font-size;
18+
line-height: calc($countdown-font-size + 2px);
19+
font-family: 'JD';
1720
}
1821
&-number,
1922
&-number-primary {
23+
position: relative;
2024
min-width: $countdown-width;
2125
padding: $countdown-number-padding;
2226
border-radius: $countdown-number-border-radius;
2327
margin: $countdown-number-margin;
2428
text-align: center;
29+
&::after {
30+
content: '';
31+
position: absolute;
32+
top: -50%;
33+
bottom: -50%;
34+
left: -50%;
35+
right: -50%;
36+
transform: scale(0.5);
37+
border-radius: calc($countdown-number-border-radius * 2);
38+
}
2539
}
2640
&-number {
27-
border: 1px solid $countdown-number-border-color;
2841
background-color: $countdown-number-background-color;
2942
color: $countdown-number-color;
43+
&::after {
44+
border: 1px solid $countdown-number-border-color;
45+
}
3046
}
47+
3148
&-number-primary {
32-
border: 1px solid $countdown-number-primary-border-color;
3349
background-color: $countdown-number-primary-background-color;
3450
color: $countdown-number-primary-color;
51+
&::after {
52+
border: 1px solid $countdown-number-primary-border-color;
53+
}
3554
}
3655
&-number-text {
3756
border: 0;

src/packages/countdown/countdown.taro.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ const InternalCountDown: ForwardRefRenderFunction<
281281
[`${classPrefix}-number-text`]: type === 'text',
282282
})}
283283
>
284-
{unit ? padZero(time) : time}
284+
{unit && unit !== 'DD' ? padZero(time) : time}
285285
</View>
286286
{unit ? (
287287
<View className={`${classPrefix}-unit`}>{getUnit(unit)}</View>

src/styles/theme-dark.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ page {
3434
--nutui-color-primary-disabled-special: var(--nutui-brand-3);
3535
// 品牌主色调镂空背景点击态
3636
--nutui-color-primary-light-pressed: var(--nutui-brand-1);
37+
--nutui-color-primary-specialdisabled: var(--nutui-red-3);
3738

3839
// service color
3940
--nutui-golden-1: #fff2e0;
@@ -65,6 +66,7 @@ page {
6566
// danger color
6667
--nutui-red-1: #ffebef;
6768
--nutui-red-2: #ff0f23;
69+
--nutui-red-3: #ffadbe;
6870
--nutui-red-6: #ff3b3b;
6971

7072
// danger color 语义化

src/styles/theme-default.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ page {
3333
--nutui-color-primary-disabled-special: var(--nutui-brand-3);
3434
// 品牌主色调镂空背景点击态
3535
--nutui-color-primary-light-pressed: var(--nutui-brand-1);
36+
--nutui-color-primary-specialdisabled: var(--nutui-red-3);
3637

3738
// service color
3839
--nutui-golden-1: #fff2e0;
@@ -63,6 +64,7 @@ page {
6364

6465
// danger color
6566
--nutui-red-1: #ffebef;
67+
--nutui-red-3: #ffadbe;
6668
--nutui-red-2: #ff0f23;
6769
--nutui-red-6: #ff3333;
6870

src/styles/variables.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ $color-primary-gradient-1: linear-gradient(
2020
) !default;
2121
$color-primary-icon: var(--nutui-red-6, #ff3333) !default;
2222
$color-primary-icon-disabled: var(--nutui-gray-8, #dadce0) !default;
23+
$color-primary-specialdisabled: var(
24+
--nutui-color-primary-specialdisabled,
25+
#ffadbe
26+
) !default;
2327

2428
// 默认色
2529
$color-default: var(--nutui-color-default) !default;
@@ -799,7 +803,7 @@ $countdown-number-background-color: var(
799803
) !default;
800804
$countdown-number-border-color: var(
801805
--nutui-countdown-number-border-color,
802-
$color-primary-light-pressed
806+
$color-primary-specialdisabled
803807
) !default;
804808
$countdown-number-primary-color: var(
805809
--nutui-countdown-number-primary-color,

0 commit comments

Comments
 (0)