How to use antd-mobile - 10 common examples

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 neroneroffy / react-music-webapp / client / src / components / my-song-list / my-song-list.js View on Github external
deleteSongList(id){
        Modal.alert('确认删除歌单?', '歌单内的歌曲会一并删除', [
            { text: '取消', onPress: () => console.log('cancel') },
            { text: '确认', onPress: () => {
                this.props.delCollectSongList(id,this.state.userId)
            } },
        ])
    }
/*    onSelect = (opt) => {
github uquinnhau / app_job / src / component / msg / msg.js View on Github external
render(){

		const Item = List.Item
		const Brief = Item.Brief
		const userid = this.props.user._id
		const userinfo = this.props.chat.users
		// console.log(this.props)
		const msgGroup = {}
		this.props.chat.chatmsg.forEach(v=>{
			msgGroup[v.chatid] = msgGroup[v.chatid] || []
			msgGroup[v.chatid].push(v)
		})
		
		const chatList = Object.values(msgGroup).sort((a,b)=>{
			const a_last = this.getLast(a).create_time
			const b_last = this.getLast(b).create_time
			return b_last - a_last
		})
github TronLink / tronlink-extension / packages / popup / src / controllers / TransferController.js View on Github external
func.then((res) => {
                this.setState({loading: false});
                Toast.success(formatMessage({ id: 'SEND.SUCCESS' }), 3, () => onCancel(), true);
                // PopupAPI.setPushMessage({
                //     title:`-${amount}${selectedToken.abbr} ${formatMessage({id:'NOTIFICATIONS.TITLE'})}`,
                //     message:formatMessage({id:'NOTIFICATIONS.MESSAGE'}),
                //     hash:res
                // });
            }).catch(error => {
                Toast.fail(JSON.stringify(error), 3, () => {
github xiyuyizhi / movies / fe / src / component / list.jsx View on Github external
constructor(props) {
        super(props)
        this.props = props
        const ds = new ListView.DataSource({
            rowHasChanged: (r1, r2) => { return r1 !== r2 }
        })
        this._footer = this._footer.bind(this)
        this._row = this._row.bind(this)
        this._onRefresh = this._onRefresh.bind(this)
        this.ds = ds
        this.state = {
            _data: [],
            // refresh: false
        }
    }
github LeeRayno / react-antd-mobile-demo / src / components / ListItem / index.js View on Github external
/**
 * Created by Administrator on 2017/8/10.
 */
import React, { Component } from 'react'
import { List, Button } from 'antd-mobile'
import { connect } from 'react-redux'
import { saveListData } from '../../redux/actions'

import './listItem.less'

const Item = List.Item

class ListItems extends Component {

	// 确认参会
	ensurePart = () => {
		this.props.ensurePart()
	}

	// 取消参会
	cancelPart = () => {
		this.props.cancelPart()
	}

	//签到
	sign = () => {
		this.props.sign()
github yeojongki / douban-house / src / views / Login.jsx View on Github external
handleSubmit = e => {
    e.preventDefault();
    const { username, password } = this.state.form;
    const { dispatch } = this.props;
    if (!username) {
      Toast.show('请输入用户名');
      return;
    }
    if (!password) {
      Toast.show('请输入密码');
      return;
    }
    Toast.loading('登录中...', 0);
    // ajax
    AjaxLogin(this.state.form)
      .then(res => {
        if (res && res.code === 1) {
          let user = res.data;
          // dispatch
          dispatch(setUser(user));
          // set cookie
          let expiresTime = new Date(new Date().getTime() + 2 * 60 * 60 * 1000); //2h
github yeojongki / douban-house / src / views / Login.jsx View on Github external
handleSubmit = e => {
    e.preventDefault();
    const { username, password } = this.state.form;
    const { dispatch } = this.props;
    if (!username) {
      Toast.show('请输入用户名');
      return;
    }
    if (!password) {
      Toast.show('请输入密码');
      return;
    }
    Toast.loading('登录中...', 0);
    // ajax
    AjaxLogin(this.state.form)
      .then(res => {
        if (res && res.code === 1) {
          let user = res.data;
          // dispatch
          dispatch(setUser(user));
          // set cookie
          let expiresTime = new Date(new Date().getTime() + 2 * 60 * 60 * 1000); //2h
          Cookie.set('token', user.token, { expires: expiresTime });
          Cookie.set('username', user.username);
          Toast.info('登录成功', 1, this.props.history.goBack());
        }
github ant-design / ant-design-mobile / components / radio / demo / basic.native.tsx View on Github external
/* tslint:disable:jsx-no-multiline-js */
import { List, Radio, WhiteSpace } from 'antd-mobile';
import React from 'react';
import { Text, View } from 'react-native';
const RadioItem = Radio.RadioItem;

export default class BasicRadioExample extends React.Component {
  state = {
    part1Value: 1,
    part2Value: 1,
  };

  render() {
    return (
github 1ibrary / 1ibrary-front-end / js / pages / Login.js View on Github external
get validatePassed() {

    // forbid gd
    if (this.state.school_id === 1) {
      Toast.fail('请输入正确的密码', 1)
      return false
    }

    if (this.state.school_id === -1) {
      Toast.offline('请选择你的学校噢~', 1)
      return false
    }

    if (!this.state.account) {
      Toast.offline('请输入学号噢~', 1)
      return false
    }

    if (!this.state.password) {
      Toast.offline('请输入密码噢~', 1)
      return false
github Juliiii / React-Cnode / src / components / Tabs / index.js View on Github external
import React from 'react'
import List from '../List';
import { Tabs } from 'antd-mobile';
import { connect } from 'react-redux';
import { topics } from '../../store/actions';
const TabPane = Tabs.TabPane;
const tabs = {
  '全部': 'all',
  '精华': 'good',
  '分享': 'share',
  '问答': 'ask',
  '招聘': 'job',
  // '测试': 'dev'
};

class MyTabs extends React.Component {

  changeTab = (value) => {
    const { loading, refresh, changeTab } = this.props;
    if (loading || refresh) return;

    changeTab(value);