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,18 +1,6 @@
<template> <template>
<view class="detail-page" :style="{ paddingTop: navBarHeight + 'px' }"> <view class="detail-page" >
<!-- Custom Navigation Bar --> <NavBar title="祝福贺卡" />
<view
class="nav-bar"
:style="{
height: navBarHeight + 'px',
paddingTop: statusBarHeight + 'px',
}"
>
<view class="nav-left" @tap="goHome">
<uni-icons type="home" size="24" color="#333"></uni-icons>
</view>
<text class="nav-title">新春祝福详情</text>
</view>
<scroll-view scroll-y class="content-scroll"> <scroll-view scroll-y class="content-scroll">
<view class="content-wrap"> <view class="content-wrap">
@@ -112,14 +100,11 @@
</template> </template>
<script setup> <script setup>
import { ref, onMounted } from "vue"; import { ref } from "vue";
import { getBavBarHeight } from "@/utils/system";
import { onLoad } from "@dcloudio/uni-app"; import { onLoad } from "@dcloudio/uni-app";
import { getPageDetail } from "@/api/system.js"; import { getPageDetail } from "@/api/system.js";
import { saveViewRequest } from "@/utils/common.js"; import { saveViewRequest } from "@/utils/common.js";
import NavBar from "@/components/NavBar/NavBar.vue";
const navBarHeight = ref(44);
const statusBarHeight = ref(20);
const cardId = ref(""); const cardId = ref("");
const cardDetail = ref({}); const cardDetail = ref({});
@@ -133,22 +118,6 @@ onLoad(async (options) => {
} }
}); });
onMounted(() => {
const sysInfo = uni.getSystemInfoSync();
statusBarHeight.value = sysInfo.statusBarHeight;
navBarHeight.value = getBavBarHeight();
});
const goBack = () => {
uni.navigateBack();
};
const goHome = () => {
uni.switchTab({
url: "/pages/index/index",
});
};
const makeGreeting = () => { const makeGreeting = () => {
uni.switchTab({ url: "/pages/make/index" }); uni.switchTab({ url: "/pages/make/index" });
}; };
@@ -211,34 +180,6 @@ const decorList = ref([
box-sizing: border-box; box-sizing: border-box;
} }
.nav-bar {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 100;
display: flex;
align-items: center;
padding: 0 24rpx;
background: #fff6f6; /* Match page bg */
}
.nav-left {
display: flex;
align-items: center;
margin-right: 24rpx;
/* 增大点击区域 */
padding: 20rpx;
margin-left: -20rpx;
}
.nav-title {
font-size: 34rpx;
font-weight: bold;
color: #333;
flex: 1;
text-align: center;
margin-right: 50rpx; /* Balance back button */
}
.content-scroll { .content-scroll {
height: 100%; height: 100%;
} }

View File

