|
@@ -58,6 +58,7 @@
|
|
|
|
|
|
const state = reactive({
|
|
const state = reactive({
|
|
liveList: [],
|
|
liveList: [],
|
|
|
|
+ mpLink: '',
|
|
});
|
|
});
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
data: {
|
|
data: {
|
|
@@ -73,21 +74,36 @@
|
|
const { marginLeft, marginRight } = props.styles ?? {};
|
|
const { marginLeft, marginRight } = props.styles ?? {};
|
|
|
|
|
|
async function getLiveListByIds(ids) {
|
|
async function getLiveListByIds(ids) {
|
|
- let { data } = await sheep.$api.app.mplive.getRoomList(ids);
|
|
|
|
|
|
+ const { data } = await sheep.$api.app.mplive.getRoomList(ids);
|
|
return data;
|
|
return data;
|
|
}
|
|
}
|
|
function goRoom(id) {
|
|
function goRoom(id) {
|
|
// wx.navigateTo({
|
|
// wx.navigateTo({
|
|
// url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${id}&custom_params=${customParams}`,
|
|
// url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${id}&custom_params=${customParams}`,
|
|
// });
|
|
// });
|
|
|
|
+ // #ifdef H5
|
|
|
|
+ window.location = state.mpLink;
|
|
|
|
+ // #endif
|
|
|
|
+ // #ifdef APP-PLUS
|
|
|
|
+ plus.runtime.openURL(state.mpLink);
|
|
|
|
+ // #endif
|
|
|
|
+ // #ifdef MP-WEIXIN
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${id}`,
|
|
url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${id}`,
|
|
});
|
|
});
|
|
|
|
+ // #endif
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ async function getMpLink() {
|
|
|
|
+ const { error, data } = await sheep.$api.app.mplive.getMpLink();
|
|
|
|
+ if (error === 0) {
|
|
|
|
+ state.mpLink = data;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
state.liveList = await getLiveListByIds(mpliveIds);
|
|
state.liveList = await getLiveListByIds(mpliveIds);
|
|
- console.log(state.liveList, 'state.liveList');
|
|
|
|
|
|
+ getMpLink();
|
|
});
|
|
});
|
|
</script>
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|