uniapp app跳转微信小程序\app跳转支付宝小程序


 //跳转微信小程序:

1.打开微信开放平台 不是小程序的平台:开启app跳转小程序功能

 

//跳转方法:

jump(){
    plus.share.getServices(function(res) {
        let sweixin = null;
        for (let i = 0; i < res.length; i++) {
            let t = res[i];
            if (t.id == 'weixin') {
                sweixin = t;
            }
        }

        if (sweixin) {
            sweixin.launchMiniProgram({
                id: 'gh_ea9d93236b51',//微信小程序平台原始id
                path: 'pages/index/index?id=xxx',//跳转路径(带参)
                type: 0
            });
        }
    }, function(res) {
        console.log(JSON.stringify(res));//回调
    });
}