Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
doublescreen-front
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pengguangpu
doublescreen-front
Commits
97e347c7
Commit
97e347c7
authored
Mar 04, 2020
by
gaodapeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改金额失真问题
parent
60adba16
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
24 deletions
+24
-24
balance.js
pages/balance/balance.js
+1
-1
scan.js
pages/scan/scan.js
+23
-23
No files found.
pages/balance/balance.js
View file @
97e347c7
...
...
@@ -62,7 +62,7 @@ Page({
if
(
totalPrice
!=
null
)
{
this
.
setData
({
payPrice
:
totalPrice
-
totalDisc
,
payPrice
:
payUtils
.
fen2Yuan
(
payUtils
.
yuan2Fen
(
totalPrice
)
-
payUtils
.
yuan2Fen
(
totalDisc
))
,
totalPrice
:
totalPrice
,
couponPrice
:
totalDisc
,
})
...
...
pages/scan/scan.js
View file @
97e347c7
...
...
@@ -62,11 +62,11 @@ Page({
})
}
else
if
(
res
.
action
==
ACTION_MEMBER
)
{
let
showPhone
=
res
.
data
.
substring
(
0
,
3
)
+
"****"
+
res
.
data
.
substring
(
7
,
11
)
let
showPhone
=
res
.
data
.
substring
(
0
,
3
)
+
"****"
+
res
.
data
.
substring
(
7
,
11
)
context
.
setData
({
memberPhone
:
res
.
data
,
showMemberPhone
:
showPhone
,
memberPoint
:
2130
showMemberPhone
:
showPhone
,
memberPoint
:
2130
})
}
else
if
(
res
.
action
==
ACTION_GO_BALANCE
)
{
...
...
@@ -80,11 +80,11 @@ Page({
my
.
reLaunch
({
url
:
"/pages/home/home"
,
});
}
else
if
(
res
.
action
==
ACTION_USE_COUPON
)
{
}
else
if
(
res
.
action
==
ACTION_USE_COUPON
)
{
//优惠券
context
.
setData
({
scanDialogDisplay
:
res
.
data
.
discCouponState
,
totalDisc
:
res
.
data
.
discCouponPrice
totalDisc
:
res
.
data
.
discCouponPrice
});
if
(
res
.
data
.
discCouponState
==
1
)
{
...
...
@@ -125,7 +125,7 @@ Page({
let
totalDiscTemp
=
this
.
data
.
totalDisc
+
Math
.
round
(
Math
.
random
()
*
4
)
+
1
;
//超额
if
(
totalDiscTemp
>
this
.
data
.
totalPrice
)
{
if
(
totalDiscTemp
>
this
.
data
.
totalPrice
)
{
let
req
=
{}
req
.
discCouponMsg
=
"超额优惠券"
req
.
discCouponState
=
4
;
...
...
@@ -136,7 +136,7 @@ Page({
let
req
=
{}
req
.
discCouponPrice
=
totalDiscTemp
;
req
.
discCouponState
=
3
;
this
.
useCouponCallback
(
ACTION_USE_COUPON
,
req
)
this
.
useCouponCallback
(
ACTION_USE_COUPON
,
req
)
},
700
);
},
...
...
@@ -153,7 +153,7 @@ Page({
success
:
(
res
)
=>
{
console
.
info
(
`sendBuddyMessage success:
${
JSON
.
stringify
(
res
)}
`
);
//用券成功
if
(
result
.
discCouponState
==
3
)
{
if
(
result
.
discCouponState
==
3
)
{
//模拟数据 1 - 5 随机整数
context
.
setData
({
scanDialogDisplay
:
0
,
totalDisc
:
result
.
discCouponPrice
})
my
.
showToast
({
...
...
@@ -165,13 +165,13 @@ Page({
},
});
//用券失败
}
else
if
(
result
.
discCouponState
==
4
)
{
}
else
if
(
result
.
discCouponState
==
4
)
{
context
.
setData
({
scanDialogDisplay
:
4
})
}
},
fail
:
(
res
)
=>
{
console
.
info
(
`sendBuddyMessage failed:
${
JSON
.
stringify
(
res
)}
`
);
context
.
useCouponCallback
(
action
,
result
)
context
.
useCouponCallback
(
action
,
result
)
}
});
},
...
...
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