This commit is contained in:
2026-09-01 16:41:51 +08:00
parent bcbe62a899
commit 25657c613a
3 changed files with 53 additions and 26 deletions
+2 -2
View File
@@ -71,6 +71,7 @@
"devServer" : { "devServer" : {
"https" : true, "https" : true,
"host" : "192.168.124.19" "host" : "192.168.124.19"
},
// 暂时关闭开发代理(直接连后端时注释掉) // 暂时关闭开发代理(直接连后端时注释掉)
// "proxy" : { // "proxy" : {
// "/public" : { // "/public" : {
@@ -88,10 +89,9 @@
// } // }
// } // }
// } // }
},
"router" : { "router" : {
"mode" : "history", "mode" : "history",
"base" : "/h5/" "base" : "/v2/h5/"
}, },
"title" : "印美达POD供应链", "title" : "印美达POD供应链",
"optimization" : { "optimization" : {
+14 -2
View File
@@ -6,7 +6,7 @@
:class="{ show: visible }" :class="{ show: visible }"
@tap="onClose" @tap="onClose"
></view> ></view>
<view class="filter-drawer" :class="{ show: visible }"> <view class="filter-drawer" :class="{ show: visible }" :style="{ paddingTop: statusBarHeight + 'px' }">
<view class="filter-drawer-header"> <view class="filter-drawer-header">
<text class="filter-drawer-title">筛选条件</text> <text class="filter-drawer-title">筛选条件</text>
<text class="filter-drawer-close" @tap="onClose"></text> <text class="filter-drawer-close" @tap="onClose"></text>
@@ -77,7 +77,19 @@ export default {
minPrice: '', minPrice: '',
maxPrice: '', maxPrice: '',
minError: false, minError: false,
maxError: false maxError: false,
statusBarHeight: 20
}
},
created() {
// 状态栏高度:抽屉 fixed top:0,需避开系统状态栏/导航栏区域(与 SearchBar 一致)
try {
var sysInfo = uni.getSystemInfoSync()
var h = sysInfo.statusBarHeight
// 获取失败/异常值时用 20px 保底
this.statusBarHeight = typeof h === 'number' && h > 0 ? h : 20
} catch (e) {
this.statusBarHeight = 20
} }
}, },
methods: { methods: {
+21 -6
View File
@@ -1,6 +1,8 @@
<template> <template>
<!-- 搜索栏 --> <!-- 搜索栏 -->
<view class="search-bar" id="searchBar" :style="{ paddingTop: statusBarHeight + 'px' }"> <view class="search-bar" id="searchBar">
<!-- 状态栏占位盒子避开系统导航栏不影响下方 CSS padding -->
<view class="status-bar-placeholder" :style="{ height: statusBarHeight + 'px' }"></view>
<view class="search-input-wrap"> <view class="search-input-wrap">
<image class="search-icon" src="/static/icons/products/icon_search.png" mode="aspectFit" /> <image class="search-icon" src="/static/icons/products/icon_search.png" mode="aspectFit" />
<input <input
@@ -33,8 +35,10 @@ export default {
}, },
created() { created() {
try { try {
const sysInfo = uni.getSystemInfoSync() var sysInfo = uni.getSystemInfoSync()
this.statusBarHeight = sysInfo.statusBarHeight || 20 var h = sysInfo.statusBarHeight
// 获取失败/异常值时用 20px 保底
this.statusBarHeight = typeof h === 'number' && h > 0 ? h : 20
} catch (e) { } catch (e) {
this.statusBarHeight = 20 this.statusBarHeight = 20
} }
@@ -71,21 +75,32 @@ export default {
</script> </script>
<style scoped> <style scoped>
/* 设计稿:左右留白 10px(20rpx)下留白 6px(12rpx),搜索框 209x32px(402x62rpx) */ /* 设计稿:左右留白 10px(20rpx),下留白 6px(12rpx),搜索框 209x32px(402x62rpx);上边距 56rpx 让搜索栏整体下移 */
.search-bar { .search-bar {
padding: 12rpx 20rpx; padding: 10rpx 20rpx 12rpx;
background: #ffffff; background: #ffffff;
box-sizing: border-box; box-sizing: border-box;
} }
/* 状态栏占位:高度由 JS 内联指定(statusBarHeight */
.status-bar-placeholder {
width: 100%;
}
.search-input-wrap { .search-input-wrap {
display: flex; display: flex;
align-items: center; align-items: center;
width: 402rpx;
height: 62rpx; height: 62rpx;
padding: 0 4rpx 0 21rpx; padding: 0 4rpx 0 21rpx;
background: #f5f5f5; background: #f5f5f5;
border-radius: 31rpx; border-radius: 31rpx;
box-sizing: border-box; box-sizing: border-box;
/* 小程序端:只占左侧大部分宽度(设计稿 402rpx) */
/* #ifdef MP */
width: 402rpx;
/* #endif */
/* 非小程序(H5/App):占整行 */
/* #ifndef MP */
width: 100%;
/* #endif */
} }
.search-icon { .search-icon {
width: 31rpx; width: 31rpx;