uni.share({
title: that.goods.name,
type: "5",
provider: "weixin", //分享服务提供商
scene: "WXSceneSession", //场景
summary: "", //分享内容的摘要
imageUrl: that?.goods?.info?.share_image,
miniProgram: {
id: "gh_430f0641948b",
path:
"/pages/mall/goods_detail/goods_detail?inviteId=" +
that.userinfo.id +
"&goodsId=" +
that.goodsId,
type: 0,
webUrl:
"https://www.feishu.cn/invite/06eWjzncH7nC1?join=1&team_name=%E4%BA%94%E7%BB%B4%E5%85%B1%E7%94%9F",
}, //分享小程序必要参数
success: res => {
console.log(res, "success");
resolve();
},
fail: res => {
console.log(res, "ree");
reject();
},
});
plus.share.getServices(
res => {
let sweixin = res.find(i => i.id === "weixin");
if (sweixin) {
sweixin.launchMiniProgram(
{
id: "gh_430f0641948b",
path: `pages/pay/pay?orderInfo=${encodeURIComponent(
JSON.stringify(that.orderInfo)
)}&&type=${this.type}&&share='app'`,
//测试环境用1 打包后正式环境用0
type: process.env.NODE_ENV === "development" ? 1 : 0,
webUrl: "http://www.dcloud.io/",
},
res => {
console.log(res, "跳转小程序");
},
error => {
console.log(error, "跳转小程序失败");
}
);
} else {
that.$ui.showModal({
title: "提示",
content: "请先安装微信客户端",
showCancel: false,
});
}
},
error => {
console.log(error);
that.$ui.showModal({
title: "提示",
content: "请先安装微信客户端",
showCancel: false,
});
}
);
- 发布:2024-04-24 10:07
- 更新:2024-04-25 18:26
- 阅读:222
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: windows11
HBuilderX类型: 正式
HBuilderX版本号: 4.13
手机系统: Android
手机系统版本号: Android 14
手机厂商: 华为
手机机型: x40
页面类型: vue
vue版本: vue2
打包方式: 云端
项目创建方式: HBuilderX
示例代码:
bug描述:
app 打开小程序报错 回调显示打开成功 返回空 界面显示 invalid_app 分享报不支持的类型(同一套代码 小程序可以分享)