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
58ff831d
Commit
58ff831d
authored
Dec 04, 2020
by
zeven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
集成自动点击模块
parent
efe0dac6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
2 deletions
+25
-2
android
android
+1
-1
App.js
src/App.js
+13
-1
AutoClick.js
src/utils/AutoClick.js
+11
-0
No files found.
android
@
90de9a22
Subproject commit
754e073990b0b8e13a3803804926f906d552e11a
Subproject commit
90de9a22a3567b2ece5d442828347be44b76673c
src/App.js
View file @
58ff831d
import
React
from
'react'
;
import
React
from
'react'
;
import
{
Dimensions
,
AppState
}
from
'react-native'
;
import
{
Dimensions
,
AppState
,
BackHandler
,
ToastAndroid
}
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
qs
from
'qs'
;
import
qs
from
'qs'
;
...
@@ -63,6 +63,7 @@ class App extends React.Component {
...
@@ -63,6 +63,7 @@ class App extends React.Component {
async
componentWillMount
()
{
async
componentWillMount
()
{
// await AsyncStorage.clear(); // 清除数据
// await AsyncStorage.clear(); // 清除数据
this
.
onPressBack
();
window
.
dispatch
=
this
.
props
.
dispatch
;
window
.
dispatch
=
this
.
props
.
dispatch
;
const
HOST
=
await
AsyncStorage
.
getItem
(
'HOST'
);
const
HOST
=
await
AsyncStorage
.
getItem
(
'HOST'
);
axios
.
defaults
.
baseURL
=
HOST
||
host
;
// 配置接口地址
axios
.
defaults
.
baseURL
=
HOST
||
host
;
// 配置接口地址
...
@@ -90,6 +91,17 @@ class App extends React.Component {
...
@@ -90,6 +91,17 @@ class App extends React.Component {
});
});
}
}
onPressBack
=
()
=>
{
let
exit
=
false
;
BackHandler
.
addEventListener
(
'hardwareBackPress'
,
()
=>
{
if
(
exit
)
BackHandler
.
exitApp
();
exit
=
true
;
ToastAndroid
.
show
(
'再按一次退出程序'
,
ToastAndroid
.
SHORT
);
setTimeout
(()
=>
(
exit
=
false
),
2000
);
return
true
;
});
};
listen
=
()
=>
{
listen
=
()
=>
{
const
{
dispatch
}
=
this
.
props
;
const
{
dispatch
}
=
this
.
props
;
window
.
socket
.
on
(
'connect'
,
()
=>
{
window
.
socket
.
on
(
'connect'
,
()
=>
{
...
...
src/utils/AutoClick.js
0 → 100644
View file @
58ff831d
import
{
NativeModules
}
from
'react-native'
;
let
{
AutoClick
}
=
NativeModules
;
if
(
!
AutoClick
)
{
AutoClick
=
{
isSettingsOn
:
async
()
=>
true
,
};
}
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