fix: navbar commpontents

This commit is contained in:
zzc
2026-01-31 23:31:40 +08:00
parent 4f4a7792cb
commit 6f08363701
11 changed files with 33 additions and 477 deletions

View File

@@ -1,17 +1,6 @@
<template>
<view class="wallpaper-page" :style="{ paddingTop: navBarTop + 'px' }">
<!-- Navbar -->
<view
class="nav-bar"
:style="{ height: navBarHeight + 'px', paddingTop: navBarTop + 'px' }"
>
<view class="nav-content">
<view class="back-btn" @tap="goBack">
<text class="back-arrow"></text>
</view>
<text class="title">我的新春壁纸</text>
</view>
</view>
<view class="wallpaper-page" >
<NavBar title="我的壁纸" />
<!-- Header Stats -->
<view class="header-stats">
@@ -61,9 +50,8 @@
import { ref, onMounted } from "vue";
import { onPullDownRefresh, onReachBottom } from "@dcloudio/uni-app";
import { getMyWallpaper } from "@/api/mine.js";
import NavBar from "@/components/NavBar/NavBar.vue";
const navBarTop = ref(0);
const navBarHeight = ref(44);
const list = ref([]);
const page = ref(1);
const loading = ref(false);
@@ -72,8 +60,6 @@ const isRefreshing = ref(false);
const totalCount = ref(0);
onMounted(() => {
const sysInfo = uni.getSystemInfoSync();
navBarTop.value = sysInfo.statusBarHeight;
fetchList(true);
});
@@ -128,10 +114,6 @@ const onRefresh = () => {
fetchList(true);
};
const goBack = () => {
uni.navigateBack();
};
const formatDate = (dateStr) => {
if (!dateStr) return "";
const date = new Date(dateStr);
@@ -157,47 +139,6 @@ const onPreview = (item) => {
box-sizing: border-box;
}
.nav-bar {
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 100;
background-color: #f9f9f9;
.nav-content {
height: 44px;
display: flex;
align-items: center;
padding: 0 24rpx;
.back-btn {
display: flex;
align-items: center;
margin-right: 24rpx;
/* 增大点击区域 */
padding: 20rpx;
margin-left: -20rpx;
.back-arrow {
font-size: 50rpx;
color: #333;
font-weight: 300;
line-height: 1;
}
}
.title {
font-size: 18px;
font-weight: 600;
color: #333;
flex: 1;
text-align: center;
margin-right: 50rpx; /* Balance back button */
}
}
}
.header-stats {
padding: 20px;
background: #f9f9f9;