export const isMobile = () => {
  return navigator.userAgent.match(
    /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
  );
};
export const openApp = (url: string) => {
  let res = isMobile();
  if (!res) {
    return;
  }
  // 是手机
  // window.location.href = 'https://wa.me/';
  let _href = 'https://api.whatsapp.com/send?';
  _href += '&text=' + encodeURIComponent(url); //标题
  // _href += '&url=' + encodeURIComponent(url); //链接
  window.location.href = _href;
};
