nomadro/apps/miniprogram/weapp/ai-pkg/socialSkill/apis/openMeetupLive.js
Eric 92bbee3c6c Ship native social weapp: immersive hall chat, SRS live, join pay.
Wire Taro social pages to social_svc (Centrifugo + live RTMP), drop multi-channel chat chrome, and add weapp WXSS sanitize/deploy helpers.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-02 12:33:35 +08:00

57 lines
1.5 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const { MEETUPS } = require('./_seed')
function text(t) {
return [{ type: 'text', text: t }]
}
async function openMeetupLive({ meetupId, nick } = {}) {
const id = String(meetupId || '').trim()
if (!id) {
return {
isError: true,
content: text('请提供场次 id,例如 wk-nomad-office。可先调用 listMeetupRooms。'),
}
}
const meetup = MEETUPS.find((m) => m.id === id) || {
id,
title: '开视频见面',
date: '',
time: '',
mirotalkRoom: id,
}
const name = String(nick || wx.getStorageSync('userName') || '游民').trim() || '游民'
try {
wx.setStorageSync('nick', name)
} catch (e) {
/* ignore */
}
const pagePath = `/pages/social/meetup-live/index`
return {
isError: false,
content: text(
`准备进入「${meetup.title}」。微信内用 live-pusher / createLivePusherContext(RTC 预览与推流),不走 web-view。`,
),
structuredContent: {
title: meetup.title,
meetupId: meetup.id,
nick: name,
pagePath: `${pagePath}?id=${encodeURIComponent(meetup.id)}`,
linkText: '进入语音视频厅',
},
handoff: () => ({
path: pagePath,
query: `id=${encodeURIComponent(meetup.id)}&nick=${encodeURIComponent(name)}`,
payload: {
meetupId: meetup.id,
title: meetup.title,
mirotalkRoom: meetup.mirotalkRoom,
nick: name,
useLivePusher: true,
},
}),
}
}
module.exports = openMeetupLive