点击按钮分享,传参
html代码:
<button class="sharing-btn" open-type="share" >确认分享</button>
js代码:
onShareAppMessage(res) {//分享
return this.confirmSharing(this.timeDate*60);
},
methods: {
async confirmSharing(dur){//点击确认分享
let param = {
ocid: this.$store.state.ocid,
token: this.$store.state.token,
odid: this.$store.state.odid,
dur :dur
};
let opts = "/biubiu/rest/defe/trip";//这里填自己的地址
const res = await this.$Request.httpRequestPost(opts, param)
if (res.data.status.ecode === 0) {
this.dsrid=res.data.result.dsrid;
//分享标题,路径和传参
return {
title: '分享轨迹',
path: '/pages/travelSharing/travelSharing?id='+res.data.result.dsrid,
}
}
},
}