uni-halo/utils/app.js
小莫唐尼 70c5b34de0 新增:留言评论头像形状设置;
修复:修复文章管理设置文章标签在小程序端不显示的bug;
修复:修复后台管理工作台因为无法读取用户信息页面不显示bug;
优化:优化友情链接动画效果
2022-12-10 12:26:47 +08:00

79 lines
1.8 KiB
JavaScript
Raw 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.

export const Platform = {
ios: 'ios',
android: 'android'
}
/**
* 检查当前环境是什么环境
*/
export const checkPlatform = (name) => {
return uni.getSystemInfoSync().platform == name;
}
// 默认的应用设置
export const _DefaultAppSettings = {
showStartPage: false, // 是否每次启动都显示启动页
isAvatarRadius: false, // 评论头像是否圆形
banner: {
useDot: true,
dotPosition: 'right'
},
// 布局配置
layout: {
// h_row_col1 = 一行一列
// h_row_col2 = 一行两列
home: 'h_row_col1',
// lr_image_text=左图右文
// lr_text_image=左文右图
// tb_image_text=上图下文
// tb_text_image=上文下图
// only_text=仅文字
cardType: 'lr_image_text',
},
// 广告配置todo
ad: {
timeout: 3, // 屏蔽广告时长,时间到后自动恢复展示(单位小时)
disabled: false, // 是否屏蔽广告(看广告可以关闭应用内设置的广告)
},
gallery: {
// 是否使用瀑布流
useWaterfull: true
},
links: {
// 是否使用简约模式
useSimple: false,
useGroup: false,
},
about: {
showAdmin: false, // 显示后台登录入口
showAllCount: true, // 默认显示所有的统计信息(关于页面)
},
// 文章配置
article: {
},
// 联系博主页面
contact: {
// 链接是否使用复制的方式,否则直接在内部打开(小程序需要配置对应链接的业务域名)
isLinkCopy: true,
}
}
/**
* 获取应用设置
*/
export const getAppSettings = () => {
let _appSettings = uni.getStorageSync('APP_GLOBAL_SETTINGS')
if (_appSettings) return JSON.parse(_appSettings)
uni.setStorageSync('APP_GLOBAL_SETTINGS', JSON.stringify(_DefaultAppSettings))
return _appSettings;
}
/**
* 保存应用设置
*/
export const setAppSettings = (appSettings) => {
uni.setStorageSync('APP_GLOBAL_SETTINGS', JSON.stringify(appSettings))
}