From 28219e5fc25ff74528d0cb3ee4724b880ad63330 Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Sat, 27 Jun 2026 01:46:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=88=91=E7=9A=84=E9=A1=B5?= =?UTF-8?q?=E8=BA=AB=E4=BB=BD=E5=92=8C=E8=A7=84=E5=88=92=E6=97=A5=E5=91=A8?= =?UTF-8?q?=E8=A7=86=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FM-Wechat-Fronted/pages/planning/index.js | 51 +++++++++++++++++---- FM-Wechat-Fronted/pages/planning/index.wxml | 4 +- FM-Wechat-Fronted/pages/planning/index.wxss | 16 +++++++ FM-Wechat-Fronted/pages/profile/index.js | 13 +++++- FM-Wechat-Fronted/pages/profile/index.wxml | 11 +++-- FM-Wechat-Fronted/pages/profile/index.wxss | 27 +++++++++++ docx/MEMORY.md | 1 + 7 files changed, 107 insertions(+), 16 deletions(-) diff --git a/FM-Wechat-Fronted/pages/planning/index.js b/FM-Wechat-Fronted/pages/planning/index.js index b85e21ed..004ac5e2 100644 --- a/FM-Wechat-Fronted/pages/planning/index.js +++ b/FM-Wechat-Fronted/pages/planning/index.js @@ -11,6 +11,36 @@ function resolveCalendarErrorMessage(error) { return error && error.message ? error.message : '规划数据加载失败' } +function toLocalDate(value) { + return value instanceof Date ? new Date(value.getTime()) : new Date(String(value).replace(/-/g, '/')) +} + +function formatMonthDay(value) { + const target = toLocalDate(value) + return `${target.getMonth() + 1}月${target.getDate()}日` +} + +function resolveAppointmentDate(item) { + if (item.date) return item.date + return String(item.startTime || '').slice(0, 10) +} + +function resolveAppointmentStartMinute(item) { + if (item.startMinute !== undefined && item.startMinute !== null) { + return Number(item.startMinute) + } + const timeText = String(item.startTime || '').slice(11, 16) + return dateUtil.minutesOfDay(timeText) +} + +function resolveAppointmentTimeText(item) { + const startMinute = resolveAppointmentStartMinute(item) + const duration = Number(item.durationMinutes || 60) + const startText = String(item.startTime || '').slice(11, 16) || dateUtil.timeFromMinutes(startMinute) + const endText = String(item.endTime || '').slice(11, 16) || dateUtil.timeFromMinutes(startMinute + duration) + return `${startText}-${endText}` +} + Page({ data: { viewMode: 'month', @@ -46,6 +76,7 @@ Page({ timelineHeight: 720, laneWidth: 720, laneItemWidth: 240, + laneHeaderHeight: 54, dayTotal: 0, freeArtistCount: 0, pendingCount: 0, @@ -216,12 +247,12 @@ Page({ const title = this.data.viewMode === 'month' ? dateUtil.formatMonth(current) : this.data.viewMode === 'week' - ? `${range.start.replace(/-/g, '/')} - ${range.end.replace(/-/g, '/')}` + ? `${formatMonthDay(range.start)} - ${formatMonthDay(range.end)}` : 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, '/')}`, + weekRange: `${formatMonthDay(range.start)} - ${formatMonthDay(range.end)}`, monthDays: this.buildMonthDays(), weekDays: this.buildWeekDays(), ...this.buildDayView() @@ -259,7 +290,7 @@ Page({ const target = dateUtil.addDays(start, index) const date = dateUtil.formatDate(target) const summary = summaryMap[date] || { artistCounts: [], totalCount: 0 } - const artistCounts = this.normalizeArtistCounts(summary.artistCounts || []) + const artistCounts = this.normalizeArtistCounts(summary.artistCounts || []).filter(count => count.count > 0) return { date, weekName: `周${label}`, @@ -278,28 +309,29 @@ Page({ const startMinute = dateUtil.minutesOfDay(this.data.businessStartTime) const endMinute = dateUtil.minutesOfDay(this.data.businessEndTime) const timelineHeight = Math.max(560, endMinute - startMinute) + const laneHeaderHeight = 54 const hours = [] for (let cursor = startMinute; cursor <= endMinute; cursor += 60) { hours.push({ value: cursor, label: dateUtil.timeFromMinutes(cursor), - top: cursor - startMinute + top: cursor - startMinute + laneHeaderHeight }) } 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 dayAppointments = this.data.appointments.filter(item => resolveAppointmentDate(item) === 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)) + const itemStart = resolveAppointmentStartMinute(item) return { ...item, - top: Math.max(0, itemStart - startMinute), + top: Math.max(0, itemStart - startMinute) + laneHeaderHeight, height: Math.max(64, item.durationMinutes || 60), - timeText: `${(item.startTime || '').slice(11, 16)}-${(item.endTime || '').slice(11, 16)}` + timeText: resolveAppointmentTimeText(item) } }) return { ...artist, blocks } @@ -308,7 +340,8 @@ Page({ return { dayLanes: lanes, hours, - timelineHeight, + timelineHeight: timelineHeight + laneHeaderHeight, + laneHeaderHeight, laneItemWidth: 248, laneWidth: Math.max(720, lanes.length * 248), dayTotal: dayAppointments.length, diff --git a/FM-Wechat-Fronted/pages/planning/index.wxml b/FM-Wechat-Fronted/pages/planning/index.wxml index ad66aec2..9f84b703 100644 --- a/FM-Wechat-Fronted/pages/planning/index.wxml +++ b/FM-Wechat-Fronted/pages/planning/index.wxml @@ -82,7 +82,7 @@ {{item.weekName}} {{item.day}} {{item.totalCount}}单 - + @@ -94,7 +94,7 @@ {{item.weekName}} {{item.day}} - + {{count.shortName}}{{count.count}} diff --git a/FM-Wechat-Fronted/pages/planning/index.wxss b/FM-Wechat-Fronted/pages/planning/index.wxss index 864b9401..0dd11e67 100644 --- a/FM-Wechat-Fronted/pages/planning/index.wxss +++ b/FM-Wechat-Fronted/pages/planning/index.wxss @@ -232,6 +232,12 @@ background: #fffdf8; } +.time-axis::before { + display: block; + height: 54rpx; + content: ''; +} + .time-label { position: absolute; right: 12rpx; @@ -363,6 +369,11 @@ flex-direction: column; gap: 6rpx; margin-top: 12rpx; + min-height: 22rpx; +} + +.week-bars.empty { + min-height: 22rpx; } .week-bar { @@ -403,6 +414,11 @@ display: flex; flex-direction: column; gap: 6rpx; + min-height: 28rpx; +} + +.week-line-bars.empty { + min-height: 28rpx; } .week-count-bar { diff --git a/FM-Wechat-Fronted/pages/profile/index.js b/FM-Wechat-Fronted/pages/profile/index.js index affd0172..33eec74e 100644 --- a/FM-Wechat-Fronted/pages/profile/index.js +++ b/FM-Wechat-Fronted/pages/profile/index.js @@ -1,9 +1,18 @@ const { BRAND_CONFIG } = require('../../utils/config') +function resolveRoleText(type) { + const role = Number(type) + if (role === 2) return '店长' + if (role === 3) return '美甲师' + if (role === 4) return '管理员' + return '管理端' +} + Page({ data: { shopName: BRAND_CONFIG.defaultShopName, phone: '店长端', + roleText: '管理端', menus: [ { title: '店铺设置', url: '/pages/shop-settings/index' }, { title: '数据导出', url: '/pages/export/index' }, @@ -14,9 +23,11 @@ Page({ onShow() { const app = getApp() + const userInfo = app.globalData.userInfo || {} this.setData({ shopName: app.globalData.shopName || BRAND_CONFIG.appName, - phone: (app.globalData.userInfo && (app.globalData.userInfo.phone || app.globalData.userInfo.account)) || '店长端' + phone: userInfo.phone || userInfo.account || '店长端', + roleText: resolveRoleText(userInfo.type) }) }, diff --git a/FM-Wechat-Fronted/pages/profile/index.wxml b/FM-Wechat-Fronted/pages/profile/index.wxml index e522710b..9f4e8215 100644 --- a/FM-Wechat-Fronted/pages/profile/index.wxml +++ b/FM-Wechat-Fronted/pages/profile/index.wxml @@ -1,10 +1,13 @@ - - - {{shopName}} - {{phone}} + + + + {{shopName}} + {{phone}} + + {{roleText}} diff --git a/FM-Wechat-Fronted/pages/profile/index.wxss b/FM-Wechat-Fronted/pages/profile/index.wxss index dedc97ce..6d761c8a 100644 --- a/FM-Wechat-Fronted/pages/profile/index.wxss +++ b/FM-Wechat-Fronted/pages/profile/index.wxss @@ -1,14 +1,27 @@ .profile-card { display: flex; align-items: center; + justify-content: space-between; gap: 20rpx; padding: 28rpx; } +.profile-main { + display: flex; + align-items: center; + min-width: 0; + gap: 20rpx; +} + +.profile-copy { + min-width: 0; +} + .shop-logo { display: flex; align-items: center; justify-content: center; + flex-shrink: 0; width: 96rpx; height: 96rpx; border-radius: 24rpx; @@ -26,6 +39,9 @@ .shop-name { font-size: 34rpx; font-weight: 800; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } .phone { @@ -34,6 +50,17 @@ font-size: 24rpx; } +.role-badge { + flex-shrink: 0; + padding: 8rpx 18rpx; + border-radius: 999rpx; + background: #e5eee9; + color: #4e7165; + font-size: 23rpx; + font-weight: 800; + line-height: 1.2; +} + .menu-list { overflow: hidden; } diff --git a/docx/MEMORY.md b/docx/MEMORY.md index c1458303..dc15dad5 100644 --- a/docx/MEMORY.md +++ b/docx/MEMORY.md @@ -631,6 +631,7 @@ rtk node WeChatProgram/utils/theme.test.js - 小程序很多页面只做过 `node --check`,真机交互仍需微信开发者工具验证。 - 用户端文案必须中文,不要出现英文测试提示或英文占位验收数据。 - 小程序自动化的 `mp_evaluate` 在部分会话会对任意函数报 `(intermediate value) is not a function`;验证页面状态时改用 `page_setData`、`page_getData`、`page_snapshot` 等不依赖 evaluate 的工具。 +- 小程序自动化健康检查可能连接到旧项目路径(如 `FD-WeChat-Fronted`)而不是当前 `FM-Wechat-Fronted`,导致 automator session missing;先用正确 `projectPath` 恢复,恢复不完整时记录为连接层验证缺口,不要循环重连。 ## Web 体验坑