初始化

This commit is contained in:
zhu
2026-03-27 13:29:41 +08:00
commit ee03132cee
112 changed files with 6417 additions and 0 deletions

38
custom-tab-bar/index.js Normal file
View File

@@ -0,0 +1,38 @@
// custom-tab-bar/index.js
Component({
lifetimes: {
attached: function () {
this.getTabBar(tabBar => {
let value = tabBar.data.selected
this.setData({
selected: value
})
})
},
},
data: {
selected: '',
tabList: [
{
path: "/pages/home/index",
label: '首页',
icon: 'home'
},
{
path: "/pages/expert/index",
label: '专家服务',
icon: 'call-1'
}
]
},
methods: {
switchTab(e) {
let value = e.detail.value
let info = this.data.tabList.find(item => item.label == value)
if (info) {
wx.switchTab({ url: info.path })
}
}
}
})

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1,5 @@
.t-tab-bar {
box-shadow: 4px 4px 20px rgba(0, 0, 0, 0.15);
--td-tab-bar-active-color: rgba(0, 106, 106, 1);
--td-tab-bar-color: rgba(151, 151, 151, 1);
}

12
custom-tab-bar/index.wxml Normal file
View File

@@ -0,0 +1,12 @@
<t-tab-bar t-class="t-tab-bar"
defaultValue="label1"
value="{{selected}}"
bindchange="switchTab"
split="{{false}}">
<t-tab-bar-item value="{{item.label}}"
icon="{{item.icon}}"
wx:for="{{tabList}}"
wx:key="index">
{{item.label}}
</t-tab-bar-item>
</t-tab-bar>