Toggle navigation
Toggle navigation
This project
Loading...
Sign in
罗广聪
/
ProtectGod
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
罗广聪
2017-09-29 18:15:40 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a1f3faaf4e9ee03ab9079934becb0f4a9c632699
a1f3faaf
1 parent
09b3f0fd
contact 可读取电话了
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
29 additions
and
11 deletions
android/app/build.gradle
android/app/src/main/java/com/protectgod/MainApplication.java
android/settings.gradle
ios/ProtectGod.xcodeproj/project.pbxproj
ios/ProtectGod/Info.plist
package.json
src/pages/Customer/index.js
yarn.lock
android/app/build.gradle
View file @
a1f3faa
...
...
@@ -133,6 +133,7 @@ android {
}
dependencies
{
compile
project
(
':react-native-contacts'
)
compile
fileTree
(
dir:
"libs"
,
include:
[
"*.jar"
])
compile
"com.android.support:appcompat-v7:23.0.1"
compile
"com.facebook.react:react-native:+"
// From node_modules
...
...
android/app/src/main/java/com/protectgod/MainApplication.java
View file @
a1f3faa
...
...
@@ -3,6 +3,7 @@ package com.protectgod;
import
android.app.Application
;
import
com.facebook.react.ReactApplication
;
import
com.rt2zz.reactnativecontacts.ReactNativeContacts
;
import
com.facebook.react.ReactNativeHost
;
import
com.facebook.react.ReactPackage
;
import
com.facebook.react.shell.MainReactPackage
;
...
...
@@ -22,7 +23,8 @@ public class MainApplication extends Application implements ReactApplication {
@Override
protected
List
<
ReactPackage
>
getPackages
()
{
return
Arrays
.<
ReactPackage
>
asList
(
new
MainReactPackage
()
new
MainReactPackage
(),
new
ReactNativeContacts
()
);
}
};
...
...
android/settings.gradle
View file @
a1f3faa
rootProject
.
name
=
'ProtectGod'
include
':react-native-contacts'
project
(
':react-native-contacts'
).
projectDir
=
new
File
(
rootProject
.
projectDir
,
'../node_modules/react-native-contacts/android'
)
include
':app'
...
...
ios/ProtectGod.xcodeproj/project.pbxproj
View file @
a1f3faa
This diff is collapsed. Click to expand it.
ios/ProtectGod/Info.plist
View file @
a1f3faa
...
...
@@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist
version=
"1.0"
>
<dict>
<key>
NSContactsUsageDescription
</key>
<string>
是否允许访问通信录
</string>
<key>
CFBundleDevelopmentRegion
</key>
<string>
en
</string>
<key>
CFBundleDisplayName
</key>
...
...
@@ -51,5 +53,7 @@
</array>
<key>
UIViewControllerBasedStatusBarAppearance
</key>
<false/>
<key>
LSApplicationCategoryType
</key>
<string></string>
</dict>
</plist>
...
...
package.json
View file @
a1f3faa
...
...
@@ -9,6 +9,7 @@
"dependencies"
:
{
"react"
:
"16.0.0-alpha.12"
,
"react-native"
:
"0.48.1"
,
"react-native-contacts"
:
"^1.0.2"
,
"react-native-easy-grid"
:
"^0.1.15"
,
"react-native-swiper"
:
"^1.5.11"
,
"react-navigation"
:
"^1.0.0-beta.11"
...
...
src/pages/Customer/index.js
View file @
a1f3faa
...
...
@@ -14,6 +14,7 @@ import {
}
from
"react-native"
;
import
{
StackNavigator
,
TabNavigator
}
from
"react-navigation"
;
import
post
from
"../../utils/fetch"
;
import
Contacts
from
'react-native-contacts'
;
export
default
class
Customer
extends
Component
{
constructor
(
props
)
{
...
...
@@ -43,6 +44,7 @@ export default class Customer extends Component {
}
]
};
this
.
getAllPhone
=
this
.
getAllPhone
.
bind
(
this
);
}
componentWillMount
()
{
this
.
getAsyncStorage
();
...
...
@@ -63,16 +65,17 @@ export default class Customer extends Component {
phones
.
push
(
phone
.
number
);
});
});
post
(
"/spreader/rank/friends/contact"
,
{
contact
:
phones
},
res
=>
{
this
.
getRankData
();
},
resErr
=>
{
Toast
.
show
(
resErr
.
cnmsg
,
Toast
.
error
);
}
);
console
.
log
(
"通信录"
,
phones
)
// post(
// "/spreader/rank/friends/contact",
// { contact: phones },
// res => {
// this.getRankData();
// },
// resErr => {
// Toast.show(resErr.cnmsg, Toast.error);
// }
// );
}
});
}
...
...
@@ -124,6 +127,7 @@ export default class Customer extends Component {
}
else
{
{
/* navigate("CustomerEdit"); */
this
.
getAllPhone
()
}
}
}}
...
...
yarn.lock
View file @
a1f3faa
...
...
@@ -3548,6 +3548,10 @@ react-devtools-core@^2.5.0:
shell-quote "^1.6.1"
ws "^2.0.3"
react-native-contacts@^1.0.2:
version "1.0.2"
resolved "http://registry.npm.taobao.org/react-native-contacts/download/react-native-contacts-1.0.2.tgz#58b3b0572e3972a320c731ff639091b013a3c4b0"
react-native-dismiss-keyboard@1.0.0:
version "1.0.0"
resolved "http://registry.npm.taobao.org/react-native-dismiss-keyboard/download/react-native-dismiss-keyboard-1.0.0.tgz#32886242b3f2317e121f3aeb9b0a585e2b879b49"
...
...
Please
register
or
login
to post a comment