Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bh_face_counter
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄天晨
bh_face_counter
Commits
0b3f139a
Commit
0b3f139a
authored
Feb 28, 2024
by
黄日华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
收银程序开门离店和条码清空时间调整
收银程序增加扫条码消除开门离店弹窗
parent
719d11a0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
9 deletions
+26
-9
CounterMixins.js
src/pages/CounterMixins.js
+26
-9
No files found.
src/pages/CounterMixins.js
View file @
0b3f139a
...
...
@@ -39,7 +39,7 @@ const mStyles = {
},
};
const
clearTime
=
30
0
;
// 五分钟自动清空购物车
const
clearTime
=
12
0
;
// 五分钟自动清空购物车
const
paidTime
=
30
;
// 支付完成等待时间 30s
const
delay
=
1500
;
// 扫码后延迟时间
...
...
@@ -127,7 +127,21 @@ const CounterMixins = ComposeComponent => {
DeviceEventEmitter
.
addListener
(
'onError'
,
()
=>
(
this
.
busy
=
false
));
const
handleScan
=
this
.
submitBarcode
;
// if you want to react to keyUp
KeyEvent
.
onKeyDownListener
(
async
e
=>
{
// KeyEvent.onKeyDownListener(async e => {
// const {keyCode, pressedKey} = e;
// if (keyCode === 66) {
// // 回车事件
// await handleScan();
// this.barcode = '';
// } else if (keyCode >= 7 && keyCode <= 16) {
// this.barcode += keyCode - 7;
// } else if (keyCode >= 29 && keyCode <= 54) {
// this.barcode += pressedKey;
// } else {
// this.barcode += pressedKey;
// }
// });
KeyEvent
.
onKeyUpListener
(
async
e
=>
{
const
{
keyCode
,
pressedKey
}
=
e
;
if
(
keyCode
===
66
)
{
// 回车事件
...
...
@@ -485,17 +499,17 @@ const CounterMixins = ComposeComponent => {
successPay
=
async
facepay
=>
{
Toast
.
hide
();
const
{
goodsArr
,
human
}
=
this
.
state
;
let
total
=
0
;
let
total
Price
=
0
;
let
totalNum
=
0
;
goodsArr
.
map
(
item
=>
{
totalNum
+=
Number
(
item
.
num
);
if
(
item
.
price
)
{
total
+=
Number
(
item
.
price
)
*
Number
(
item
.
num
);
total
Price
+=
Number
(
item
.
price
)
*
Number
(
item
.
num
);
}
else
{
total
+=
Number
(
item
.
prePrice
)
*
Number
(
item
.
num
);
total
Price
+=
Number
(
item
.
prePrice
)
*
Number
(
item
.
num
);
}
});
let
msg
=
'付款'
+
total
+
'元,共'
+
totalNum
+
'件商品'
;
let
msg
=
'付款'
+
total
Price
+
'元,共'
+
totalNum
+
'件商品'
;
this
.
props
.
dispatch
({
// 购物完成步骤
type
:
'app/step'
,
...
...
@@ -574,10 +588,10 @@ const CounterMixins = ComposeComponent => {
};
print
=
async
()
=>
{
let
total
=
0
;
let
total
Price
=
0
;
let
goods
=
[];
this
.
state
.
printer
.
map
(
v
=>
{
total
+=
(
v
.
price
>
0
?
v
.
price
:
v
.
prePrice
)
*
v
.
num
;
total
Price
+=
(
v
.
price
>
0
?
v
.
price
:
v
.
prePrice
)
*
v
.
num
;
goods
.
push
(
`
${
v
.
name
}
,
${
v
.
num
}
,
${
v
.
price
>
0
?
v
.
price
:
v
.
prePrice
}
,
${(
v
.
price
>
0
...
...
@@ -585,7 +599,7 @@ const CounterMixins = ComposeComponent => {
:
v
.
prePrice
)
*
v
.
num
}
`
,
);
});
goods
.
push
(
`总计, , ,
${
total
.
toFixed
(
2
)}
`
);
goods
.
push
(
`总计, , ,
${
total
Price
.
toFixed
(
2
)}
`
);
await
Printer
.
printNote
(
goods
,
this
.
state
.
receipt
);
this
.
setState
({
printer
:
[]});
};
...
...
@@ -772,6 +786,9 @@ const CounterMixins = ComposeComponent => {
};
submitBarcode
=
async
barcode
=>
{
this
.
setState
({
cloudFinishModal
:
false
,
});
if
(
this
.
props
.
goods
.
cardVisible
)
{
return
await
this
.
handleCard
(
barcode
||
this
.
barcode
);
}
...
...
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