使用了很多种方法 最终让后端生成链接 前端传参 (跳转的地址 id 版本) 使用uni.share分享到朋友圈
let that = this
//请求接口
http.request({
url: '/prod/getShareUrl',
method: 'POST',
// data是需要传的参数
data: {
path: "/package-prod/pages/prod/prod", // 跳转的地址
prodId: this.prodId,
envVersion: "trial" // release正式 体验 trial 开发 develop
},
callBack: (res) => {
uni.share({
provider: "weixin",
scene: "WXSceneTimeline",
type: 0,
title: that.prodInfo.prodName,
imageUrl: that.prodInfo.pic,
href: res,
success: ret => {
console.log(JSON.stringify(ret));
},
fail: result => {
}
});
},
})