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
6f7f0cd0
Commit
6f7f0cd0
authored
Dec 04, 2020
by
zeven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支付宝自动点击确认
parent
98c6b890
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
8 deletions
+31
-8
android
android
+1
-1
FacePage.js
src/pages/FacePage.js
+5
-2
VerticalPage.js
src/pages/VerticalPage.js
+14
-3
AutoClick.js
src/utils/AutoClick.js
+11
-2
No files found.
android
@
ae144fb0
Subproject commit
90de9a22a3567b2ece5d442828347be44b76673c
Subproject commit
ae144fb06f21278eac9ee5357c0dd64ba36079c0
src/pages/FacePage.js
View file @
6f7f0cd0
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
{
View
,
Text
,
Image
}
from
'react-native'
;
import
{
View
,
Text
,
Image
,
DeviceEventEmitter
}
from
'react-native'
;
import
AsyncStorage
from
'@react-native-community/async-storage'
;
import
AsyncStorage
from
'@react-native-community/async-storage'
;
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
// import RtcEngine from 'react-native-agora';
// import RtcEngine from 'react-native-agora';
...
@@ -61,6 +61,9 @@ class FacePage extends Component {
...
@@ -61,6 +61,9 @@ class FacePage extends Component {
}
}
const
setting
=
await
AutoClick
.
isSettingsOn
();
const
setting
=
await
AutoClick
.
isSettingsOn
();
if
(
!
setting
)
this
.
setState
({
setting
:
true
});
// 展示按钮
if
(
!
setting
)
this
.
setState
({
setting
:
true
});
// 展示按钮
DeviceEventEmitter
.
addListener
(
'wxpayfaceRegister'
,
()
=>
{
this
.
wechatFace
();
// 点击开通重新调用
});
}
}
setting
=
async
()
=>
{
setting
=
async
()
=>
{
...
@@ -331,7 +334,7 @@ class FacePage extends Component {
...
@@ -331,7 +334,7 @@ class FacePage extends Component {
ask_unionid
:
1
,
ask_unionid
:
1
,
};
};
let
res
=
(
await
WxFacepay
.
faceinfo
(
params
))
||
{};
let
res
=
(
await
WxFacepay
.
faceinfo
(
params
))
||
{};
if
(
!
res
.
openid
)
{
if
(
!
res
.
openid
&&
!
AutoClick
.
enable
)
{
// 返回错误自动重新识别
// 返回错误自动重新识别
res
=
(
await
WxFacepay
.
faceinfo
(
params
))
||
{};
res
=
(
await
WxFacepay
.
faceinfo
(
params
))
||
{};
}
}
...
...
src/pages/VerticalPage.js
View file @
6f7f0cd0
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
{
View
,
Text
,
Image
,
FlatList
,
Modal
,
Button
}
from
'react-native'
;
import
{
View
,
Text
,
Image
,
FlatList
,
Modal
,
Button
,
DeviceEventEmitter
,
}
from
'react-native'
;
import
AsyncStorage
from
'@react-native-community/async-storage'
;
import
AsyncStorage
from
'@react-native-community/async-storage'
;
import
Swiper
from
'react-native-swiper'
;
import
Swiper
from
'react-native-swiper'
;
import
QRCode
from
'react-native-qrcode-svg'
;
import
QRCode
from
'react-native-qrcode-svg'
;
...
@@ -57,6 +65,9 @@ class VerticalPage extends Component {
...
@@ -57,6 +65,9 @@ class VerticalPage extends Component {
}
}
const
setting
=
await
AutoClick
.
isSettingsOn
();
const
setting
=
await
AutoClick
.
isSettingsOn
();
if
(
!
setting
)
this
.
setState
({
setting
:
true
});
// 展示按钮
if
(
!
setting
)
this
.
setState
({
setting
:
true
});
// 展示按钮
DeviceEventEmitter
.
addListener
(
'wxpayfaceRegister'
,
()
=>
{
this
.
wxFacepay
();
// 点击开通重新调用
});
}
}
setting
=
async
()
=>
{
setting
=
async
()
=>
{
...
@@ -215,7 +226,7 @@ class VerticalPage extends Component {
...
@@ -215,7 +226,7 @@ class VerticalPage extends Component {
return
;
return
;
}
}
let
res
=
await
WxFacepay
.
facepay
(
params
);
let
res
=
await
WxFacepay
.
facepay
(
params
);
if
(
!
res
)
{
if
(
!
res
&&
!
AutoClick
.
enable
)
{
// 返回错误自动重新识别
// 返回错误自动重新识别
res
=
await
WxFacepay
.
facepay
(
params
);
res
=
await
WxFacepay
.
facepay
(
params
);
}
}
...
@@ -254,7 +265,7 @@ class VerticalPage extends Component {
...
@@ -254,7 +265,7 @@ class VerticalPage extends Component {
}
}
};
};
onCall
=
async
phone
=>
{
onCall
=
async
()
=>
{
const
{
talkCall
}
=
this
.
state
;
const
{
talkCall
}
=
this
.
state
;
if
(
talkCall
===
2
)
{
if
(
talkCall
===
2
)
{
Speech
.
speak
(
'正在接通中请稍候'
);
Speech
.
speak
(
'正在接通中请稍候'
);
...
...
src/utils/AutoClick.js
View file @
6f7f0cd0
import
{
NativeModules
}
from
'react-native'
;
import
{
NativeModules
}
from
'react-native'
;
let
{
AutoClick
}
=
NativeModules
;
let
AutoClick
=
{}
;
if
(
!
AutoClick
)
{
if
(
!
NativeModules
.
AutoClick
)
{
AutoClick
=
{
AutoClick
=
{
isSettingsOn
:
async
()
=>
true
,
isSettingsOn
:
async
()
=>
true
,
};
};
}
else
{
AutoClick
=
{
isSettingsOn
:
async
()
=>
{
const
enable
=
await
NativeModules
.
AutoClick
.
isSettingsOn
();
AutoClick
.
enable
=
enable
;
return
enable
;
},
goSetting
:
NativeModules
.
AutoClick
.
goSetting
,
};
}
}
export
default
AutoClick
;
export
default
AutoClick
;
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