{"size": 1462, "ext": "js", "max_stars_repo_path": "src/utils/fetch.js", "max_stars_repo_name": "whoskobe/mmjpg2", "max_stars_repo_stars_event_min_datetime": "2018-03-27T15:21:46.000Z", "max_stars_repo_stars_event_max_datetime": "2018-03-27T15:21:46.000Z", "max_issues_repo_path": "src/utils/fetch.js", "max_issues_repo_name": "whoskobe/mmjpg2", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/utils/fetch.js", "max_forks_repo_name": "whoskobe/mmjpg2", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 18.049382716, "max_line_length": 85, "alphanum_fraction": 0.524623803}
import React, {Component} from "react";
import {
    StyleSheet,
    Image,
    Dimensions,
    ListView,
    View,
    ActivityIndicator,
    InteractionManager,
    RefreshControl,
    Platform,
    TouchableWithoutFeedback,
    Text, NativeModules
} from "react-native";


export function fetchBookList(domain, list, page) {

    return new Promise(function (resolve, reject) {


        NativeModules.JsoupModule.getBookList(domain, list, page).then(result => {
            console.log('resolve', result);

            let json = JSON.parse(result);
            console.log('json====>', json);


            resolve(json);


        }).catch(result => {
            console.log('reject', result);

            let json2 = {
                code: 99999,
                message: '发生未知错误，请重试！'
            };

            reject(json2);
        });


    });


}


export function fetchCardList(domain, list, linkUrl) {

    return new Promise(function (resolve, reject) {


        NativeModules.JsoupModule.getCardList(domain, list, linkUrl).then(result => {
            console.log('resolve', result);

            let json = JSON.parse(result);
            console.log('json====>', json);


            resolve(json);


        }).catch(result => {
            console.log('reject', result);

            let json2 = {
                code: 99999,
                message: '发生未知错误，请重试！'
            };

            reject(json2);

        });


    });


}