import Taro from '@tarojs/taro'

const handleShare = () => {
  if (process.env.TARO_ENV == "h5") {
    console.log('[ h5 分享 ] >', )
    if (navigator.share) {
        navigator.share({
          title: '分享标题',
          text: '分享内容',
          url: window.location.href,
        }).catch(err => {
          console.log('[ err ] >', err)
        })

    } else {
      Taro.showToast({
        title: '分享功能不可用',
        icon: 'error',
        duration: 2000
      })
    }
  }
}

export {
  handleShare,
}
