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
c9bda32d
Commit
c9bda32d
authored
Feb 14, 2020
by
pengguangpu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加前后屏指令交互常量js文件;支付成功页添加指令传递&接收逻辑;
parent
3f0efb0d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
actioncmd.js
const/actioncmd.js
+5
-0
paysuccess.js
pages/paysuccess/paysuccess.js
+11
-5
No files found.
const/actioncmd.js
0 → 100644
View file @
c9bda32d
//发送打印结果
export
const
ACTION_PRINT_RESULT
=
"ACTION_PRINT_RESULT"
;
//发送重打印指令
export
const
ACTION_REPRINT
=
"ACTION_REPRINT"
;
\ No newline at end of file
pages/paysuccess/paysuccess.js
View file @
c9bda32d
import
{
ACTION_PRINT_RESULT
}
from
'../../const/actioncmd'
import
{
ACTION_REPRINT
}
from
'../../const/actioncmd'
Page
({
Page
({
data
:
{
data
:
{
orderPriceYuan
:
"--.--"
,
orderPriceYuan
:
"--.--"
,
...
@@ -67,7 +70,7 @@ Page({
...
@@ -67,7 +70,7 @@ Page({
//循环取出商品数据
//循环取出商品数据
cmds
.
push
(
printer
.
setAlign
(
printer
.
ALIGN_LEFT
));
cmds
.
push
(
printer
.
setAlign
(
printer
.
ALIGN_LEFT
));
cmds
.
push
(
printer
.
printText
(
this
.
data
.
goodsList
[
i
].
name
));
cmds
.
push
(
printer
.
printText
(
this
.
data
.
goodsList
[
i
].
name
));
cmds
.
push
(
printer
.
printTwoText
(
this
.
data
.
goodsList
[
i
].
barcode
,
this
.
data
.
goodsList
[
i
].
quantity
+
""
));
cmds
.
push
(
printer
.
printTwoText
(
this
.
data
.
goodsList
[
i
].
barcode
,
this
.
data
.
goodsList
[
i
].
quantity
+
""
));
}
}
cmds
.
push
(
printer
.
setAlign
(
printer
.
ALIGN_LEFT
));
cmds
.
push
(
printer
.
setAlign
(
printer
.
ALIGN_LEFT
));
cmds
.
push
(
printer
.
printDivide
(
"-"
));
cmds
.
push
(
printer
.
printDivide
(
"-"
));
...
@@ -87,9 +90,12 @@ Page({
...
@@ -87,9 +90,12 @@ Page({
printCallback
(
res
)
{
printCallback
(
res
)
{
//通知后屏打印结果
//通知后屏打印结果
my
.
ix
.
sendBuddyMessage
({
my
.
ix
.
sendBuddyMessage
({
target
:
"****************"
,
// 填入目标小程序的 AppID
// 填入目标小程序的 AppID
data
:
res
,
target
:
"****************"
,
data
:
{
action
:
ACTION_PRINT_RESULT
,
data
:
res
},
success
:
(
res
)
=>
{
success
:
(
res
)
=>
{
console
.
info
(
`sendBuddyMessage success:
${
JSON
.
stringify
(
res
)}
`
);
console
.
info
(
`sendBuddyMessage success:
${
JSON
.
stringify
(
res
)}
`
);
},
},
...
@@ -118,9 +124,9 @@ Page({
...
@@ -118,9 +124,9 @@ Page({
my
.
ix
.
onBuddyMessage
({
my
.
ix
.
onBuddyMessage
({
success
:
(
res
)
=>
{
success
:
(
res
)
=>
{
console
.
info
(
`onBuddyMessage success:
${
JSON
.
stringify
(
res
)}
`
);
console
.
info
(
`onBuddyMessage success:
${
JSON
.
stringify
(
res
)}
`
);
if
(
""
)
{
if
(
res
.
action
==
ACTION_REPRINT
)
{
//重新打印
//重新打印
this
.
print
();
}
else
{
}
else
{
//未知指令
//未知指令
}
}
...
...
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