app打开小程序
plus.share.getServices(function(services) {var service = services.find(function(service) {return service.id === 'weixin';});if (service) {service.launchMiniProgram({id: 'gh_**********02', success: function() {console.log('成功打开小程序');},fail: function(err) {console.error('打开小程序失败', err);}});} else {console.log('未找到微信服务');}
}, function(err) {console.error('获取分享服务失败', err);
});
小程序打开另一个小程序
uni.navigateToMiniProgram({appId: 'wx7a*************', path: 'pages/index/index', extraData: {foo: 'bar' },success(res) {console.log('成功打开小程序', res);},fail(err) {console.error('打开小程序失败', err);}
});
app分享小程序卡片
uni.share({provider: 'weixin',scene: "WXSceneSession", type: 5,title: '你好',imageUrl: 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/share-logo@3.png',miniProgram: {id: 'gh_abcdefg', path: 'pages/index/index',type: 0,webUrl: 'http://uniapp.dcloud.io' },success: ret => {console.log(JSON.stringify(ret));}
});