How to use the antd-mobile.Toast.fail function in antd-mobile

To help you get started, we’ve selected a few antd-mobile 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 zxj963577494 / OverWatchTeams / src / containers / Account / RecruitOrders / Create / index.js View on Github external
form.validateFields((error, value) => {
      if (!error) {
        if (this.state.teamid) {
          postRecruit({
            teamid: this.state.teamid,
            contact: this.state.contact,
            title: this.state.title,
            description: this.state.description,
            endDate: this.state.endDate
          })
        } else {
          Toast.fail('请选择战队', 1.5)
        }
      } else {
        Toast.fail('格式错误,请检查后提交', 1.5)
      }
    })
  }
github KieSun / Chat-Buy-React / chat-buy-react / src / actions / user.js View on Github external
return async dispatch => {
    if (!user || !pwd) {
      Toast.fail("请输入帐号密码", 1);
    } else {
      try {
        const res = await axios.post("/user/register", { user, pwd, type });
        if (res.status === 200 && res.data.code === 0) {
          dispatch({ type: REGISTER, payload: res.data.data });
          setToken(res.data.token);
        }
      } catch (error) {
        console.log(error)
      }
    }
  };
}
github wujiabk / zhaopinApp / src / container / geniusinfo / geniusinfo.js View on Github external
saveHandle(){
        const info = Object.values(this.state);
        for(let i =0;i{
            this.props.history.push("/genius")
        });
    }
github Juliiii / React-Cnode / src / store / comments.js View on Github external
this.allReplies.push({
          id: data.data.reply_id,
          author: {
            loginname: session.loginname,
            avatar_url: session.avatar_url
          },
          content,
          ups: [],
          create_at: new Date(),
          reply_id: reply_id ? reply_id : null,
          is_uped: false
        });
      });
      Toast.success(successInfo, 1);
    } catch (err) {
      Toast.fail(errorInfo, 1);
    } finally {
      status.setSubmitting(false);
    }
  }
github layupbolon / cnode-with-umi / src / pages / login / index.js View on Github external
cb: (isSuccess, msg) => {
                                    if (isSuccess) {
                                        Toast.success(msg, 1);
                                        router.replace('/me');
                                    } else {
                                        Toast.fail(msg, 1);
                                    }
                                }
                            }
github zxj963577494 / OverWatchTeams-React-Native-Expo / src / sagas / teamsSaga.js View on Github external
if (team.length < currentUser.get('teamLimit')) {
      const response = yield call(teamsService.cerateTeam, payload, currentUser)
      yield put(action.postTeamsSuccess(response))
      Toast.success('提交成功', 1)
      yield delay(1000)
      yield put(NavigationActions.back())
    } else {
      yield put(action.postTeamsFailed())
      Toast.fail(
        '提交失败,每位用户最多可创建一支战队,若想创建多支战队,请联系管理员963577494@qq.com',
        3
      )
    }
  } catch (error) {
    yield put(action.postTeamsFailed())
    Toast.fail('提交失败', 1)
  }
}
github minooo / react-ssr / pages / 3-me / 2-login.js View on Github external
http.get('register_agreement').then((response) => {
            if (response.code === 200 && response.success) {
              const agreeCon = response.data.register_agreement.register_agreement
              this.setState(() => ({ agreeCon }))
            } else {
              Toast.fail(response.msg ? response.msg : '获取异常,请稍后再试。')
            }
          }).catch(() => { Toast.offline('抱歉,网络错误,请稍后再试!') })
        })
github Peroluo / easyMarketApp / src / page / goods / index.js View on Github external
async fetchCartNum () {
    try {
      const {errno, errmsg, cartTotal} = await http.getCartNum({})
      if(errno===401){
          Toast.fail(errmsg, .5,() => {
            this.props.actions.loginFailure()
          })
      }else{
        this.setState({goodsCount:cartTotal.goodsCount})
      }
    } catch (e) {
        throw e
    }
  }
  /*添加到我喜欢*/