nomadro/apps/miniprogram/weapp/ai-pkg/socialSkill/apis/listMeetupRooms.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

44 lines
1.1 KiB
JavaScript
Raw Permalink 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 listMeetupRooms({ keyword } = {}) {
const q = String(keyword || '')
.trim()
.toLowerCase()
const rooms = MEETUPS.filter(
(m) =>
!q ||
m.title.toLowerCase().includes(q) ||
m.id.toLowerCase().includes(q) ||
m.mirotalkRoom.toLowerCase().includes(q),
).map((m) => ({
id: m.id,
title: m.title,
when: `${m.date} ${m.time}`,
room: m.mirotalkRoom,
}))
return {
isError: false,
content: text(
rooms.length
? `找到 ${rooms.length} 个语音视频场次。微信内用原生 live-pusher(RTC),点卡片进场。`
: '暂时没有匹配场次,可以打开场次列表再挑。',
),
structuredContent: {
rooms,
pagePath: '/pages/social/meetup/index',
linkText: '查看全部场次',
},
handoff: () => ({
query: keyword ? `q=${encodeURIComponent(keyword)}` : '',
payload: { rooms },
}),
}
}
module.exports = listMeetupRooms