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

This commit is contained in:
cyh666666
2026-03-17 12:03:57 +08:00
parent b5c7947ad8
commit c3d2be354e
2083 changed files with 1110 additions and 44315 deletions

View File

@@ -3,7 +3,7 @@
<view class="cart-page">
<!-- 智能顶部导航栏 - 与消息页保持一致 -->
<view class="smart-navbar" :style="{ paddingTop: statusBarHeight + 'px' }">
<view class="nav-container" :style="{ paddingRight: navBarRight + 'px' }">
<view class="nav-container" :style="{ paddingRight: (navBarRight > 0 ? navBarRight : 16) + 'px' }">
<text class="nav-title">购物车</text>
<view class="nav-actions">
<view class="action-btn" @click="toggleManageMode">

View File

@@ -2,7 +2,7 @@
<view class="category-page">
<!-- 顶部搜索栏 -->
<view class="search-bar" :style="{ paddingTop: statusBarHeight + 'px' }">
<view class="search-container" :style="{ paddingRight: navBarRight + 'px' }">
<view class="search-container" :style="{ paddingRight: (navBarRight > 0 ? navBarRight : 16) + 'px' }">
<view class="search-box" @click="navigateToSearch" :style="{ height: '30px' }">
<!-- 模拟输入框 -->
<text class="search-placeholder">请输入商品名称、店铺</text>

View File

@@ -9,7 +9,7 @@
transform: showNavbar ? 'translateY(0)' : 'translateY(-100%)'
}"
>
<view class="search-container" :style="{ paddingRight: navBarRight + 'px' }">
<view class="search-container" :style="{ paddingRight: (navBarRight > 0 ? navBarRight : 16) + 'px' }">
<view class="search-box" @click="navigateToSearch" :style="{ height: '30px' }">
<!-- 模拟输入框 -->
<text class="search-placeholder">请输入商品名称、店铺</text>
@@ -1146,7 +1146,7 @@ const navigateToReminders = () => uni.navigateTo({ url: '/pages/user/reminders'
}
.nav-inner-search-text {
font-size: 12px; /* 字体稍微变小 */
font-size: 12px;
color: #ffffff;
font-weight: normal;
}

View File

@@ -2,7 +2,7 @@
<view class="messages-page">
<!-- 智能顶部导航栏 - 与主页保持一致 -->
<view class="smart-navbar" :style="{ paddingTop: statusBarHeight + 'px' }">
<view class="nav-container">
<view class="nav-container" :style="{ paddingRight: (navBarRight > 0 ? navBarRight : 16) + 'px' }">
<text class="nav-title">消息中心</text>
<view class="nav-actions">
<view class="action-btn" @click="clearAllUnread">
@@ -263,6 +263,20 @@ const unreadCount = ref<number>(12)
const statusBarHeight = ref(0)
const scrollTop = ref(0)
const scrollHeight = ref(0)
const navBarRight = ref(0)
// 小程序胶囊按钮信息类型
type CapsuleButtonInfo = {
left: number,
top: number,
right: number,
bottom: number,
width: number,
height: number
}
// 小程序胶囊按钮信息
const capsuleButtonInfo = ref<CapsuleButtonInfo | null>(null)
// 消息分类标签
const messageTabs = reactive<MessageTab[]>([
@@ -339,6 +353,23 @@ const initPage = () => {
const systemInfo = uni.getSystemInfoSync()
statusBarHeight.value = systemInfo.statusBarHeight
// 获取小程序胶囊按钮信息
// #ifdef MP-WEIXIN
try {
capsuleButtonInfo.value = uni.getMenuButtonBoundingClientRect()
if (capsuleButtonInfo.value != null) {
navBarRight.value = (systemInfo.screenWidth - capsuleButtonInfo.value.left) + 10
}
} catch (e) {
console.log('获取胶囊按钮信息失败', e)
navBarRight.value = 90
}
// #endif
// #ifndef MP-WEIXIN
navBarRight.value = 0
// #endif
const windowHeight = systemInfo.windowHeight
scrollHeight.value = windowHeight - statusBarHeight.value - 44 - 42
}

View File

@@ -3,7 +3,7 @@
<view class="consumer-profile">
<!-- 智能顶部导航栏 - 与消息页保持一致 -->
<view class="smart-navbar" :style="{ paddingTop: statusBarHeight + 'px' }">
<view class="nav-container">
<view class="nav-container" :style="{ paddingRight: (navBarRight > 0 ? navBarRight : 16) + 'px' }">
<!-- 基础用户信息:头像和昵称 -->
<view class="nav-user-basic" @click="editProfile">
<image
@@ -14,7 +14,7 @@
</view>
<!-- 用户资产横向排列 (积分、余额、优惠券) -->
<view class="nav-user-stats" :style="{ marginRight: navBarRight + 'px' }">
<view class="nav-user-stats">
<view class="nav-stat-item" @click="goToPoints">
<text class="nav-stat-label">积分</text>
<text class="nav-stat-value">{{ userStats.points }}</text>
@@ -31,12 +31,14 @@
</view>
</view>
<!-- 设置按钮 (最右侧) -->
<!-- #ifndef MP-WEIXIN -->
<!-- 设置按钮 (安卓端和电脑端显示,小程序不显示) -->
<view class="nav-actions">
<view class="action-btn" @click="goToSettings">
<text class="action-icon">⚙️</text>
</view>
</view>
<!-- #endif -->
</view>
</view>
@@ -48,6 +50,11 @@
<view class="my-services" style="margin-top: 10px;">
<view class="section-title">我的服务</view>
<view class="service-grid">
<view class="service-item" @click="goToMessages">
<text class="service-icon">💬</text>
<text class="service-text">消息中心</text>
<text v-if="serviceCounts.unreadMessages > 0" class="service-badge">{{ serviceCounts.unreadMessages }}</text>
</view>
<view class="service-item" @click="goToCoupons">
<text class="service-icon">🎫</text>
<text class="service-text">优惠券</text>
@@ -301,6 +308,7 @@ type OrderCountsType = {
type ServiceCountsType = {
coupons: number
favorites: number
unreadMessages: number
}
type ConsumptionStatsType = {
@@ -354,7 +362,8 @@ export default {
} as OrderCountsType,
serviceCounts: {
coupons: 0,
favorites: 0
favorites: 0,
unreadMessages: 0
} as ServiceCountsType,
recentOrders: [] as Array<OrderItemType>,
statsPeriods: [
@@ -543,6 +552,10 @@ export default {
this.navBarRight = 90
}
// #endif
// #ifndef MP-WEIXIN
this.navBarRight = 0
// #endif
},
async loadUserProfile() {
try {
@@ -1166,6 +1179,12 @@ export default {
url: '/pages/mall/consumer/coupons'
})
},
goToMessages() {
uni.navigateTo({
url: '/pages/main/messages'
})
},
goToPoints() {
uni.navigateTo({