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
ec00a0a0
Commit
ec00a0a0
authored
Feb 27, 2020
by
pengguangpu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加日结本地写死数据打印;
parent
91e88fcb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
1 deletion
+51
-1
actioncmd.js
const/actioncmd.js
+3
-0
home.js
pages/home/home.js
+48
-1
No files found.
const/actioncmd.js
View file @
ec00a0a0
...
...
@@ -66,3 +66,6 @@ export const ACTION_SYSTEM_SETTING = "ACTION_SYSTEM_SETTING";
//结算页面back到扫商品页面
export
const
ACTION_BALANCE_BACK_GOODS
=
"ACTION_BALANCE_BACK_GOODS"
;
//打印日结订单
export
const
ACTION_DAY_CHECK
=
"ACTION_DAY_CHECK"
;
\ No newline at end of file
pages/home/home.js
View file @
ec00a0a0
...
...
@@ -9,7 +9,7 @@ import {
ACTION_DIRECT_PAYMENT
,
ACTION_CONVERT_COUPON
,
ACTION_GO_HOME
,
ACTION_REFUND
,
ACTION_REFUND_FAILED
,
ACTION_REFUND_SUCCESS
,
ACTION_PRINT_LAST_ORDER
,
ACTION_SYSTEM_SETTING
,
ACTION_SYSTEM_SETTING
,
ACTION_DAY_CHECK
}
from
'../../const/actioncmd'
...
...
@@ -173,6 +173,9 @@ Page({
context
.
setData
({
toSetting
:
true
,
})
}
else
if
(
res
.
action
==
ACTION_DAY_CHECK
)
{
//本地先写死数据
context
.
printDayCheck
();
}
}
});
...
...
@@ -199,6 +202,50 @@ Page({
}
},
/**
* 打印
*/
printDayCheck
()
{
var
printer
=
require
(
"../../utils/printer.js"
);
var
cmds
=
[
printer
.
setAlign
(
printer
.
ALIGN_CENTER
),
printer
.
printText
(
'日结订单'
),
printer
.
printText
(
getApp
().
globalData
.
localAccountInfo
.
storeName
),
printer
.
setAlign
(
printer
.
ALIGN_LEFT
),
//打印日期
printer
.
printNowDate
(),
//门店号
printer
.
printText
(
"门店号:"
+
getApp
().
globalData
.
localAccountInfo
.
storeName
),
//收款总额
printer
.
printText
(
'收款总额:10.00元'
),
printer
.
feedPaper
(),
printer
.
feedPaper
(),
printer
.
feedPaper
(),
printer
.
feedPaper
(),
];
printer
.
print
({
isCheckStatus
:
getApp
().
globalData
.
containerVersionCode
>
20
,
cmds
:
cmds
,
callback
:
(
res
)
=>
{
//发送给后屏,告知打印结果
my
.
ix
.
sendBuddyMessage
({
// 填入目标小程序的 AppID
target
:
getApp
().
globalData
.
backScreenAppId
,
data
:
{
action
:
ACTION_DAY_CHECK
,
data
:
res
},
success
:
(
res
)
=>
{
console
.
info
(
`sendBuddyMessage success:
${
JSON
.
stringify
(
res
)}
`
);
},
fail
:
(
res
)
=>
{
console
.
info
(
`sendBuddyMessage failed:
${
JSON
.
stringify
(
res
)}
`
);
}
});
}
});
},
/**返回当前选中广告 */
returnCurShowAd
()
{
let
context
=
this
;
...
...
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