重构项目文件夹目录
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
const mock = require('../../utils/mock')
|
||||
|
||||
Page({
|
||||
data: {
|
||||
id: '',
|
||||
employee: {}
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
const id = options.id || mock.artists[0].id
|
||||
const artist = mock.artists.find(item => String(item.id) === String(id)) || mock.artists[0]
|
||||
this.setData({
|
||||
id,
|
||||
employee: {
|
||||
...artist,
|
||||
monthOrders: 32,
|
||||
monthAmount: 5800,
|
||||
avgAmount: 181
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
go(event) {
|
||||
wx.navigateTo({ url: `${event.currentTarget.dataset.url}?id=${this.data.id}` })
|
||||
},
|
||||
|
||||
back() {
|
||||
wx.navigateBack()
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "员工详情"
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<view class="page no-tab">
|
||||
<view class="card employee-head">
|
||||
<view class="avatar" style="background: {{employee.color}};">{{employee.shortName}}</view>
|
||||
<view>
|
||||
<text class="employee-name">{{employee.name}}</text>
|
||||
<text class="tag" style="background: {{employee.color}}; color: #fff;">员工色</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="stats">
|
||||
<view class="card stat">
|
||||
<text class="stat-value">{{employee.monthOrders}}</text>
|
||||
<text class="stat-label">本月订单</text>
|
||||
</view>
|
||||
<view class="card stat">
|
||||
<text class="stat-value">¥{{employee.monthAmount}}</text>
|
||||
<text class="stat-label">本月营业额</text>
|
||||
</view>
|
||||
<view class="card stat">
|
||||
<text class="stat-value">¥{{employee.avgAmount}}</text>
|
||||
<text class="stat-label">平均客单价</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="menu-grid">
|
||||
<view class="card menu-card" data-url="/pages/schedule-setting/index" bindtap="go">排班设置</view>
|
||||
<view class="card menu-card" data-url="/pages/leave-management/index" bindtap="go">请假管理</view>
|
||||
<view class="card menu-card" data-url="/pages/color-setting/index" bindtap="go">颜色设置</view>
|
||||
<view class="card menu-card" data-url="/pages/employee-orders/index" bindtap="go">订单记录</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,68 @@
|
||||
.employee-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
padding: 28rpx;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 94rpx;
|
||||
height: 94rpx;
|
||||
border-radius: 50%;
|
||||
color: #fff;
|
||||
font-size: 34rpx;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.employee-name {
|
||||
display: block;
|
||||
margin-bottom: 12rpx;
|
||||
font-size: 34rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.stats {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 14rpx;
|
||||
margin-top: 18rpx;
|
||||
}
|
||||
|
||||
.stat {
|
||||
padding: 18rpx 12rpx;
|
||||
}
|
||||
|
||||
.stat-value,
|
||||
.stat-label {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 28rpx;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
margin-top: 8rpx;
|
||||
color: #91897f;
|
||||
font-size: 20rpx;
|
||||
}
|
||||
|
||||
.menu-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.menu-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-height: 148rpx;
|
||||
padding: 24rpx;
|
||||
color: #302c27;
|
||||
font-size: 30rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
Reference in New Issue
Block a user