Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
ydl-packages
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
许振钊
ydl-packages
Commits
332f2f17
Commit
332f2f17
authored
Oct 19, 2022
by
郑炬波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 精度
parent
3b30e32d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
4 deletions
+11
-4
package-lock.json
packages/toolkit/package-lock.json
+6
-1
package.json
packages/toolkit/package.json
+1
-1
Payment.ts
packages/toolkit/src/Payment/Payment.ts
+4
-2
No files found.
packages/toolkit/package-lock.json
View file @
332f2f17
{
{
"name"
:
"@ydl-packages/toolkit"
,
"name"
:
"@ydl-packages/toolkit"
,
"version"
:
"1.0.3"
,
"version"
:
"1.0.
1-next.3
3"
,
"lockfileVersion"
:
1
,
"lockfileVersion"
:
1
,
"requires"
:
true
,
"requires"
:
true
,
"dependencies"
:
{
"dependencies"
:
{
...
@@ -4224,6 +4224,11 @@
...
@@ -4224,6 +4224,11 @@
"blueimp-md5"
:
{
"blueimp-md5"
:
{
"version"
:
"2.19.0"
"version"
:
"2.19.0"
},
},
"decimal.js"
:
{
"version"
:
"10.4.2"
,
"resolved"
:
"http://npm.ydl.com/decimal.js/-/decimal.js-10.4.2.tgz"
,
"integrity"
:
"sha512-ic1yEvwT6GuvaYwBLLY6/aFFgjZdySKTE8en/fkU3QICTmRtgtSlFn0u0BXN06InZwtfCelR7j8LRiDI/02iGA=="
},
"jest"
:
{
"jest"
:
{
"version"
:
"28.1.3"
,
"version"
:
"28.1.3"
,
"dev"
:
true
,
"dev"
:
true
,
...
...
packages/toolkit/package.json
View file @
332f2f17
...
@@ -33,8 +33,8 @@
...
@@ -33,8 +33,8 @@
"dependencies"
:
{
"dependencies"
:
{
"axios"
:
"^0.27.2"
,
"axios"
:
"^0.27.2"
,
"blueimp-md5"
:
"^2.19.0"
,
"blueimp-md5"
:
"^2.19.0"
,
"decimal.js"
:
"^10.4.2"
,
"js-cookie"
:
"^3.0.1"
,
"js-cookie"
:
"^3.0.1"
,
"mathjs"
:
"^11.0.1"
,
"qs"
:
"^6.11.0"
"qs"
:
"^6.11.0"
},
},
"devDependencies"
:
{
"devDependencies"
:
{
...
...
packages/toolkit/src/Payment/Payment.ts
View file @
332f2f17
...
@@ -2,7 +2,7 @@ import {UNIT_PAY, IS_PAY, MY_BALANCE, PAY_CHECK_INTERVAL} from "./API";
...
@@ -2,7 +2,7 @@ import {UNIT_PAY, IS_PAY, MY_BALANCE, PAY_CHECK_INTERVAL} from "./API";
import
md5
from
'blueimp-md5'
import
md5
from
'blueimp-md5'
import
qs
from
'qs'
import
qs
from
'qs'
import
{
Utils
}
from
"@/Utils/Utils"
;
import
{
Utils
}
from
"@/Utils/Utils"
;
import
{
bignumber
,
subtract
}
from
'mathjs'
import
Decimal
from
'decimal.js'
;
import
{
createRequest
,
defaultRequest
,
DefaultResponse
}
from
"@/Request/Request"
;
import
{
createRequest
,
defaultRequest
,
DefaultResponse
}
from
"@/Request/Request"
;
import
{
import
{
BACK_ORDER_ID
,
BACK_ORDER_ID
,
...
@@ -180,7 +180,9 @@ export class Payment {
...
@@ -180,7 +180,9 @@ export class Payment {
payAmount
=
totalAmount
payAmount
=
totalAmount
}
else
if
(
balance
>
0
&&
balance
<
totalAmount
)
{
}
else
if
(
balance
>
0
&&
balance
<
totalAmount
)
{
payBalance
=
balance
;
payBalance
=
balance
;
payAmount
=
totalAmount
-
balance
;
const
x
=
new
Decimal
(
totalAmount
);
const
y
=
new
Decimal
(
balance
);
payAmount
=
Number
(
x
.
minus
(
y
));
}
else
{
}
else
{
payBalance
=
totalAmount
payBalance
=
totalAmount
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment