1.第一个组件距离顶部导航的距离计算

master
sws 2024-10-19 18:16:07 +08:00
parent 80e8ffcdbf
commit f8d32b6c07
3 changed files with 25 additions and 24 deletions

View File

@ -7,12 +7,12 @@
data: {
//
//
request_url: 'http://shopxo.com/',
// request_url:'https://new.shopxo.vip/',
// request_url: 'http://shopxo.com/',
request_url:'https://new.shopxo.vip/',
// publicpublichttps://d1.shopxo.vip/public/
static_url: 'http://shopxo.com/',
// static_url:'https://new.shopxo.vip/',
// static_url: 'http://shopxo.com/',
static_url:'https://new.shopxo.vip/',
// default
system_type: 'default',

View File

@ -109,29 +109,29 @@ export function gradient_handle (color_list, direction, is_return_all = true) {
* @returns {string}
*/
export function padding_computer (new_style, scale = 1, is_custom = false, index) {
let padding_top = '';
if (index == 0) {
// 状态栏高度
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0));
// #ifdef MP-TOUTIAO
bar_height = 0;
// #endif
let sticky_top = 0;
// #ifdef MP
sticky_top = bar_height + 5 + 12;
// #endif
// #ifdef H5 || MP-TOUTIAO
sticky_top = bar_height + 7 + 12;
// #endif
// #ifdef APP
sticky_top = bar_height + 0 + 12;
// #endif
padding_top = `padding-top:calc(${new_style.padding_top * 2 || 0}rpx + ${sticky_top}px);`;
}
if (!is_custom) {
let padding_top = '';
if (index == 0) {
// 状态栏高度
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0));
// #ifdef MP-TOUTIAO
bar_height = 0;
// #endif
let sticky_top = 0;
// #ifdef MP
sticky_top = bar_height + 5 + 12;
// #endif
// #ifdef H5 || MP-TOUTIAO
sticky_top = bar_height + 7 + 12;
// #endif
// #ifdef APP
sticky_top = bar_height + 0 + 12;
// #endif
padding_top = `padding-top:calc(${new_style.padding_top * 2 || 0}rpx + ${sticky_top}px);`;
}
return `padding: ${new_style.padding_top * 2 || 0}rpx ${new_style.padding_right * 2 || 0}rpx ${new_style.padding_bottom * 2 || 0}rpx ${new_style.padding_left * 2 || 0}rpx;` + padding_top;
} else {
return `padding: ${new_style.padding_top * scale || 0}px ${new_style.padding_right * scale || 0}px ${new_style.padding_bottom * scale || 0}px ${new_style.padding_left * scale || 0}px;`;
return `padding: ${new_style.padding_top * scale || 0}px ${new_style.padding_right * scale || 0}px ${new_style.padding_bottom * scale || 0}px ${new_style.padding_left * scale || 0}px;` + padding_top;
}
}
/**

View File

@ -105,6 +105,7 @@
style_img_container: common_img_computer(new_style.common_style, this.propIndex),
div_height: new_form.height,
});
console.log(this.propIndex);
},
url_event(e) {
app.globalData.url_event(e);