通用样式和系统信息获取的添加
This commit is contained in:
parent
35fb8fbb40
commit
5c935f23b1
9
common/style/base-style.scss
Normal file
9
common/style/base-style.scss
Normal 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; //更浅
|
||||||
5
common/style/common-style.scss
Normal file
5
common/style/common-style.scss
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
|
||||||
|
.safe-area-inset-bottom {
|
||||||
|
height: env(safe-area-inset-bottom);
|
||||||
|
}
|
||||||
|
|
||||||
1
uni.scss
1
uni.scss
|
|
@ -16,6 +16,7 @@
|
||||||
// 引入uview
|
// 引入uview
|
||||||
|
|
||||||
@import 'uview-ui/theme.scss';
|
@import 'uview-ui/theme.scss';
|
||||||
|
@import "@/common/style/base-style.scss";
|
||||||
/* 行为相关颜色 */
|
/* 行为相关颜色 */
|
||||||
$uni-color-primary: #007aff;
|
$uni-color-primary: #007aff;
|
||||||
$uni-color-success: #4cd964;
|
$uni-color-success: #4cd964;
|
||||||
|
|
|
||||||
|
|
@ -17,19 +17,19 @@ import {
|
||||||
const ENV_CONFIG = {
|
const ENV_CONFIG = {
|
||||||
develop: {
|
develop: {
|
||||||
// 开发环境
|
// 开发环境
|
||||||
// baseUrl: 'http://192.168.2.136:4501',
|
baseUrl: "http://192.168.2.174:4501",
|
||||||
baseUrl: "https://testlu.chuangtewl.com/prod-api",
|
//baseUrl: "https://testlu.chuangtewl.com/prod-api",
|
||||||
appId: 1, // TODO: 根据实际后端配置调整
|
appId: 1,
|
||||||
},
|
},
|
||||||
trial: {
|
trial: {
|
||||||
// 体验版
|
// 体验版
|
||||||
baseUrl: "https://testlu.chuangtewl.com/prod-api",
|
baseUrl: "http://192.168.2.174:4501",
|
||||||
appId: 1, // TODO: 根据实际后端配置调整
|
appId: 1,
|
||||||
},
|
},
|
||||||
release: {
|
release: {
|
||||||
// 正式版
|
// 正式版
|
||||||
baseUrl: "https://testlu.chuangtewl.com/prod-api",
|
baseUrl: "http://192.168.2.174:4501",
|
||||||
appId: 1, // TODO: 根据实际后端配置调整
|
appId: 1,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
25
utils/system.js
Normal file
25
utils/system.js
Normal 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
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user