fix:优化
parent
c34e10cdc5
commit
3f36f8704f
|
@ -78,32 +78,49 @@
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
function goRoom(id) {
|
function goRoom(id) {
|
||||||
// wx.navigateTo({
|
// #ifdef MP-WEIXIN
|
||||||
// url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${id}&custom_params=${customParams}`,
|
uni.navigateTo({
|
||||||
// });
|
url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${id}`,
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifndef MP-WEIXIN
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
confirmText: '允许',
|
||||||
|
content: '将打开小程序访问',
|
||||||
|
success: async function (res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
getMpLink();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
|
||||||
|
function goMpLink() {
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
window.location = state.mpLink;
|
window.location = state.mpLink;
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
plus.runtime.openURL(state.mpLink);
|
plus.runtime.openURL(state.mpLink);
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
wx.navigateTo({
|
|
||||||
url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${id}`,
|
|
||||||
});
|
|
||||||
// #endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getMpLink() {
|
async function getMpLink() {
|
||||||
|
// #ifndef MP-WEIXIN
|
||||||
|
if (state.mpLink === '') {
|
||||||
const { error, data } = await sheep.$api.app.mplive.getMpLink();
|
const { error, data } = await sheep.$api.app.mplive.getMpLink();
|
||||||
if (error === 0) {
|
if (error === 0) {
|
||||||
state.mpLink = data;
|
state.mpLink = data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
goMpLink();
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
state.liveList = await getLiveListByIds(mpliveIds);
|
state.liveList = await getLiveListByIds(mpliveIds);
|
||||||
getMpLink();
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
Loading…
Reference in New Issue