consumer模块完成度95%,优化安卓端界面和小程序测试3

This commit is contained in:
cyh666666
2026-03-13 17:12:00 +08:00
parent b2a6e5a142
commit b5c7947ad8
1741 changed files with 3427 additions and 2036 deletions

View File

@@ -2,7 +2,7 @@
<view class="category-page">
<!-- 顶部搜索栏 -->
<view class="search-bar" :style="{ paddingTop: statusBarHeight + 'px' }">
<view class="search-container">
<view class="search-container" :style="{ paddingRight: navBarRight + 'px' }">
<view class="search-box" @click="navigateToSearch" :style="{ height: '30px' }">
<!-- 模拟输入框 -->
<text class="search-placeholder">请输入商品名称、店铺</text>
@@ -139,6 +139,21 @@ type LocalCategory = {
// 响应式数据
const statusBarHeight = ref(0)
const headerHeight = ref(44)
// 小程序胶囊按钮信息类型
type CapsuleButtonInfo = {
left: number,
top: number,
right: number,
bottom: number,
width: number,
height: number
}
// 小程序胶囊按钮信息
const capsuleButtonInfo = ref<CapsuleButtonInfo | null>(null)
const navBarRight = ref(0) // 导航栏右侧预留空间
const primaryCategories = ref<LocalCategory[]>([])
const subCategories = ref<LocalCategory[]>([]) // 二级分类列表
const productList = ref<Product[]>([])
@@ -547,6 +562,28 @@ onShow(() => {
onLoad((options: any) => {
const systemInfo = uni.getSystemInfoSync()
statusBarHeight.value = systemInfo.statusBarHeight
// 获取小程序胶囊按钮信息
// #ifdef MP-WEIXIN
try {
const menuButton = uni.getMenuButtonBoundingClientRect()
if (menuButton != null) {
capsuleButtonInfo.value = {
left: menuButton.left,
top: menuButton.top,
right: menuButton.right,
bottom: menuButton.bottom,
width: menuButton.width,
height: menuButton.height
}
navBarRight.value = (systemInfo.screenWidth - menuButton.left) + 10
}
} catch (e) {
console.log('获取胶囊按钮信息失败', e)
navBarRight.value = 90
}
// #endif
console.log('=== category页面onLoad被调用 ===')
let categoryId = ''