62 lines
1.8 KiB
JavaScript
62 lines
1.8 KiB
JavaScript
"use strict";
|
|
const utils_request = require("../utils/request.js");
|
|
const getBanners = () => {
|
|
return Promise.resolve(new UTSJSONObject({
|
|
code: 0,
|
|
message: "success",
|
|
data: [
|
|
new UTSJSONObject({
|
|
id: "1",
|
|
image: "/static/mock/banner1.svg",
|
|
title: "专业沙发翻新服务",
|
|
link: "/pages/service/index"
|
|
}),
|
|
new UTSJSONObject({
|
|
id: "2",
|
|
image: "/static/mock/banner2.svg",
|
|
title: "十年品质保证",
|
|
link: "/pages/about/index"
|
|
}),
|
|
new UTSJSONObject({
|
|
id: "3",
|
|
image: "/static/mock/banner3.svg",
|
|
title: "免费上门评估",
|
|
link: "/pages/booking/index"
|
|
})
|
|
]
|
|
}));
|
|
};
|
|
const getCaseList = (params = null) => {
|
|
const queryParams = params ? new UTSJSONObject({
|
|
page: params["page"] || 1,
|
|
limit: params["pageSize"] || params["limit"] || 10,
|
|
serviceType: params["category"],
|
|
status: "published"
|
|
// 只获取已发布的案例
|
|
}) : new UTSJSONObject({});
|
|
return utils_request.get("/cases", queryParams);
|
|
};
|
|
const getCaseDetail = (id) => {
|
|
return utils_request.get(`/cases/${id}`);
|
|
};
|
|
const getHotCases = () => {
|
|
return utils_request.get("/cases", new UTSJSONObject({ limit: 4, status: "published" }));
|
|
};
|
|
const getServiceProcess = () => {
|
|
return utils_request.get("/services");
|
|
};
|
|
const getCompanyInfo = () => {
|
|
return utils_request.get("/company/info");
|
|
};
|
|
const submitBooking = (data) => {
|
|
return utils_request.post("/booking", data);
|
|
};
|
|
exports.getBanners = getBanners;
|
|
exports.getCaseDetail = getCaseDetail;
|
|
exports.getCaseList = getCaseList;
|
|
exports.getCompanyInfo = getCompanyInfo;
|
|
exports.getHotCases = getHotCases;
|
|
exports.getServiceProcess = getServiceProcess;
|
|
exports.submitBooking = submitBooking;
|
|
//# sourceMappingURL=../../.sourcemap/mp-weixin/api/index.js.map
|