73 lines
2.2 KiB
JavaScript
73 lines
2.2 KiB
JavaScript
"use strict";
|
|
const ENV = new UTSJSONObject(
|
|
{
|
|
// 开发环境
|
|
development: new UTSJSONObject({
|
|
baseUrl: "http://192.168.1.43:3000/api",
|
|
imageBaseUrl: "http://192.168.1.43:3000"
|
|
}),
|
|
// 生产环境
|
|
production: new UTSJSONObject({
|
|
baseUrl: "https://api.youyijia.com/api",
|
|
imageBaseUrl: "https://api.youyijia.com"
|
|
})
|
|
}
|
|
// 当前环境 - 切换为 'production' 上线
|
|
);
|
|
const getEnvConfig = () => {
|
|
return new UTSJSONObject({
|
|
baseUrl: ENV.development.baseUrl,
|
|
imageBaseUrl: ENV.development.imageBaseUrl
|
|
});
|
|
};
|
|
const PAGE_SIZE = 10;
|
|
new UTSJSONObject(
|
|
{
|
|
maxSize: 5 * 1024 * 1024,
|
|
maxCount: 9,
|
|
accept: ["image/jpeg", "image/png", "image/gif"]
|
|
}
|
|
// 缓存Key
|
|
);
|
|
const STORAGE_KEYS = new UTSJSONObject(
|
|
{
|
|
TOKEN: "user_token",
|
|
USER_INFO: "user_info",
|
|
FAVORITES: "user_favorites",
|
|
SEARCH_HISTORY: "search_history"
|
|
}
|
|
// 沙发分类
|
|
);
|
|
const SOFA_CATEGORIES = [
|
|
new UTSJSONObject({ id: "all", name: "全部" }),
|
|
new UTSJSONObject({ id: "leather", name: "皮沙发" }),
|
|
new UTSJSONObject({ id: "fabric", name: "布艺沙发" }),
|
|
new UTSJSONObject({ id: "functional", name: "功能沙发" }),
|
|
new UTSJSONObject({ id: "antique", name: "古典沙发" }),
|
|
new UTSJSONObject({ id: "office", name: "办公沙发" })
|
|
];
|
|
[
|
|
new UTSJSONObject({ id: "repair", name: "局部修复", icon: "/static/icons/repair.png" }),
|
|
new UTSJSONObject({ id: "refurbish", name: "整体翻新", icon: "/static/icons/refurbish.png" })
|
|
];
|
|
const getServiceTypeName = (type) => {
|
|
var _a;
|
|
const map = /* @__PURE__ */ new Map([
|
|
["leather", "真皮翻新"],
|
|
["fabric", "布艺翻新"],
|
|
["functional", "功能维修"],
|
|
["antique", "古董修复"],
|
|
["office", "办公沙发"],
|
|
["cleaning", "清洁保养"],
|
|
["repair", "维修改装"],
|
|
["custom", "定制沙发"]
|
|
]);
|
|
return (_a = UTS.mapGet(map, type)) !== null && _a !== void 0 ? _a : type;
|
|
};
|
|
exports.PAGE_SIZE = PAGE_SIZE;
|
|
exports.SOFA_CATEGORIES = SOFA_CATEGORIES;
|
|
exports.STORAGE_KEYS = STORAGE_KEYS;
|
|
exports.getEnvConfig = getEnvConfig;
|
|
exports.getServiceTypeName = getServiceTypeName;
|
|
//# sourceMappingURL=../../.sourcemap/mp-weixin/utils/config.js.map
|