1.uniapp中微信小程序跳转微信小程序
uni.navigateToMiniProgram({
appId:"appId"//微信小程序id
path: "pages/index/index", // 不填默认首页
extraData:{
'data1': 'test'
}, //传递给页面的参数
success(res) {
console.log("跳转成功");
},
fail(res) {
console.log(res, "调用失败");
}
})
注:使用的是uniapp的跳转方法
2.uniapp中app跳转微信小程序
plus.share.getServices(res => {
let sweixin = null;
sweixin = res.find(i => i.id === 'weixin')
if (sweixin) {
// 分享跳转到微信小程序
sweixin.launchMiniProgram({
id: "gh_...",//微信小程序原生id
path:"pages/index/index", // 打开小程序的页面路径,不传默认跳转首页
type: 0 // 微信小程序版本类型,可取值: 0-正式版; 1-测试版; 2-体验版。 默认值为0。
})
} else {
uni.showToast({
title: '请安装微信',
icon: 'none'
})
}
}, err => {
console.log("分享失败"); // 获取分享服务列表失败
});
3.uniapp中app唤起微信并跳转企业微信用户页的方法
let url ="weixin://biz/ww/profile/"+url
plus.runtime.openURL(url); //前缀是直接打开微信,如果没有会先跳转浏览器
4.uniapp中app唤起微信小程序并跳转到企业微信用户的方法
plus.share.getServices(res => {
wechat = res.find(i => i.id === 'weixin')
if (wechat) {
wechat.openCustomerServiceChat({
corpid: '微信企业ID',//企业ID
url: 'https://work.weixin.qq.com/'+url,//客服地址
}, src => {
console.log("success:")
}, err => {
console.log("error:")
})
} else {
uni.showToast({
title: '当前环境不支持微信操作',icon:"error"
});
}
});