Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
doublescreen-back
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-back
Commits
d67d90b2
Commit
d67d90b2
authored
Feb 14, 2020
by
pengguangpu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加前后屏交互指令常量js文件;添加支付结果页的指令监听&发送;
parent
6808a2e0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
9 deletions
+55
-9
app.json
app.json
+1
-1
actioncmd.js
const/actioncmd.js
+5
-0
payresult.axml
pages/payresult/payresult.axml
+1
-1
payresult.js
pages/payresult/payresult.js
+48
-7
No files found.
app.json
View file @
d67d90b2
{
"pages"
:
[
"pages/landscan/landscan"
,
"pages/payresult/payresult"
,
"pages/landscan/landscan"
,
"pages/index/index"
],
"window"
:
{
...
...
const/actioncmd.js
0 → 100644
View file @
d67d90b2
//发送打印结果
export
const
ACTION_PRINT_RESULT
=
"ACTION_PRINT_RESULT"
;
//发送重打印指令
export
const
ACTION_REPRINT
=
"ACTION_REPRINT"
;
\ No newline at end of file
pages/payresult/payresult.axml
View file @
d67d90b2
...
...
@@ -37,7 +37,7 @@
</block>
<block a:else>
<view hidden="{{isPrinting}}">
<button type="ghost" style="height:40rpx;margin:0 auto;border-radius:20rpx;border-color:#FF7F19;color:#FF7F19;width:166rpx;" hover-class="loginButtonHover" onTap="">重新打印</button>
<button type="ghost" style="height:40rpx;margin:0 auto;border-radius:20rpx;border-color:#FF7F19;color:#FF7F19;width:166rpx;" hover-class="loginButtonHover" onTap="
onReprint
">重新打印</button>
</view>
</block>
</view>
...
...
pages/payresult/payresult.js
View file @
d67d90b2
import
{
ACTION_PRINT_RESULT
}
from
'../../const/actioncmd'
import
{
ACTION_REPRINT
}
from
'../../const/actioncmd'
Page
({
data
:
{
payFailedReason
:
"xxxxxxxxxxx"
,
isPaySuccess
:
true
,
payPriceYuan
:
"--.--"
,
printResult
:
"正在打印小票..."
,
isPrinting
:
false
,
isPrintSuccess
:
true
,
payFailedReason
:
"xxxxxxxxxxx"
,
isPaySuccess
:
true
,
payPriceYuan
:
"--.--"
,
printResult
:
"正在打印小票..."
,
isPrinting
:
false
,
isPrintSuccess
:
true
,
},
onLoad
()
{},
onLoad
()
{
},
onShow
()
{
//开启后屏监听
my
.
ix
.
onBuddyMessage
({
success
:
(
res
)
=>
{
console
.
info
(
`onBuddyMessage success:
${
JSON
.
stringify
(
res
)}
`
);
if
(
res
.
action
==
ACTION_PRINT_RESULT
)
{
//获取到打印结果
var
printResult
=
res
.
data
;
}
else
{
//未知指令
}
}
});
},
onReprint
()
{
//通知前屏重新打印
my
.
ix
.
sendBuddyMessage
({
// 填入目标小程序的 AppID
target
:
"****************"
,
data
:
{
action
:
ACTION_REPRINT
,
data
:
null
},
success
:
(
res
)
=>
{
console
.
info
(
`sendBuddyMessage success:
${
JSON
.
stringify
(
res
)}
`
);
},
fail
:
(
res
)
=>
{
console
.
info
(
`sendBuddyMessage failed:
${
JSON
.
stringify
(
res
)}
`
);
}
});
},
onHide
()
{
//关闭后屏监听
my
.
ix
.
offBuddyMessage
();
}
});
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