通用样式和系统信息获取的添加

This commit is contained in:
WindowBird 2025-08-27 11:08:54 +08:00
parent 35fb8fbb40
commit 5c935f23b1
5 changed files with 47 additions and 7 deletions

View File

@ -0,0 +1,9 @@
$brand-theme-color: #28B389; //品牌主体红色
$border-color: #e0e0e0; //边框颜色
$border-color-light: #efefef; //边框亮色
$text-font-color-1: #522510; //文字主色
$text-font-color-2: #676767; //副标题颜色
$text-font-color-3: #a7a7a7; //浅色
$text-font-color-4: #e4e4e4; //更浅

View File

@ -0,0 +1,5 @@
.safe-area-inset-bottom {
height: env(safe-area-inset-bottom);
}

View File

@ -16,6 +16,7 @@
// 引入uview
@import 'uview-ui/theme.scss';
@import "@/common/style/base-style.scss";
/* 行为相关颜色 */
$uni-color-primary: #007aff;
$uni-color-success: #4cd964;

View File

@ -17,19 +17,19 @@ import {
const ENV_CONFIG = {
develop: {
// 开发环境
// baseUrl: 'http://192.168.2.136:4501',
baseUrl: "https://testlu.chuangtewl.com/prod-api",
appId: 1, // TODO: 根据实际后端配置调整
baseUrl: "http://192.168.2.174:4501",
//baseUrl: "https://testlu.chuangtewl.com/prod-api",
appId: 1,
},
trial: {
// 体验版
baseUrl: "https://testlu.chuangtewl.com/prod-api",
appId: 1, // TODO: 根据实际后端配置调整
baseUrl: "http://192.168.2.174:4501",
appId: 1,
},
release: {
// 正式版
baseUrl: "https://testlu.chuangtewl.com/prod-api",
appId: 1, // TODO: 根据实际后端配置调整
baseUrl: "http://192.168.2.174:4501",
appId: 1,
},
};

25
utils/system.js Normal file
View File

@ -0,0 +1,25 @@
const SYSTEM_INFO = uni.getSystemInfoSync();
export const getStatusBarHeight = ()=> SYSTEM_INFO.statusBarHeight || 15;
export const getTitleBarHeight = ()=>{
if(uni.getMenuButtonBoundingClientRect){
let {top,height} = uni.getMenuButtonBoundingClientRect();
return height + (top - getStatusBarHeight())*2
}else{
return 40;
}
}
export const getNavBarHeight = ()=> getStatusBarHeight()+getTitleBarHeight();
export const getLeftIconLeft = ()=> {
// #ifdef MP-TOUTIAO
let {leftIcon:{left,width}} = tt.getCustomButtonBoundingClientRect();
return left+ parseInt(width);
// #endif
// #ifndef MP-TOUTIAO
return 0
// #endif
}