The h5 page calls up the app, and the h5 jumps to the app to carry parameters

The h5 page calls up the app, and the h5 jumps to the app to carry parameters

  const config = {
    
    
                /*scheme:必须 打开app的方式*/
                scheme_IOS: 'ios的打开链接,找app开发者拿',
                scheme_Adr: '安卓的app的打开链接,找app开发者拿',
                // 下载链接
                download_url_Adr: '安卓的app的下载链接,找app开发者拿',
                download_url_IOS: 'ios的下载链接,找app开发者拿',
                timeout: 3000
                //携带参数:链接携带?参数名=“参数值”
                // '打开的app链接?content=' + this.Invitation
            }
            //判断当前是安卓还是ios
            const u = navigator.userAgent;
            if (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) {
    
    
                // 判断是否在微信内,安卓在微信内没办法打开app,需要指引用户打开浏览器
                if (/MicroMessenger/.test(navigator.userAgent)) {
    
    
                    this.$refs.popup.open('top')
                } else {
    
    
                    // 调起打开app
                    window.location.href = config.scheme_Adr
                    this.$refs.popupdon.open('bottom')
                }
            } else if (u.indexOf('iPhone') > -1) {
    
    
                window.location = config.scheme_IOS
            }

Guess you like

Origin blog.csdn.net/xiaokangna/article/details/130573029