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
607a6a3b
Commit
607a6a3b
authored
Feb 26, 2020
by
jiangjiantao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix
parent
297f4bf5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
9 deletions
+32
-9
scan.js
pages/scan/scan.js
+32
-9
No files found.
pages/scan/scan.js
View file @
607a6a3b
...
@@ -108,17 +108,40 @@ Page({
...
@@ -108,17 +108,40 @@ Page({
useCoupon
(
code
)
{
useCoupon
(
code
)
{
this
.
setData
({
scanDialogDisplay
:
2
})
this
.
setData
({
scanDialogDisplay
:
2
})
setTimeout
(()
=>
{
setTimeout
(()
=>
{
//模拟数据 1 - 5 随机整数
let
totalDiscTemp
=
this
.
data
.
totalDisc
+
Math
.
round
(
Math
.
random
()
*
4
)
+
1
;
let
totalDiscTemp
=
this
.
data
.
totalDisc
+
Math
.
round
(
Math
.
random
()
*
4
)
+
1
;
this
.
setData
({
scanDialogDisplay
:
0
,
totalDisc
:
totalDiscTemp
})
let
context
=
this
;
my
.
showToast
({
let
req
=
{}
type
:
'success'
,
req
.
discCouponPrice
=
totalDiscTemp
;
content
:
'优惠已录入'
,
req
.
discCouponState
=
3
;
duration
:
3000
,
var
commonRequest
=
{
success
:
()
=>
{
action
:
ACTION_USE_COUPON
,
data
:
req
};
my
.
ix
.
sendBuddyMessage
({
target
:
getApp
().
globalData
.
backScreenAppId
,
data
:
commonRequest
,
success
:
(
res
)
=>
{
//模拟数据 1 - 5 随机整数
context
.
setData
({
scanDialogDisplay
:
0
,
totalDisc
:
totalDiscTemp
})
my
.
showToast
({
type
:
'success'
,
content
:
'优惠已录入'
,
duration
:
3000
,
success
:
()
=>
{
},
});
console
.
log
(
"用券成功到后屏小程序成功 ===》"
+
JSON
.
stringify
(
res
));
},
},
});
fail
:
(
res
)
=>
{
console
.
log
(
"用券成功后屏小程序 失败 ===》 "
+
JSON
.
stringify
(
res
));
//发送失败重试
context
.
sendGoodInfoToBack
();
}
})
},
700
);
},
700
);
},
},
...
...
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