Showing
2 changed files
with
19 additions
and
3 deletions
| @@ -26,6 +26,25 @@ export default class Home extends Component { | @@ -26,6 +26,25 @@ export default class Home extends Component { | ||
| 26 | post("/test/insurance/article", {}, res => {}, err => {}); | 26 | post("/test/insurance/article", {}, res => {}, err => {}); |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | + getAllPhone() { | ||
| 30 | + Contacts.getAll((err, contacts) => { | ||
| 31 | + if(err && err.type === 'permissionDenied'){ | ||
| 32 | + } else { | ||
| 33 | + let phones = []; | ||
| 34 | + contacts.forEach((item, index) => { | ||
| 35 | + item.phoneNumbers.forEach((phone, i) => { | ||
| 36 | + phones.push(phone.number); | ||
| 37 | + }); | ||
| 38 | + }); | ||
| 39 | + post('/spreader/rank/friends/contact', { contact: phones }, (res) => { | ||
| 40 | + this.getRankData(); | ||
| 41 | + }, (resErr) => { | ||
| 42 | + Toast.show(resErr.cnmsg, Toast.error); | ||
| 43 | + }); | ||
| 44 | + } | ||
| 45 | + }); | ||
| 46 | + } | ||
| 47 | + | ||
| 29 | render() { | 48 | render() { |
| 30 | const { navigate } = this.props.navigation; | 49 | const { navigate } = this.props.navigation; |
| 31 | return ( | 50 | return ( |
| @@ -58,9 +58,6 @@ export default class Discover extends Component { | @@ -58,9 +58,6 @@ export default class Discover extends Component { | ||
| 58 | } | 58 | } |
| 59 | }); | 59 | }); |
| 60 | } | 60 | } |
| 61 | - // handleCopyPress(string) { | ||
| 62 | - // Clipboard.setString(string); | ||
| 63 | - // } | ||
| 64 | copyWords(string) { | 61 | copyWords(string) { |
| 65 | const { goBack } = this.props.navigation; | 62 | const { goBack } = this.props.navigation; |
| 66 | Clipboard.setString(string); | 63 | Clipboard.setString(string); |
-
Please register or login to post a comment