|
|
- <template>
- <view class="staff-manage-container">
- <!-- 顶部导航栏 -->
- <view class="navbar" :style="navbarStyle">
- <view class="nav-left" @tap="goBack">
- <uni-icons type="back" size="24" color="#222" />
- </view>
- <view class="nav-title">员工管理</view>
- <view class="nav-right">
- <!-- <uni-icons type="more-filled" size="24" color="#222" style="margin-right: 16rpx;" />
- <uni-icons type="scan" size="24" color="#222" /> -->
- </view>
- </view>
- <view class="staff-list" :style="{marginTop: navBarRealHeight + 'px'}">
- <view v-for="(staff, idx) in staffList" :key="idx" class="staff-card" @tap="goStaffDetail(staff)">
- <view class="staff-info-row">
- <text class="staff-label">姓名:</text>
- <text class="staff-value">{{ staff.name }}</text>
- </view>
- <view class="staff-info-row">
- <text class="staff-label">角色:</text>
- <text class="staff-value">{{ staff.role }}</text>
- </view>
- </view>
- </view>
- </view>
- </template>
-
- <script>
- import pullRefreshMixin from '../mixins/pullRefreshMixin.js'
- export default {
- mixins: [pullRefreshMixin],
- data() {
- return {
- staffList: [
- { name: '冯启彬', role: '质检员' },
- { name: '周琪', role: '质检员' },
- { name: '王凡玄', role: '质检员' },
- { name: '李世海', role: '质检员' },
- { name: '李娅', role: '质检员' },
- { name: '郑婷雅', role: '质检员' },
- { name: '冯思钰', role: '质检员' },
- ],
- statusBarHeight: 0,
- navBarRealHeight: 0,
- }
- },
- computed: {
- navbarStyle() {
- return `padding-top: ${this.statusBarHeight}px;`;
- }
- },
- onLoad() {
- uni.getSystemInfo({
- success: (res) => {
- this.statusBarHeight = res.statusBarHeight || 20;
- }
- });
- this.$nextTick(() => {
- uni.createSelectorQuery().select('.navbar').boundingClientRect(rect => {
- if (rect) {
- this.navBarRealHeight = rect.height;
- }
- }).exec();
- });
- },
- methods: {
- goBack() {
- uni.navigateBack();
- },
- goStaffDetail(staff) {
- uni.navigateTo({
- url: '/pages/manager/staff-detail',
- success: (res) => {
- res.eventChannel.emit('staffDetail', staff);
- }
- });
- },
- refreshData() {
- // TODO: 实现员工列表刷新逻辑,如重新请求接口
- },
- async onRefresh() {
- await this.refreshData && this.refreshData()
- },
- },
- onPullDownRefresh() {
- this.refreshData && this.refreshData()
- uni.stopPullDownRefresh()
- }
- }
- </script>
-
- <style lang="scss" scoped>
- .staff-manage-container {
- min-height: 100vh;
- background: #f7f7f7;
- padding-bottom: 40rpx;
- }
- .navbar {
- position: fixed;
- top: 0;
- left: 0;
- width: 100vw;
- height: 100rpx;
- background: #fff;
- z-index: 10;
- display: flex;
- align-items: flex-end;
- justify-content: space-between;
- box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.03);
- padding: 0 32rpx;
- .nav-left {
- flex: 0 0 48rpx;
- display: flex;
- align-items: center;
- height: 100%;
- }
- .nav-title {
- flex: 1;
- text-align: center;
- font-size: 36rpx;
- font-weight: bold;
- color: #222;
- line-height: 100rpx;
- }
- .nav-right {
- flex: 0 0 80rpx;
- display: flex;
- align-items: center;
- justify-content: flex-end;
- height: 100%;
- }
- }
- .staff-list {
- margin-top: calc(100rpx + var(--status-bar-height));
- padding: 32rpx 0;
- min-height: calc(100vh - 100rpx - var(--status-bar-height));
- box-sizing: border-box;
- }
- .staff-card {
- background: #fff;
- border-radius: 40rpx;
- margin: 0 32rpx 32rpx 32rpx;
- padding: 40rpx 36rpx 36rpx 36rpx;
- box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.03);
- }
- .staff-info-row {
- display: flex;
- align-items: center;
- margin-bottom: 18rpx;
- .staff-label {
- font-size: 30rpx;
- color: #b3b3b3;
- width: 110rpx;
- font-weight: 400;
- }
- .staff-value {
- font-size: 32rpx;
- color: #222;
- font-weight: 500;
- }
- }
- </style>
|