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
caa79788
Commit
caa79788
authored
Dec 01, 2021
by
zeven
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/hzp'
parents
812f54db
7b025397
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
99 additions
and
8 deletions
+99
-8
card.png
src/assets/Vertical/card.png
+0
-0
card.js
src/models/card.js
+9
-0
goods.js
src/models/goods.js
+3
-0
index.js
src/models/index.js
+2
-0
CounterMixins.js
src/pages/CounterMixins.js
+35
-1
VerticalPage.js
src/pages/VerticalPage.js
+34
-7
goods.js
src/services/goods.js
+4
-0
yarn.lock
yarn.lock
+12
-0
No files found.
src/assets/Vertical/card.png
0 → 100644
View file @
caa79788
11 KB
src/models/card.js
0 → 100644
View file @
caa79788
export
default
{
namespace
:
'card'
,
state
:
false
,
reducers
:
{
change
(
bool
)
{
return
!
bool
;
},
},
};
src/models/goods.js
View file @
caa79788
...
...
@@ -99,5 +99,8 @@ export default {
*
getOrderCounter
(
action
,
{
call
})
{
return
yield
call
(
api
.
getOrderCounter
,
action
);
},
*
cardPay
(
action
,
{
call
})
{
return
yield
call
(
api
.
cardPay
,
action
);
},
},
};
src/models/index.js
View file @
caa79788
...
...
@@ -11,6 +11,7 @@ import store from './store';
import
agora
from
'./agora'
;
import
lucky
from
'./lucky'
;
import
searchGoods
from
'./searchGoods'
;
import
card
from
'./card'
;
const
{
width
:
_width
,
height
:
_height
}
=
Dimensions
.
get
(
'window'
);
...
...
@@ -79,4 +80,5 @@ export default [
agora
,
lucky
,
searchGoods
,
card
,
];
src/pages/CounterMixins.js
View file @
caa79788
...
...
@@ -125,6 +125,32 @@ const CounterMixins = ComposeComponent => {
this
.
listen
();
};
handleCard
=
async
cardId
=>
{
Toast
.
hide
();
Toast
.
loading
(
'正在付款,请稍后~'
);
const
{
ids
,
noBarcode
}
=
this
.
getGoods
();
this
.
props
.
dispatch
({
type
:
'goods/cardPay'
,
ids
,
noBarcode
,
cardId
,
})
.
then
(
async
({
data
})
=>
{
console
.
log
(
data
);
if
(
data
.
code
===
1
)
{
this
.
orderId
=
data
.
data
.
orderId
;
await
this
.
successPay
(
true
);
}
else
{
Toast
.
hide
();
Speech
.
speak
(
data
.
msg
);
}
});
setTimeout
(()
=>
{
this
.
setState
({
voiceModal
:
false
});
},
2000
);
};
componentWillUnmount
=
()
=>
{
clearInterval
(
this
.
clearListInter
);
clearInterval
(
this
.
payInter
);
...
...
@@ -555,6 +581,9 @@ const CounterMixins = ComposeComponent => {
};
submitBarcode
=
async
barcode
=>
{
if
(
this
.
props
.
card
)
{
return
await
this
.
handleCard
(
barcode
||
this
.
barcode
);
}
this
.
errGood
=
null
;
if
(
!
window
.
auth
)
{
const
msg
=
'系统未授权,无法查询商品'
;
...
...
@@ -994,7 +1023,12 @@ const CounterMixins = ComposeComponent => {
};
}
return
connect
(({
goods
,
admin
,
store
})
=>
({
goods
,
admin
,
store
}))(
Mixins
);
return
connect
(({
goods
,
admin
,
store
,
card
})
=>
({
goods
,
admin
,
store
,
card
,
}))(
Mixins
);
};
const
CloseButton
=
({
onClose
,
style
})
=>
{
...
...
src/pages/VerticalPage.js
View file @
caa79788
...
...
@@ -5,7 +5,6 @@ import Swiper from 'react-native-swiper';
import
QRCode
from
'react-native-qrcode-svg'
;
import
Icon
from
'react-native-vector-icons/Ionicons'
;
import
Icons
from
'react-native-vector-icons/MaterialIcons'
;
// import { connect } from 'react-redux';
import
CounterMixins
from
'./CounterMixins'
;
import
NP
from
'../utils/np'
;
import
AutoClick
from
'../utils/AutoClick'
;
...
...
@@ -38,7 +37,6 @@ window.pageSize = pageSize;
// const wait = t => new Promise(resolve => setTimeout(resolve, t));
// @connect(({ app }) => ({ app }))
class
VerticalPage
extends
Component
{
state
=
{
contact
:
''
,
...
...
@@ -51,6 +49,7 @@ class VerticalPage extends Component {
logoVisible
:
true
,
logo
:
''
,
priceVisible
:
true
,
isCard
:
false
,
};
async
componentWillMount
()
{
...
...
@@ -139,6 +138,12 @@ class VerticalPage extends Component {
group
,
});
if
(
data
.
code
===
1
&&
data
.
data
)
{
if
(
data
.
data
.
cardCounter
)
{
// 是否支持刷卡
this
.
setState
({
isCard
:
true
,
});
}
await
this
.
setState
({
logo
:
`
${
ossLink
}
/
${
data
.
data
.
logo
}
`
,
priceVisible
:
data
.
data
.
priceVisible
,
...
...
@@ -540,6 +545,14 @@ class VerticalPage extends Component {
}
};
cardPayPay
=
async
()
=>
{
Speech
.
speak
(
'请刷卡'
);
Toast
.
loading
(
'请刷卡'
,
2000
,
()
=>
{
this
.
props
.
dispatch
({
type
:
'card/change'
});
});
this
.
props
.
dispatch
({
type
:
'card/change'
});
};
render
()
{
let
{
admin
,
...
...
@@ -557,6 +570,7 @@ class VerticalPage extends Component {
logo
,
priceVisible
,
stype
,
isCard
,
}
=
this
.
state
;
pageSize
=
goods
&&
goods
.
bags
.
length
>
0
...
...
@@ -897,14 +911,16 @@ class VerticalPage extends Component {
{
/* })}*/
}
{
/*</View>*/
}
<
View
style
=
{
styles
.
shadow
}
/
>
<
Touch
onPress
=
{
facepay
}
>
<
Touch
onPress
=
{
isCard
?
this
.
cardPayPay
:
facepay
}
>
<
View
style
=
{
styles
.
guide
}
>
<
Text
style
=
{
styles
.
guideText
}
>
点击进入
<
/Text
>
<
Image
source
=
{
require
(
'../assets/down.png'
)}
style
=
{
styles
.
down
}
/
>
<
Text
style
=
{
styles
.
guideText
}
>
人脸支付
<
/Text
>
<
Text
style
=
{
styles
.
guideText
}
>
{
isCard
?
'刷卡支付'
:
'人脸支付'
}
<
/Text
>
<
/View
>
<
/Touch
>
<
View
style
=
{
styles
.
payment
}
>
...
...
@@ -935,14 +951,22 @@ class VerticalPage extends Component {
<
/View
>
<
/View
>
<
View
style
=
{
styles
.
faceScan
}
>
<
Touch
onPress
=
{
facepay
}
>
<
Touch
onPress
=
{
isCard
?
this
.
cardPayPay
:
facepay
}
>
<
View
>
{
isCard
?
(
<
Image
source
=
{
require
(
'../assets/Vertical/card.png'
)}
alt
=
""
/>
)
:
(
<
Image
source
=
{
require
(
'../assets/Vertical/face.gif'
)}
style
=
{
styles
.
faceGif
}
alt
=
""
/>
)}
<
View
style
=
{
styles
.
facePay
}
>
{
!
isCard
&&
(
<
Image
source
=
{
this
.
state
.
faceType
===
'wxpay'
...
...
@@ -952,7 +976,10 @@ class VerticalPage extends Component {
style
=
{
styles
.
payImage
}
alt
=
""
/>
<
Text
style
=
{
styles
.
payText
}
>
点击刷脸支付
<
/Text
>
)}
<
Text
style
=
{
styles
.
payText
}
>
{
isCard
?
'点击刷卡支付'
:
'点击刷脸支付'
}
<
/Text
>
<
/View
>
<
/View
>
<
/Touch
>
...
...
@@ -995,7 +1022,7 @@ class VerticalPage extends Component {
<
Text
style
=
{
styles
.
explainText2
}
>
2
<
/Text
>
<
/View
>
<
Text
style
=
{
styles
.
explainText1
}
>
微信
/
支付宝扫二维码或付款码付款
{
isCard
?
'刷卡付款'
:
'微信/支付宝扫二维码或付款码付款'
}
<
/Text
>
<
/View
>
<
/View
>
...
...
src/services/goods.js
View file @
caa79788
...
...
@@ -78,3 +78,7 @@ export function balancePay(action) {
export
function
getOrderCounter
()
{
return
axios
.
get
(
'/store/goods/counter'
);
}
export
function
cardPay
(
action
)
{
return
axios
.
post
(
'/store/goods/cardPay'
,
qs
.
stringify
(
action
));
}
yarn.lock
View file @
caa79788
...
...
@@ -5891,6 +5891,18 @@ react-native-qrcode-svg@6.0.6:
prop-types "^15.5.10"
qrcode "^1.3.2"
react-native-root-modal@^5.0.1:
version "5.0.1"
resolved "https://registry.npm.taobao.org/react-native-root-modal/download/react-native-root-modal-5.0.1.tgz#8b49f523f70732f1697961edc42174f81259e6c1"
integrity sha1-i0n1I/cHMvFpeWHtxCF0+BJZ5sE=
dependencies:
react-native-root-siblings "^4.0.0"
react-native-root-siblings@^4.0.0:
version "4.1.1"
resolved "https://registry.nlark.com/react-native-root-siblings/download/react-native-root-siblings-4.1.1.tgz#b7742db7634a87f507eb99a5fd699c4f10c46ab0"
integrity sha1-t3Qtt2NKh/UH65ml/WmcTxDEarA=
react-native-svg@12.1.0:
version "12.1.0"
resolved "https://registry.npm.taobao.org/react-native-svg/download/react-native-svg-12.1.0.tgz#acfe48c35cd5fca3d5fd767abae0560c36cfc03d"
...
...
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