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
65eb0c5c
Commit
65eb0c5c
authored
Sep 14, 2021
by
zeven
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/hzp'
parents
a7d458c1
ae96442a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
10 deletions
+30
-10
OrderDetailMini.js
src/components/OrderDetailMini.js
+2
-8
TipsModal.js
src/components/TipsModal.js
+2
-1
FacePage.js
src/pages/FacePage.js
+26
-1
No files found.
src/components/OrderDetailMini.js
View file @
65eb0c5c
...
@@ -4,7 +4,6 @@ import {FlatList, Image, Modal, ScrollView, Text, View} from 'react-native';
...
@@ -4,7 +4,6 @@ import {FlatList, Image, Modal, ScrollView, Text, View} from 'react-native';
import
{
font
}
from
'../utils/common'
;
import
{
font
}
from
'../utils/common'
;
import
NP
from
'../utils/np'
;
import
NP
from
'../utils/np'
;
import
{
scaleSize
,
setSpText
}
from
'../utils/screen'
;
import
{
scaleSize
,
setSpText
}
from
'../utils/screen'
;
import
Speech
from
'../utils/Speech'
;
import
ModalStyles
from
'./Modal/styles'
;
import
ModalStyles
from
'./Modal/styles'
;
import
Touch
from
'./Touch'
;
import
Touch
from
'./Touch'
;
...
@@ -121,13 +120,8 @@ class OrderDetailMini extends Component {
...
@@ -121,13 +120,8 @@ class OrderDetailMini extends Component {
<
/View
>
<
/View
>
);
);
onNoBuy
=
async
()
=>
{
const
{
data
}
=
await
this
.
props
.
dispatch
({
type
:
'store/noBuyGoGoGo'
});
Speech
.
speak
(
data
.
msg
);
};
render
()
{
render
()
{
const
{
goodsArr
,
faceType
,
...
props
}
=
this
.
props
;
const
{
goodsArr
,
faceType
,
onGoBack
,
...
props
}
=
this
.
props
;
let
totalPrice
=
0
;
// 总价
let
totalPrice
=
0
;
// 总价
let
totalCount
=
0
;
// 总优惠
let
totalCount
=
0
;
// 总优惠
let
number
=
0
;
// 总数量
let
number
=
0
;
// 总数量
...
@@ -220,7 +214,7 @@ class OrderDetailMini extends Component {
...
@@ -220,7 +214,7 @@ class OrderDetailMini extends Component {
style
=
{
styles
.
emptyImg
}
style
=
{
styles
.
emptyImg
}
/
>
/
>
<
/View
>
<
/View
>
<
Touch
onPress
=
{()
=>
this
.
onNoBuy
()}
>
<
Touch
onPress
=
{()
=>
onGoBack
()}
>
<
View
<
View
style
=
{{
style
=
{{
backgroundColor
:
backgroundColor
:
...
...
src/components/TipsModal.js
View file @
65eb0c5c
...
@@ -33,6 +33,7 @@ class TipsModal extends Component {
...
@@ -33,6 +33,7 @@ class TipsModal extends Component {
faceType
,
faceType
,
qrCode
,
qrCode
,
onMaskPress
,
onMaskPress
,
tryFace
,
...
props
...
props
}
=
this
.
props
;
}
=
this
.
props
;
let
flag
=
true
;
let
flag
=
true
;
...
@@ -103,7 +104,7 @@ class TipsModal extends Component {
...
@@ -103,7 +104,7 @@ class TipsModal extends Component {
style
=
{
styles
.
tip
}
>
style
=
{
styles
.
tip
}
>
{
tip
}
{
tip
}
<
/Text
>
<
/Text
>
<
Touch
onPress
=
{()
=>
console
.
log
(
'1'
)}
>
<
Touch
onPress
=
{()
=>
tryFace
(
)}
>
<
View
style
=
{
styles
.
tryAngin
}
>
<
View
style
=
{
styles
.
tryAngin
}
>
<
Image
<
Image
source
=
{
require
(
'../assets/shualian.png'
)}
source
=
{
require
(
'../assets/shualian.png'
)}
...
...
src/pages/FacePage.js
View file @
65eb0c5c
...
@@ -257,11 +257,14 @@ class FacePage extends Component {
...
@@ -257,11 +257,14 @@ class FacePage extends Component {
// 出门身份识别提示
// 出门身份识别提示
Speech
.
speak
(
'正在进行安全检查'
);
Speech
.
speak
(
'正在进行安全检查'
);
if
(
this
.
state
.
goodsArr
.
length
===
0
)
{
if
(
this
.
state
.
goodsArr
.
length
===
0
)
{
Speech
.
speak
(
'请点击无购物出店按钮出门'
);
return
;
return
;
}
}
this
.
setState
({
orderDetailMini
:
false
});
const
facepay
=
const
facepay
=
this
.
state
.
faceType
===
'wxpay'
?
this
.
wxFacepay
:
this
.
smilepay
;
this
.
state
.
faceType
===
'wxpay'
?
this
.
wxFacepay
:
this
.
smilepay
;
await
facepay
();
await
facepay
();
// await facepay();
// this.getOrderDetailMiniCounter();
// this.getOrderDetailMiniCounter();
// this.orderDetailMiniPop(30000);
// this.orderDetailMiniPop(30000);
// this.loading(true, 30000);
// this.loading(true, 30000);
...
@@ -310,6 +313,10 @@ class FacePage extends Component {
...
@@ -310,6 +313,10 @@ class FacePage extends Component {
};
};
face
=
()
=>
{
face
=
()
=>
{
this
.
setState
({
tipsModal
:
false
,
goTipsModal
:
false
,
});
this
.
orderDetailMiniPop
(
false
);
this
.
orderDetailMiniPop
(
false
);
const
{
faceType
}
=
this
.
state
;
const
{
faceType
}
=
this
.
state
;
if
(
faceType
===
'wxpay'
)
{
if
(
faceType
===
'wxpay'
)
{
...
@@ -849,7 +856,9 @@ class FacePage extends Component {
...
@@ -849,7 +856,9 @@ class FacePage extends Component {
};
};
balancePay
=
async
openid
=>
{
balancePay
=
async
openid
=>
{
if
(
this
.
barcodeBusy
)
return
true
;
Toast
.
loading
(
'正在付款,请稍后~'
);
Toast
.
loading
(
'正在付款,请稍后~'
);
this
.
barcodeBusy
=
true
;
const
{
ids
,
noBarcode
}
=
this
.
getGoods
();
const
{
ids
,
noBarcode
}
=
this
.
getGoods
();
const
{
data
}
=
await
this
.
props
.
dispatch
({
const
{
data
}
=
await
this
.
props
.
dispatch
({
type
:
'goods/balancePay'
,
type
:
'goods/balancePay'
,
...
@@ -862,17 +871,20 @@ class FacePage extends Component {
...
@@ -862,17 +871,20 @@ class FacePage extends Component {
this
.
successPay
(
true
);
this
.
successPay
(
true
);
await
AutoClick
.
clickBackKey
();
await
AutoClick
.
clickBackKey
();
await
wait
(
1200
);
await
wait
(
1200
);
// await this.setState({orderDetailMini: false})
;
this
.
barcodeBusy
=
false
;
return
data
;
return
data
;
}
}
this
.
barcodeBusy
=
false
;
return
data
;
return
data
;
};
};
barcodePay
=
async
(
code
,
facepay
,
openid
,
fToken
,
uid
)
=>
{
barcodePay
=
async
(
code
,
facepay
,
openid
,
fToken
,
uid
)
=>
{
if
(
this
.
barcodeBusy
)
return
true
;
Toast
.
loading
(
'正在付款,请稍后'
);
Toast
.
loading
(
'正在付款,请稍后'
);
const
isWxpay
=
code
.
toString
().
match
(
/1
[
0-5
]\d{16}
/
);
const
isWxpay
=
code
.
toString
().
match
(
/1
[
0-5
]\d{16}
/
);
const
isAlipay
=
fToken
||
code
.
toString
().
match
(
/^
(
2
[
5-9
]
|30
)\d{14,22}
$/
);
const
isAlipay
=
fToken
||
code
.
toString
().
match
(
/^
(
2
[
5-9
]
|30
)\d{14,22}
$/
);
if
(
!
isWxpay
&&
!
isAlipay
)
return
false
;
if
(
!
isWxpay
&&
!
isAlipay
)
return
false
;
this
.
barcodeBusy
=
true
;
let
successPay
=
false
;
let
successPay
=
false
;
const
{
ids
,
noBarcode
}
=
this
.
getGoods
();
const
{
ids
,
noBarcode
}
=
this
.
getGoods
();
const
res
=
await
this
.
props
.
dispatch
({
const
res
=
await
this
.
props
.
dispatch
({
...
@@ -888,6 +900,7 @@ class FacePage extends Component {
...
@@ -888,6 +900,7 @@ class FacePage extends Component {
if
(
res
.
code
!==
1
)
{
if
(
res
.
code
!==
1
)
{
Toast
.
info
(
`
${
res
.
msg
}
`
);
Toast
.
info
(
`
${
res
.
msg
}
`
);
Speech
.
speak
(
res
.
msg
);
Speech
.
speak
(
res
.
msg
);
this
.
setState
({
orderDetailMini
:
true
});
}
}
if
(
res
.
code
===
1
)
{
if
(
res
.
code
===
1
)
{
this
.
orderId
=
res
.
data
.
orderId
;
this
.
orderId
=
res
.
data
.
orderId
;
...
@@ -919,16 +932,25 @@ class FacePage extends Component {
...
@@ -919,16 +932,25 @@ class FacePage extends Component {
}
}
}
}
}
else
if
(
res
.
code
===
3
)
{
}
else
if
(
res
.
code
===
3
)
{
this
.
setState
({
orderDetailMini
:
true
});
await
wait
(
res
.
data
.
timeout
);
await
wait
(
res
.
data
.
timeout
);
}
else
{
}
else
{
this
.
setState
({
orderDetailMini
:
true
});
await
wait
(
1200
);
await
wait
(
1200
);
}
}
this
.
barcodeBusy
=
false
;
if
(
successPay
)
{
if
(
successPay
)
{
return
'SUCCESS'
;
return
'SUCCESS'
;
}
}
return
true
;
return
true
;
};
};
onNoBuy
=
async
()
=>
{
console
.
log
(
'noBuy'
);
const
{
data
}
=
await
this
.
props
.
dispatch
({
type
:
'store/noBuyGoGoGo'
});
Speech
.
speak
(
data
.
msg
);
};
render
()
{
render
()
{
const
{
const
{
verifyCodeModal
,
verifyCodeModal
,
...
@@ -1004,6 +1026,7 @@ class FacePage extends Component {
...
@@ -1004,6 +1026,7 @@ class FacePage extends Component {
goodsArr
=
{
goodsArr
}
goodsArr
=
{
goodsArr
}
dispatch
=
{
dispatch
}
dispatch
=
{
dispatch
}
faceType
=
{
faceType
}
faceType
=
{
faceType
}
onGoBack
=
{
this
.
onNoBuy
}
/
>
/
>
<
TipsModal
<
TipsModal
visible
=
{
tipsModal
}
visible
=
{
tipsModal
}
...
@@ -1018,6 +1041,7 @@ class FacePage extends Component {
...
@@ -1018,6 +1041,7 @@ class FacePage extends Component {
rightTouch
=
{
this
.
onCall
}
rightTouch
=
{
this
.
onCall
}
onMaskPress
=
{()
=>
this
.
setState
({
tipsModal
:
false
})}
onMaskPress
=
{()
=>
this
.
setState
({
tipsModal
:
false
})}
faceType
=
{
faceType
}
faceType
=
{
faceType
}
tryFace
=
{
this
.
face
}
/
>
/
>
<
TipsModal
<
TipsModal
visible
=
{
goTipsModal
}
visible
=
{
goTipsModal
}
...
@@ -1027,6 +1051,7 @@ class FacePage extends Component {
...
@@ -1027,6 +1051,7 @@ class FacePage extends Component {
tip
=
{
tip
}
tip
=
{
tip
}
onMaskPress
=
{()
=>
this
.
setState
({
goTipsModal
:
false
})}
onMaskPress
=
{()
=>
this
.
setState
({
goTipsModal
:
false
})}
faceType
=
{
faceType
}
faceType
=
{
faceType
}
tryFace
=
{
this
.
face
}
/
>
/
>
<
LoadingModal
transparent
visible
=
{
loadingModal
}
/
>
<
LoadingModal
transparent
visible
=
{
loadingModal
}
/
>
<
View
style
=
{
styles
.
header
}
>
<
View
style
=
{
styles
.
header
}
>
...
...
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