统一甲屿云命名体系

This commit is contained in:
2026-06-29 23:26:43 +08:00
parent 48c47fe3ff
commit bc8a7d8d4c
1268 changed files with 3477 additions and 3511 deletions
@@ -0,0 +1,86 @@
const planningApi = require('../../api/planning')
const dateUtil = require('../../utils/date')
const { markPlanningRefresh } = require('../../utils/planning-refresh')
Page({
data: {
id: '',
artists: [],
selectedArtistId: '',
date: dateUtil.formatDate(new Date()),
time: '13:00',
loadError: '',
loading: false
},
onLoad(options) {
this.setData({
id: options.id || ''
})
this.loadArtists()
},
async loadArtists() {
try {
const calendar = await planningApi.calendar({
startDate: this.data.date,
endDate: this.data.date
})
const artists = Array.isArray(calendar.artists) ? calendar.artists : []
this.setData({
artists: artists.map(item => ({
...item,
availableStatus: 'free',
availableText: '可选择'
})),
selectedArtistId: '',
loadError: ''
})
} catch (error) {
this.setData({
artists: [],
selectedArtistId: '',
loadError: error.message || '美甲师列表加载失败'
})
}
},
selectArtist(event) {
this.setData({ selectedArtistId: event.currentTarget.dataset.id })
},
async onDateChange(event) {
this.setData({ date: event.detail.value })
await this.loadArtists()
},
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
})
markPlanningRefresh()
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,40 @@
<view class="page no-tab">
<view class="list">
<view wx:if="{{loadError}}" class="empty card">
<text>{{loadError}}</text>
<button class="secondary-btn retry-btn" bindtap="loadArtists">重试</button>
</view>
<view wx:elif="{{artists.length === 0}}" class="empty card">暂无可选美甲师</view>
<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 wx:if="{{!loadError}}" class="card form-card section">
<view class="field">
<text class="field-label required">新日期</text>
<picker mode="date" value="{{date}}" bindchange="onDateChange">
<view class="field-value">{{date}}</view>
</picker>
</view>
<view class="field">
<text class="field-label required">新时间</text>
<picker mode="time" value="{{time}}" start="10:00" end="22:00" bindchange="onTimeChange">
<view class="field-value">{{time}}</view>
</picker>
</view>
</view>
<view wx:if="{{!loadError}}" class="fixed-bottom">
<button class="primary-btn" loading="{{loading}}" bindtap="submit">确认改派</button>
</view>
</view>
@@ -0,0 +1,52 @@
.transfer-card {
padding: 24rpx;
}
.retry-btn {
width: 180rpx;
min-width: 180rpx;
max-width: 180rpx;
margin: 24rpx auto 0;
}
.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;
}