diff --git a/api/memorial/memorial.js b/api/memorial/memorial.js index dc94267..caf6504 100644 --- a/api/memorial/memorial.js +++ b/api/memorial/memorial.js @@ -24,4 +24,33 @@ export function searchDeceased(params) { method: 'get', params }) -} \ No newline at end of file +} + +// 收藏牌位 (使用 x-www-form-urlencoded 格式) +export function collectMemorial(data) { + // 将数据转换为 x-www-form-urlencoded 格式 + + + return request({ + url: '/app/collect', + method: 'post', + data, + header: { + 'Content-Type': 'application/x-www-form-urlencoded' + } + }) +} + +// // 收藏牌位 (使用 form-data 格式,可选) +// export function collectMemorialFormData(data) { +// return request({ +// url: '/app/collect', +// method: 'post', +// data, +// header: { + + +// 'Content-Type': 'multipart/form-data' +// } +// }) +// } \ No newline at end of file diff --git a/pages/memorial/memorialHall.vue b/pages/memorial/memorialHall.vue index 893405e..29336a1 100644 --- a/pages/memorial/memorialHall.vue +++ b/pages/memorial/memorialHall.vue @@ -21,7 +21,12 @@ {{ memorialDetail ? memorialDetail.name : '加载中...' }} - 收藏牌位 + + {{ isCollected ? '已收藏' : '收藏牌位' }} + @@ -131,7 +136,7 @@