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
Show 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"
:
[
"pages/poster/poster"
,
"pages/index/index"
,
"pages/index/index"
,
"pages/poster/poster"
,
"pages/home/home"
,
"pages/home/home"
,
"pages/waitoperate/waitoperate"
,
"pages/waitoperate/waitoperate"
,
"pages/landscan/landscan"
,
"pages/landscan/landscan"
,
...
...
const/actioncmd.js
View file @
08a8949a
...
@@ -30,3 +30,6 @@ export const ACTION_GO_HOME = "ACTION_GO_HOME";
...
@@ -30,3 +30,6 @@ export const ACTION_GO_HOME = "ACTION_GO_HOME";
//获取账户信息
//获取账户信息
export
const
ACTION_GET_ACCOUNT
=
"ACTION_GET_ACCOUNT"
;
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({
...
@@ -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页面逻辑方法 */
/**landscan页面逻辑方法 */
//把所有的商品数据发送到后屏
//把所有的商品数据发送到后屏
...
@@ -284,10 +315,17 @@ Page({
...
@@ -284,10 +315,17 @@ Page({
//键盘完成
//键盘完成
onKeyBordFinished
(
barcode
)
{
onKeyBordFinished
(
result
)
{
this
.
onKeyBordClose
();
this
.
onKeyBordClose
();
if
(
this
.
data
.
scene
==
3
){
this
.
sendPaymentToFront
(
result
)
}
else
if
(
this
.
data
.
scene
==
1
){
this
.
sendGoodsInfoToFront
(
result
)
}
},
//把手输条码发生到前屏
sendGoodsInfoToFront
(
barcode
)
{
my
.
showLoading
({});
my
.
showLoading
({});
var
commonRequest
=
{
var
commonRequest
=
{
action
:
ACTION_REQUEST_GOOD_INFO
,
action
:
ACTION_REQUEST_GOOD_INFO
,
...
@@ -304,15 +342,19 @@ Page({
...
@@ -304,15 +342,19 @@ Page({
my
.
hideLoading
();
my
.
hideLoading
();
my
.
showToast
({
my
.
showToast
({
type
:
'fail'
,
type
:
'fail'
,
content
:
'
发送商品条码到后屏
失败'
,
content
:
'
操作
失败'
,
duration
:
3000
,
duration
:
3000
,
success
:
()
=>
{
success
:
()
=>
{
},
},
});
});
}
}
})
})
},
},
// 键盘关闭
// 键盘关闭
onKeyBordClose
()
{
onKeyBordClose
()
{
this
.
setData
({
scene
:
0
})
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