92 lines
1.8 KiB
JavaScript
92 lines
1.8 KiB
JavaScript
import request from "@/utils/request";
|
|
import { get } from "../../utils/request";
|
|
|
|
// 获取牌位详情
|
|
export function getMemorialDetail(id) {
|
|
return request({
|
|
url: `/app/memorial/${id}`,
|
|
method: "get",
|
|
});
|
|
}
|
|
|
|
// 获取供奉记录列表
|
|
export function getEnshrinedList(params) {
|
|
return request({
|
|
url: "/app/enshrined/list",
|
|
method: "get",
|
|
params: {
|
|
pageNum: "1",
|
|
pageSize: "12",
|
|
orderByColumn: "create_time",
|
|
isAsc: "descending",
|
|
...params,
|
|
},
|
|
});
|
|
}
|
|
|
|
// 搜索往生者
|
|
export function searchDeceased(params) {
|
|
return request({
|
|
url: "/app/deceased/search",
|
|
method: "get",
|
|
params,
|
|
});
|
|
}
|
|
|
|
// 收藏牌位 (使用 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",
|
|
},
|
|
});
|
|
}
|
|
|
|
// 检查是否已收藏
|
|
export function checkIsCollected(memorialId) {
|
|
return request({
|
|
url: "/app/collect/isCollect",
|
|
method: "get",
|
|
params: {
|
|
memorialId: memorialId,
|
|
},
|
|
});
|
|
}
|
|
|
|
export function getUserCollection() {
|
|
return request({
|
|
url: "/app/collect",
|
|
});
|
|
}
|
|
|
|
// 获取套餐列表
|
|
export function getPackageList() {
|
|
return request({
|
|
url: "/app/thali/list",
|
|
method: "get",
|
|
});
|
|
}
|
|
|
|
// 根据扫码获取的sn获取id
|
|
export function getIdBySN(sn) {
|
|
return request({
|
|
url: `/app/memorial/sn/${encodeURIComponent(sn)}`, // 修复:正确拼接动态参数
|
|
method: "get",
|
|
});
|
|
}
|
|
|
|
export function getMemorialList(params = {}) {
|
|
const defaultParams = {
|
|
orderByColumn: "order_num",
|
|
isAsc: "ascending",
|
|
searchId: "42",
|
|
type: "3",
|
|
};
|
|
return get("/bst/memorial/list", { ...defaultParams, ...params });
|
|
}
|