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
b656e4b7
Commit
b656e4b7
authored
Oct 19, 2022
by
郑炬波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 本地
parent
3202c7a6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
+4
-3
units.test.ts
packages/toolkit/__tests__/payment/units.test.ts
+2
-2
package-lock.json
packages/toolkit/package-lock.json
+0
-0
API.ts
packages/toolkit/src/Payment/API.ts
+2
-1
No files found.
packages/toolkit/__tests__/payment/units.test.ts
View file @
b656e4b7
...
...
@@ -52,7 +52,7 @@ test('测试组合支付价格计算', () => {
const
payment
=
new
Payment
()
const
goodsPrice
=
0.3
const
balance
=
0.1
const
{
payAmount
,
payBalance
}
=
payment
.
computeAmount
(
goodsPrice
,
balance
)
const
{
payAmount
,
payBalance
}
=
payment
.
computeAmount
ForCombination
(
goodsPrice
,
balance
)
expect
(
payAmount
).
toBe
(
0.2
)
expect
(
payBalance
).
toBe
(
0.1
)
})
...
...
@@ -61,7 +61,7 @@ test('测试非组合支付价格计算', () => {
const
payment
=
new
Payment
({
supportCombination
:
false
})
const
goodsPrice
=
0.3
payment
.
balance
=
0.1
const
{
payAmount
,
payBalance
}
=
payment
.
computeAmount
(
goodsPrice
)
const
{
payAmount
,
payBalance
}
=
payment
.
computeAmount
(
goodsPrice
,
PayType
.
ALIPAY
)
expect
(
payAmount
).
toBe
(
0.3
)
expect
(
payBalance
).
toBe
(
0
)
})
...
...
packages/toolkit/package-lock.json
0 → 100644
View file @
b656e4b7
This source diff could not be displayed because it is too large. You can
view the blob
instead.
packages/toolkit/src/Payment/API.ts
View file @
b656e4b7
...
...
@@ -2,7 +2,8 @@ let BASE_URL_JAVA = "";
let
BASE_GATEWAY
=
""
;
const
isDev
=
typeof
window
!==
'undefined'
?
window
.
location
.
hostname
.
indexOf
(
"dev"
)
>
-
1
:
false
;
const
isTest
=
typeof
window
!==
'undefined'
?
window
.
location
.
hostname
.
indexOf
(
"test"
)
>
-
1
:
false
;
if
(
isDev
||
isTest
){
const
isLocal
=
typeof
window
!==
'undefined'
?
window
.
location
.
hostname
.
indexOf
(
"localhost"
)
>
-
1
:
false
;
if
(
isDev
||
isTest
||
isLocal
){
BASE_URL_JAVA
=
'https://testapi.ydl.com'
;
BASE_GATEWAY
=
'https://testapp2.yidianling.com'
}
...
...
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