How to use the antd-mobile-rn.Toast.loading function in antd-mobile-rn

To help you get started, we’ve selected a few antd-mobile-rn examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gyxing / react-native-book / app / containers / Read.js View on Github external
if (!chapterList) {
      chapterList = this.state.chapterList;
    }

    if (chapter.content) {
      this.setState({
        book,
        chapter,
        chapterList
      });
      this.scrollToTop();
      this.drawer.closeDrawer();
      // 自动缓存后5章
      this.onCache(5);
    } else {
      Toast.loading("正在下载内容...", 0);
      this.props.dispatch(
        createAction("book/searchContent")({
          chapter,
          callback: content => {
            Toast.hide();
            if (content) {
              chapter.content = content;
              chapterList.find(item => item.id === chapter.id).content = content;
              this.setState({
                book,
                chapter,
                chapterList
              });
              this.scrollToTop();
              this.drawer.closeDrawer();
              // 自动缓存后5章
github gyxing / react-native-book / app / containers / Detail.js View on Github external
onToRead = () => {
    const { book } = this.state
    if (!book.url) {
      Toast.loading('初次阅读,正在加载章节列表...', 0)
      this.props.dispatch(
        createAction('book/searchBookUrl')({
          book,
          onSuccess: () => {
            Toast.hide()
            this.props.dispatch(
              NavigationActions.navigate({
                routeName: 'Read',
                params: { id: book.id },
              })
            )
          },
          onError: () => {
            Toast.fail('缺乏资源,无法阅读', 1)
          },
        })
github gyxing / react-native-book / app / containers / Switching.js View on Github external
onRowClick = (item) => {
        const {dispatch} = this.props;
        Toast.loading("加载中...", 0);
        dispatch(createAction("book/replaceChapters")({
            book: this.book,
            dlWay: this.state.dlWay,
            origin: item,
            ...this.afterCallback()
        }));
    };
github gyxing / react-native-book / app / containers / Home.js View on Github external
onItemClick = item => {
        if (!item.url) {
            Toast.loading("初次阅读,正在加载章节列表...", 0);
            this.props.dispatch(
                createAction("book/searchBookUrl")({
                    book: item,
                    onSuccess: () => {
                        Toast.hide();
                        this.props.dispatch(
                            NavigationActions.navigate({
                                routeName: "Read",
                                params: { id: item.id }
                            })
                        );
                    },
                    onError: () => {
                        Modal.alert("此来源缺少数据", "是否切换下载源?", [
                            { text: "不用", style: "cancel" },
                            {

antd-mobile-rn

基于蚂蚁金服移动设计规范的 React Native 组件库

MIT
Latest version published 6 years ago

Package Health Score

67 / 100
Full package analysis