@@ -1,10 +1,6 @@
<template> <template>
<view class="feedback-page" :style="{ paddingTop: getBavBarHeight() + 'px' }"> <view class="feedback-page" >
<!-- Custom Navbar --> <NavBar title="意见反馈" />
<view class="nav-bar">
<view class="back" @tap="goBack"></view>
<text class="nav-title">意见反馈</text>
</view>
<view class="content-wrap"> <view class="content-wrap">
<!-- Type Selector --> <!-- Type Selector -->
@@ -84,9 +80,10 @@
<script setup> <script setup>
import { ref, computed } from "vue"; import { ref, computed } from "vue";
import { getBavBarHeight, getDeviceInfo } from "@/utils/system"; import { getDeviceInfo } from "@/utils/system";
import { sendFeedback } from "@/api/mine.js"; import { sendFeedback } from "@/api/mine.js";
import { uploadImage } from "@/utils/common.js"; import { uploadImage } from "@/utils/common.js";
import NavBar from "@/components/NavBar/NavBar.vue";
const feedbackTypes = [ const feedbackTypes = [
{ label: "功能建议", value: 1 }, { label: "功能建议", value: 1 },
@@ -105,10 +102,6 @@ const isValid = computed(() => {
return formData.value.content.trim().length > 0; return formData.value.content.trim().length > 0;
}); });
const goBack = () => {
uni.navigateBack();
};
const chooseImage = () => { const chooseImage = () => {
uni.chooseImage({ uni.chooseImage({
count: 3 - formData.value.images.length, count: 3 - formData.value.images.length,

View File

@@ -1,11 +1,6 @@
<template> <template>
<view class="fortune-detail-page"> <view class="fortune-detail-page">
<!-- 顶部导航栏 (透明) --> <NavBar title="2026 灵马贺岁" />
<view class="nav-bar">
<view class="back-btn" @click="goHome">
<text class="uni-icons">🏠</text>
</view>
</view>
<!-- 顶部提示条 --> <!-- 顶部提示条 -->
<view class="top-banner" v-if="inviterName"> <view class="top-banner" v-if="inviterName">
@@ -38,9 +33,6 @@
:src="fortuneData.imageUrl || defaultImage" :src="fortuneData.imageUrl || defaultImage"
mode="widthFix" mode="widthFix"
/> />
<view class="tag-pill">
<text class="tag-text">马到成功</text>
</view>
</view> </view>
<view class="card-content"> <view class="card-content">
@@ -94,6 +86,7 @@ import { ref } from "vue";
import { onLoad } from "@dcloudio/uni-app"; import { onLoad } from "@dcloudio/uni-app";
import { getPageDetail } from "@/api/system.js"; import { getPageDetail } from "@/api/system.js";
import { saveViewRequest } from "@/utils/common.js"; import { saveViewRequest } from "@/utils/common.js";
import NavBar from "@/components/NavBar/NavBar.vue";
const inviterName = ref(""); const inviterName = ref("");
const inviterAvatar = ref(""); const inviterAvatar = ref("");
@@ -176,37 +169,6 @@ const saveCard = () => {
font-family: sans-serif; font-family: sans-serif;
} }
.nav-bar {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 44px;
display: flex;
align-items: center;
padding-left: 16px;
z-index: 100;
}
.back-btn {
width: 32px;
height: 32px;
background: rgba(0, 0, 0, 0.3);
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
color: #fff;
position: relative;
}
.back-btn::after {
content: "";
position: absolute;
top: -10px;
left: -10px;
right: -10px;
bottom: -10px;
}
.top-banner { .top-banner {
background: rgba(255, 215, 0, 0.1); background: rgba(255, 215, 0, 0.1);
border: 1px solid rgba(255, 215, 0, 0.2); border: 1px solid rgba(255, 215, 0, 0.2);
@@ -271,23 +233,6 @@ const saveCard = () => {
width: 100%; width: 100%;
display: block; display: block;
} }
.tag-pill {
position: absolute;
top: 20px;
right: 20px;
background: #ffd700; /* 黄色背景 */
padding: 10px 6px;
border-radius: 20px;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
border: 2px solid #fff;
}
.tag-text {
writing-mode: vertical-rl;
font-size: 16px;
font-weight: bold;
color: #333;
letter-spacing: 4px;
}
.card-content { .card-content {
padding: 24px; padding: 24px;

View File

@@ -1,12 +1,6 @@
<template> <template>
<view class="record-page" :style="{ paddingTop: navBarHeight + 'px' }"> <view class="record-page">
<!-- 导航栏 --> <NavBar title="我的运势记录" />
<view class="nav-bar" :style="{ height: navBarHeight + 'px' }">
<view class="nav-content" :style="{ paddingTop: statusBarHeight + 'px' }">
<view class="back" @tap="goBack"></view>
<text class="nav-title">我的运势记录</text>
</view>
</view>
<scroll-view <scroll-view
scroll-y scroll-y
@@ -93,12 +87,9 @@
<script setup> <script setup>
import { ref, computed } from "vue"; import { ref, computed } from "vue";
import { getBavBarHeight, getStatusBarHeight } from "@/utils/system";
import { onLoad } from "@dcloudio/uni-app"; import { onLoad } from "@dcloudio/uni-app";
import { getList } from "@/api/fortune.js"; import { getList } from "@/api/fortune.js";
import NavBar from "@/components/NavBar/NavBar.vue";
const navBarHeight = getBavBarHeight();
const statusBarHeight = getStatusBarHeight();
// 状态管理 // 状态管理
const records = ref([]); const records = ref([]);
@@ -195,37 +186,6 @@ onLoad(() => {
overflow: hidden; overflow: hidden;
} }
.nav-bar {
position: fixed;
top: 0;
left: 0;
width: 100%;
background-color: #1a1a1a;
z-index: 100;
}
.nav-content {
height: 100%;
display: flex;
align-items: center;
padding: 0 24rpx;
}
.back {
font-size: 50rpx;
color: #fff;
margin-right: 24rpx;
line-height: 1;
padding: 20rpx;
margin-left: -20rpx;
}
.nav-title {
font-size: 34rpx;
font-weight: 600;
color: #fff;
flex: 1;
text-align: center;
margin-right: 50rpx;
}
.content-scroll { .content-scroll {
flex: 1; flex: 1;
height: 0; /* Important for scroll-view in flex container */ height: 0; /* Important for scroll-view in flex container */

View File

@@ -559,7 +559,7 @@ onShareAppMessage(async () => {
}); });
shareOrSave(id); shareOrSave(id);
return { return {
title: "新春祝福", title: "我刚做了一张祝福卡片,送给你",
path: "/pages/detail/index?shareToken=" + shareTokenRes.shareToken, path: "/pages/detail/index?shareToken=" + shareTokenRes.shareToken,
imageUrl: currentTemplate.value?.imageUrl || "/static/images/bg.jpg", imageUrl: currentTemplate.value?.imageUrl || "/static/images/bg.jpg",
}; };

View File

@@ -1,20 +0,0 @@
<template>
<view class="message-content">
</view>
</template>
<script setup>
</script>
<style lang="scss">
.message-content {
display: flex;
flex-direction: column;
height: 100vh;
background: linear-gradient(to bottom, #D6EDD8 0%, #F4E2D8 100%);
}
</style>

View File

@@ -1,17 +1,6 @@
<template> <template>
<view class="greeting-page" :style="{ paddingTop: navBarTop + 'px' }"> <view class="greeting-page" >
<!-- Navbar --> <NavBar title="我的祝福" />
<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>
<!-- Header Stats --> <!-- Header Stats -->
<view class="header-stats"> <view class="header-stats">
@@ -111,7 +100,7 @@
import { ref, onMounted } from "vue"; import { ref, onMounted } from "vue";
import { onPullDownRefresh, onReachBottom } from "@dcloudio/uni-app"; import { onPullDownRefresh, onReachBottom } from "@dcloudio/uni-app";
import { getMyCard } from "@/api/mine.js"; import { getMyCard } from "@/api/mine.js";
import { getBavBarHeight } from "@/utils/system"; import NavBar from "@/components/NavBar/NavBar.vue";
const navBarTop = ref(0); const navBarTop = ref(0);
const navBarHeight = ref(44); const navBarHeight = ref(44);
@@ -190,8 +179,6 @@ const onTouchEnd = (e, item) => {
}; };
onMounted(() => { onMounted(() => {
const sysInfo = uni.getSystemInfoSync();
navBarTop.value = sysInfo.statusBarHeight;
fetchList(true); fetchList(true);
}); });
@@ -298,47 +285,6 @@ const onEdit = (item) => {
box-sizing: border-box; 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 { .header-stats {
padding: 20px; padding: 20px;
background: #f9f9f9; background: #f9f9f9;

View File

@@ -1,26 +1,14 @@
<template> <template>
<view class="help-page" :style="{ paddingTop: navBarHeight + 'px' }"> <view class="help-page" >
<!-- Custom Navbar --> <NavBar title="帮助中心" />
<view
class="nav-bar"
:style="{
height: navBarHeight + 'px',
paddingTop: statusBarHeight + 'px',
}"
>
<view class="nav-left" @click="goBack">
<uni-icons type="left" size="24" color="#000" />
</view>
<text class="nav-title">帮助中心</text>
</view>
<!-- Search Bar --> <!-- Search Bar -->
<view class="search-box"> <!-- <view class="search-box">
<view class="search-input-box"> <view class="search-input-box">
<uni-icons type="search" size="18" color="#999" /> <uni-icons type="search" size="18" color="#999" />
<text class="placeholder">搜索你遇到的问题</text> <text class="placeholder">搜索你遇到的问题</text>
</view> </view>
</view> </view> -->
<view class="content-scroll"> <view class="content-scroll">
<!-- Quick Start --> <!-- Quick Start -->
@@ -115,10 +103,10 @@
<uni-icons type="chatbubbles-filled" size="20" color="#fff" /> <uni-icons type="chatbubbles-filled" size="20" color="#fff" />
<text>在线客服</text> <text>在线客服</text>
</button> </button>
<button class="c-btn"> <!-- <button class="c-btn">
<uni-icons type="world-filled" size="20" color="#fff" /> <uni-icons type="world-filled" size="20" color="#fff" />
<text>官方公众号</text> <text>官方公众号</text>
</button> </button> -->
</view> </view>
<view class="bg-decor"> <view class="bg-decor">
<uni-icons <uni-icons
@@ -144,14 +132,7 @@
<script setup> <script setup>
import { ref } from "vue"; import { ref } from "vue";
import { getBavBarHeight, getStatusBarHeight } from "@/utils/system"; import NavBar from "@/components/NavBar/NavBar.vue";
const navBarHeight = getBavBarHeight();
const statusBarHeight = getStatusBarHeight();
const goBack = () => {
uni.navigateBack();
};
const faqList = ref([ const faqList = ref([
{ {
@@ -222,36 +203,6 @@ const toggleQuestion = (catIndex, itemIndex) => {
box-sizing: border-box; box-sizing: border-box;
} }
.nav-bar {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 100;
display: flex;
align-items: center;
padding: 0 24rpx;
background: #fff;
}
.nav-left {
display: flex;
align-items: center;
margin-right: 24rpx;
/* 增大点击区域 */
padding: 20rpx;
margin-left: -20rpx;
}
.nav-title {
font-size: 32rpx;
font-weight: bold;
color: #000;
flex: 1;
text-align: center;
margin-right: 50rpx; /* Balance back button */
}
.search-box { .search-box {
padding: 20rpx 30rpx; padding: 20rpx 30rpx;
background: #fff; background: #fff;

View File

@@ -1,18 +1,6 @@
<template> <template>
<view class="profile-page" :style="{ paddingTop: navBarHeight + 'px' }"> <view class="profile-page" >
<!-- Custom Navbar --> <NavBar title="个人信息" />
<view
class="nav-bar"
:style="{
height: navBarHeight + 'px',
paddingTop: statusBarHeight + 'px',
}"
>
<view class="nav-left" @click="goBack">
<uni-icons type="left" size="24" color="#000" />
</view>
<text class="nav-title">个人信息</text>
</view>
<!-- Content --> <!-- Content -->
<view class="content"> <view class="content">
@@ -96,15 +84,10 @@
<script setup> <script setup>
import { ref, computed, watch } from "vue"; import { ref, computed, watch } from "vue";
import { storeToRefs } from "pinia"; import { storeToRefs } from "pinia";
import {
getBavBarHeight,
getStatusBarHeight as getStatus,
} from "@/utils/system";
import { useUserStore } from "@/stores/user"; import { useUserStore } from "@/stores/user";
import { updateUserInfo } from "@/api/auth.js"; import { updateUserInfo } from "@/api/auth.js";
import NavBar from "@/components/NavBar/NavBar.vue";
const navBarHeight = getBavBarHeight();
const statusBarHeight = getStatus();
const userStore = useUserStore(); const userStore = useUserStore();
const { userInfo } = storeToRefs(userStore); const { userInfo } = storeToRefs(userStore);
@@ -132,10 +115,6 @@ watch(
{ immediate: true, deep: true }, { immediate: true, deep: true },
); );
const goBack = () => {
uni.navigateBack();
};
const handleAvatarClick = () => { const handleAvatarClick = () => {
// Navigate to avatar page or open picker // Navigate to avatar page or open picker
uni.navigateTo({ uni.navigateTo({
@@ -247,36 +226,6 @@ const handleSave = async () => {
padding-bottom: 200rpx; padding-bottom: 200rpx;
} }
.nav-bar {
position: fixed;
top: 0;
left: 0;
width: 100%;
background-color: #fcfcfc;
display: flex;
align-items: center;
padding: 0 24rpx;
z-index: 100;
.nav-left {
display: flex;
align-items: center;
margin-right: 24rpx;
/* 增大点击区域 */
padding: 20rpx;
margin-left: -20rpx;
}
.nav-title {
font-size: 34rpx;
font-weight: 600;
color: #000;
flex: 1;
text-align: center;
margin-right: 50rpx; /* Balance back button */
}
}
.content { .content {
padding: 30rpx; padding: 30rpx;
} }

View File

@@ -1,16 +1,6 @@
<template> <template>
<view class="vip-page" :style="{ paddingTop: navBarHeight + 'px' }"> <view class="vip-page" >
<!-- Custom Navbar --> <NavBar title="会员中心" />
<view
class="nav-bar"
:style="{
height: navBarHeight + 'px',
paddingTop: statusBarHeight + 'px',
}"
>
<view class="back" @click="goBack"></view>
<text class="nav-title">会员中心</text>
</view>
<!-- Content --> <!-- Content -->
<view class="content"> <view class="content">
@@ -118,15 +108,10 @@
import { ref, onMounted } from "vue"; import { ref, onMounted } from "vue";
import { storeToRefs } from "pinia"; import { storeToRefs } from "pinia";
import {
getBavBarHeight,
getStatusBarHeight as getStatus,
} from "@/utils/system";
import { useUserStore } from "@/stores/user"; import { useUserStore } from "@/stores/user";
import { createOrder, getVipPlan } from "@/api/pay.js"; import { createOrder, getVipPlan } from "@/api/pay.js";
import NavBar from "@/components/NavBar/NavBar.vue";
const navBarHeight = getBavBarHeight();
const statusBarHeight = getStatus();
const userStore = useUserStore(); const userStore = useUserStore();
const { userInfo } = storeToRefs(userStore); const { userInfo } = storeToRefs(userStore);
@@ -164,10 +149,6 @@ const getVipPlanList = async () => {
plans.value = planRes; plans.value = planRes;
}; };
const goBack = () => {
uni.navigateBack();
};
const selectPlan = (index) => { const selectPlan = (index) => {
selectedPlanIndex.value = index; selectedPlanIndex.value = index;
}; };
@@ -228,37 +209,6 @@ const handlePurchase = async () => {
padding-bottom: 200rpx; // Space for bottom bar padding-bottom: 200rpx; // Space for bottom bar
} }
.nav-bar {
position: fixed;
top: 0;
left: 0;
width: 100%;
background-color: #fff;
display: flex;
align-items: center;
padding: 0 24rpx;
z-index: 100;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
.back {
font-size: 50rpx;
margin-right: 24rpx;
line-height: 1;
color: #333;
padding: 20rpx;
margin-left: -20rpx;
}
.nav-title {
font-size: 34rpx;
font-weight: 600;
color: #000;
flex: 1;
text-align: center;
margin-right: 50rpx;
}
}
.content { .content {
padding: 30rpx; padding: 30rpx;
} }

View File

@@ -1,17 +1,6 @@
<template> <template>
<view class="wallpaper-page" :style="{ paddingTop: navBarTop + 'px' }"> <view class="wallpaper-page" >
<!-- Navbar --> <NavBar title="我的壁纸" />
<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>
<!-- Header Stats --> <!-- Header Stats -->
<view class="header-stats"> <view class="header-stats">
@@ -61,9 +50,8 @@
import { ref, onMounted } from "vue"; import { ref, onMounted } from "vue";
import { onPullDownRefresh, onReachBottom } from "@dcloudio/uni-app"; import { onPullDownRefresh, onReachBottom } from "@dcloudio/uni-app";
import { getMyWallpaper } from "@/api/mine.js"; 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 list = ref([]);
const page = ref(1); const page = ref(1);
const loading = ref(false); const loading = ref(false);
@@ -72,8 +60,6 @@ const isRefreshing = ref(false);
const totalCount = ref(0); const totalCount = ref(0);
onMounted(() => { onMounted(() => {
const sysInfo = uni.getSystemInfoSync();
navBarTop.value = sysInfo.statusBarHeight;
fetchList(true); fetchList(true);
}); });
@@ -128,10 +114,6 @@ const onRefresh = () => {
fetchList(true); fetchList(true);
}; };
const goBack = () => {
uni.navigateBack();
};
const formatDate = (dateStr) => { const formatDate = (dateStr) => {
if (!dateStr) return ""; if (!dateStr) return "";
const date = new Date(dateStr); const date = new Date(dateStr);
@@ -157,47 +139,6 @@ const onPreview = (item) => {
box-sizing: border-box; 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 { .header-stats {
padding: 20px; padding: 20px;
background: #f9f9f9; background: #f9f9f9;