if (this.onLive() && [1007, 1008, 1014, 1044, 1045, 1046, 1047, 1048, 1049, 1073, 1154, 1155, 1177].includes(option.scene)) {
console.log(option, 11111);
livePlayer.getShareParams().then(res => {
console.log(res, '我是livePlayer里面');
let data = { open_id: res.share_openid };
console.log('get room id', res.room_id);
console.log('get openid', res.openid);
console.log('get share openid', res.share_openid);
console.log('get custom params', res.custom_params);
this.requesUtil.gettjrid(data).then(res => {
console.log(res.data,'请求服务器了');
if (res.data.error_code === 0) {
uni.setStorageSync('tjr_id', res.data)
}
})
})
.catch(err => {
console.log('get share params', err);
});
console.log(decodeURIComponent(option.query.custom_params), 'onShow后面打印');
if (option.query.custom_params) {
uni.setStorageSync('tjr_id', JSON.parse(decodeURIComponent(option.query.custom_params)).pid);
}
}else{
console.log('livePlayer 失败进不来');
}
不知道你用的是不是微信官方的直播插件,直播的分享参数有两种判断,一种是在进入页面onload用option.custom_params,一种是在onlauch判断options.path == 'plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin'时用options.query.custom_params,其对应两种不同的分享行为,具体哪些有点忘记了,我固定都是这么判断的,两种判断最好一起写