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
08a8949a
Commit
08a8949a
authored
Feb 21, 2020
by
jiangjiantao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
直接收款
parent
e3108493
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
5 deletions
+50
-5
app.json
app.json
+1
-1
actioncmd.js
const/actioncmd.js
+3
-0
index.js
pages/index/index.js
+46
-4
No files found.
app.json
View file @
08a8949a
{
"pages"
:
[
"pages/poster/poster"
,
"pages/index/index"
,
"pages/poster/poster"
,
"pages/home/home"
,
"pages/waitoperate/waitoperate"
,
"pages/landscan/landscan"
,
...
...
const/actioncmd.js
View file @
08a8949a
...
...
@@ -30,3 +30,6 @@ export const ACTION_GO_HOME = "ACTION_GO_HOME";
//获取账户信息
export
const
ACTION_GET_ACCOUNT
=
"ACTION_GET_ACCOUNT"
;
//直接收款
export
const
ACTION_DIRECT_PAYMENT
=
"ACTION_DIRECT_PAYMENT"
;
pages/index/index.js
View file @
08a8949a
...
...
@@ -259,6 +259,37 @@ Page({
});
},
//直接收银
directPayment
(
e
)
{
this
.
setData
({
scene
:
3
})
},
//发生直接收银事件
sendPaymentToFront
(
payment
)
{
var
commonRequest
=
{
action
:
ACTION_DIRECT_PAYMENT
,
data
:
payment
};
let
context
=
this
;
my
.
ix
.
sendBuddyMessage
({
target
:
getApp
().
globalData
.
frontScreenAppId
,
data
:
commonRequest
,
success
:
(
res
)
=>
{
console
.
log
(
"发送直接收款事件到前屏小程序 成功 ===》"
+
JSON
.
stringify
(
res
));
//跳转到结算页面
},
fail
:
(
res
)
=>
{
console
.
log
(
"发送收款事件到前屏小程序 失败 ===》 "
+
JSON
.
stringify
(
res
));
my
.
showToast
({
type
:
'fail'
,
content
:
'操作失败'
,
duration
:
3000
,
success
:
()
=>
{
},
});
},
});
},
/**landscan页面逻辑方法 */
//把所有的商品数据发送到后屏
...
...
@@ -284,10 +315,17 @@ Page({
//键盘完成
onKeyBordFinished
(
barcode
)
{
onKeyBordFinished
(
result
)
{
this
.
onKeyBordClose
();
if
(
this
.
data
.
scene
==
3
){
this
.
sendPaymentToFront
(
result
)
}
else
if
(
this
.
data
.
scene
==
1
){
this
.
sendGoodsInfoToFront
(
result
)
}
},
//把手输条码发生到前屏
sendGoodsInfoToFront
(
barcode
)
{
my
.
showLoading
({});
var
commonRequest
=
{
action
:
ACTION_REQUEST_GOOD_INFO
,
...
...
@@ -304,15 +342,19 @@ Page({
my
.
hideLoading
();
my
.
showToast
({
type
:
'fail'
,
content
:
'
发送商品条码到后屏
失败'
,
content
:
'
操作
失败'
,
duration
:
3000
,
success
:
()
=>
{
},
});
}
})
},
// 键盘关闭
onKeyBordClose
()
{
this
.
setData
({
scene
:
0
})
...
...
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