import React from 'react';
import { View, Image, Button } from '@tarojs/components';
// import Icon from '@/assets/image/WeChat.png';
import { useModel } from '@/store';
import { Icon } from '@antmjs/vantui';
import style from './bottom.module.less';

export default (props) => {

  const { signinByPhone } = useModel('user');

  const onGetPhoneNumber = (e) => {
    console.log(e)
    const code = e.detail.code;
    signinByPhone(code).then(props.onSuccess);
  }

  return (
    <View>
      <View className={style['txt-box2']}>—— 没有账号？手机号快捷登录 ——</View>
      <View className={style['img-box2']}>
        <Button openType="getPhoneNumber" onGetPhoneNumber={onGetPhoneNumber}>
          {/* <Image className={style['img-wechat']}
            src={Icon}
          /> */}
          <Icon name="phone" size="32px" color='green' style={{ marginTop: '10px' }} />
        </Button>
      </View>
      <View className={style['wechat-login']}>手机号快捷登录</View>
    </View>
  )
}
