Initial commit

This commit is contained in:
Dev
2026-09-17 16:25:31 +08:00
commit 382a3069b9
1268 changed files with 266342 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
export default [{
icon: 'home',
text: '首页',
url: 'pages/home/home',
},
{
icon: 'sort',
text: '软件',
url: 'pages/goods/list/index',
},
{
icon: 'comment',
text: '消息',
url: 'pages/message/list/index',
},
{
icon: 'person',
text: '个人中心',
url: 'pages/usercenter/index',
},
];
+29
View File
@@ -0,0 +1,29 @@
import TabMenu from './data';
Component({
data: {
active: 0,
list: TabMenu,
},
methods: {
onChange(event) {
this.setData({ active: event.detail.value });
wx.switchTab({
url: this.data.list[event.detail.value].url.startsWith('/')
? this.data.list[event.detail.value].url
: `/${this.data.list[event.detail.value].url}`,
});
},
init() {
const page = getCurrentPages().pop();
const route = page ? page.route.split('?')[0] : '';
const active = this.data.list.findIndex(
(item) =>
(item.url.startsWith('/') ? item.url.substr(1) : item.url) ===
`${route}`,
);
this.setData({ active });
},
},
});
@@ -0,0 +1,8 @@
{
"component": true,
"usingComponents": {
"t-tab-bar": "tdesign-miniprogram/tab-bar/tab-bar",
"t-tab-bar-item": "tdesign-miniprogram/tab-bar-item/tab-bar-item",
"t-icon": "tdesign-miniprogram/icon/icon"
}
}
@@ -0,0 +1,19 @@
<t-tab-bar
class="custom-tab-bar"
value="{{active}}"
bindchange="onChange"
split="{{false}}"
>
<t-tab-bar-item
wx:for="{{list}}"
wx:for-item="item"
wx:for-index="index"
wx:key="index"
>
<view class="custom-tab-bar-wrapper">
<t-icon prefix="wr" name="{{item.icon}}" size="48rpx" />
<view class="text">{{ item.text }}</view>
</view>
</t-tab-bar-item>
</t-tab-bar>
@@ -0,0 +1,21 @@
.custom-tab-bar-wrapper {
display: flex;
flex-direction: column;
align-items: center;
transition: color 0.2s ease;
}
.custom-tab-bar-wrapper .text {
font-size: 20rpx;
line-height: 28rpx;
margin-top: 4rpx;
}
/* 底部导航整体:顶部细分隔线 + 安全区自适应 */
.custom-tab-bar {
background: rgba(255, 255, 255, 0.96);
backdrop-filter: blur(20rpx);
-webkit-backdrop-filter: blur(20rpx);
box-shadow: 0 -2rpx 20rpx rgba(29, 33, 41, 0.05);
border-top: 1rpx solid rgba(229, 230, 235, 0.6);
}