feat:"完成页面接口的对接"
This commit is contained in:
62
前端/unpackage/dist/dev/mp-weixin/api/index.js
vendored
62
前端/unpackage/dist/dev/mp-weixin/api/index.js
vendored
@@ -27,13 +27,18 @@ const getBanners = () => {
|
||||
}));
|
||||
};
|
||||
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({});
|
||||
const queryParams = new UTSJSONObject(
|
||||
{
|
||||
page: params ? params["page"] || 1 : 1,
|
||||
limit: params ? params["pageSize"] || params["limit"] || 10 : 10,
|
||||
status: "published"
|
||||
// 只获取已发布的案例
|
||||
}
|
||||
// 如果有分类且不是all,则添加serviceType参数
|
||||
);
|
||||
if (params && params["category"] && params["category"] != "all") {
|
||||
queryParams["serviceType"] = params["category"];
|
||||
}
|
||||
return utils_request.get("/cases", queryParams);
|
||||
};
|
||||
const getCaseDetail = (id) => {
|
||||
@@ -42,20 +47,55 @@ const getCaseDetail = (id) => {
|
||||
const getHotCases = () => {
|
||||
return utils_request.get("/cases", new UTSJSONObject({ limit: 4, status: "published" }));
|
||||
};
|
||||
const getServiceProcess = () => {
|
||||
return utils_request.get("/services");
|
||||
const getActiveServices = () => {
|
||||
return utils_request.get("/services/active");
|
||||
};
|
||||
const getCompanyInfo = () => {
|
||||
return utils_request.get("/company/info");
|
||||
return Promise.resolve(new UTSJSONObject({
|
||||
code: 0,
|
||||
message: "success",
|
||||
data: new UTSJSONObject({
|
||||
name: "优艺家沙发翻新",
|
||||
slogan: "让旧沙发焕发新生",
|
||||
description: "优艺家专注沙发翻新服务10余年,拥有专业的技术团队和丰富的经验。我们提供各类沙发翻新、维修、清洁服务,让您的旧沙发重新焕发光彩。",
|
||||
phone: "400-888-8888",
|
||||
wechat: "youyijia2024",
|
||||
address: "北京市朝阳区XX路XX号",
|
||||
workTime: "周一至周日 9:00-18:00",
|
||||
features: [
|
||||
new UTSJSONObject({ title: "专业团队", desc: "10年以上经验的专业师傅" }),
|
||||
new UTSJSONObject({ title: "品质保证", desc: "使用优质材料,质保一年" }),
|
||||
new UTSJSONObject({ title: "免费上门", desc: "免费上门测量和评估" }),
|
||||
new UTSJSONObject({ title: "快速交付", desc: "3-7天完成翻新服务" })
|
||||
]
|
||||
})
|
||||
}));
|
||||
};
|
||||
const submitBooking = (data) => {
|
||||
return utils_request.post("/booking", data);
|
||||
};
|
||||
const getMyBookings = (params = null) => {
|
||||
const queryParams = params ? new UTSJSONObject({
|
||||
page: params["page"] || 1,
|
||||
limit: params["limit"] || 10,
|
||||
status: params["status"]
|
||||
}) : new UTSJSONObject({});
|
||||
return utils_request.get("/booking/my", queryParams);
|
||||
};
|
||||
const cancelBooking = (id) => {
|
||||
return utils_request.post(`/booking/${id}/cancel`, new UTSJSONObject({}));
|
||||
};
|
||||
const wechatLogin = (code) => {
|
||||
return utils_request.post("/auth/wechat/login", new UTSJSONObject({ code }));
|
||||
};
|
||||
exports.cancelBooking = cancelBooking;
|
||||
exports.getActiveServices = getActiveServices;
|
||||
exports.getBanners = getBanners;
|
||||
exports.getCaseDetail = getCaseDetail;
|
||||
exports.getCaseList = getCaseList;
|
||||
exports.getCompanyInfo = getCompanyInfo;
|
||||
exports.getHotCases = getHotCases;
|
||||
exports.getServiceProcess = getServiceProcess;
|
||||
exports.getMyBookings = getMyBookings;
|
||||
exports.submitBooking = submitBooking;
|
||||
exports.wechatLogin = wechatLogin;
|
||||
//# sourceMappingURL=../../.sourcemap/mp-weixin/api/index.js.map
|
||||
|
||||
Reference in New Issue
Block a user