功能:重建指尖管理师规划系统
@@ -1,7 +1,7 @@
|
||||
<!-- gitnexus:start -->
|
||||
# GitNexus — Code Intelligence
|
||||
|
||||
This project is indexed by GitNexus as **xiaowang** (15795 symbols, 31793 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
|
||||
This project is indexed by GitNexus as **xiaowang** (16101 symbols, 32240 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
|
||||
|
||||
> If any GitNexus tool warns the index is stale, run `npx gitnexus analyze` in terminal first.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!-- gitnexus:start -->
|
||||
# GitNexus — Code Intelligence
|
||||
|
||||
This project is indexed by GitNexus as **xiaowang** (15795 symbols, 31793 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
|
||||
This project is indexed by GitNexus as **xiaowang** (16101 symbols, 32240 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
|
||||
|
||||
> If any GitNexus tool warns the index is stale, run `npx gitnexus analyze` in terminal first.
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
const request = require('../utils/request')
|
||||
const { API_DOMAIN } = require('../utils/config')
|
||||
|
||||
module.exports = {
|
||||
login(data) {
|
||||
return request({
|
||||
url: '/auth/login',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
register(data) {
|
||||
return request({
|
||||
url: '/auth/register',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
sendCode(phone) {
|
||||
return request({
|
||||
url: '/user/send-verification-code',
|
||||
method: 'POST',
|
||||
params: {
|
||||
__baseUrl: API_DOMAIN
|
||||
},
|
||||
data: {
|
||||
phone,
|
||||
sceneCode: 'PLANNING_MANAGER_REGISTER'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
logout() {
|
||||
return request({
|
||||
url: '/auth/logout',
|
||||
method: 'POST'
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
const request = require('../utils/request')
|
||||
|
||||
module.exports = {
|
||||
list(params) {
|
||||
return request({
|
||||
url: '/user/list',
|
||||
params: {
|
||||
type: 0,
|
||||
hasOrder: true,
|
||||
...params
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
detail(id) {
|
||||
return request({
|
||||
url: `/user/detail/${id}`
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
const request = require('../utils/request')
|
||||
|
||||
module.exports = {
|
||||
list(params) {
|
||||
return request({
|
||||
url: '/nail-artist/list',
|
||||
params
|
||||
})
|
||||
},
|
||||
|
||||
detail(userId) {
|
||||
return request({
|
||||
url: `/nail-artist/get/${userId}`
|
||||
})
|
||||
},
|
||||
|
||||
save(data) {
|
||||
return request({
|
||||
url: '/nail-artist/save',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
schedules(params) {
|
||||
return request({
|
||||
url: '/artist-schedule/list',
|
||||
params
|
||||
})
|
||||
},
|
||||
|
||||
saveSchedule(data) {
|
||||
return request({
|
||||
url: '/artist-schedule/save',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
const request = require('../utils/request')
|
||||
|
||||
module.exports = {
|
||||
calendar(params) {
|
||||
return request({
|
||||
url: '/planning/calendar',
|
||||
params
|
||||
})
|
||||
},
|
||||
|
||||
createAppointment(data) {
|
||||
return request({
|
||||
url: '/planning/appointments',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
appointment(orderItemId) {
|
||||
return request({
|
||||
url: `/planning/appointments/${orderItemId}`
|
||||
})
|
||||
},
|
||||
|
||||
moveAppointment(orderItemId, data) {
|
||||
return request({
|
||||
url: `/planning/appointments/${orderItemId}/time-artist`,
|
||||
method: 'PUT',
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
updateStatus(orderId, status) {
|
||||
return request({
|
||||
url: `/planning/appointments/${orderId}/status`,
|
||||
method: 'PUT',
|
||||
data: { status }
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
const request = require('../utils/request')
|
||||
|
||||
module.exports = {
|
||||
list(params) {
|
||||
return request({
|
||||
url: '/product/list',
|
||||
params
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
const request = require('../utils/request')
|
||||
|
||||
module.exports = {
|
||||
settings() {
|
||||
return request({
|
||||
url: '/shops/current'
|
||||
})
|
||||
},
|
||||
|
||||
saveSettings(data) {
|
||||
return request({
|
||||
url: '/shops/current',
|
||||
method: 'PUT',
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
exportData(params) {
|
||||
return request({
|
||||
url: '/export',
|
||||
params
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
const auth = require('./utils/auth')
|
||||
|
||||
App({
|
||||
globalData: {
|
||||
appName: '指尖管理师',
|
||||
shopName: 'Yumi Nail',
|
||||
userInfo: null
|
||||
},
|
||||
|
||||
onLaunch() {
|
||||
this.bootstrapSession()
|
||||
},
|
||||
|
||||
bootstrapSession() {
|
||||
const session = auth.getSession()
|
||||
this.globalData.userInfo = session.userInfo || null
|
||||
if (session.shopName) {
|
||||
this.globalData.shopName = session.shopName
|
||||
}
|
||||
},
|
||||
|
||||
setSession(session) {
|
||||
auth.setSession(session)
|
||||
this.bootstrapSession()
|
||||
},
|
||||
|
||||
clearSession() {
|
||||
auth.clearSession()
|
||||
this.globalData.userInfo = null
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"pages": [
|
||||
"pages/login/index",
|
||||
"pages/register/index",
|
||||
"pages/planning/index",
|
||||
"pages/appointment-form/index",
|
||||
"pages/appointment-detail/index",
|
||||
"pages/artist-transfer/index",
|
||||
"pages/customers/index",
|
||||
"pages/customer-detail/index",
|
||||
"pages/employees/index",
|
||||
"pages/employee-detail/index",
|
||||
"pages/schedule-setting/index",
|
||||
"pages/leave-management/index",
|
||||
"pages/color-setting/index",
|
||||
"pages/employee-orders/index",
|
||||
"pages/profile/index",
|
||||
"pages/shop-settings/index",
|
||||
"pages/export/index",
|
||||
"pages/password/index",
|
||||
"pages/about/index"
|
||||
],
|
||||
"window": {
|
||||
"navigationBarTitleText": "指尖管理师",
|
||||
"navigationBarBackgroundColor": "#F8F5EF",
|
||||
"navigationBarTextStyle": "black",
|
||||
"backgroundColor": "#F8F5EF",
|
||||
"backgroundTextStyle": "dark"
|
||||
},
|
||||
"tabBar": {
|
||||
"color": "#8B8680",
|
||||
"selectedColor": "#2F6F62",
|
||||
"backgroundColor": "#FFFDF8",
|
||||
"borderStyle": "white",
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/planning/index",
|
||||
"text": "规划",
|
||||
"iconPath": "assets/tabbar/planning.png",
|
||||
"selectedIconPath": "assets/tabbar/planning-active.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/customers/index",
|
||||
"text": "客户",
|
||||
"iconPath": "assets/tabbar/customers.png",
|
||||
"selectedIconPath": "assets/tabbar/customers-active.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/employees/index",
|
||||
"text": "员工",
|
||||
"iconPath": "assets/tabbar/employees.png",
|
||||
"selectedIconPath": "assets/tabbar/employees-active.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/profile/index",
|
||||
"text": "我的",
|
||||
"iconPath": "assets/tabbar/profile.png",
|
||||
"selectedIconPath": "assets/tabbar/profile-active.png"
|
||||
}
|
||||
]
|
||||
},
|
||||
"style": "v2",
|
||||
"sitemapLocation": "sitemap.json"
|
||||
}
|
||||
@@ -0,0 +1,257 @@
|
||||
page {
|
||||
min-height: 100%;
|
||||
background: #f8f5ef;
|
||||
color: #26231f;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
view,
|
||||
text,
|
||||
button,
|
||||
input,
|
||||
textarea,
|
||||
picker,
|
||||
scroll-view {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
button {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
min-width: 0;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
button::after {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.page {
|
||||
min-height: 100vh;
|
||||
padding: 22rpx 24rpx 140rpx;
|
||||
background: #f8f5ef;
|
||||
}
|
||||
|
||||
.page.no-tab {
|
||||
padding-bottom: 196rpx;
|
||||
}
|
||||
|
||||
.card {
|
||||
border: 1rpx solid rgba(50, 43, 34, 0.06);
|
||||
border-radius: 12px;
|
||||
background: #fffdf8;
|
||||
box-shadow: 0 10rpx 28rpx rgba(58, 48, 34, 0.06);
|
||||
}
|
||||
|
||||
.section {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
margin: 4rpx 4rpx 16rpx;
|
||||
color: #4c4740;
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.between {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.muted {
|
||||
color: #9d968e;
|
||||
}
|
||||
|
||||
.tag {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
min-height: 40rpx;
|
||||
padding: 0 16rpx;
|
||||
border-radius: 999rpx;
|
||||
background: #f0ece5;
|
||||
color: #6d675f;
|
||||
font-size: 22rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.primary-btn,
|
||||
.secondary-btn,
|
||||
.text-btn,
|
||||
.danger-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
min-height: 76rpx;
|
||||
border-radius: 12px;
|
||||
font-size: 26rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.primary-btn,
|
||||
.secondary-btn,
|
||||
.danger-btn {
|
||||
min-width: 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.primary-btn {
|
||||
background: #6f8f83;
|
||||
color: #fffdf8;
|
||||
box-shadow: 0 12rpx 24rpx rgba(111, 143, 131, 0.22);
|
||||
}
|
||||
|
||||
.secondary-btn {
|
||||
border: 1rpx solid #d8d1c8;
|
||||
background: #fffdf8;
|
||||
color: #514b44;
|
||||
}
|
||||
|
||||
.danger-btn {
|
||||
background: #d98d8d;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.text-btn {
|
||||
width: auto;
|
||||
min-width: 0;
|
||||
max-width: none;
|
||||
min-height: 56rpx;
|
||||
color: #6f8f83;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.compact-btn,
|
||||
.small-action {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 112rpx;
|
||||
min-width: 112rpx;
|
||||
max-width: 112rpx;
|
||||
height: 56rpx;
|
||||
padding: 0 20rpx;
|
||||
border-radius: 999rpx;
|
||||
background: #e5eee9;
|
||||
color: #55786d;
|
||||
font-size: 24rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.small-action {
|
||||
width: 112rpx;
|
||||
min-width: 104rpx;
|
||||
max-width: 112rpx;
|
||||
height: 52rpx;
|
||||
background: #f0ece5;
|
||||
color: #5f5951;
|
||||
}
|
||||
|
||||
.icon-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 64rpx;
|
||||
min-width: 64rpx;
|
||||
max-width: 64rpx;
|
||||
height: 64rpx;
|
||||
min-height: 64rpx;
|
||||
padding: 0;
|
||||
border-radius: 50%;
|
||||
background: #fffdf8;
|
||||
color: #4e4942;
|
||||
box-shadow: 0 6rpx 14rpx rgba(58, 48, 34, 0.05);
|
||||
}
|
||||
|
||||
.form-card {
|
||||
padding: 8rpx 24rpx;
|
||||
}
|
||||
|
||||
.field {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-height: 108rpx;
|
||||
border-bottom: 1rpx solid #eee8df;
|
||||
}
|
||||
|
||||
.field:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.field-label {
|
||||
width: 180rpx;
|
||||
color: #625c55;
|
||||
font-size: 26rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.field input,
|
||||
.field textarea,
|
||||
.field-value {
|
||||
flex: 1;
|
||||
color: #27231f;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.field textarea {
|
||||
min-height: 140rpx;
|
||||
padding: 34rpx 0;
|
||||
}
|
||||
|
||||
.fixed-bottom {
|
||||
position: fixed;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 20;
|
||||
padding: 14rpx 24rpx calc(14rpx + env(safe-area-inset-bottom));
|
||||
background: rgba(248, 245, 239, 0.94);
|
||||
backdrop-filter: blur(18rpx);
|
||||
}
|
||||
|
||||
.fab {
|
||||
position: fixed;
|
||||
right: 28rpx;
|
||||
bottom: calc(100rpx + env(safe-area-inset-bottom));
|
||||
z-index: 18;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 84rpx;
|
||||
min-width: 84rpx;
|
||||
max-width: 84rpx;
|
||||
height: 84rpx;
|
||||
min-height: 84rpx;
|
||||
padding: 0;
|
||||
border-radius: 50%;
|
||||
background: #6f8f83;
|
||||
color: #fff;
|
||||
font-size: 46rpx;
|
||||
font-weight: 300;
|
||||
line-height: 84rpx;
|
||||
box-shadow: 0 12rpx 26rpx rgba(111, 143, 131, 0.24);
|
||||
}
|
||||
|
||||
.list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 18rpx;
|
||||
}
|
||||
|
||||
.list-card {
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
.empty {
|
||||
padding: 56rpx 24rpx;
|
||||
color: #a39b91;
|
||||
text-align: center;
|
||||
}
|
||||
|
After Width: | Height: | Size: 448 B |
|
After Width: | Height: | Size: 306 B |
|
After Width: | Height: | Size: 453 B |
|
After Width: | Height: | Size: 290 B |
|
After Width: | Height: | Size: 397 B |
|
After Width: | Height: | Size: 240 B |
|
After Width: | Height: | Size: 434 B |
|
After Width: | Height: | Size: 285 B |
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"treeData": []
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
Page({})
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "关于系统"
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<view class="page no-tab about-page">
|
||||
<view class="brand-card card">
|
||||
<view class="logo">指</view>
|
||||
<text class="name">指尖管理师</text>
|
||||
<text class="desc">专为美甲店店长设计的预约排班日历子系统</text>
|
||||
</view>
|
||||
<view class="card about-list">
|
||||
<view class="row between"><text>版本</text><text class="muted">1.0.0</text></view>
|
||||
<view class="row between"><text>定位</text><text class="muted">规划 / 客户 / 员工 / 我的</text></view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,40 @@
|
||||
.about-page {
|
||||
padding-top: 80rpx;
|
||||
}
|
||||
|
||||
.brand-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 52rpx 28rpx;
|
||||
}
|
||||
|
||||
.logo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
border-radius: 30rpx;
|
||||
background: #6f8f83;
|
||||
color: #fff;
|
||||
font-size: 52rpx;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.name {
|
||||
margin-top: 22rpx;
|
||||
font-size: 38rpx;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.desc {
|
||||
margin-top: 12rpx;
|
||||
color: #90887e;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.about-list {
|
||||
margin-top: 20rpx;
|
||||
padding: 24rpx;
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
const planningApi = require('../../api/planning')
|
||||
const mock = require('../../utils/mock')
|
||||
|
||||
Page({
|
||||
data: {
|
||||
id: '',
|
||||
appointment: {},
|
||||
avatarText: '',
|
||||
timeText: ''
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
this.setData({ id: options.id || '' })
|
||||
this.loadDetail()
|
||||
},
|
||||
|
||||
async loadDetail() {
|
||||
try {
|
||||
const appointment = await planningApi.appointment(this.data.id)
|
||||
this.applyAppointment(appointment)
|
||||
} catch (error) {
|
||||
const demo = mock.buildCalendar(new Date()).appointments[0]
|
||||
this.applyAppointment(demo)
|
||||
}
|
||||
},
|
||||
|
||||
applyAppointment(appointment) {
|
||||
this.setData({
|
||||
appointment,
|
||||
avatarText: String(appointment.customerName || '客').slice(0, 1),
|
||||
timeText: `${(appointment.startTime || '').slice(0, 16)} - ${(appointment.endTime || '').slice(11, 16)}`
|
||||
})
|
||||
},
|
||||
|
||||
async updateStatus(status) {
|
||||
try {
|
||||
await planningApi.updateStatus(this.data.appointment.orderId, status)
|
||||
wx.showToast({ title: '已更新' })
|
||||
this.loadDetail()
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '操作失败', icon: 'none' })
|
||||
}
|
||||
},
|
||||
|
||||
confirm() {
|
||||
this.updateStatus(1)
|
||||
},
|
||||
|
||||
complete() {
|
||||
this.updateStatus(2)
|
||||
},
|
||||
|
||||
cancel() {
|
||||
this.updateStatus(3)
|
||||
},
|
||||
|
||||
goTransfer() {
|
||||
wx.navigateTo({ url: `/pages/artist-transfer/index?id=${this.data.id}` })
|
||||
},
|
||||
|
||||
back() {
|
||||
wx.navigateBack()
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "预约详情"
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<view class="page no-tab">
|
||||
<view class="card detail-card">
|
||||
<view class="detail-head">
|
||||
<view class="detail-person">
|
||||
<view class="avatar">{{avatarText}}</view>
|
||||
<view>
|
||||
<text class="customer">{{appointment.customerName}}</text>
|
||||
<text class="phone">{{appointment.customerPhone}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="detail-actions">
|
||||
<text class="tag">{{appointment.statusText}}</text>
|
||||
<button class="small-action" bindtap="goTransfer">改派</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="detail-grid">
|
||||
<view>
|
||||
<text class="label">项目</text>
|
||||
<text class="value">{{appointment.productTitle}}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="label">美甲师</text>
|
||||
<text class="value">{{appointment.artistName}}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="label">时间</text>
|
||||
<text class="value">{{timeText}}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="label">时长</text>
|
||||
<text class="value">{{appointment.durationMinutes}}分钟</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="section-title">备注</view>
|
||||
<view class="card note-card">{{appointment.remark || '暂无备注'}}</view>
|
||||
</view>
|
||||
|
||||
<view class="fixed-bottom action-row">
|
||||
<button class="secondary-btn" bindtap="confirm">确认</button>
|
||||
<button class="primary-btn" bindtap="complete">完成</button>
|
||||
<button class="danger-btn" bindtap="cancel">取消</button>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,99 @@
|
||||
.detail-card {
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
.detail-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 18rpx;
|
||||
}
|
||||
|
||||
.detail-person {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-width: 0;
|
||||
gap: 18rpx;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
width: 82rpx;
|
||||
height: 82rpx;
|
||||
border-radius: 50%;
|
||||
background: #e5eee9;
|
||||
color: #5d8175;
|
||||
font-size: 32rpx;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.customer,
|
||||
.phone {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.customer {
|
||||
color: #24211d;
|
||||
font-size: 32rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.phone {
|
||||
margin-top: 6rpx;
|
||||
color: #928a81;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.detail-actions {
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
align-items: center;
|
||||
gap: 10rpx;
|
||||
}
|
||||
|
||||
.detail-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 22rpx;
|
||||
margin-top: 28rpx;
|
||||
}
|
||||
|
||||
.label,
|
||||
.value {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.label {
|
||||
color: #9a9288;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
|
||||
.value {
|
||||
margin-top: 8rpx;
|
||||
color: #2d2924;
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.note-card {
|
||||
padding: 24rpx;
|
||||
color: #6d655d;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.action-row {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
gap: 14rpx;
|
||||
}
|
||||
|
||||
.action-row .primary-btn,
|
||||
.action-row .secondary-btn,
|
||||
.action-row .danger-btn {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
const planningApi = require('../../api/planning')
|
||||
const productsApi = require('../../api/products')
|
||||
const mock = require('../../utils/mock')
|
||||
const dateUtil = require('../../utils/date')
|
||||
|
||||
Page({
|
||||
data: {
|
||||
form: {
|
||||
customerName: '',
|
||||
phone: '',
|
||||
appointmentDate: dateUtil.formatDate(new Date()),
|
||||
appointmentTime: '13:00',
|
||||
productId: '',
|
||||
durationMinutes: '',
|
||||
artistId: '',
|
||||
remark: ''
|
||||
},
|
||||
products: [],
|
||||
artists: mock.artists,
|
||||
selectedProduct: {},
|
||||
selectedArtist: {},
|
||||
conflictTip: '',
|
||||
conflictLevel: 'free',
|
||||
loading: false
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
this.setData({
|
||||
'form.appointmentDate': options.date || dateUtil.formatDate(new Date()),
|
||||
'form.artistId': options.artistId || ''
|
||||
})
|
||||
this.loadOptions()
|
||||
},
|
||||
|
||||
async loadOptions() {
|
||||
const fallbackProducts = [
|
||||
{ id: 1, title: '纯色美甲', approximateDuration: '90分钟' },
|
||||
{ id: 2, title: '猫眼延长', approximateDuration: '120分钟' },
|
||||
{ id: 3, title: '手部护理', approximateDuration: '60分钟' }
|
||||
]
|
||||
try {
|
||||
const productsData = await productsApi.list({ page: 1, size: 100 })
|
||||
const products = productsData.list || productsData || fallbackProducts
|
||||
this.setData({ products })
|
||||
} catch (error) {
|
||||
this.setData({ products: fallbackProducts })
|
||||
}
|
||||
if (this.data.form.artistId) {
|
||||
const selectedArtist = this.data.artists.find(item => String(item.id) === String(this.data.form.artistId)) || {}
|
||||
this.setData({ selectedArtist })
|
||||
}
|
||||
this.checkAvailability()
|
||||
},
|
||||
|
||||
onInput(event) {
|
||||
this.setData({
|
||||
[`form.${event.currentTarget.dataset.field}`]: event.detail.value
|
||||
})
|
||||
},
|
||||
|
||||
onDateChange(event) {
|
||||
this.setData({ 'form.appointmentDate': event.detail.value })
|
||||
this.checkAvailability()
|
||||
},
|
||||
|
||||
onTimeChange(event) {
|
||||
this.setData({ 'form.appointmentTime': event.detail.value })
|
||||
this.checkAvailability()
|
||||
},
|
||||
|
||||
onProductChange(event) {
|
||||
const selectedProduct = this.data.products[Number(event.detail.value)] || {}
|
||||
this.setData({
|
||||
selectedProduct,
|
||||
'form.productId': selectedProduct.id,
|
||||
'form.durationMinutes': String(parseInt(selectedProduct.approximateDuration, 10) || this.data.form.durationMinutes || 60)
|
||||
})
|
||||
this.checkAvailability()
|
||||
},
|
||||
|
||||
onArtistChange(event) {
|
||||
const selectedArtist = this.data.artists[Number(event.detail.value)] || {}
|
||||
this.setData({
|
||||
selectedArtist,
|
||||
'form.artistId': selectedArtist.id
|
||||
})
|
||||
this.checkAvailability()
|
||||
},
|
||||
|
||||
async checkAvailability() {
|
||||
const form = this.data.form
|
||||
if (!form.appointmentDate || !form.appointmentTime || !form.artistId) {
|
||||
this.setData({ conflictTip: '', conflictLevel: 'free' })
|
||||
return { ok: true }
|
||||
}
|
||||
const durationMinutes = Number(form.durationMinutes || 0) || 60
|
||||
const startMinute = dateUtil.minutesOfDay(form.appointmentTime)
|
||||
const endMinute = startMinute + durationMinutes
|
||||
if (startMinute < dateUtil.minutesOfDay('10:00') || endMinute > dateUtil.minutesOfDay('22:00')) {
|
||||
const tip = '该时间超出营业时间 10:00-22:00'
|
||||
this.setData({ conflictTip: tip, conflictLevel: 'danger' })
|
||||
return { ok: false, tip }
|
||||
}
|
||||
try {
|
||||
let calendar
|
||||
try {
|
||||
calendar = await planningApi.calendar({
|
||||
startDate: form.appointmentDate,
|
||||
endDate: form.appointmentDate,
|
||||
artistId: form.artistId
|
||||
})
|
||||
} catch (error) {
|
||||
calendar = mock.buildCalendar(form.appointmentDate)
|
||||
}
|
||||
const conflicts = (calendar.appointments || []).filter(item => {
|
||||
if (String(item.artistId) !== String(form.artistId) || item.date !== form.appointmentDate) return false
|
||||
if (item.status === 3 || item.statusText === '已取消') return false
|
||||
const itemStart = Number(item.startMinute || dateUtil.minutesOfDay((item.startTime || '').slice(11, 16)))
|
||||
const itemEnd = itemStart + Number(item.durationMinutes || 60)
|
||||
return startMinute < itemEnd && endMinute > itemStart
|
||||
})
|
||||
if (conflicts.length > 0) {
|
||||
const first = conflicts[0]
|
||||
const itemStart = Number(first.startMinute || dateUtil.minutesOfDay((first.startTime || '').slice(11, 16)))
|
||||
const itemEnd = itemStart + Number(first.durationMinutes || 60)
|
||||
const tip = `${this.data.selectedArtist.name || '该美甲师'} ${dateUtil.timeFromMinutes(itemStart)}-${dateUtil.timeFromMinutes(itemEnd)} 已有预约`
|
||||
this.setData({ conflictTip: tip, conflictLevel: 'danger' })
|
||||
return { ok: false, tip }
|
||||
}
|
||||
const tip = `${this.data.selectedArtist.name || '该美甲师'} ${form.appointmentTime}-${dateUtil.timeFromMinutes(endMinute)} 可预约`
|
||||
this.setData({ conflictTip: tip, conflictLevel: 'free' })
|
||||
return { ok: true, tip }
|
||||
} catch (error) {
|
||||
const tip = '暂未获取到排班,请保存时以系统校验为准'
|
||||
this.setData({ conflictTip: tip, conflictLevel: 'warn' })
|
||||
return { ok: true, tip }
|
||||
}
|
||||
},
|
||||
|
||||
async submit() {
|
||||
const form = this.data.form
|
||||
if (!form.customerName || !form.phone || !form.productId || !form.artistId) {
|
||||
wx.showToast({ title: '请补全预约信息', icon: 'none' })
|
||||
return
|
||||
}
|
||||
const availability = await this.checkAvailability()
|
||||
if (!availability.ok) {
|
||||
wx.showToast({ title: availability.tip || '该时段已被预约', icon: 'none' })
|
||||
return
|
||||
}
|
||||
this.setData({ loading: true })
|
||||
try {
|
||||
const result = await planningApi.createAppointment({
|
||||
...form,
|
||||
productId: Number(form.productId),
|
||||
artistId: Number(form.artistId),
|
||||
durationMinutes: Number(form.durationMinutes || 0) || undefined
|
||||
})
|
||||
wx.redirectTo({ url: `/pages/appointment-detail/index?id=${result.orderItemId}` })
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '保存失败', icon: 'none' })
|
||||
} finally {
|
||||
this.setData({ loading: false })
|
||||
}
|
||||
},
|
||||
|
||||
back() {
|
||||
wx.navigateBack()
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "新建预约"
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
<view class="page no-tab">
|
||||
<view class="card form-card">
|
||||
<view class="field">
|
||||
<text class="field-label">客户姓名</text>
|
||||
<input value="{{form.customerName}}" data-field="customerName" bindinput="onInput" placeholder="请输入客户姓名" />
|
||||
</view>
|
||||
<view class="field">
|
||||
<text class="field-label">手机号</text>
|
||||
<input value="{{form.phone}}" data-field="phone" bindinput="onInput" placeholder="请输入手机号" />
|
||||
</view>
|
||||
<view class="field">
|
||||
<text class="field-label">预约日期</text>
|
||||
<picker mode="date" value="{{form.appointmentDate}}" bindchange="onDateChange">
|
||||
<view class="field-value">{{form.appointmentDate}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="field">
|
||||
<text class="field-label">预约时间</text>
|
||||
<picker mode="time" value="{{form.appointmentTime}}" start="10:00" end="22:00" bindchange="onTimeChange">
|
||||
<view class="field-value">{{form.appointmentTime}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="field">
|
||||
<text class="field-label">项目内容</text>
|
||||
<picker range="{{products}}" range-key="title" bindchange="onProductChange">
|
||||
<view class="field-value">{{selectedProduct.title || '请选择项目'}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="field">
|
||||
<text class="field-label">预计时长</text>
|
||||
<input value="{{form.durationMinutes}}" data-field="durationMinutes" bindinput="onInput" type="number" placeholder="默认读取项目时长" />
|
||||
<text class="unit">分钟</text>
|
||||
</view>
|
||||
<view class="field">
|
||||
<text class="field-label">指定员工</text>
|
||||
<picker range="{{artists}}" range-key="name" bindchange="onArtistChange">
|
||||
<view class="field-value">{{selectedArtist.name || '请选择美甲师'}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="field textarea-field">
|
||||
<text class="field-label">备注</text>
|
||||
<textarea value="{{form.remark}}" data-field="remark" bindinput="onInput" placeholder="客户偏好、款式说明" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="capacity-tip card">
|
||||
<text class="tip-title">容量校验</text>
|
||||
<text class="tip-text">保存时会校验营业时间、美甲师休息和同时间段容量,冲突会直接拦截。</text>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{conflictTip}}" class="availability-tip card {{conflictLevel}}">
|
||||
<text class="tip-title">时段检查</text>
|
||||
<text class="tip-text">{{conflictTip}}</text>
|
||||
</view>
|
||||
|
||||
<view class="fixed-bottom">
|
||||
<button class="primary-btn" loading="{{loading}}" bindtap="submit">保存预约</button>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,60 @@
|
||||
.unit {
|
||||
color: #9a9288;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.textarea-field {
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.capacity-tip {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8rpx;
|
||||
margin-top: 20rpx;
|
||||
padding: 22rpx;
|
||||
}
|
||||
|
||||
.tip-title {
|
||||
color: #4e4942;
|
||||
font-size: 26rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.tip-text {
|
||||
color: #90877e;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.availability-tip {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8rpx;
|
||||
margin-top: 16rpx;
|
||||
padding: 22rpx;
|
||||
}
|
||||
|
||||
.availability-tip.free {
|
||||
background: #f3faf5;
|
||||
}
|
||||
|
||||
.availability-tip.warn {
|
||||
background: #fff8e8;
|
||||
}
|
||||
|
||||
.availability-tip.danger {
|
||||
background: #fff2f2;
|
||||
}
|
||||
|
||||
.availability-tip.free .tip-title {
|
||||
color: #4f7d62;
|
||||
}
|
||||
|
||||
.availability-tip.warn .tip-title {
|
||||
color: #a2763d;
|
||||
}
|
||||
|
||||
.availability-tip.danger .tip-title {
|
||||
color: #c36a6a;
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
const planningApi = require('../../api/planning')
|
||||
const mock = require('../../utils/mock')
|
||||
const dateUtil = require('../../utils/date')
|
||||
|
||||
Page({
|
||||
data: {
|
||||
id: '',
|
||||
artists: [],
|
||||
selectedArtistId: '',
|
||||
date: dateUtil.formatDate(new Date()),
|
||||
time: '13:00',
|
||||
loading: false
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
this.setData({
|
||||
id: options.id || '',
|
||||
artists: mock.artists.map((item, index) => ({
|
||||
...item,
|
||||
availableStatus: index === 1 ? 'busy' : index === 2 ? 'full' : 'free',
|
||||
availableText: index === 1 ? '有冲突' : index === 2 ? '已满' : '可接'
|
||||
}))
|
||||
})
|
||||
},
|
||||
|
||||
selectArtist(event) {
|
||||
this.setData({ selectedArtistId: event.currentTarget.dataset.id })
|
||||
},
|
||||
|
||||
onDateChange(event) {
|
||||
this.setData({ date: event.detail.value })
|
||||
},
|
||||
|
||||
onTimeChange(event) {
|
||||
this.setData({ time: event.detail.value })
|
||||
},
|
||||
|
||||
async submit() {
|
||||
if (!this.data.selectedArtistId) {
|
||||
wx.showToast({ title: '请选择美甲师', icon: 'none' })
|
||||
return
|
||||
}
|
||||
this.setData({ loading: true })
|
||||
try {
|
||||
await planningApi.moveAppointment(this.data.id, {
|
||||
artistId: Number(this.data.selectedArtistId),
|
||||
appointmentDate: this.data.date,
|
||||
appointmentTime: this.data.time
|
||||
})
|
||||
wx.showToast({ title: '已改派' })
|
||||
setTimeout(() => wx.navigateBack(), 500)
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '改派失败', icon: 'none' })
|
||||
} finally {
|
||||
this.setData({ loading: false })
|
||||
}
|
||||
},
|
||||
|
||||
back() {
|
||||
wx.navigateBack()
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "改派员工"
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<view class="page no-tab">
|
||||
<view class="list">
|
||||
<view wx:for="{{artists}}" wx:key="id" class="card transfer-card {{selectedArtistId == item.id ? 'active' : ''}}" data-id="{{item.id}}" bindtap="selectArtist">
|
||||
<view class="row between">
|
||||
<view class="row">
|
||||
<view class="chip-dot large" style="background: {{item.color}};"></view>
|
||||
<view>
|
||||
<text class="artist-name">{{item.name}}</text>
|
||||
<text class="artist-status">{{item.statusText}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<text class="tag {{item.availableStatus}}">{{item.availableText}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="card form-card section">
|
||||
<view class="field">
|
||||
<text class="field-label">新日期</text>
|
||||
<picker mode="date" value="{{date}}" bindchange="onDateChange">
|
||||
<view class="field-value">{{date}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="field">
|
||||
<text class="field-label">新时间</text>
|
||||
<picker mode="time" value="{{time}}" start="10:00" end="22:00" bindchange="onTimeChange">
|
||||
<view class="field-value">{{time}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="fixed-bottom">
|
||||
<button class="primary-btn" loading="{{loading}}" bindtap="submit">确认改派</button>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,45 @@
|
||||
.transfer-card {
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
.transfer-card.active {
|
||||
outline: 3rpx solid #8fb89a;
|
||||
}
|
||||
|
||||
.chip-dot.large {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
|
||||
.artist-name,
|
||||
.artist-status {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.artist-name {
|
||||
color: #25211d;
|
||||
font-size: 30rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.artist-status {
|
||||
margin-top: 6rpx;
|
||||
color: #948c83;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
|
||||
.tag.free {
|
||||
background: #e5eee9;
|
||||
color: #55786d;
|
||||
}
|
||||
|
||||
.tag.busy {
|
||||
background: #fbedd7;
|
||||
color: #a5722a;
|
||||
}
|
||||
|
||||
.tag.full {
|
||||
background: #f8e2e6;
|
||||
color: #b06070;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
Page({
|
||||
data: {
|
||||
selected: '#7BA7C7',
|
||||
customColor: '#7BA7C7',
|
||||
wheelColors: [
|
||||
'#E0627A', '#E7785B', '#E2A64B', '#D8C85C', '#9EBB63', '#63B77B',
|
||||
'#4CB7A6', '#56A7D6', '#5F82D7', '#7C70D4', '#A66BC8', '#CF72A8'
|
||||
],
|
||||
recommendedColors: ['#7BA7C7', '#8FB89A', '#A894C7', '#D7A86E', '#D98DA5', '#79A6A3', '#B9A16B', '#9BA9C8'],
|
||||
paletteColors: [
|
||||
'#6F8F83', '#7BA7C7', '#8AAECA', '#9BA9C8', '#A894C7', '#C19AB7',
|
||||
'#D98DA5', '#D9958D', '#D7A86E', '#C8B47E', '#B9A16B', '#9FAD7B',
|
||||
'#8FB89A', '#79A6A3', '#6E9E92', '#A6B7A4', '#B8B0A6', '#C7B7A3',
|
||||
'#8E8A7D', '#A4A097', '#B6A6A0', '#C9A2A2', '#B58A8A', '#8C7C92',
|
||||
'#6D8491', '#829A9A', '#A9B3A2', '#C6B7D1', '#E0C2B6', '#F0D6A8'
|
||||
]
|
||||
},
|
||||
select(event) {
|
||||
const color = event.currentTarget.dataset.color
|
||||
this.setData({ selected: color, customColor: color })
|
||||
},
|
||||
selectWheelColor(event) {
|
||||
const color = event.currentTarget.dataset.color
|
||||
this.setData({ selected: color, customColor: color })
|
||||
},
|
||||
onCustomInput(event) {
|
||||
this.setData({ customColor: event.detail.value })
|
||||
},
|
||||
applyCustomColor() {
|
||||
let color = (this.data.customColor || '').trim()
|
||||
if (color && color[0] !== '#') color = `#${color}`
|
||||
if (!/^#[0-9a-fA-F]{6}$/.test(color)) {
|
||||
wx.showToast({ title: '请输入6位色值', icon: 'none' })
|
||||
return
|
||||
}
|
||||
this.setData({ selected: color.toUpperCase(), customColor: color.toUpperCase() })
|
||||
},
|
||||
save() { wx.showToast({ title: '已保存到本地' }) },
|
||||
back() { wx.navigateBack() }
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "颜色设置"
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<view class="page no-tab">
|
||||
<view class="card color-preview" style="background: {{selected}};">{{selected}}</view>
|
||||
<view class="section-title">推荐色</view>
|
||||
<view class="palette recommended-palette">
|
||||
<view wx:for="{{recommendedColors}}" wx:key="*this" class="color-swatch recommended {{selected === item ? 'active' : ''}}" style="background: {{item}};" data-color="{{item}}" bindtap="select"></view>
|
||||
</view>
|
||||
<view class="section-title">色盘选择</view>
|
||||
<view class="card color-wheel-card">
|
||||
<view class="color-wheel-wrap">
|
||||
<view class="color-wheel">
|
||||
<view wx:for="{{wheelColors}}" wx:key="*this" class="wheel-hit hit-{{index}}" data-color="{{item}}" bindtap="selectWheelColor"></view>
|
||||
<view class="wheel-center" style="background: {{selected}};">
|
||||
<text>{{selected}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="palette-grid compact">
|
||||
<view wx:for="{{paletteColors}}" wx:key="*this" class="palette-dot {{selected === item ? 'active' : ''}}" style="background: {{item}};" data-color="{{item}}" bindtap="select"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card custom-color-card">
|
||||
<view class="custom-color-preview" style="background: {{customColor}};"></view>
|
||||
<input class="custom-color-input" value="{{customColor}}" maxlength="7" placeholder="#7BA7C7" bindinput="onCustomInput" />
|
||||
<button class="small-action" bindtap="applyCustomColor">应用</button>
|
||||
</view>
|
||||
<view class="fixed-bottom"><button class="primary-btn" bindtap="save">保存颜色</button></view>
|
||||
</view>
|
||||
@@ -0,0 +1,148 @@
|
||||
.color-preview {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 168rpx;
|
||||
color: #fff;
|
||||
font-size: 34rpx;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.palette {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 14rpx;
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
|
||||
.color-swatch {
|
||||
height: 92rpx;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 8rpx 18rpx rgba(58, 48, 34, 0.08);
|
||||
}
|
||||
|
||||
.color-swatch.active {
|
||||
outline: 6rpx solid rgba(47, 111, 98, 0.22);
|
||||
}
|
||||
|
||||
.color-wheel-card {
|
||||
padding: 22rpx 18rpx 18rpx;
|
||||
}
|
||||
|
||||
.color-wheel-wrap {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.color-wheel {
|
||||
position: relative;
|
||||
width: 308rpx;
|
||||
height: 308rpx;
|
||||
border-radius: 50%;
|
||||
background: conic-gradient(#e0627a, #e7785b, #e2a64b, #d8c85c, #9ebb63, #63b77b, #4cb7a6, #56a7d6, #5f82d7, #7c70d4, #a66bc8, #cf72a8, #e0627a);
|
||||
box-shadow: inset 0 0 0 2rpx rgba(255, 255, 255, 0.45), 0 12rpx 28rpx rgba(58, 48, 34, 0.12);
|
||||
}
|
||||
|
||||
.color-wheel::after {
|
||||
position: absolute;
|
||||
top: 42rpx;
|
||||
right: 42rpx;
|
||||
bottom: 42rpx;
|
||||
left: 42rpx;
|
||||
border-radius: 50%;
|
||||
background: radial-gradient(circle at 34% 30%, rgba(255,255,255,0.78), rgba(255,255,255,0.18) 38%, rgba(38,35,31,0.12) 100%);
|
||||
content: "";
|
||||
}
|
||||
|
||||
.wheel-center {
|
||||
position: absolute;
|
||||
top: 94rpx;
|
||||
left: 94rpx;
|
||||
z-index: 2;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
border: 8rpx solid #fffdf8;
|
||||
border-radius: 50%;
|
||||
color: #fff;
|
||||
font-size: 20rpx;
|
||||
font-weight: 900;
|
||||
text-shadow: 0 2rpx 6rpx rgba(31, 25, 20, 0.22);
|
||||
box-shadow: 0 10rpx 24rpx rgba(58, 48, 34, 0.16);
|
||||
}
|
||||
|
||||
.wheel-hit {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
z-index: 3;
|
||||
width: 70rpx;
|
||||
height: 154rpx;
|
||||
margin-left: -35rpx;
|
||||
transform-origin: 50% 154rpx;
|
||||
}
|
||||
|
||||
.hit-0 { transform: rotate(0deg); }
|
||||
.hit-1 { transform: rotate(30deg); }
|
||||
.hit-2 { transform: rotate(60deg); }
|
||||
.hit-3 { transform: rotate(90deg); }
|
||||
.hit-4 { transform: rotate(120deg); }
|
||||
.hit-5 { transform: rotate(150deg); }
|
||||
.hit-6 { transform: rotate(180deg); }
|
||||
.hit-7 { transform: rotate(210deg); }
|
||||
.hit-8 { transform: rotate(240deg); }
|
||||
.hit-9 { transform: rotate(270deg); }
|
||||
.hit-10 { transform: rotate(300deg); }
|
||||
.hit-11 { transform: rotate(330deg); }
|
||||
|
||||
.palette-grid.compact {
|
||||
margin-top: 22rpx;
|
||||
}
|
||||
|
||||
.palette-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(6, 1fr);
|
||||
gap: 12rpx;
|
||||
}
|
||||
|
||||
.palette-dot {
|
||||
width: 68rpx;
|
||||
height: 68rpx;
|
||||
border-radius: 50%;
|
||||
box-shadow: inset 0 0 0 1rpx rgba(255, 255, 255, 0.42), 0 6rpx 14rpx rgba(58, 48, 34, 0.08);
|
||||
}
|
||||
|
||||
.palette-dot.active {
|
||||
outline: 6rpx solid rgba(47, 111, 98, 0.24);
|
||||
outline-offset: 3rpx;
|
||||
}
|
||||
|
||||
.custom-color-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
margin-top: 18rpx;
|
||||
padding: 18rpx;
|
||||
}
|
||||
|
||||
.custom-color-preview {
|
||||
width: 58rpx;
|
||||
height: 58rpx;
|
||||
flex-shrink: 0;
|
||||
border-radius: 50%;
|
||||
box-shadow: inset 0 0 0 1rpx rgba(255, 255, 255, 0.45);
|
||||
}
|
||||
|
||||
.custom-color-input {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
height: 58rpx;
|
||||
padding: 0 18rpx;
|
||||
border-radius: 999rpx;
|
||||
background: #f4f0ea;
|
||||
color: #2f2a25;
|
||||
font-size: 26rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
Page({
|
||||
data: {
|
||||
id: '',
|
||||
avatarText: '客',
|
||||
customer: { name: '王女士', phone: '138****1201' },
|
||||
stats: { orderCount: 12, amount: 2860, lastTime: '06-01' },
|
||||
orders: [
|
||||
{ id: 1, date: '2026-06-01', project: '纯色美甲', amount: 168, artist: '小王' },
|
||||
{ id: 2, date: '2026-05-18', project: '猫眼延长', amount: 268, artist: '小李' },
|
||||
{ id: 3, date: '2026-05-02', project: '手部护理', amount: 98, artist: '小张' }
|
||||
]
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
this.setData({ id: options.id || '' })
|
||||
},
|
||||
|
||||
createAppointment() {
|
||||
wx.navigateTo({ url: '/pages/appointment-form/index' })
|
||||
},
|
||||
|
||||
back() {
|
||||
wx.navigateBack()
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "客户详情"
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<view class="page no-tab">
|
||||
<view class="card customer-head">
|
||||
<view class="customer-identity">
|
||||
<view class="avatar">{{avatarText}}</view>
|
||||
<view>
|
||||
<text class="customer-name">{{customer.name}}</text>
|
||||
<text class="customer-phone">{{customer.phone}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<button class="small-action" bindtap="createAppointment">新预约</button>
|
||||
</view>
|
||||
|
||||
<view class="stats">
|
||||
<view class="card stat">
|
||||
<text class="stat-value">{{stats.orderCount}}</text>
|
||||
<text class="stat-label">累计订单</text>
|
||||
</view>
|
||||
<view class="card stat">
|
||||
<text class="stat-value">¥{{stats.amount}}</text>
|
||||
<text class="stat-label">累计消费</text>
|
||||
</view>
|
||||
<view class="card stat">
|
||||
<text class="stat-value">{{stats.lastTime}}</text>
|
||||
<text class="stat-label">最近消费</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="section-title">历史订单</view>
|
||||
<view class="list">
|
||||
<view wx:for="{{orders}}" wx:key="id" class="card list-card order-card">
|
||||
<view>
|
||||
<text class="order-title">{{item.project}}</text>
|
||||
<text class="meta">{{item.date}} · {{item.artist}}</text>
|
||||
</view>
|
||||
<text class="amount">¥{{item.amount}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,89 @@
|
||||
.customer-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 18rpx;
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
.customer-identity {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-width: 0;
|
||||
gap: 18rpx;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
width: 84rpx;
|
||||
height: 84rpx;
|
||||
border-radius: 50%;
|
||||
background: #e5eee9;
|
||||
color: #5b7f73;
|
||||
font-size: 32rpx;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.customer-name,
|
||||
.customer-phone {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.customer-name {
|
||||
font-size: 32rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.customer-phone {
|
||||
margin-top: 8rpx;
|
||||
color: #928a81;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.stats {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 14rpx;
|
||||
margin-top: 18rpx;
|
||||
}
|
||||
|
||||
.stat {
|
||||
padding: 16rpx 12rpx;
|
||||
}
|
||||
|
||||
.stat-value,
|
||||
.stat-label {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
color: #26231f;
|
||||
font-size: 28rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
margin-top: 8rpx;
|
||||
color: #91897f;
|
||||
font-size: 20rpx;
|
||||
}
|
||||
|
||||
.order-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.order-title {
|
||||
display: block;
|
||||
font-size: 28rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.amount {
|
||||
color: #6f8f83;
|
||||
font-weight: 900;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
const customersApi = require('../../api/customers')
|
||||
|
||||
Page({
|
||||
data: {
|
||||
keyword: '',
|
||||
customers: []
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.loadCustomers()
|
||||
},
|
||||
|
||||
onSearchInput(event) {
|
||||
this.setData({ keyword: event.detail.value })
|
||||
clearTimeout(this._timer)
|
||||
this._timer = setTimeout(() => this.loadCustomers(), 300)
|
||||
},
|
||||
|
||||
async loadCustomers() {
|
||||
const fallback = [
|
||||
{ id: 1, name: '王女士', phone: '138****1201', lastTime: '2026-06-01' },
|
||||
{ id: 2, name: '陈女士', phone: '136****8842', lastTime: '2026-05-29' },
|
||||
{ id: 3, name: '林女士', phone: '159****6671', lastTime: '2026-05-27' }
|
||||
]
|
||||
try {
|
||||
const data = await customersApi.list({ keyword: this.data.keyword, page: 1, size: 30 })
|
||||
const list = data.list || data || []
|
||||
this.setData({
|
||||
customers: list.map(item => ({
|
||||
id: item.id,
|
||||
name: item.nickname || item.name || item.account || '客户',
|
||||
phone: item.contactPhone || item.phone || '未填写',
|
||||
lastTime: item.lastOrderTime || item.lastConsumeTime || '-'
|
||||
}))
|
||||
})
|
||||
} catch (error) {
|
||||
this.setData({ customers: fallback })
|
||||
}
|
||||
},
|
||||
|
||||
openDetail(event) {
|
||||
wx.navigateTo({ url: `/pages/customer-detail/index?id=${event.currentTarget.dataset.id}` })
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "客户"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<view class="page">
|
||||
<view class="search-card card">
|
||||
<input value="{{keyword}}" bindinput="onSearchInput" placeholder="搜索客户姓名或手机号" />
|
||||
</view>
|
||||
|
||||
<view class="list section">
|
||||
<view wx:for="{{customers}}" wx:key="id" class="card list-card customer-card" data-id="{{item.id}}" bindtap="openDetail">
|
||||
<view>
|
||||
<text class="name">{{item.name}}</text>
|
||||
<text class="meta">{{item.phone}}</text>
|
||||
<text class="meta">最近消费 {{item.lastTime}}</text>
|
||||
</view>
|
||||
<text class="arrow">›</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,39 @@
|
||||
.search-card {
|
||||
padding: 0 24rpx;
|
||||
height: 84rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.search-card input {
|
||||
width: 100%;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.customer-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.name,
|
||||
.meta {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.name {
|
||||
color: #292520;
|
||||
font-size: 30rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.meta {
|
||||
margin-top: 8rpx;
|
||||
color: #928a81;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.arrow {
|
||||
color: #b0a79e;
|
||||
font-size: 48rpx;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
Page({
|
||||
data: {
|
||||
orders: [
|
||||
{ id: 1, date: '2026-06-01', project: '纯色美甲', customer: '王女士', amount: 168 },
|
||||
{ id: 2, date: '2026-05-31', project: '猫眼延长', customer: '陈女士', amount: 268 },
|
||||
{ id: 3, date: '2026-05-30', project: '手部护理', customer: '林女士', amount: 98 }
|
||||
]
|
||||
},
|
||||
back() { wx.navigateBack() }
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "订单记录"
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<view class="page no-tab">
|
||||
<view class="list">
|
||||
<view wx:for="{{orders}}" wx:key="id" class="card list-card order-row">
|
||||
<view>
|
||||
<text class="order-title">{{item.project}}</text>
|
||||
<text class="muted">{{item.date}} · {{item.customer}}</text>
|
||||
</view>
|
||||
<text class="amount">¥{{item.amount}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,17 @@
|
||||
.order-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.order-title {
|
||||
display: block;
|
||||
margin-bottom: 8rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.amount {
|
||||
color: #6f8f83;
|
||||
font-weight: 900;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
const employeesApi = require('../../api/employees')
|
||||
const mock = require('../../utils/mock')
|
||||
|
||||
Page({
|
||||
data: {
|
||||
employees: []
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.loadEmployees()
|
||||
},
|
||||
|
||||
async loadEmployees() {
|
||||
const fallback = mock.artists.map((item, index) => ({
|
||||
...item,
|
||||
monthOrders: 32 - index * 5,
|
||||
monthAmount: 5800 - index * 760
|
||||
}))
|
||||
try {
|
||||
const data = await employeesApi.list({ page: 1, size: 50 })
|
||||
const list = data.list || data || []
|
||||
this.setData({
|
||||
employees: list.map((item, index) => ({
|
||||
id: item.userId || item.id,
|
||||
name: item.nickname || item.name || item.artistName || `美甲师${index + 1}`,
|
||||
shortName: (item.nickname || item.name || '师').slice(-1),
|
||||
color: mock.artists[index % mock.artists.length].color,
|
||||
monthOrders: item.monthOrders || item.orderCount || 0,
|
||||
monthAmount: item.monthAmount || item.turnover || 0
|
||||
}))
|
||||
})
|
||||
} catch (error) {
|
||||
this.setData({ employees: fallback })
|
||||
}
|
||||
},
|
||||
|
||||
openDetail(event) {
|
||||
wx.navigateTo({ url: `/pages/employee-detail/index?id=${event.currentTarget.dataset.id}` })
|
||||
},
|
||||
|
||||
addEmployee() {
|
||||
wx.showToast({ title: '员工创建沿用后台账号', icon: 'none' })
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "员工"
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<view class="page">
|
||||
<view class="list-heading">
|
||||
<text>美甲师</text>
|
||||
<button class="compact-btn" bindtap="addEmployee">新增</button>
|
||||
</view>
|
||||
|
||||
<view class="list">
|
||||
<view wx:for="{{employees}}" wx:key="id" class="card employee-card" data-id="{{item.id}}" bindtap="openDetail">
|
||||
<view class="employee-left">
|
||||
<view class="avatar" style="background: {{item.color}};">{{item.shortName}}</view>
|
||||
<view>
|
||||
<text class="employee-name">{{item.name}}</text>
|
||||
<text class="employee-meta">本月 {{item.monthOrders}} 单 · ¥{{item.monthAmount}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="color-pill" style="background: {{item.color}};"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,66 @@
|
||||
.list-heading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
width: 100%;
|
||||
margin-bottom: 16rpx;
|
||||
color: #4c4740;
|
||||
font-size: 28rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.list-heading text {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.list-heading .compact-btn {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.employee-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 22rpx;
|
||||
}
|
||||
|
||||
.employee-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 18rpx;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 78rpx;
|
||||
height: 78rpx;
|
||||
border-radius: 50%;
|
||||
color: #fff;
|
||||
font-size: 28rpx;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.employee-name,
|
||||
.employee-meta {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.employee-name {
|
||||
color: #25211d;
|
||||
font-size: 28rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.employee-meta {
|
||||
margin-top: 8rpx;
|
||||
color: #91897f;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.color-pill {
|
||||
width: 44rpx;
|
||||
height: 18rpx;
|
||||
border-radius: 999rpx;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
const dateUtil = require('../../utils/date')
|
||||
|
||||
Page({
|
||||
data: {
|
||||
types: ['订单数据', '客户数据', '员工数据'],
|
||||
type: '订单数据',
|
||||
startDate: dateUtil.formatDate(dateUtil.startOfMonth(new Date())),
|
||||
endDate: dateUtil.formatDate(new Date())
|
||||
},
|
||||
onTypeChange(event) { this.setData({ type: this.data.types[Number(event.detail.value)] }) },
|
||||
onStartDate(event) { this.setData({ startDate: event.detail.value }) },
|
||||
onEndDate(event) { this.setData({ endDate: event.detail.value }) },
|
||||
exportExcel() { wx.showToast({ title: '导出任务已创建', icon: 'none' }) },
|
||||
back() { wx.navigateBack() }
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "数据导出"
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<view class="page no-tab">
|
||||
<view class="card form-card">
|
||||
<view class="field"><text class="field-label">导出类型</text><picker range="{{types}}" bindchange="onTypeChange"><view class="field-value">{{type}}</view></picker></view>
|
||||
<view class="field"><text class="field-label">开始日期</text><picker mode="date" value="{{startDate}}" bindchange="onStartDate"><view class="field-value">{{startDate}}</view></picker></view>
|
||||
<view class="field"><text class="field-label">结束日期</text><picker mode="date" value="{{endDate}}" bindchange="onEndDate"><view class="field-value">{{endDate}}</view></picker></view>
|
||||
</view>
|
||||
<view class="fixed-bottom"><button class="primary-btn" bindtap="exportExcel">导出 Excel</button></view>
|
||||
</view>
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
Page({
|
||||
data: {
|
||||
days: Array.from({ length: 31 }).map((_, index) => ({ day: index + 1, rest: [12, 25].includes(index + 1) })),
|
||||
records: [
|
||||
{ date: '2026-06-12', text: '全天请假' },
|
||||
{ date: '2026-06-25', text: '下午请假' }
|
||||
]
|
||||
},
|
||||
add() { wx.showToast({ title: '请选择日期后保存', icon: 'none' }) },
|
||||
back() { wx.navigateBack() }
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "请假管理"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<view class="page no-tab">
|
||||
<view class="card mini-calendar">
|
||||
<view wx:for="{{days}}" wx:key="date" class="mini-day {{item.rest ? 'rest' : ''}}">{{item.day}}</view>
|
||||
</view>
|
||||
<view class="section">
|
||||
<view class="section-title">请假记录</view>
|
||||
<view class="list">
|
||||
<view wx:for="{{records}}" wx:key="date" class="card list-card">{{item.date}} {{item.text}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fixed-bottom"><button class="primary-btn" bindtap="add">新增请假</button></view>
|
||||
</view>
|
||||
@@ -0,0 +1,22 @@
|
||||
.mini-calendar {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(7, 1fr);
|
||||
gap: 10rpx;
|
||||
padding: 18rpx;
|
||||
}
|
||||
|
||||
.mini-day {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 64rpx;
|
||||
border-radius: 10rpx;
|
||||
background: #f2ede7;
|
||||
color: #5d564e;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.mini-day.rest {
|
||||
background: #e7f0f6;
|
||||
color: #6e9fbd;
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
const authApi = require('../../api/auth')
|
||||
|
||||
Page({
|
||||
data: {
|
||||
form: {
|
||||
account: '',
|
||||
password: ''
|
||||
},
|
||||
loading: false
|
||||
},
|
||||
|
||||
onInput(event) {
|
||||
const field = event.currentTarget.dataset.field
|
||||
this.setData({
|
||||
[`form.${field}`]: event.detail.value
|
||||
})
|
||||
},
|
||||
|
||||
async submit() {
|
||||
if (!this.data.form.account || !this.data.form.password) {
|
||||
wx.showToast({ title: '请填写手机号和密码', icon: 'none' })
|
||||
return
|
||||
}
|
||||
this.setData({ loading: true })
|
||||
try {
|
||||
const data = await authApi.login({
|
||||
account: this.data.form.account,
|
||||
password: this.data.form.password
|
||||
})
|
||||
const app = getApp()
|
||||
app.setSession({
|
||||
...data,
|
||||
accessToken: data.accessToken || data.token,
|
||||
userInfo: data.userInfo || data.user || {},
|
||||
shopName: data.shopName || (data.shop && data.shop.shopName)
|
||||
})
|
||||
wx.reLaunch({ url: '/pages/planning/index' })
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '登录失败', icon: 'none' })
|
||||
} finally {
|
||||
this.setData({ loading: false })
|
||||
}
|
||||
},
|
||||
|
||||
goRegister() {
|
||||
wx.navigateTo({ url: '/pages/register/index' })
|
||||
},
|
||||
|
||||
wechatLogin() {
|
||||
wx.showToast({ title: '请先使用账号登录', icon: 'none' })
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "登录"
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<view class="page no-tab auth-page">
|
||||
<view class="brand">
|
||||
<view class="logo">指</view>
|
||||
<text class="brand-name">指尖管理师</text>
|
||||
<text class="brand-sub">美甲店预约排班管理</text>
|
||||
</view>
|
||||
|
||||
<view class="card auth-card">
|
||||
<view class="field">
|
||||
<text class="field-label">手机号</text>
|
||||
<input value="{{form.account}}" data-field="account" bindinput="onInput" placeholder="请输入手机号或账号" />
|
||||
</view>
|
||||
<view class="field">
|
||||
<text class="field-label">密码</text>
|
||||
<input value="{{form.password}}" data-field="password" bindinput="onInput" password placeholder="请输入密码" />
|
||||
</view>
|
||||
<button class="primary-btn login-btn" loading="{{loading}}" bindtap="submit">登录</button>
|
||||
<view class="auth-links">
|
||||
<button class="text-btn">忘记密码</button>
|
||||
<button class="text-btn" bindtap="goRegister">注册账号</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<button class="secondary-btn wechat-btn" bindtap="wechatLogin">微信快捷登录</button>
|
||||
</view>
|
||||
@@ -0,0 +1,58 @@
|
||||
.auth-page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
padding-top: 84rpx;
|
||||
}
|
||||
|
||||
.brand {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-bottom: 54rpx;
|
||||
}
|
||||
|
||||
.logo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
border-radius: 30rpx;
|
||||
background: #6f8f83;
|
||||
color: #fffdf8;
|
||||
font-size: 52rpx;
|
||||
font-weight: 900;
|
||||
box-shadow: 0 16rpx 34rpx rgba(111, 143, 131, 0.24);
|
||||
}
|
||||
|
||||
.brand-name {
|
||||
margin-top: 24rpx;
|
||||
color: #24211d;
|
||||
font-size: 42rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.brand-sub {
|
||||
margin-top: 8rpx;
|
||||
color: #938c83;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.auth-card {
|
||||
padding: 12rpx 24rpx 26rpx;
|
||||
}
|
||||
|
||||
.login-btn {
|
||||
margin-top: 28rpx;
|
||||
}
|
||||
|
||||
.auth-links {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 18rpx;
|
||||
}
|
||||
|
||||
.wechat-btn {
|
||||
margin-top: 34rpx;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
Page({
|
||||
data: { form: { oldPassword: '', newPassword: '', confirmPassword: '' } },
|
||||
onInput(event) { this.setData({ [`form.${event.currentTarget.dataset.field}`]: event.detail.value }) },
|
||||
save() {
|
||||
if (this.data.form.newPassword !== this.data.form.confirmPassword) {
|
||||
wx.showToast({ title: '两次密码不一致', icon: 'none' })
|
||||
return
|
||||
}
|
||||
wx.showToast({ title: '已提交' })
|
||||
},
|
||||
back() { wx.navigateBack() }
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "修改密码"
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<view class="page no-tab">
|
||||
<view class="card form-card">
|
||||
<view class="field"><text class="field-label">原密码</text><input password value="{{form.oldPassword}}" data-field="oldPassword" bindinput="onInput" /></view>
|
||||
<view class="field"><text class="field-label">新密码</text><input password value="{{form.newPassword}}" data-field="newPassword" bindinput="onInput" /></view>
|
||||
<view class="field"><text class="field-label">确认密码</text><input password value="{{form.confirmPassword}}" data-field="confirmPassword" bindinput="onInput" /></view>
|
||||
</view>
|
||||
<view class="fixed-bottom"><button class="primary-btn" bindtap="save">保存密码</button></view>
|
||||
</view>
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,340 @@
|
||||
const planningApi = require('../../api/planning')
|
||||
const dateUtil = require('../../utils/date')
|
||||
const mock = require('../../utils/mock')
|
||||
|
||||
Page({
|
||||
data: {
|
||||
viewMode: 'month',
|
||||
viewModes: [
|
||||
{ value: 'day', label: '日' },
|
||||
{ value: 'week', label: '周' },
|
||||
{ value: 'month', label: '月' }
|
||||
],
|
||||
monthDisplayMode: 'count',
|
||||
monthDisplayModes: [
|
||||
{ value: 'count', label: '单量' },
|
||||
{ value: 'blocks', label: '点阵' },
|
||||
{ value: 'rows', label: '横条' }
|
||||
],
|
||||
monthRowLabelVisible: false,
|
||||
weekLabels: ['一', '二', '三', '四', '五', '六', '日'],
|
||||
currentDate: new Date(),
|
||||
currentDateText: dateUtil.formatDate(new Date()),
|
||||
selectedArtistId: '',
|
||||
selectedArtistName: '全部员工',
|
||||
dateTitle: '',
|
||||
rangeText: '',
|
||||
weekRange: '',
|
||||
businessStartTime: '10:00',
|
||||
businessEndTime: '22:00',
|
||||
artists: [],
|
||||
appointments: [],
|
||||
daySummaries: [],
|
||||
monthDays: [],
|
||||
weekDays: [],
|
||||
dayLanes: [],
|
||||
hours: [],
|
||||
timelineHeight: 720,
|
||||
laneWidth: 720,
|
||||
laneItemWidth: 240,
|
||||
dayTotal: 0,
|
||||
freeArtistCount: 0,
|
||||
pendingCount: 0,
|
||||
loading: false
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.loadCalendar()
|
||||
},
|
||||
|
||||
onShow() {
|
||||
if (this._needRefresh) {
|
||||
this._needRefresh = false
|
||||
this.loadCalendar()
|
||||
}
|
||||
},
|
||||
|
||||
switchView(event) {
|
||||
this.setData({ viewMode: event.currentTarget.dataset.mode })
|
||||
this.prepareView()
|
||||
this.loadCalendar()
|
||||
},
|
||||
|
||||
switchMonthDisplay(event) {
|
||||
this.setData({ monthDisplayMode: event.currentTarget.dataset.mode })
|
||||
},
|
||||
|
||||
toggleMonthRowLabel() {
|
||||
this.setData({ monthRowLabelVisible: !this.data.monthRowLabelVisible })
|
||||
},
|
||||
|
||||
selectArtist(event) {
|
||||
const id = event.currentTarget.dataset.id || ''
|
||||
const artist = this.data.artists.find(item => String(item.id) === String(id))
|
||||
this.setData({
|
||||
selectedArtistId: id,
|
||||
selectedArtistName: artist ? artist.name : '全部员工'
|
||||
})
|
||||
this.prepareView()
|
||||
},
|
||||
|
||||
selectDate(event) {
|
||||
const currentDate = dateUtil.formatDate(event.currentTarget.dataset.date)
|
||||
this.setData({
|
||||
currentDate,
|
||||
currentDateText: currentDate,
|
||||
viewMode: this.data.viewMode === 'month' ? 'day' : this.data.viewMode
|
||||
})
|
||||
this.prepareView()
|
||||
},
|
||||
|
||||
prevRange() {
|
||||
this.shiftRange(-1)
|
||||
},
|
||||
|
||||
nextRange() {
|
||||
this.shiftRange(1)
|
||||
},
|
||||
|
||||
goToday() {
|
||||
const today = new Date()
|
||||
this.setData({
|
||||
currentDate: today,
|
||||
currentDateText: dateUtil.formatDate(today)
|
||||
})
|
||||
this.loadCalendar()
|
||||
},
|
||||
|
||||
shiftRange(direction) {
|
||||
let next
|
||||
if (this.data.viewMode === 'month') {
|
||||
next = dateUtil.addMonths(this.data.currentDateText, direction)
|
||||
} else if (this.data.viewMode === 'week') {
|
||||
next = dateUtil.addDays(this.data.currentDateText, direction * 7)
|
||||
} else {
|
||||
next = dateUtil.addDays(this.data.currentDateText, direction)
|
||||
}
|
||||
this.setData({
|
||||
currentDate: next,
|
||||
currentDateText: dateUtil.formatDate(next)
|
||||
})
|
||||
this.loadCalendar()
|
||||
},
|
||||
|
||||
async loadCalendar() {
|
||||
const range = this.resolveRange()
|
||||
this.setData({ loading: true })
|
||||
try {
|
||||
const data = await planningApi.calendar({
|
||||
startDate: range.start,
|
||||
endDate: range.end,
|
||||
artistId: this.data.selectedArtistId || undefined
|
||||
})
|
||||
this.applyCalendar(data)
|
||||
} catch (error) {
|
||||
this.applyCalendar(mock.buildCalendar(this.data.currentDateText))
|
||||
} finally {
|
||||
this.setData({ loading: false })
|
||||
}
|
||||
},
|
||||
|
||||
resolveRange() {
|
||||
const current = this.data.currentDateText
|
||||
if (this.data.viewMode === 'week') {
|
||||
return {
|
||||
start: dateUtil.formatDate(dateUtil.startOfWeek(current)),
|
||||
end: dateUtil.formatDate(dateUtil.endOfWeek(current))
|
||||
}
|
||||
}
|
||||
if (this.data.viewMode === 'month') {
|
||||
return {
|
||||
start: dateUtil.formatDate(dateUtil.startOfMonth(current)),
|
||||
end: dateUtil.formatDate(dateUtil.endOfMonth(current))
|
||||
}
|
||||
}
|
||||
return { start: current, end: current }
|
||||
},
|
||||
|
||||
applyCalendar(calendar) {
|
||||
const artists = calendar.artists || []
|
||||
this.setData({
|
||||
businessStartTime: (calendar.businessStartTime || '10:00').slice(0, 5),
|
||||
businessEndTime: (calendar.businessEndTime || '22:00').slice(0, 5),
|
||||
artists,
|
||||
appointments: calendar.appointments || [],
|
||||
daySummaries: calendar.daySummaries || []
|
||||
})
|
||||
this.prepareView()
|
||||
},
|
||||
|
||||
prepareView() {
|
||||
const current = this.data.currentDateText
|
||||
const range = this.resolveRange()
|
||||
const title = this.data.viewMode === 'month'
|
||||
? dateUtil.formatMonth(current)
|
||||
: this.data.viewMode === 'week'
|
||||
? `${range.start.replace(/-/g, '/')} - ${range.end.replace(/-/g, '/')}`
|
||||
: dateUtil.formatCnDate(current)
|
||||
this.setData({
|
||||
dateTitle: title,
|
||||
rangeText: this.data.viewMode === 'month' ? '月视图' : this.data.viewMode === 'week' ? '周视图' : '日视图',
|
||||
weekRange: `${range.start.replace(/-/g, '/')} - ${range.end.replace(/-/g, '/')}`,
|
||||
monthDays: this.buildMonthDays(),
|
||||
weekDays: this.buildWeekDays(),
|
||||
...this.buildDayView()
|
||||
})
|
||||
},
|
||||
|
||||
buildMonthDays() {
|
||||
const summaryMap = this.summaryMap()
|
||||
const artistTemplate = this.data.artists.map(artist => ({
|
||||
artistId: artist.id,
|
||||
artistName: artist.name,
|
||||
shortName: artist.shortName,
|
||||
color: artist.color,
|
||||
count: 0,
|
||||
status: 'free'
|
||||
}))
|
||||
return dateUtil.monthGrid(this.data.currentDateText).map(day => {
|
||||
const summary = summaryMap[day.date] || {}
|
||||
const artistCounts = this.normalizeArtistCounts(summary.artistCounts || artistTemplate)
|
||||
return {
|
||||
...day,
|
||||
totalCount: summary.totalCount || 0,
|
||||
dayStatus: summary.dayStatus || 'free',
|
||||
artistCounts,
|
||||
expandedBlocks: this.buildExpandedBlocks(artistCounts),
|
||||
rowBlocks: this.buildRowBlocks(artistCounts)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
buildWeekDays() {
|
||||
const start = dateUtil.startOfWeek(this.data.currentDateText)
|
||||
const summaryMap = this.summaryMap()
|
||||
return this.data.weekLabels.map((label, index) => {
|
||||
const target = dateUtil.addDays(start, index)
|
||||
const date = dateUtil.formatDate(target)
|
||||
const summary = summaryMap[date] || { artistCounts: [], totalCount: 0 }
|
||||
const artistCounts = this.normalizeArtistCounts(summary.artistCounts || [])
|
||||
return {
|
||||
date,
|
||||
weekName: `周${label}`,
|
||||
day: target.getDate(),
|
||||
totalCount: summary.totalCount || 0,
|
||||
artistCounts: artistCounts.map(count => ({
|
||||
...count,
|
||||
width: Math.max(12, Math.min(100, count.count * 22)),
|
||||
barWidth: Math.max(14, Math.min(100, count.count * 18))
|
||||
}))
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
buildDayView() {
|
||||
const startMinute = dateUtil.minutesOfDay(this.data.businessStartTime)
|
||||
const endMinute = dateUtil.minutesOfDay(this.data.businessEndTime)
|
||||
const timelineHeight = Math.max(560, endMinute - startMinute)
|
||||
const hours = []
|
||||
for (let cursor = startMinute; cursor <= endMinute; cursor += 60) {
|
||||
hours.push({
|
||||
value: cursor,
|
||||
label: dateUtil.timeFromMinutes(cursor),
|
||||
top: cursor - startMinute
|
||||
})
|
||||
}
|
||||
const filteredArtists = this.data.selectedArtistId
|
||||
? this.data.artists.filter(item => String(item.id) === String(this.data.selectedArtistId))
|
||||
: this.data.artists
|
||||
const dayAppointments = this.data.appointments.filter(item => item.date === this.data.currentDateText)
|
||||
const lanes = filteredArtists.map(artist => {
|
||||
const blocks = dayAppointments
|
||||
.filter(item => String(item.artistId) === String(artist.id))
|
||||
.map(item => {
|
||||
const itemStart = item.startMinute || dateUtil.minutesOfDay((item.startTime || '').slice(11, 16))
|
||||
return {
|
||||
...item,
|
||||
top: Math.max(0, itemStart - startMinute),
|
||||
height: Math.max(64, item.durationMinutes || 60),
|
||||
timeText: `${(item.startTime || '').slice(11, 16)}-${(item.endTime || '').slice(11, 16)}`
|
||||
}
|
||||
})
|
||||
return { ...artist, blocks }
|
||||
})
|
||||
const pendingCount = dayAppointments.filter(item => item.status === 0).length
|
||||
return {
|
||||
dayLanes: lanes,
|
||||
hours,
|
||||
timelineHeight,
|
||||
laneItemWidth: 248,
|
||||
laneWidth: Math.max(720, lanes.length * 248),
|
||||
dayTotal: dayAppointments.length,
|
||||
freeArtistCount: lanes.filter(item => item.blocks.length === 0).length,
|
||||
pendingCount
|
||||
}
|
||||
},
|
||||
|
||||
summaryMap() {
|
||||
return (this.data.daySummaries || []).reduce((map, item) => {
|
||||
map[item.date] = item
|
||||
return map
|
||||
}, {})
|
||||
},
|
||||
|
||||
normalizeArtistCounts(counts) {
|
||||
const colorMap = this.data.artists.reduce((map, artist) => {
|
||||
map[artist.id] = artist
|
||||
return map
|
||||
}, {})
|
||||
return (counts || []).map(count => {
|
||||
const artist = colorMap[count.artistId] || {}
|
||||
return {
|
||||
...count,
|
||||
color: count.color || artist.color || '#B8B0A6',
|
||||
shortName: count.shortName || artist.shortName || '?',
|
||||
count: Number(count.count || 0)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
buildExpandedBlocks(artistCounts) {
|
||||
return (artistCounts || []).reduce((blocks, count) => {
|
||||
for (let index = 0; index < Number(count.count || 0); index += 1) {
|
||||
blocks.push({
|
||||
key: `${count.artistId || count.shortName}-${index}`,
|
||||
artistId: count.artistId,
|
||||
color: count.color,
|
||||
shortName: count.shortName
|
||||
})
|
||||
}
|
||||
return blocks
|
||||
}, [])
|
||||
},
|
||||
|
||||
buildRowBlocks(artistCounts) {
|
||||
return (artistCounts || []).reduce((rows, count) => {
|
||||
for (let index = 0; index < Number(count.count || 0); index += 1) {
|
||||
rows.push({
|
||||
key: `${count.artistId || count.shortName}-row-${index}`,
|
||||
artistId: count.artistId,
|
||||
color: count.color,
|
||||
shortName: count.shortName,
|
||||
artistName: count.artistName || count.shortName
|
||||
})
|
||||
}
|
||||
return rows
|
||||
}, [])
|
||||
},
|
||||
|
||||
createAppointment() {
|
||||
wx.navigateTo({
|
||||
url: `/pages/appointment-form/index?date=${this.data.currentDateText}&artistId=${this.data.selectedArtistId || ''}`
|
||||
})
|
||||
},
|
||||
|
||||
openAppointment(event) {
|
||||
wx.navigateTo({
|
||||
url: `/pages/appointment-detail/index?id=${event.currentTarget.dataset.id}`
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "规划"
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
<view class="page planning-page">
|
||||
<view class="card control-card">
|
||||
<view class="date-row">
|
||||
<view class="date-side">
|
||||
<button class="icon-btn small" bindtap="prevRange">‹</button>
|
||||
</view>
|
||||
<view class="date-center">
|
||||
<text class="date-main">{{dateTitle}}</text>
|
||||
<text class="date-sub">{{businessStartTime}}-{{businessEndTime}}</text>
|
||||
</view>
|
||||
<view class="date-side date-tools">
|
||||
<button class="today-btn" bindtap="goToday">今</button>
|
||||
<button class="icon-btn small" bindtap="nextRange">›</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="segmented">
|
||||
<view wx:for="{{viewModes}}" wx:key="value" class="segment {{viewMode === item.value ? 'active' : ''}}" data-mode="{{item.value}}" bindtap="switchView">{{item.label}}</view>
|
||||
</view>
|
||||
<scroll-view class="artist-filter" scroll-x enable-flex>
|
||||
<view class="artist-chip {{!selectedArtistId ? 'active' : ''}}" data-id="" bindtap="selectArtist">全部员工</view>
|
||||
<view wx:for="{{artists}}" wx:key="id" class="artist-chip {{selectedArtistId == item.id ? 'active' : ''}}" data-id="{{item.id}}" bindtap="selectArtist">
|
||||
<view class="chip-dot" style="background: {{item.color}};"></view>
|
||||
<text>{{item.name}}</text>
|
||||
<text class="chip-count">{{item.rangeCount || 0}}</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{viewMode === 'day'}}" class="section">
|
||||
<view class="day-summary">
|
||||
<view class="summary-item card">
|
||||
<text class="summary-value">{{dayTotal}}</text>
|
||||
<text class="summary-label">今日预约</text>
|
||||
</view>
|
||||
<view class="summary-item card">
|
||||
<text class="summary-value">{{freeArtistCount}}</text>
|
||||
<text class="summary-label">可插单员工</text>
|
||||
</view>
|
||||
<view class="summary-item card">
|
||||
<text class="summary-value">{{pendingCount}}</text>
|
||||
<text class="summary-label">待确认</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<scroll-view class="day-board card" scroll-y>
|
||||
<view class="timeline-wrap" style="height: {{timelineHeight}}rpx;">
|
||||
<view class="time-axis">
|
||||
<view wx:for="{{hours}}" wx:key="value" class="time-label" style="top: {{item.top}}rpx;">{{item.label}}</view>
|
||||
</view>
|
||||
<scroll-view class="lane-scroll" scroll-x enable-flex>
|
||||
<view class="lanes" style="height: {{timelineHeight}}rpx; width: {{laneWidth}}rpx;">
|
||||
<view wx:for="{{dayLanes}}" wx:key="artistId" class="artist-lane" style="height: {{timelineHeight}}rpx; width: {{laneItemWidth}}rpx;">
|
||||
<view class="lane-head">
|
||||
<view class="chip-dot" style="background: {{item.color}};"></view>
|
||||
<text>{{item.name}}</text>
|
||||
</view>
|
||||
<view wx:for="{{item.blocks}}" wx:for-item="block" wx:key="orderItemId" class="appointment-block {{block.status === 0 ? 'pending' : ''}}" style="top: {{block.top}}rpx; height: {{block.height}}rpx; border-left-color: {{item.color}};" data-id="{{block.orderItemId}}" bindtap="openAppointment">
|
||||
<text class="block-title">{{block.customerName}}</text>
|
||||
<text class="block-meta">{{block.timeText}} · {{block.productTitle}}</text>
|
||||
<text class="block-status">{{block.statusText}}</text>
|
||||
</view>
|
||||
<view wx:if="{{item.blocks.length === 0}}" class="lane-empty">全天可约</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{viewMode === 'week'}}" class="section">
|
||||
<scroll-view class="week-strip" scroll-x enable-flex>
|
||||
<view wx:for="{{weekDays}}" wx:key="date" class="week-day-card card {{item.date === currentDateText ? 'active' : ''}}" data-date="{{item.date}}" bindtap="selectDate">
|
||||
<text class="week-name">{{item.weekName}}</text>
|
||||
<text class="week-date">{{item.day}}</text>
|
||||
<text class="week-total">{{item.totalCount}}单</text>
|
||||
<view class="week-bars">
|
||||
<view wx:for="{{item.artistCounts}}" wx:for-item="count" wx:key="artistId" class="week-bar" style="background: {{count.color}}; width: {{count.width}}%;"></view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="card week-grid">
|
||||
<view class="week-grid-head">
|
||||
<text>本周排班密度</text>
|
||||
<text class="muted">{{weekRange}}</text>
|
||||
</view>
|
||||
<view wx:for="{{weekDays}}" wx:key="date" class="week-line">
|
||||
<view class="week-line-date">{{item.weekName}} {{item.day}}</view>
|
||||
<view class="week-line-bars">
|
||||
<view wx:for="{{item.artistCounts}}" wx:for-item="count" wx:key="artistId" class="week-count-bar" style="background: {{count.color}}; width: {{count.barWidth}}%;">
|
||||
<text>{{count.shortName}}{{count.count}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{viewMode === 'month'}}" class="section">
|
||||
<view class="month-toolbar">
|
||||
<text class="month-toolbar-title">月历显示</text>
|
||||
<view class="month-mode-switch">
|
||||
<view wx:for="{{monthDisplayModes}}" wx:key="value" class="month-mode {{monthDisplayMode === item.value ? 'active' : ''}}" data-mode="{{item.value}}" bindtap="switchMonthDisplay">{{item.label}}</view>
|
||||
</view>
|
||||
<view wx:if="{{monthDisplayMode === 'rows'}}" class="row-name-switch {{monthRowLabelVisible ? 'active' : ''}}" bindtap="toggleMonthRowLabel">
|
||||
<text>姓名</text>
|
||||
<view class="switch-track"><view class="switch-thumb"></view></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="month-card card">
|
||||
<view class="month-week-head">
|
||||
<text wx:for="{{weekLabels}}" wx:key="*this">{{item}}</text>
|
||||
</view>
|
||||
<view class="month-grid">
|
||||
<view wx:for="{{monthDays}}" wx:key="date" class="month-cell {{item.isCurrentMonth ? '' : 'out-month'}} {{item.date === currentDateText ? 'selected' : ''}}" data-date="{{item.date}}" bindtap="selectDate">
|
||||
<view class="month-cell-head">
|
||||
<text class="month-day">{{item.day}}</text>
|
||||
<text wx:if="{{item.dayStatus === 'full'}}" class="day-mark full">满</text>
|
||||
<text wx:elif="{{item.dayStatus === 'rest'}}" class="day-mark rest">休</text>
|
||||
</view>
|
||||
<view wx:if="{{monthDisplayMode === 'count'}}" class="month-bars">
|
||||
<view wx:for="{{item.artistCounts}}" wx:for-item="count" wx:key="artistId" wx:if="{{count.count > 0}}" class="month-artist-bar" style="background: {{count.color}};">
|
||||
<text>{{count.shortName}}{{count.count}}</text>
|
||||
</view>
|
||||
<view wx:if="{{item.totalCount === 0}}" class="month-empty">空</view>
|
||||
</view>
|
||||
<view wx:else class="month-blocks">
|
||||
<block wx:if="{{monthDisplayMode === 'blocks'}}">
|
||||
<view wx:for="{{item.expandedBlocks}}" wx:for-item="block" wx:key="key" class="month-order-block" style="background: {{block.color}};"></view>
|
||||
<view wx:if="{{item.totalCount === 0}}" class="month-empty">空</view>
|
||||
</block>
|
||||
<block wx:else>
|
||||
<view wx:for="{{item.rowBlocks}}" wx:for-item="block" wx:key="key" class="month-row-block {{monthRowLabelVisible ? 'named' : ''}}" style="background: {{block.color}};">
|
||||
<text wx:if="{{monthRowLabelVisible}}">{{block.artistName}}</text>
|
||||
</view>
|
||||
<view wx:if="{{item.totalCount === 0}}" class="month-empty">空</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<button class="fab" bindtap="createAppointment">+</button>
|
||||
</view>
|
||||
@@ -0,0 +1,586 @@
|
||||
.planning-page {
|
||||
padding-top: 18rpx;
|
||||
}
|
||||
|
||||
.today-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 58rpx;
|
||||
min-width: 58rpx;
|
||||
max-width: 58rpx;
|
||||
height: 52rpx;
|
||||
min-height: 52rpx;
|
||||
padding: 0;
|
||||
border-radius: 999rpx;
|
||||
background: #e5eee9;
|
||||
color: #6f8f83;
|
||||
font-size: 24rpx;
|
||||
font-weight: 800;
|
||||
line-height: 52rpx;
|
||||
}
|
||||
|
||||
.control-card {
|
||||
padding: 18rpx;
|
||||
}
|
||||
|
||||
.date-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12rpx;
|
||||
}
|
||||
|
||||
.date-side {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 128rpx;
|
||||
}
|
||||
|
||||
.date-tools {
|
||||
justify-content: flex-end;
|
||||
gap: 8rpx;
|
||||
}
|
||||
|
||||
.icon-btn.small {
|
||||
width: 52rpx;
|
||||
min-width: 52rpx;
|
||||
max-width: 52rpx;
|
||||
height: 52rpx;
|
||||
min-height: 52rpx;
|
||||
font-size: 34rpx;
|
||||
}
|
||||
|
||||
.date-center {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 4rpx;
|
||||
}
|
||||
|
||||
.date-main {
|
||||
color: #25211d;
|
||||
font-size: 32rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.date-sub {
|
||||
color: #9a9288;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
|
||||
.segmented {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 8rpx;
|
||||
margin-top: 18rpx;
|
||||
padding: 8rpx;
|
||||
border-radius: 12px;
|
||||
background: #f1ece4;
|
||||
}
|
||||
|
||||
.segment {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 58rpx;
|
||||
border-radius: 10px;
|
||||
color: #7d756c;
|
||||
font-size: 24rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.segment.active {
|
||||
background: #fffdf8;
|
||||
color: #2f2a25;
|
||||
box-shadow: 0 6rpx 14rpx rgba(58, 48, 34, 0.07);
|
||||
}
|
||||
|
||||
.artist-filter {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
margin-top: 16rpx;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.artist-chip {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
height: 52rpx;
|
||||
margin-right: 10rpx;
|
||||
padding: 0 16rpx;
|
||||
border-radius: 999rpx;
|
||||
background: #f4f0ea;
|
||||
color: #625b52;
|
||||
font-size: 24rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.artist-chip.active {
|
||||
background: #e5eee9;
|
||||
color: #4e7165;
|
||||
}
|
||||
|
||||
.chip-dot {
|
||||
width: 14rpx;
|
||||
height: 14rpx;
|
||||
margin-right: 8rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.chip-count {
|
||||
margin-left: 8rpx;
|
||||
color: #9a9288;
|
||||
}
|
||||
|
||||
.day-summary {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 12rpx;
|
||||
}
|
||||
|
||||
.summary-item {
|
||||
padding: 16rpx;
|
||||
}
|
||||
|
||||
.summary-value {
|
||||
display: block;
|
||||
color: #26231f;
|
||||
font-size: 34rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.summary-label {
|
||||
display: block;
|
||||
margin-top: 8rpx;
|
||||
color: #938c82;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
|
||||
.day-board {
|
||||
height: 820rpx;
|
||||
margin-top: 18rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.timeline-wrap {
|
||||
position: relative;
|
||||
min-height: 720rpx;
|
||||
}
|
||||
|
||||
.time-axis {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 4;
|
||||
width: 92rpx;
|
||||
height: 100%;
|
||||
border-right: 1rpx solid #eee8df;
|
||||
background: #fffdf8;
|
||||
}
|
||||
|
||||
.time-label {
|
||||
position: absolute;
|
||||
right: 12rpx;
|
||||
color: #9a9288;
|
||||
font-size: 20rpx;
|
||||
line-height: 1;
|
||||
white-space: nowrap;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.lane-scroll {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 104rpx;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.lanes {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.artist-lane {
|
||||
position: relative;
|
||||
flex-shrink: 0;
|
||||
border-right: 1rpx solid #eee8df;
|
||||
background-image: linear-gradient(to bottom, rgba(214, 207, 197, 0.35) 1rpx, transparent 1rpx);
|
||||
background-size: 100% 60rpx;
|
||||
}
|
||||
|
||||
.lane-head {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 2;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 54rpx;
|
||||
padding: 0 14rpx;
|
||||
background: rgba(255, 253, 248, 0.92);
|
||||
color: #4d473f;
|
||||
font-size: 22rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.appointment-block {
|
||||
position: absolute;
|
||||
right: 12rpx;
|
||||
left: 12rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4rpx;
|
||||
overflow: hidden;
|
||||
padding: 12rpx 12rpx;
|
||||
border-left: 8rpx solid #7ba7c7;
|
||||
border-radius: 10px;
|
||||
background: #fff7ee;
|
||||
box-shadow: 0 8rpx 16rpx rgba(58, 48, 34, 0.08);
|
||||
}
|
||||
|
||||
.appointment-block.pending {
|
||||
background: #fff3f6;
|
||||
}
|
||||
|
||||
.block-title {
|
||||
color: #2c2823;
|
||||
font-size: 24rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.block-meta,
|
||||
.block-status {
|
||||
color: #7e756b;
|
||||
font-size: 20rpx;
|
||||
line-height: 1.25;
|
||||
}
|
||||
|
||||
.lane-empty {
|
||||
position: absolute;
|
||||
top: 76rpx;
|
||||
right: 18rpx;
|
||||
left: 18rpx;
|
||||
padding: 16rpx 0;
|
||||
border: 1rpx dashed #d8d1c8;
|
||||
border-radius: 10px;
|
||||
color: #aaa198;
|
||||
text-align: center;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
|
||||
.week-strip {
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.week-day-card {
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
width: 148rpx;
|
||||
min-height: 164rpx;
|
||||
margin-right: 12rpx;
|
||||
padding: 16rpx;
|
||||
}
|
||||
|
||||
.week-day-card.active {
|
||||
outline: 3rpx solid #8fb89a;
|
||||
}
|
||||
|
||||
.week-name,
|
||||
.week-total {
|
||||
color: #8f877e;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
|
||||
.week-date {
|
||||
margin: 8rpx 0;
|
||||
color: #211e1a;
|
||||
font-size: 38rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.week-bars {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6rpx;
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
|
||||
.week-bar {
|
||||
height: 8rpx;
|
||||
border-radius: 999rpx;
|
||||
}
|
||||
|
||||
.week-grid {
|
||||
margin-top: 18rpx;
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.week-grid-head,
|
||||
.week-line {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.week-grid-head {
|
||||
margin-bottom: 14rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.week-line {
|
||||
min-height: 70rpx;
|
||||
border-top: 1rpx solid #eee8df;
|
||||
}
|
||||
|
||||
.week-line-date {
|
||||
width: 132rpx;
|
||||
color: #6f675f;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.week-line-bars {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6rpx;
|
||||
}
|
||||
|
||||
.week-count-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-width: 58rpx;
|
||||
height: 28rpx;
|
||||
padding-left: 10rpx;
|
||||
border-radius: 7rpx;
|
||||
color: #fff;
|
||||
font-size: 18rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.month-card {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.month-toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 8rpx;
|
||||
margin-bottom: 14rpx;
|
||||
padding: 0 4rpx;
|
||||
}
|
||||
|
||||
.month-toolbar-title {
|
||||
color: #615a51;
|
||||
font-size: 24rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.month-mode-switch {
|
||||
display: inline-flex;
|
||||
gap: 6rpx;
|
||||
padding: 6rpx;
|
||||
border-radius: 999rpx;
|
||||
background: #eee8df;
|
||||
}
|
||||
|
||||
.month-mode {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 68rpx;
|
||||
height: 44rpx;
|
||||
padding: 0 12rpx;
|
||||
border-radius: 999rpx;
|
||||
color: #766e65;
|
||||
font-size: 22rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.month-mode.active {
|
||||
background: #fffdf8;
|
||||
color: #2f6f62;
|
||||
box-shadow: 0 4rpx 12rpx rgba(58, 48, 34, 0.07);
|
||||
}
|
||||
|
||||
.row-name-switch {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
height: 44rpx;
|
||||
padding: 0 10rpx;
|
||||
border-radius: 999rpx;
|
||||
background: #f0ece5;
|
||||
color: #766e65;
|
||||
font-size: 21rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.row-name-switch.active {
|
||||
color: #2f6f62;
|
||||
background: #e5eee9;
|
||||
}
|
||||
|
||||
.switch-track {
|
||||
position: relative;
|
||||
width: 44rpx;
|
||||
height: 24rpx;
|
||||
border-radius: 999rpx;
|
||||
background: #d6d0c7;
|
||||
}
|
||||
|
||||
.switch-thumb {
|
||||
position: absolute;
|
||||
top: 3rpx;
|
||||
left: 3rpx;
|
||||
width: 18rpx;
|
||||
height: 18rpx;
|
||||
border-radius: 50%;
|
||||
background: #fffdf8;
|
||||
box-shadow: 0 2rpx 6rpx rgba(58, 48, 34, 0.16);
|
||||
}
|
||||
|
||||
.row-name-switch.active .switch-track {
|
||||
background: #6f8f83;
|
||||
}
|
||||
|
||||
.row-name-switch.active .switch-thumb {
|
||||
transform: translateX(20rpx);
|
||||
}
|
||||
|
||||
.month-week-head {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(7, 1fr);
|
||||
height: 58rpx;
|
||||
align-items: center;
|
||||
border-bottom: 1rpx solid #ebe5dc;
|
||||
color: #726b62;
|
||||
font-size: 24rpx;
|
||||
font-weight: 800;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.month-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(7, 1fr);
|
||||
}
|
||||
|
||||
.month-cell {
|
||||
min-height: 168rpx;
|
||||
padding: 8rpx 5rpx;
|
||||
border-right: 1rpx solid #eee8df;
|
||||
border-bottom: 1rpx solid #eee8df;
|
||||
background: #fffdf8;
|
||||
}
|
||||
|
||||
.month-cell:nth-child(7n) {
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
.month-cell.out-month {
|
||||
background: #f7f3ed;
|
||||
}
|
||||
|
||||
.month-cell.selected {
|
||||
background: #eef5f1;
|
||||
}
|
||||
|
||||
.month-cell-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
min-height: 32rpx;
|
||||
}
|
||||
|
||||
.month-day {
|
||||
color: #2c2824;
|
||||
font-size: 26rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.out-month .month-day {
|
||||
color: #aba39a;
|
||||
}
|
||||
|
||||
.day-mark {
|
||||
font-size: 18rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.day-mark.full {
|
||||
color: #d98d8d;
|
||||
}
|
||||
|
||||
.day-mark.rest {
|
||||
color: #8aaeca;
|
||||
}
|
||||
|
||||
.month-bars {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 5rpx;
|
||||
margin-top: 7rpx;
|
||||
}
|
||||
|
||||
.month-artist-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 24rpx;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
border-radius: 6rpx;
|
||||
color: #fff;
|
||||
font-size: 17rpx;
|
||||
font-weight: 800;
|
||||
line-height: 1;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.month-blocks {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-content: flex-start;
|
||||
gap: 5rpx;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
|
||||
.month-order-block {
|
||||
width: 22rpx;
|
||||
height: 12rpx;
|
||||
border-radius: 999rpx;
|
||||
box-shadow: inset 0 0 0 1rpx rgba(255, 255, 255, 0.24);
|
||||
}
|
||||
|
||||
.month-row-block {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 12rpx;
|
||||
overflow: hidden;
|
||||
border-radius: 999rpx;
|
||||
color: #fff;
|
||||
font-size: 13rpx;
|
||||
font-weight: 900;
|
||||
line-height: 1;
|
||||
white-space: nowrap;
|
||||
text-shadow: 0 1rpx 3rpx rgba(37, 31, 24, 0.22);
|
||||
box-shadow: inset 0 0 0 1rpx rgba(255, 255, 255, 0.24);
|
||||
}
|
||||
|
||||
.month-row-block.named {
|
||||
height: 20rpx;
|
||||
}
|
||||
|
||||
.month-blocks .month-empty {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.month-empty {
|
||||
margin-top: 10rpx;
|
||||
color: #b5ada4;
|
||||
font-size: 20rpx;
|
||||
text-align: center;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
Page({
|
||||
data: {
|
||||
shopName: 'Yumi Nail',
|
||||
phone: '店长端',
|
||||
menus: [
|
||||
{ title: '店铺设置', url: '/pages/shop-settings/index' },
|
||||
{ title: '数据导出', url: '/pages/export/index' },
|
||||
{ title: '修改密码', url: '/pages/password/index' },
|
||||
{ title: '关于系统', url: '/pages/about/index' }
|
||||
]
|
||||
},
|
||||
|
||||
onShow() {
|
||||
const app = getApp()
|
||||
this.setData({
|
||||
shopName: app.globalData.shopName || '指尖管理师',
|
||||
phone: (app.globalData.userInfo && (app.globalData.userInfo.phone || app.globalData.userInfo.account)) || '店长端'
|
||||
})
|
||||
},
|
||||
|
||||
go(event) {
|
||||
wx.navigateTo({ url: event.currentTarget.dataset.url })
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "我的"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<view class="page">
|
||||
<view class="card profile-card">
|
||||
<view class="shop-logo">指</view>
|
||||
<view>
|
||||
<text class="shop-name">{{shopName}}</text>
|
||||
<text class="phone">{{phone}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="section menu-list card">
|
||||
<view wx:for="{{menus}}" wx:key="url" class="menu-row" data-url="{{item.url}}" bindtap="go">
|
||||
<text>{{item.title}}</text>
|
||||
<text class="arrow">›</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,60 @@
|
||||
.profile-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
padding: 28rpx;
|
||||
}
|
||||
|
||||
.shop-logo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
border-radius: 24rpx;
|
||||
background: #6f8f83;
|
||||
color: #fff;
|
||||
font-size: 40rpx;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.shop-name,
|
||||
.phone {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.shop-name {
|
||||
font-size: 34rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.phone {
|
||||
margin-top: 8rpx;
|
||||
color: #91897f;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.menu-list {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.menu-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
min-height: 104rpx;
|
||||
padding: 0 26rpx;
|
||||
border-bottom: 1rpx solid #eee8df;
|
||||
color: #302c27;
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.menu-row:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.arrow {
|
||||
color: #b0a79e;
|
||||
font-size: 44rpx;
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
const authApi = require('../../api/auth')
|
||||
|
||||
Page({
|
||||
data: {
|
||||
form: {
|
||||
phone: '',
|
||||
code: '',
|
||||
password: '',
|
||||
confirmPassword: '',
|
||||
shopName: ''
|
||||
},
|
||||
loading: false,
|
||||
codeLoading: false,
|
||||
countdown: 0,
|
||||
countdownTimer: null
|
||||
},
|
||||
|
||||
onInput(event) {
|
||||
this.setData({
|
||||
[`form.${event.currentTarget.dataset.field}`]: event.detail.value
|
||||
})
|
||||
},
|
||||
|
||||
back() {
|
||||
wx.navigateBack()
|
||||
},
|
||||
|
||||
async sendCode() {
|
||||
const phone = this.data.form.phone
|
||||
if (!phone) {
|
||||
wx.showToast({ title: '请输入手机号', icon: 'none' })
|
||||
return
|
||||
}
|
||||
if (this.data.codeLoading || this.data.countdown > 0) {
|
||||
return
|
||||
}
|
||||
this.setData({ codeLoading: true })
|
||||
try {
|
||||
await authApi.sendCode(phone)
|
||||
wx.showToast({ title: '验证码已发送' })
|
||||
this.startCountdown()
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '发送失败', icon: 'none' })
|
||||
} finally {
|
||||
this.setData({ codeLoading: false })
|
||||
}
|
||||
},
|
||||
|
||||
startCountdown() {
|
||||
if (this.data.countdownTimer) {
|
||||
clearInterval(this.data.countdownTimer)
|
||||
}
|
||||
this.setData({ countdown: 60 })
|
||||
const timer = setInterval(() => {
|
||||
const next = this.data.countdown - 1
|
||||
if (next <= 0) {
|
||||
clearInterval(timer)
|
||||
this.setData({ countdown: 0, countdownTimer: null })
|
||||
return
|
||||
}
|
||||
this.setData({ countdown: next })
|
||||
}, 1000)
|
||||
this.setData({ countdownTimer: timer })
|
||||
},
|
||||
|
||||
onUnload() {
|
||||
if (this.data.countdownTimer) {
|
||||
clearInterval(this.data.countdownTimer)
|
||||
}
|
||||
},
|
||||
|
||||
async submit() {
|
||||
const form = this.data.form
|
||||
if (!form.phone || !form.code || !form.password || !form.shopName) {
|
||||
wx.showToast({ title: '请补全注册信息', icon: 'none' })
|
||||
return
|
||||
}
|
||||
if (form.password !== form.confirmPassword) {
|
||||
wx.showToast({ title: '两次密码不一致', icon: 'none' })
|
||||
return
|
||||
}
|
||||
this.setData({ loading: true })
|
||||
try {
|
||||
await authApi.register(form)
|
||||
wx.showToast({ title: '注册成功' })
|
||||
setTimeout(() => wx.navigateBack(), 500)
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '注册失败', icon: 'none' })
|
||||
} finally {
|
||||
this.setData({ loading: false })
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "注册"
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<view class="page no-tab">
|
||||
<view class="card form-card">
|
||||
<view class="field">
|
||||
<text class="field-label">手机号</text>
|
||||
<input value="{{form.phone}}" data-field="phone" bindinput="onInput" placeholder="请输入手机号" />
|
||||
</view>
|
||||
<view class="field">
|
||||
<text class="field-label">验证码</text>
|
||||
<input value="{{form.code}}" data-field="code" bindinput="onInput" placeholder="请输入验证码" />
|
||||
<button class="code-btn" loading="{{codeLoading}}" disabled="{{codeLoading || countdown > 0}}" bindtap="sendCode">
|
||||
{{countdown > 0 ? countdown + 's' : '获取验证码'}}
|
||||
</button>
|
||||
</view>
|
||||
<view class="field">
|
||||
<text class="field-label">密码</text>
|
||||
<input value="{{form.password}}" data-field="password" bindinput="onInput" password placeholder="设置登录密码" />
|
||||
</view>
|
||||
<view class="field">
|
||||
<text class="field-label">确认密码</text>
|
||||
<input value="{{form.confirmPassword}}" data-field="confirmPassword" bindinput="onInput" password placeholder="再次输入密码" />
|
||||
</view>
|
||||
<view class="field">
|
||||
<text class="field-label">店铺名称</text>
|
||||
<input value="{{form.shopName}}" data-field="shopName" bindinput="onInput" placeholder="例如:Yumi Nail" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="fixed-bottom">
|
||||
<button class="primary-btn" loading="{{loading}}" bindtap="submit">注册</button>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,11 @@
|
||||
.code-btn {
|
||||
width: 148rpx;
|
||||
min-width: 148rpx;
|
||||
max-width: 148rpx;
|
||||
height: 56rpx;
|
||||
padding: 0;
|
||||
color: #6f8f83;
|
||||
font-size: 24rpx;
|
||||
font-weight: 700;
|
||||
text-align: right;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
const dateUtil = require('../../utils/date')
|
||||
|
||||
Page({
|
||||
data: {
|
||||
form: { workDate: dateUtil.formatDate(new Date()), startTime: '10:00', endTime: '22:00', capacity: 1 }
|
||||
},
|
||||
onInput(event) { this.setData({ [`form.${event.currentTarget.dataset.field}`]: event.detail.value }) },
|
||||
onDateChange(event) { this.setData({ 'form.workDate': event.detail.value }) },
|
||||
onStartChange(event) { this.setData({ 'form.startTime': event.detail.value }) },
|
||||
onEndChange(event) { this.setData({ 'form.endTime': event.detail.value }) },
|
||||
save() { wx.showToast({ title: '已保存' }) },
|
||||
back() { wx.navigateBack() }
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "排班设置"
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<view class="page no-tab">
|
||||
<view class="card form-card">
|
||||
<view class="field">
|
||||
<view class="field-label-wrap">
|
||||
<text class="field-label">日期</text>
|
||||
<text class="field-hint">点击可编辑</text>
|
||||
</view>
|
||||
<picker mode="date" value="{{form.workDate}}" bindchange="onDateChange"><view class="field-value">{{form.workDate}}</view></picker>
|
||||
</view>
|
||||
<view class="field">
|
||||
<view class="field-label-wrap">
|
||||
<text class="field-label">开始时间</text>
|
||||
<text class="field-hint">点击可编辑</text>
|
||||
</view>
|
||||
<picker mode="time" value="{{form.startTime}}" bindchange="onStartChange"><view class="field-value">{{form.startTime}}</view></picker>
|
||||
</view>
|
||||
<view class="field">
|
||||
<view class="field-label-wrap">
|
||||
<text class="field-label">结束时间</text>
|
||||
<text class="field-hint">点击可编辑</text>
|
||||
</view>
|
||||
<picker mode="time" value="{{form.endTime}}" bindchange="onEndChange"><view class="field-value">{{form.endTime}}</view></picker>
|
||||
</view>
|
||||
<view class="field capacity-field">
|
||||
<view class="field-label-wrap">
|
||||
<text class="field-label">容量</text>
|
||||
<text class="field-desc">同一时间段最多可同时接待的预约数</text>
|
||||
<text class="field-hint">点击可编辑</text>
|
||||
</view>
|
||||
<input type="number" value="{{form.capacity}}" data-field="capacity" bindinput="onInput" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="fixed-bottom"><button class="primary-btn" bindtap="save">保存排班</button></view>
|
||||
</view>
|
||||
@@ -0,0 +1,34 @@
|
||||
.field-label-wrap {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
width: 260rpx;
|
||||
flex-shrink: 0;
|
||||
gap: 6rpx;
|
||||
}
|
||||
|
||||
.field-label-wrap .field-label {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.field-hint {
|
||||
color: #a39b91;
|
||||
font-size: 20rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.field-desc {
|
||||
max-width: 240rpx;
|
||||
color: #7f786f;
|
||||
font-size: 20rpx;
|
||||
line-height: 1.25;
|
||||
}
|
||||
|
||||
.capacity-field {
|
||||
min-height: 136rpx;
|
||||
}
|
||||
|
||||
.field input,
|
||||
.field-value {
|
||||
text-align: right;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
Page({
|
||||
data: {
|
||||
form: { shopName: 'Yumi Nail', startTime: '10:00', endTime: '22:00', defaultDuration: 60, rule: '必须选择已有作品作为项目来源' }
|
||||
},
|
||||
onInput(event) { this.setData({ [`form.${event.currentTarget.dataset.field}`]: event.detail.value }) },
|
||||
onStartChange(event) { this.setData({ 'form.startTime': event.detail.value }) },
|
||||
onEndChange(event) { this.setData({ 'form.endTime': event.detail.value }) },
|
||||
save() { wx.showToast({ title: '已保存' }) },
|
||||
back() { wx.navigateBack() }
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "店铺设置"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<view class="page no-tab">
|
||||
<view class="card form-card">
|
||||
<view class="field"><text class="field-label">店铺名称</text><input value="{{form.shopName}}" data-field="shopName" bindinput="onInput" /></view>
|
||||
<view class="field"><text class="field-label">营业开始</text><picker mode="time" value="{{form.startTime}}" bindchange="onStartChange"><view class="field-value">{{form.startTime}}</view></picker></view>
|
||||
<view class="field"><text class="field-label">营业结束</text><picker mode="time" value="{{form.endTime}}" bindchange="onEndChange"><view class="field-value">{{form.endTime}}</view></picker></view>
|
||||
<view class="field"><text class="field-label">默认时长</text><input type="number" value="{{form.defaultDuration}}" data-field="defaultDuration" bindinput="onInput" /><text class="muted">分钟</text></view>
|
||||
<view class="field"><text class="field-label">预约规则</text><input value="{{form.rule}}" data-field="rule" bindinput="onInput" /></view>
|
||||
</view>
|
||||
<view class="fixed-bottom"><button class="primary-btn" bindtap="save">保存设置</button></view>
|
||||
</view>
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"appid": "wxb6d77f7c07020d51",
|
||||
"compileType": "miniprogram",
|
||||
"libVersion": "3.6.7",
|
||||
"libVersion": "3.15.2",
|
||||
"packOptions": {
|
||||
"ignore": [],
|
||||
"include": []
|
||||
@@ -34,8 +34,9 @@
|
||||
}
|
||||
},
|
||||
"condition": {},
|
||||
"projectname": "YumiNail-Admin-Program",
|
||||
"projectname": "指尖管理师",
|
||||
"simulatorType": "wechat",
|
||||
"simulatorPluginLibVersion": {},
|
||||
"editorSetting": {}
|
||||
"editorSetting": {},
|
||||
"testRoot": "minitest/"
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"libVersion": "3.15.2",
|
||||
"condition": {},
|
||||
"projectname": "YumiNail-Admin-Program",
|
||||
"projectname": "指尖管理师",
|
||||
"setting": {
|
||||
"urlCheck": false,
|
||||
"coverView": false,
|
||||
@@ -0,0 +1,29 @@
|
||||
const SESSION_KEY = 'fingertip_manager_session'
|
||||
|
||||
function getSession() {
|
||||
try {
|
||||
return wx.getStorageSync(SESSION_KEY) || {}
|
||||
} catch (error) {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
|
||||
function setSession(session) {
|
||||
wx.setStorageSync(SESSION_KEY, session || {})
|
||||
}
|
||||
|
||||
function clearSession() {
|
||||
wx.removeStorageSync(SESSION_KEY)
|
||||
}
|
||||
|
||||
function getAccessToken() {
|
||||
const session = getSession()
|
||||
return session.accessToken || session.token || ''
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getSession,
|
||||
setSession,
|
||||
clearSession,
|
||||
getAccessToken
|
||||
}
|
||||