修改页面
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
Component({
|
||||
properties: {
|
||||
active: { type: String, value: 'home' },
|
||||
tabs: {
|
||||
type: Array,
|
||||
value: [
|
||||
{ key: 'home', label: '打卡', icon: '📋' },
|
||||
{ key: 'feed', label: '广场', icon: '🌊' },
|
||||
{ key: 'profile', label: '我的', icon: '👤' },
|
||||
],
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onSwitch(e) {
|
||||
this.triggerEvent('switch', { key: e.currentTarget.dataset.key })
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<view class="nav-bar">
|
||||
<view wx:for="{{tabs}}" wx:key="key" class="nav-item" data-key="{{item.key}}" bindtap="onSwitch">
|
||||
<text class="nav-icon">{{item.icon}}</text>
|
||||
<text class="nav-label {{active===item.key?'active':''}}">{{item.label}}</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,24 @@
|
||||
.nav-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
padding: 8px 0 24px;
|
||||
border-top: 0.5px solid #E5E5EA;
|
||||
background: rgba(245,245,247,0.95);
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 100;
|
||||
}
|
||||
.nav-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
padding: 4px;
|
||||
}
|
||||
.nav-icon { font-size: 22px; }
|
||||
.nav-label { font-size: 10px; color: #86868B; }
|
||||
.nav-label.active { color: #FF6B35; font-weight: 600; }
|
||||
Reference in New Issue
Block a user