uniapp 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: 'gh_8888888', //这里写你的小程序原始id(以gh开头)
type: 0,//这里是不同的环境(默认0)
path:'/pages/shop/index?storeId=123456'//这里是指定页的路径,如需传参直接字符串拼接(首页可以省略)
});
}
},function(res){
console.log(JSON.stringify(res));
});

本文由 我爱PHP169 作者:admin 发表,其版权均为 我爱PHP169 所有,文章内容系作者个人观点,不代表 我爱PHP169 对观点赞同或支持。如需转载,请注明文章来源。

发表回复