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>
44 lines
1.1 KiB
JavaScript
44 lines
1.1 KiB
JavaScript
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
|