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
dd1a96a7
Commit
dd1a96a7
authored
Feb 24, 2020
by
pengguangpu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
打印上一单逻辑完善;
parent
d006f2dc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
7 deletions
+72
-7
index.js
pages/index/index.js
+72
-7
No files found.
pages/index/index.js
View file @
dd1a96a7
...
@@ -16,8 +16,10 @@ import { ACTION_LOGIN_OK } from '../../const/actioncmd'
...
@@ -16,8 +16,10 @@ import { ACTION_LOGIN_OK } from '../../const/actioncmd'
import
{
ACTION_REFUND
}
from
'../../const/actioncmd'
import
{
ACTION_REFUND
}
from
'../../const/actioncmd'
import
{
ACTION_REFUND_SUCCESS
}
from
'../../const/actioncmd'
import
{
ACTION_REFUND_SUCCESS
}
from
'../../const/actioncmd'
import
{
ACTION_REFUND_FAILED
}
from
'../../const/actioncmd'
import
{
ACTION_REFUND_FAILED
}
from
'../../const/actioncmd'
import
{
ACTION_PRINT_LAST_ORDER
}
from
'../../const/actioncmd'
import
{
FLOW_IDLE
,
FLOW_COLLECTIONS
,
FLOW_REFUND
}
from
'../../const/actioncmd'
import
{
FLOW_IDLE
,
FLOW_COLLECTIONS
,
FLOW_REFUND
}
from
'../../const/actioncmd'
Page
({
Page
({
data
:
{
data
:
{
//页面控制相关参数
//页面控制相关参数
...
@@ -72,7 +74,7 @@ Page({
...
@@ -72,7 +74,7 @@ Page({
printLastOrderPrintStatusHint
:
"正在打印上一单..."
,
printLastOrderPrintStatusHint
:
"正在打印上一单..."
,
//是否打印成功
//是否打印成功
printLastOrderIsPrintSuccess
:
false
,
printLastOrderIsPrintSuccess
:
false
,
printLastOrderIsPrinting
:
true
printLastOrderIsPrinting
:
true
},
},
/**跳转页面方法 */
/**跳转页面方法 */
...
@@ -83,7 +85,7 @@ Page({
...
@@ -83,7 +85,7 @@ Page({
"waitoperate"
:
false
,
"waitoperate"
:
false
,
"payresult"
:
false
,
"payresult"
:
false
,
"operateResult"
:
false
,
"operateResult"
:
false
,
"printlastorder"
:
false
"printlastorder"
:
false
};
};
//遍历pageShow
//遍历pageShow
for
(
var
key
in
pageShowTemp
)
{
for
(
var
key
in
pageShowTemp
)
{
...
@@ -210,6 +212,26 @@ Page({
...
@@ -210,6 +212,26 @@ Page({
isPaySuccess
:
false
,
isPaySuccess
:
false
,
});
});
context
.
goPage
(
'operateResult'
);
context
.
goPage
(
'operateResult'
);
}
else
if
(
res
.
action
==
ACTION_PRINT_LAST_ORDER
&&
context
.
data
.
pageShow
[
'printlastorder'
]
==
true
)
{
//打印上一单结果返回
//获取到打印结果
var
printLastOrderResult
=
res
.
data
;
this
.
setData
({
printLastOrderIsPrinting
:
false
});
if
(
printLastOrderResult
.
code
==
0
)
{
//打印成功
this
.
setData
({
printLastOrderIsPrintSuccess
:
true
,
printLastOrderPrintStatusHint
:
"打印完成"
});
}
else
{
//打印失败
this
.
setData
({
printLastOrderIsPrintSuccess
:
false
,
printLastOrderPrintStatusHint
:
"打印失败"
});
}
}
}
}
}
...
@@ -296,6 +318,22 @@ Page({
...
@@ -296,6 +318,22 @@ Page({
* 打印上一单
* 打印上一单
*/
*/
onHomePrintLastOrderClicked
()
{
onHomePrintLastOrderClicked
()
{
//发送指令至前屏
//通知前屏重新打印
my
.
ix
.
sendBuddyMessage
({
// 填入目标小程序的 AppID
target
:
getApp
().
globalData
.
frontScreenAppId
,
data
:
{
action
:
ACTION_PRINT_LAST_ORDER
,
data
:
null
},
success
:
(
res
)
=>
{
console
.
info
(
`sendBuddyMessage success:
${
JSON
.
stringify
(
res
)}
`
);
},
fail
:
(
res
)
=>
{
console
.
info
(
`sendBuddyMessage failed:
${
JSON
.
stringify
(
res
)}
`
);
}
});
//跳转至打印上一单页面
//跳转至打印上一单页面
this
.
goPage
(
'printlastorder'
);
this
.
goPage
(
'printlastorder'
);
},
},
...
@@ -695,12 +733,39 @@ Page({
...
@@ -695,12 +733,39 @@ Page({
/**
/**
* 打印上一单页面
* 打印上一单页面
*/
*/
onPrintLastOrderCancelClicked
()
{
},
onPrintLastOrderCancelClicked
()
{
//回首页
this
.
setData
({
printLastOrderIsPrintSuccess
:
false
,
printLastOrderIsPrinting
:
true
,
printLastOrderPrintStatusHint
:
"正在打印上一单"
});
this
.
goPage
(
'home'
);
},
onPrintLastOrderConfirmClicked
()
{
},
onPrintLastOrderConfirmClicked
()
{
//回首页
this
.
setData
({
printLastOrderIsPrintSuccess
:
false
,
printLastOrderIsPrinting
:
true
,
printLastOrderPrintStatusHint
:
"正在打印上一单"
});
this
.
goPage
(
'home'
);
},
onPrintLastOrderRePrintClicked
()
{
},
onPrintLastOrderRePrintClicked
()
{
//发送重新打印指令
onPrintLastOrderBackClicked
(){}
},
onPrintLastOrderBackClicked
()
{
//回首页
this
.
setData
({
printLastOrderIsPrintSuccess
:
false
,
printLastOrderIsPrinting
:
true
,
printLastOrderPrintStatusHint
:
"正在打印上一单"
});
this
.
goPage
(
'home'
);
}
});
});
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