H5⽹页打开App以及App内某个页⾯/**
* 下载、打开App
* @param type  doctor:医⽣端  patient:患者端
* @param meetData  跳转app页⾯携带参数
*/
export const downLoadApp = (type?: string, meetData?: any) => {
let openAppUrl = ''
let downloadIosApp = ''
let downloadAndroidApp = ''
if (type === 'doctor') {
openAppUrl = 'hxqdoctor://' + meetData
downloadIosApp =
'itunes.apple/cn/app/hao-xin-qing-yi-sheng-ban/id1079814056?mt=8'
downloadAndroidApp =
'a.app.qq/o/simple.jsp?pkgname=com.hxqydyl.app.ys'
} else {
// 患者端app下载连接(腾讯应⽤宝链接)
openAppUrl = downloadIosApp = downloadAndroidApp = 't/RcxMVvL'
}
const openIframe = createIframe()
if (isIphone()) {
if (isUserApp() || isDoctorApp()) { // 此操作是为了提醒Iphone⽤户下载最新app,否则不可⽤部分功能
window.location.href = downloadIosApp
} else {
window.location.href = openAppUrl
const loadDateTime = w()
setTimeout(() => {
const timeOutDateTime = w()
if (timeOutDateTime - loadDateTime < 1000) {
window.location.href = downloadIosApp
}
}, 25)
}
} else if (isAndroid()) {
if (isUserApp() || isDoctorApp()) { // 此操作是为了提醒安卓⽤户下载最新app,否则不可⽤部分功能
window.location.href = downloadAndroidApp
} else {
安卓下载if (isChrome()) {
// chrome浏览器⽤iframe打不开得直接去打开,算⼀个坑
window.location.href = openAppUrl
} else {
// 抛出你的scheme
openIframe.src = openAppUrl
}
setTimeout(() => {
window.location.href = downloadAndroidApp
}, 500)
}
}
}

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。