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
cbd714e3
Commit
cbd714e3
authored
Feb 27, 2020
by
pengguangpu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加日结相关逻辑;
parent
e9be6be4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
5 deletions
+32
-5
actioncmd.js
const/actioncmd.js
+2
-0
index.js
pages/index/index.js
+30
-5
No files found.
const/actioncmd.js
View file @
cbd714e3
...
...
@@ -67,6 +67,8 @@ export const ACTION_SYSTEM_SETTING = "ACTION_SYSTEM_SETTING";
//结算页面回到扫商品页面
export
const
ACTION_BALANCE_BACK_GOODS
=
"ACTION_BALANCE_BACK_GOODS"
;
//日结打印
export
const
ACTION_DAY_CHECK
=
"ACTION_DAY_CHECK"
;
const
FLOW_IDLE
=
"idle"
;
const
FLOW_COLLECTIONS
=
"collections"
;
//收款
...
...
pages/index/index.js
View file @
cbd714e3
...
...
@@ -7,7 +7,7 @@ import {
ACTION_DIRECT_PAYMENT
,
ACTION_CONVERT_COUPON
,
ACTION_LOGIN_OK
,
ACTION_REFUND
,
ACTION_REFUND_SUCCESS
,
ACTION_REFUND_FAILED
,
ACTION_PRINT_LAST_ORDER
,
ACTION_GET_CUR_AD
,
ACTION_SEND_SEL_AD
,
ACTION_SYSTEM_SETTING
,
ACTION_BALANCE_BACK_GOODS
,
ACTION_SYSTEM_SETTING
,
ACTION_BALANCE_BACK_GOODS
,
ACTION_DAY_CHECK
}
from
'../../const/actioncmd'
import
{
FLOW_IDLE
,
FLOW_COLLECTIONS
,
FLOW_REFUND
,
FLOW_DIRECT_PAYMENT
}
from
'../../const/actioncmd'
...
...
@@ -16,18 +16,18 @@ Page({
data
:
{
//页面控制相关参数
pageShow
:
{
"home"
:
fals
e
,
"home"
:
tru
e
,
"landscan"
:
false
,
"waitoperate"
:
false
,
"payresult"
:
false
,
"operateresult"
:
false
,
"printlastorder"
:
false
,
"poster"
:
tru
e
,
"poster"
:
fals
e
,
"aboutsystem"
:
false
,
"appsetting"
:
false
,
},
// 前屏是否完成登录
isFrontScreenLoginOK
:
tru
e
,
isFrontScreenLoginOK
:
fals
e
,
flowType
:
""
,
//流程类型:用于区分易混淆的流程,以及共同界面使用时用该标识位作为区分
/**账号信息 */
...
...
@@ -319,6 +319,16 @@ Page({
}
else
if
(
res
.
action
==
ACTION_BALANCE_BACK_GOODS
){
//结算页面回到扫商品页面
context
.
goPage
(
'landscan'
);
}
else
if
(
res
.
action
==
ACTION_DAY_CHECK
){
//收到日结处理回调
var
printDayCheckResult
=
res
.
data
;
if
(
printDayCheckResult
.
code
==
0
){
//打印成功
my
.
showToast
({
content
:
"打印成功"
});
}
else
{
//打印失败
my
.
showToast
({
content
:
"打印失败"
});
}
}
}
});
...
...
@@ -472,7 +482,22 @@ Page({
/**日结 */
onHomeDayCheckClicked
()
{
//发送打印日结订单到前屏
my
.
ix
.
sendBuddyMessage
({
// 填入目标小程序的 AppID
target
:
getApp
().
globalData
.
frontScreenAppId
,
data
:
{
action
:
ACTION_DAY_CHECK
,
data
:
null
},
success
:
(
res
)
=>
{
console
.
info
(
`sendBuddyMessage success:
${
JSON
.
stringify
(
res
)}
`
);
my
.
showToast
({
content
:
"正在打印中"
});
},
fail
:
(
res
)
=>
{
console
.
info
(
`sendBuddyMessage failed:
${
JSON
.
stringify
(
res
)}
`
);
}
});
},
/**关于系统(实际上是关于应用) */
...
...
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