Skip to content

Commit

Permalink
fix: amountInput bug
Browse files Browse the repository at this point in the history
  • Loading branch information
linxz committed Mar 10, 2021
1 parent 933f1b5 commit 272e3f9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.3.2
`2021-03-10`
* **Fixed**:amount-input 组件中细节问题;

## 1.3.1
`2021-01-12`
* **Fixed**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mini-ali-ui",
"version": "1.3.1",
"version": "1.3.2",
"description": "小程序版AntUI",
"repository": {
"type": "git",
Expand Down
5 changes: 3 additions & 2 deletions src/amount-input/index.less
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
@import "../style/mixins/hairline.less";

@font-face {
// 仅针对支付宝端内小程序的字体使用,具体可参考:https://antd-mobile.alipay.com/wiki/din
font-family: "DINPro";
src: url('https://resource/DINPro-Medium.ttf?v=202100204') format('truetype');
src: url('https://resource/DINPro-Medium.ttf') format('truetype');
}

.am-amount {
Expand All @@ -16,7 +17,7 @@
.a-input-content {
height: 120rpx;
/* stylelint-disable-next-line */
font-family: 'DINPro';
font-family: 'DINPro', 'DIN Alternate';
font-size: @font-size-amount-largenumber;
font-size: var(--am-amount-content-font-size, @font-size-amount-largenumber);
line-height: @line-height-base;
Expand Down
14 changes: 7 additions & 7 deletions src/amount-input/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,31 +88,31 @@ Component({
},
getMoneyUnit(inputValue) {
const value = Math.floor(inputValue);
if (value > 999.99 && value <= 10000) {
if (value > 999.99 && value < 10000) {
this.setData({
_unit: i18n.thousand,
});
} else if (value > 9999.99 && value <= 100000) {
} else if (value > 9999.99 && value < 100000) {
this.setData({
_unit: i18n.tenThousand,
});
} else if (value > 99999.99 && value <= 1000000) {
} else if (value > 99999.99 && value < 1000000) {
this.setData({
_unit: i18n.hundredThousand,
});
} else if (value > 999999.99 && value <= 10000000) {
} else if (value > 999999.99 && value < 10000000) {
this.setData({
_unit: i18n.million,
});
} else if (value > 9999999.99 && value <= 100000000) {
} else if (value > 9999999.99 && value < 100000000) {
this.setData({
_unit: i18n.tenMillion,
});
} else if (value > 99999999.99 && value <= 1000000000) {
} else if (value > 99999999.99 && value < 1000000000) {
this.setData({
_unit: i18n.hundredMillion,
});
} else if (value > 999999999.99 && value <= 10000000000) {
} else if (value > 999999999.99 && value < 10000000000) {
this.setData({
_unit: i18n.billion,
});
Expand Down

0 comments on commit 272e3f9

Please sign in to comment.