微信小程序之间的跳转
uni.navigateToMiniProgram(OBJECT) | uni-app官网 (dcloud.net.cn)
uni.navigateToMiniProgram({
appId: '*******', // 小程序的id
path: 'pages/index/index?id=123',
extraData: {
'data1': 'test' //传递给页面的参数
},
success(res) {
// 打开成功
}
})
app跳转微信小程序
开通 | uni-app官网 (dcloud.net.cn)
plus.share.getServices(res => {
let wxx= null;
wxx= res.find(item => item.id === 'weixin')
if (wxx) {
wxx.launchMiniProgram({
id: "******",//微信小程序原生id
path:"pages/main/index", // 打开小程序的页面路径,默认跳转首页
type: 0 // 微信小程序版本类型,可取值: 0-正式版; 1-测试版; 2-体验版。 默认值为0。
})
} else {
uni.showToast({
title: '请安装微信',
icon: 'none'
})
}
}, err => {});
app唤起微信并跳转企业微信用户页的方法
let url ="weixin://biz/ww/profile/"+url
plus.runtime.openURL(url); //前缀是直接打开微信,如果没有会先跳转浏览器
app唤起微信小程序并跳转到企业微信用户的方法
开通 | uni-app官网 (dcloud.net.cn)
plus.share.getServices(res => {
wechat = res.find(i => i.id === 'weixin')
if (wechat) {
wechat.openCustomerServiceChat({
corpid: '****', //企业ID
url: 'https://work.weixin.qq.com/' + url, //客服地址
}, src => {}, err => {})
} else {
uni.showToast({
title: '当前环境不支持微信操作',
icon: "error"
});
}
})