/** * @file Info.tsx * @author lihuanji * * 收货地址详情 */ import React from 'react'; import Icon from '../../../Icon'; const styles = require('./style.module.styl'); const mask = (str: string) => { return str ? str.replace(/(\d{3})(\d{4})/, '$1****') : ''; }; interface InfoProps { name?: string; phone?: string; detail?: string; onClick?: any; } const Info = (props: InfoProps) => { const { name, phone, detail, onClick } = props; return (

商品将寄送至:

{!name || !phone || !detail ? (

请添加收货地址

) : (
{name} {mask(phone)}

{detail}

)}
); }; export default Info;