PageResult 结果页

定义/Definition

用于系统繁忙,网络异常,返回空结果等异常页面,结果页的插画可以自定义。

代码演示

出错

  1. import { PageResult } from 'antd-mobile';
  2. const PageResultExample = () => (
  3. <PageResult
  4. imgUrl="https://os.alipayobjects.com/rmsportal/SgCjcxAQTmmNUWi.png"
  5. title="加载出错"
  6. buttonTxt="重新加载"
  7. buttonClick={() => alert('点击了按钮')}
  8. />
  9. );
  10. ReactDOM.render(<PageResultExample />, mountNode);

系统繁忙

  1. import { PageResult } from 'antd-mobile';
  2. const PageResultExample = () => (
  3. <PageResult
  4. imgUrl="https://os.alipayobjects.com/rmsportal/awwrfcIKXAKwGyx.png"
  5. title="系统繁忙"
  6. buttonTxt="重新加载"
  7. buttonClick={() => alert('点击了按钮')}
  8. />
  9. );
  10. ReactDOM.render(<PageResultExample />, mountNode);

404

  1. import { PageResult } from 'antd-mobile';
  2. const PageResultExample = () => (
  3. <PageResult
  4. imgUrl="https://os.alipayobjects.com/rmsportal/awwrfcIKXAKwGyx.png"
  5. title="系统繁忙"
  6. buttonTxt="重新加载"
  7. buttonClick={() => alert('点击了按钮')}
  8. />
  9. );
  10. ReactDOM.render(<PageResultExample />, mountNode);

空白页

  1. import { PageResult } from 'antd-mobile';
  2. const PageResultExample = () => (
  3. <PageResult
  4. imgUrl="https://os.alipayobjects.com/rmsportal/dlMevdYPbXUwgCQ.png"
  5. title="空白页"
  6. brief="可各业务自定义文案"
  7. buttonTxt="重新加载"
  8. buttonClick={() => alert('点击了按钮')}
  9. />
  10. );
  11. ReactDOM.render(<PageResultExample />, mountNode);

断线

  1. import { PageResult } from 'antd-mobile';
  2. const PageResultExample = () => (
  3. <PageResult
  4. imgUrl="https://os.alipayobjects.com/rmsportal/XMUAssczvVftDHX.png"
  5. title="网络无法连接"
  6. brief="请查看网络连接或稍后重试"
  7. buttonTxt="刷新"
  8. buttonClick={() => alert('点击了按钮')}
  9. />
  10. );
  11. ReactDOM.render(<PageResultExample />, mountNode);

其他自定义样式

  1. import { PageResult } from 'antd-mobile';
  2. const PageResultExample = () => (
  3. <div className="other">
  4. <PageResult
  5. imgUrl="https://os.alipayobjects.com/rmsportal/MKXqtwNOLFmYmrY.png"
  6. title="内容为空"
  7. brief="可各业务自定义文案"
  8. buttonTxt="重新尝试"
  9. buttonClick={() => alert('点击了按钮')}
  10. />
  11. <PageResult
  12. imgUrl="https://os.alipayobjects.com/rmsportal/hcEPreZxgZWxhVw.png"
  13. title="警示"
  14. brief="可各业务自定义文案"
  15. buttonTxt="重新加载"
  16. buttonClick={() => alert('点击了按钮')}
  17. />
  18. <PageResult
  19. imgUrl="https://os.alipayobjects.com/rmsportal/QGxGZRxaqMRKnjS.png"
  20. title="网络不给力"
  21. brief="请查看网络连接或稍后重试"
  22. buttonTxt="重新尝试"
  23. buttonClick={() => alert('点击了按钮')}
  24. />
  25. </div>
  26. );
  27. ReactDOM.render(<PageResultExample />, mountNode);
  1. .other .am-page-result {
  2. border-bottom: 8px solid #e9e9e9;
  3. }

PageResult结果页 - 图1

API

PageResult

成员说明类型默认值
imgUrl插图URLstring
titletitle文案string
briefbrief文案string
buttonTxt按钮文案string
buttonType请参考button的配置string
buttonGhost请参考button的配置bool
buttonClick按钮回调函数Func