feat(navBar): 新增自定义导航栏组件,接入详细报告与我的页面
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
48ac39f0e0
commit
f13edf31b7
@@ -1,4 +1,6 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationStyle": "custom"
|
||||
"usingComponents": {
|
||||
"navBar": "/components/navBar/navBar"
|
||||
},
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
@@ -5,7 +5,8 @@ Page({
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
// 导航栏背景色,根据滚动位置动态变化
|
||||
navBgColor: 'rgba(255,255,255,0)',
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -15,6 +16,15 @@ Page({
|
||||
|
||||
},
|
||||
|
||||
// 滚动时导航栏背景渐显
|
||||
onScroll(e: WechatMiniprogram.ScrollViewScroll) {
|
||||
const scrollTop = e.detail.scrollTop;
|
||||
const opacity = Math.min(Math.max(scrollTop / 300, 0), 1);
|
||||
this.setData({
|
||||
navBgColor: `rgba(255,255,255,${opacity})`,
|
||||
});
|
||||
},
|
||||
|
||||
onTapPersonalInfo() {
|
||||
wx.navigateTo({ url: '/pages/personalInformation/personalInformation' })
|
||||
},
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
<navBar title="我的" fixed="{{true}}" bgColor="{{navBgColor}}" />
|
||||
|
||||
<view class="my">
|
||||
<view class="header">
|
||||
<view class="bg">
|
||||
|
||||
Reference in New Issue
Block a user