文件
yjyf/yjyf-app/components/YjyfMasterTabBar.vue
YuanWen 361dffc7d8 feat: 新增师傅端功能及服务增项管理模块
- 新增师傅端路由和页面配置,切换登录后默认跳转到师傅大厅
- 新增服务分类图标上传功能和增项服务管理模块
- 新增订单、申诉、结算等模型关联关系及后台控制器
- 新增师傅端TabBar组件和消息页面跳转逻辑
- 新增文件上传接口和服务计算逻辑
- 新增各类SVG图标和空状态提示
2026-11-03 15:45:21 +08:00

121 行
2.9 KiB
Vue

<template>
<view class="yjyf-master-tabbar-container">
<view class="tabbar">
<!-- 1. 首页 (抢单大厅) -->
<view class="tab" :class="{ on: current === 0 }" @tap="switchTab(0)">
<image class="tab-icon" :src="current === 0 ? '/static/tabbar/master/home-active.svg' : '/static/tabbar/master/home.svg'" mode="aspectFit" />
<text class="tab-txt">首页</text>
</view>
<!-- 2. 订单 (工单管理) -->
<view class="tab" :class="{ on: current === 1 }" @tap="switchTab(1)">
<image class="tab-icon" :src="current === 1 ? '/static/tabbar/master/order-active.svg' : '/static/tabbar/master/order.svg'" mode="aspectFit" />
<text class="tab-txt">订单</text>
</view>
<!-- 3. 消息 -->
<view class="tab" :class="{ on: current === 2 }" @tap="switchTab(2)">
<image class="tab-icon" :src="current === 2 ? '/static/tabbar/master/message-active.svg' : '/static/tabbar/master/message.svg'" mode="aspectFit" />
<text class="tab-txt">消息</text>
</view>
<!-- 4. 我的 (师傅中心) -->
<view class="tab" :class="{ on: current === 3 }" @tap="switchTab(3)">
<image class="tab-icon" :src="current === 3 ? '/static/tabbar/master/mine-active.svg' : '/static/tabbar/master/mine.svg'" mode="aspectFit" />
<text class="tab-txt">我的</text>
</view>
</view>
<!-- 底部防遮挡垫高占位 -->
<view class="tabbar-placeholder"></view>
</view>
</template>
<script setup>
const props = defineProps({
current: {
type: Number,
default: 0
}
});
const TAB_ROUTES = [
'/pages/master/hall',
'/pages/master/orders',
'/pages/message/message',
'/pages/master/workbench'
];
function switchTab(index) {
if (props.current === index) return;
const targetUrl = TAB_ROUTES[index];
if (targetUrl) {
uni.redirectTo({
url: targetUrl,
fail: () => {
uni.reLaunch({ url: targetUrl });
}
});
}
}
</script>
<style scoped>
.yjyf-master-tabbar-container {
position: relative;
z-index: 99;
}
.tabbar {
position: fixed;
left: 0;
right: 0;
bottom: 0;
z-index: 99;
box-sizing: content-box !important;
height: 104rpx;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
display: flex;
background: #ffffff;
border-top: 1rpx solid #ECECEC;
box-shadow: 0 -4rpx 16rpx rgba(0, 0, 0, 0.05);
}
.tab {
flex: 1;
height: 104rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-bottom: 6rpx;
}
.tab-icon {
width: 44rpx;
height: 44rpx;
flex-shrink: 0;
}
.tab-txt {
margin-top: 6rpx;
font-size: 22rpx;
line-height: 1.2;
color: #8E8E93;
transition: color 0.15s ease;
}
.tab.on .tab-txt {
color: #F0710D;
font-weight: 600;
}
.tabbar-placeholder {
height: 104rpx;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
box-sizing: content-box !important;
}
</style>