84 lines
2.5 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import storage from "@/utils/storage";
import SettingModel from "@/common/model/Setting";
const appSettings = {
storeInfo: {
store_name: "购de着商城",
describe:
"感谢您选择购de着商城",
},
client: "MP-WEIXIN",
setting: {
app_theme: {
mainBg: "#fa2209",
mainBg2: "#ff6335",
mainText: "#ffffff",
viceBg: "#ffb100",
viceBg2: "#ffb900",
viceText: "#ffffff",
},
page_category_template: {
style: 20,
shareTitle: "全部分类",
showAddCart: true,
cartStyle: 1,
},
points: {
points_name: "积分",
describe:
"a) 积分不可兑现、不可转让,仅可在本平台使用;\nb) 您在本平台参加特定活动也可使用积分,详细使用规则以具体活动时的规则为准;\nc) 积分的数值精确到个位(小数点后全部舍弃,不进行四舍五入)\nd) 买家在完成该笔交易(订单状态为“已签收”)后才能得到此笔交易的相应积分,如购买商品参加店铺其他优惠,则优惠的金额部分不享受积分获取;",
},
recharge: {
is_entrance: 1,
is_custom: 1,
describe:
"1. 账户充值仅限微信在线方式支付,充值金额实时到账;\n2. 账户充值套餐赠送的金额即时到账;\n3. 账户余额有效期:自充值日起至用完即止;\n4. 若有其它疑问可拨打客服电话400-000-1234",
},
register: {
registerMethod: 10,
isManualBind: 1,
isOauthMpweixin: 1,
isOauthMobileMpweixin: 1,
},
customer: { enabled: 1, provider: "mpwxkf", config: { mpwxkf: [] } },
},
clientData: {
h5: {
setting: {
enabled: true,
baseUrl: "https://h5.goudezhao.com/",
},
},
},
};
/**
* 获取商城基础信息
* 有缓存的情况下返回缓存, 没有缓存从后端api获取
*/
const data = () => {
storage.set("Store", appSettings);
storage.set("Setting", appSettings.setting); // 设置商城设置缓存
SettingModel.setAppTheme(appSettings.setting.app_theme); // 设置全局自定义主题
};
// 获取商城基本信息
const storeInfo = () => {
return new Promise((resolve, reject) => {
resolve(appSettings.storeInfo);
});
}
// 获取H5端访问地址
const h5Url = () => {
return new Promise((resolve, reject) => {
resolve(appSettings.clientData.h5.setting.baseUrl);
});
};
export default {
data,
storeInfo,
h5Url,
};