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
d42ca7dd
Commit
d42ca7dd
authored
Mar 11, 2021
by
zhonghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单详情弹窗逻辑优化
parent
d729545c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
24 deletions
+43
-24
OrderDetailMini.js
src/components/OrderDetailMini.js
+7
-3
FacePage.js
src/pages/FacePage.js
+34
-18
goods.js
src/services/goods.js
+1
-2
config.js
src/utils/config.js
+1
-1
No files found.
src/components/OrderDetailMini.js
View file @
d42ca7dd
...
...
@@ -113,7 +113,11 @@ class OrderDetailMini extends Component {
let
totalPrice
=
0
;
// 总价
let
totalCount
=
0
;
// 总优惠
let
number
=
0
;
// 总数量
goodsArr
.
map
(
item
=>
{
let
_goodsArr
=
goodsArr
;
if
(
!
goodsArr
||
goodsArr
.
code
)
{
_goodsArr
=
[];
}
_goodsArr
.
map
(
item
=>
{
number
+=
item
.
num
;
if
(
item
.
price
)
{
totalPrice
+=
item
.
price
*
item
.
num
;
...
...
@@ -314,8 +318,8 @@ const styles = {
justifyContent
:
'center'
,
paddingTop
:
scaleSize
(
14
),
paddingBottom
:
scaleSize
(
14
),
paddingLeft
:
scaleSize
(
8
),
paddingRight
:
scaleSize
(
9
0
),
paddingLeft
:
scaleSize
(
6
),
paddingRight
:
scaleSize
(
5
0
),
},
TdText
:
{
fontSize
:
setSpText
(
45
),
...
...
src/pages/FacePage.js
View file @
d42ca7dd
...
...
@@ -7,7 +7,7 @@ import Touch from '../components/Touch';
import
PhoneModal
from
'../components/PhoneModal'
;
import
VerifyCodeModal
from
'../components/VerifyCodeModal'
;
import
QRCode
from
'react-native-qrcode-svg'
;
import
OrderDetailsModal
from
'../components/OrderDetailsModal'
;
//
import OrderDetailsModal from '../components/OrderDetailsModal';
import
OrderDetailMini
from
'../components/OrderDetailMini'
;
import
TipsModal
from
'../components/TipsModal'
;
import
LoadingModal
from
'../components/LoadingModal'
;
...
...
@@ -42,7 +42,7 @@ class FacePage extends Component {
tipsModal
:
false
,
faceType
:
'wxpay'
,
// 屏保模式
sleep
:
true
,
//
sleep: true,
loadingModal
:
false
,
qrCode
:
''
,
goTipsModal
:
false
,
...
...
@@ -53,7 +53,7 @@ class FacePage extends Component {
phone
=
''
;
// 监听用户输入手机
// 设备类型
//
sense = true; // 测试即拿刷脸设备
sense
=
true
;
// 测试即拿刷脸设备
async
componentWillMount
()
{
this
.
storeKey
=
await
AsyncStorage
.
getItem
(
'KEY'
);
...
...
@@ -155,14 +155,28 @@ class FacePage extends Component {
});
};
/**
* @param {String} timeoutt 超时时间
* 用于控制订单详情弹窗,当参数为Number时为弹窗显示时间,当参数为boolean时关闭弹窗
* @param {Number} timeoutt 超时时间
* @param {Boolean} timeoutt 当参数为false时会清空定时器
*/
orderDetailMiniPop
=
timeoutt
=>
{
let
timerr
=
null
;
if
(
timeoutt
===
false
)
{
this
.
setState
({
orderDetailMini
:
false
,
});
clearTimeout
(
timerr
);
return
;
}
else
if
(
timeoutt
===
true
)
{
this
.
setState
({
orderDetailMini
:
true
,
});
return
;
}
this
.
setState
({
orderDetailMini
:
true
,
});
// 没有清空计时器的操作,可能造成内存溢出
setTimeout
(()
=>
{
timerr
=
setTimeout
(()
=>
{
this
.
setState
({
orderDetailMini
:
false
,
});
...
...
@@ -224,9 +238,9 @@ class FacePage extends Component {
else
if
(
this
.
action
===
'leave'
)
{
// 出门身份识别提示
Speech
.
speak
(
'正在进行安全检查'
);
this
.
getOrderDetailMiniCounter
();
this
.
orderDetailMiniPop
(
30000
);
//
this.loading(true, 30000);
//
this.getOrderDetailMiniCounter();
//
this.orderDetailMiniPop(30000);
this
.
loading
(
true
,
30000
);
}
}
};
...
...
@@ -268,6 +282,7 @@ class FacePage extends Component {
};
face
=
()
=>
{
this
.
orderDetailMiniPop
(
false
);
const
{
faceType
}
=
this
.
state
;
if
(
faceType
===
'wxpay'
)
{
if
(
this
.
sense
)
{
...
...
@@ -314,9 +329,7 @@ class FacePage extends Component {
});
if
(
ret
)
{
if
(
ret
.
code
===
1
&&
ret
.
action
===
'leave'
)
{
this
.
setState
({
orderDetailMini
:
false
,
});
this
.
orderDetailMiniPop
(
false
);
}
if
(
ret
.
code
<
0
||
ret
.
code
===
401
)
{
// 未授权,提示用户扫码验证
...
...
@@ -369,7 +382,13 @@ class FacePage extends Component {
Speech
.
speak
(
tipText
);
if
(
ret
.
code
!==
1
)
{
this
.
setState
({
tip
:
tipText
,
tipsModal
:
true
,
loadingModal
:
false
});
}
else
if
(
this
.
sense
)
this
.
setState
({
loadingModal
:
false
});
}
else
if
(
this
.
sense
)
{
this
.
setState
({
loadingModal
:
false
});
if
((
ret
.
action
=
'enter'
))
{
this
.
getOrderDetailMiniCounter
();
this
.
orderDetailMiniPop
(
1800000
);
}
}
}
}
else
{
Speech
.
speak
(
'正在重新识别,请靠中间站稳'
);
...
...
@@ -687,14 +706,11 @@ class FacePage extends Component {
const
{
verifyCodeModal
,
phoneModal
,
orderDetailsModal
,
orderDetailMini
,
goodsArr
,
talkCall
,
storeName
,
contact
,
customerPhone
,
current
,
tip
,
tipsModal
,
sleep
,
...
...
@@ -738,7 +754,7 @@ class FacePage extends Component {
onSubmit
=
{
this
.
onCodeSubmit
}
faceType
=
{
faceType
}
/
>
<
OrderDetailsModal
{
/*
<OrderDetailsModal
visible={orderDetailsModal}
transparent
maskClosable
...
...
@@ -753,7 +769,7 @@ class FacePage extends Component {
customerPhone={customerPhone}
current={current}
faceType={faceType}
/
>
/>
*/
}
<
OrderDetailMini
visible
=
{
orderDetailMini
}
transparent
...
...
src/services/goods.js
View file @
d42ca7dd
...
...
@@ -77,4 +77,4 @@ export function balancePay(action) {
export
function
getOrderCounter
()
{
return
axios
.
get
(
'/store/goods/counter'
);
}
\ No newline at end of file
}
src/utils/config.js
View file @
d42ca7dd
...
...
@@ -2,7 +2,7 @@ const app = ''; // eg: .25h/.eg
export
const
isProd
=
process
.
env
.
NODE_ENV
===
'production'
;
export
const
host
=
isProd
?
`https://api
${
app
}
.vs-u.com`
:
'http://192.168.88.
88
:7001'
;
:
'http://192.168.88.
171
:7001'
;
export
const
login
=
`https://m
${
app
}
.vs-u.com`
;
export
const
qrHost
=
login
;
export
const
imgUrl
=
'http://barcod.oss-cn-shenzhen.aliyuncs.com/images/'
;
...
...
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