diff --git a/pwuniapp/common/api.js b/pwuniapp/common/api.js index f7ee126..c492004 100644 --- a/pwuniapp/common/api.js +++ b/pwuniapp/common/api.js @@ -191,10 +191,12 @@ export async function getMyActivities(userId) { /** * 获取同城大神列表 */ -export async function getCompanions() { +export async function getCompanions(keyword) { try { - const list = await http.get('/companions'); - if (Array.isArray(list) && list.length > 0) { + const kw = String(keyword == null ? '' : keyword).trim(); + const query = kw ? `?keyword=${encodeURIComponent(kw)}` : ''; + const list = await http.get(`/companions${query}`); + if (Array.isArray(list)) { return list .filter((c) => !c.auditStatus || c.auditStatus === '已通过') .map((c) => ({ diff --git a/pwuniapp/pages/index/index.vue b/pwuniapp/pages/index/index.vue index 55f1d9b..987417f 100644 --- a/pwuniapp/pages/index/index.vue +++ b/pwuniapp/pages/index/index.vue @@ -266,7 +266,7 @@