nomadro/apps/miniprogram/weapp/ai-pkg/socialSkill/apis/listTeamGigs.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.2 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 { GIGS } = require('./_seed')
function text(t) {
return [{ type: 'text', text: t }]
}
async function listTeamGigs({ kind = 'all', keyword } = {}) {
const k = String(kind || 'all')
const q = String(keyword || '')
.trim()
.toLowerCase()
const gigs = GIGS.filter((g) => {
if (k !== 'all' && g.kind !== k) return false
if (!q) return true
const hay = `${g.title} ${g.role} ${(g.tags || []).join(' ')}`.toLowerCase()
return hay.includes(q)
})
return {
isError: false,
content: text(
gigs.length
? `找到 ${gigs.length} 个机会。选一个后用 applyTeamGig,或点卡片打开申请页填表。`
: '暂时没有匹配机会,换个关键词或打开找搭子页看看。',
),
structuredContent: {
gigs,
pagePath: '/pages/social/team/index',
linkText: '打开找搭子',
},
handoff: () => ({
query: [
k !== 'all' ? `kind=${encodeURIComponent(k)}` : '',
q ? `q=${encodeURIComponent(keyword)}` : '',
]
.filter(Boolean)
.join('&'),
payload: { gigs, kind: k, keyword: keyword || '' },
}),
}
}
module.exports = listTeamGigs