APP跳转小程序
plus.share.getServices(function(res) {
var sweixin = null;
for (var i = 0; i < res.length; i++) {
var t = res[i];
if (t.id == ‘weixin’) {
sweixin = t;
}
}
if (sweixin) {
sweixin.launchMiniProgram({
id: item.id, //小程序原始id
type: item.type, //环境 0-正式版; 1-测试版; 2-体验版
path: path //指定页的路径,如需传参直接字符串拼接
});
}
}, function(res) {
console.log(JSON.stringify(res));
});
APP跳转H5
plus.runtime.openWeb(path)//使用内置Webview窗口打开URL
plus.runtime.openURL(path)//调用第三方程序打开指定的URL
微信小程序互跳
uni.navigateToMiniProgram({
appId: item.id,
path: item.path,
extraData: {},//传递的参数
envVersion: type, //要打开的小程序版本,有效值: develop(开发版),trial(体验版),release(正式版)(非必填,默认正式版,string),
success(res) {
// 打开成功
},
fail(err) {
//打开失败
},
})
微信小程序打开H5
使用webView标签打开H5页面
本文介绍了如何在APP中实现跳转到小程序或H5页面的功能,并提供了详细的代码示例。包括通过plus.share获取微信服务并跳转小程序,以及使用plus.runtime打开H5页面的方法。此外还展示了微信小程序之间互相跳转及打开H5页面的具体实现。
4086

被折叠的 条评论
为什么被折叠?



