diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/artist/service/ArtistScheduleService.java b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/artist/service/ArtistScheduleService.java index d2c6fd55..af814ce6 100644 --- a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/artist/service/ArtistScheduleService.java +++ b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/artist/service/ArtistScheduleService.java @@ -21,4 +21,6 @@ public interface ArtistScheduleService { ArtistScheduleRuleVO saveRule(ArtistScheduleRuleDTO dto); ArtistScheduleExceptionVO saveException(ArtistScheduleExceptionDTO dto); + + List listExceptions(Long shopId, Long artistId, LocalDate start, LocalDate end); } diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/artist/service/impl/ArtistScheduleServiceImpl.java b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/artist/service/impl/ArtistScheduleServiceImpl.java index 9d0e764b..a1b48b39 100644 --- a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/artist/service/impl/ArtistScheduleServiceImpl.java +++ b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/artist/service/impl/ArtistScheduleServiceImpl.java @@ -112,10 +112,7 @@ public class ArtistScheduleServiceImpl implements ArtistScheduleService { ArtistScheduleRuleSettingVO setting = new ArtistScheduleRuleSettingVO(); ArtistScheduleRuleDO rule = selectRule(shopId, artistId); setting.setRule(rule == null ? defaultRuleVO(shopId, artistId) : toRuleVO(rule)); - setting.setExceptions(listExceptions(shopId, artistId, LocalDate.now(), LocalDate.now().plusDays(GENERATED_DAYS - 1L)) - .stream() - .map(this::toExceptionVO) - .toList()); + setting.setExceptions(listExceptions(shopId, artistId, LocalDate.now(), LocalDate.now().plusDays(GENERATED_DAYS - 1L))); return setting; } @@ -153,6 +150,26 @@ public class ArtistScheduleServiceImpl implements ArtistScheduleService { return toExceptionVO(normalized); } + @Override + public List listExceptions(Long shopId, Long artistId, LocalDate start, LocalDate end) { + LocalDate begin = start == null ? LocalDate.now().withDayOfMonth(1) : start; + LocalDate finish = end == null ? begin.plusDays(30) : end; + if (finish.isBefore(begin)) { + finish = begin; + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper() + .eq(ArtistScheduleExceptionDO::getShopId, shopId) + .eq(ArtistScheduleExceptionDO::getIsDelete, 0) + .between(ArtistScheduleExceptionDO::getWorkDate, begin, finish) + .orderByAsc(ArtistScheduleExceptionDO::getWorkDate); + if (artistId != null) { + wrapper.eq(ArtistScheduleExceptionDO::getArtistId, artistId); + } + return exceptionMapper.selectList(wrapper).stream() + .map(this::toExceptionVO) + .collect(Collectors.toList()); + } + private ArtistScheduleRuleDO normalizeRule(ArtistScheduleRuleDTO dto) { if (dto == null || dto.getShopId() == null || dto.getArtistId() == null) { throw new RuntimeException("排班规则信息不完整"); @@ -220,7 +237,7 @@ public class ArtistScheduleServiceImpl implements ArtistScheduleService { .last("LIMIT 1")); } - private List listExceptions(Long shopId, Long artistId, LocalDate start, LocalDate end) { + private List listExceptionRecords(Long shopId, Long artistId, LocalDate start, LocalDate end) { return exceptionMapper.selectList(new LambdaQueryWrapper() .eq(ArtistScheduleExceptionDO::getShopId, shopId) .eq(ArtistScheduleExceptionDO::getArtistId, artistId) @@ -232,7 +249,7 @@ public class ArtistScheduleServiceImpl implements ArtistScheduleService { private void refreshGeneratedSchedules(ArtistScheduleRuleDO rule) { LocalDate start = LocalDate.now(); LocalDate end = start.plusDays(GENERATED_DAYS - 1L); - Map exceptionByDate = listExceptions(rule.getShopId(), rule.getArtistId(), start, end) + Map exceptionByDate = listExceptionRecords(rule.getShopId(), rule.getArtistId(), start, end) .stream() .collect(Collectors.toMap(ArtistScheduleExceptionDO::getWorkDate, Function.identity(), (a, b) -> a)); LocalDate cursor = start; diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/manager/controller/admin/AdminManagerController.java b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/manager/controller/admin/AdminManagerController.java index 422210bf..8047fc69 100644 --- a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/manager/controller/admin/AdminManagerController.java +++ b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/manager/controller/admin/AdminManagerController.java @@ -15,6 +15,8 @@ import com.xiaowang.jayucloud.salon.core.modules.artist.vo.ArtistScheduleRuleSet import com.xiaowang.jayucloud.salon.core.modules.artist.vo.ArtistScheduleRuleVO; import com.xiaowang.jayucloud.salon.core.modules.artist.vo.ArtistScheduleVO; import com.xiaowang.jayucloud.salon.core.modules.manager.dto.ManagerCustomerCreateDTO; +import com.xiaowang.jayucloud.salon.core.modules.order.service.OrderService; +import com.xiaowang.jayucloud.salon.core.modules.order.vo.OrderVO; import com.xiaowang.jayucloud.salon.core.modules.planning.dto.PlanningAppointmentCreateDTO; import com.xiaowang.jayucloud.salon.core.modules.planning.dto.PlanningAppointmentMoveDTO; import com.xiaowang.jayucloud.salon.core.modules.planning.dto.PlanningAppointmentStatusDTO; @@ -38,6 +40,7 @@ import com.xiaowang.jayucloud.salon.core.modules.privacy.vo.CustomerDialVO; import com.xiaowang.jayucloud.salon.core.modules.user.dto.UserDTO; import com.xiaowang.jayucloud.salon.core.modules.user.entity.UserDO; import com.xiaowang.jayucloud.salon.core.modules.user.service.UserService; +import com.xiaowang.jayucloud.salon.core.modules.manager.vo.UnlinkedWechatUserVO; import com.xiaowang.jayucloud.salon.core.modules.user.vo.UserVO; import lombok.RequiredArgsConstructor; import org.springframework.format.annotation.DateTimeFormat; @@ -69,6 +72,7 @@ public class AdminManagerController { private final ShopService shopService; private final AdminScopeHelper adminScopeHelper; private final CustomerDialService customerDialService; + private final OrderService orderService; @GetMapping("/planning/calendar") @RequirePermission("schedule:view") @@ -341,6 +345,75 @@ public class AdminManagerController { return Result.success(artistScheduleService.saveException(dto)); } + @GetMapping("/employees/schedule-exceptions") + @RequirePermission("schedule:view") + public Result> listScheduleExceptions(HttpServletRequest request, + @RequestParam(required = false) Long artistId, + @RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate startDate, + @RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate endDate) { + UserDO currentUser = adminScopeHelper.getCurrentUser(request); + Long shopId = adminScopeHelper.resolveShopScope(currentUser, null); + return Result.success(artistScheduleService.listExceptions(shopId, artistId, startDate, endDate)); + } + + @GetMapping("/orders/preview") + @RequirePermission("order:view") + public Result> orderPreview(HttpServletRequest request, + @RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate startDate, + @RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate endDate) { + UserDO currentUser = adminScopeHelper.getCurrentUser(request); + Long scopedShopId = adminScopeHelper.resolveShopScope(currentUser, null); + List orders = Integer.valueOf(3).equals(currentUser.getType()) + ? orderService.getOrdersByArtistId(currentUser.getId()) + : orderService.getAllOrders(); + if (scopedShopId != null && !Integer.valueOf(3).equals(currentUser.getType())) { + orders = orders.stream().filter(order -> scopedShopId.equals(order.getShopId())).toList(); + } + if (startDate != null) { + orders = orders.stream() + .filter(order -> order.getCreateTime() != null && !order.getCreateTime().toLocalDate().isBefore(startDate)) + .toList(); + } + if (endDate != null) { + orders = orders.stream() + .filter(order -> order.getCreateTime() != null && !order.getCreateTime().toLocalDate().isAfter(endDate)) + .toList(); + } + List preview = orders.stream() + .sorted((left, right) -> { + if (left.getCreateTime() == null) return 1; + if (right.getCreateTime() == null) return -1; + return right.getCreateTime().compareTo(left.getCreateTime()); + }) + .limit(10) + .toList(); + return Result.success(preview); + } + + @GetMapping("/employees/users/unlinked-candidates") + @RequirePermission("user:create") + public Result> unlinkedWechatCandidates(HttpServletRequest request, + @RequestParam(required = false) String keyword) { + UserDO currentUser = adminScopeHelper.getCurrentUser(request); + Long shopId = adminScopeHelper.resolveShopScope(currentUser, null); + java.util.Set linkedUserIds = nailArtistInfoService.getByShopId(shopId).stream() + .map(NailArtistInfoDTO::getUserId) + .filter(java.util.Objects::nonNull) + .collect(java.util.stream.Collectors.toSet()); + String normalizedKeyword = keyword == null ? "" : keyword.trim().toLowerCase(); + List candidates = userService.listUsersByShopId(shopId).stream() + .filter(user -> Integer.valueOf(1).equals(user.getType())) + .filter(user -> user.getId() != null && !linkedUserIds.contains(user.getId())) + .filter(user -> normalizedKeyword.isEmpty() + || String.valueOf(user.getNickname() == null ? "" : user.getNickname()).toLowerCase().contains(normalizedKeyword) + || String.valueOf(user.getMaskedPhone() == null ? "" : user.getMaskedPhone()).contains(normalizedKeyword)) + .limit(50) + .map(user -> new UnlinkedWechatUserVO(user.getId(), user.getNickname(), user.getMaskedPhone(), + user.getAvatar(), user.getWechatId(), user.getCreateTime())) + .toList(); + return Result.success(candidates); + } + @GetMapping("/products") @RequirePermission("product:view") public Result> products(HttpServletRequest request, diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/manager/vo/UnlinkedWechatUserVO.java b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/manager/vo/UnlinkedWechatUserVO.java new file mode 100644 index 00000000..7eef18f3 --- /dev/null +++ b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/manager/vo/UnlinkedWechatUserVO.java @@ -0,0 +1,17 @@ +package com.xiaowang.jayucloud.salon.core.modules.manager.vo; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +@AllArgsConstructor +public class UnlinkedWechatUserVO { + private Long id; + private String nickname; + private String maskedPhone; + private String avatar; + private String wechatId; + private LocalDateTime createTime; +} diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/planning/service/impl/PlanningServiceImpl.java b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/planning/service/impl/PlanningServiceImpl.java index d5120bdd..d333bdb5 100644 --- a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/planning/service/impl/PlanningServiceImpl.java +++ b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/planning/service/impl/PlanningServiceImpl.java @@ -34,6 +34,8 @@ import com.xiaowang.jayucloud.salon.core.modules.planning.service.PlanningServic import com.xiaowang.jayucloud.salon.core.modules.security.support.AdminScopeHelper; import com.xiaowang.jayucloud.salon.core.modules.order.support.OrderStatus; import com.xiaowang.jayucloud.salon.core.modules.file.support.ObjectStorageUrlSupport; +import com.xiaowang.jayucloud.salon.core.modules.file.service.ObjectStorageFileService; +import com.xiaowang.jayucloud.salon.core.modules.file.vo.ObjectStorageFileVO; import com.xiaowang.jayucloud.salon.core.modules.planning.support.PlanningCalendarSupport; import com.xiaowang.jayucloud.salon.core.modules.planning.support.PlanningTodayOverviewSupport; import com.xiaowang.jayucloud.salon.core.support.id.TimeOrderedSnowflakeIdGenerator; @@ -104,6 +106,7 @@ public class PlanningServiceImpl implements PlanningService { private final WechatSubscribeMessageService wechatSubscribeMessageService; private final TimeOrderedSnowflakeIdGenerator snowflakeIdGenerator; private final ObjectStorageUrlSupport objectStorageUrlSupport; + private final ObjectStorageFileService objectStorageFileService; private final PhoneCrypto phoneCrypto; @Override @@ -632,6 +635,7 @@ public class PlanningServiceImpl implements PlanningService { vo.setProductTitle(reservation != null && hasText(reservation.getProductTitle()) ? reservation.getProductTitle() : product == null ? "预约作品" : product.getTitle()); + vo.setCoverImages(resolveProductCoverImages(product)); vo.setArtistId(artistId); boolean unassigned = artistId == null; vo.setArtistName(unassigned ? "待分配" : artist == null ? "美甲师" : artist.getName()); @@ -993,6 +997,52 @@ public class PlanningServiceImpl implements PlanningService { .collect(Collectors.toMap(OrderItemDO::getId, Function.identity(), (a, b) -> a)); } + private List resolveProductCoverImages(ProductDO product) { + if (product == null || !hasText(product.getImageFileIds())) { + return List.of(); + } + Set fileIds = new HashSet<>(); + for (String rawId : product.getImageFileIds().split(",")) { + String normalized = rawId == null ? "" : rawId.trim(); + if (!normalized.isEmpty()) { + try { + fileIds.add(Long.parseLong(normalized)); + } catch (NumberFormatException ignored) { + } + } + } + if (fileIds.isEmpty()) { + return List.of(); + } + Map files = objectStorageFileService.getObjectStorageFileMapByIds(fileIds); + return parseOrderedCoverUrls(product.getImageFileIds(), files); + } + + private List parseOrderedCoverUrls(String imageFileIds, Map files) { + List urls = new ArrayList<>(); + for (String rawId : imageFileIds.split(",")) { + String normalized = rawId == null ? "" : rawId.trim(); + if (normalized.isEmpty()) { + continue; + } + Long fileId; + try { + fileId = Long.parseLong(normalized); + } catch (NumberFormatException ignored) { + continue; + } + ObjectStorageFileVO file = files.get(fileId); + if (file == null) { + continue; + } + String url = objectStorageUrlSupport.toAccessibleUrl(file); + if (hasText(url)) { + urls.add(url); + } + } + return urls; + } + private Map loadOrders(Set orderIds) { if (orderIds == null || orderIds.isEmpty()) { return Map.of(); diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/planning/vo/PlanningAppointmentVO.java b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/planning/vo/PlanningAppointmentVO.java index b7f2ebdd..e3f1b93c 100644 --- a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/planning/vo/PlanningAppointmentVO.java +++ b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/planning/vo/PlanningAppointmentVO.java @@ -3,6 +3,7 @@ package com.xiaowang.jayucloud.salon.core.modules.planning.vo; import lombok.Data; import java.math.BigDecimal; +import java.util.List; @Data public class PlanningAppointmentVO { @@ -17,6 +18,8 @@ public class PlanningAppointmentVO { private Boolean customerPhoneAvailable; private Long productId; private String productTitle; + /** 作品图片访问地址,用于预约详情项目图片轮播 */ + private List coverImages; private Long artistId; private String artistName; private String artistColor; diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/registration/service/impl/WorkbenchRegistrationServiceImpl.java b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/registration/service/impl/WorkbenchRegistrationServiceImpl.java index eef08f62..52ec2150 100644 --- a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/registration/service/impl/WorkbenchRegistrationServiceImpl.java +++ b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/registration/service/impl/WorkbenchRegistrationServiceImpl.java @@ -574,7 +574,8 @@ public class WorkbenchRegistrationServiceImpl implements WorkbenchRegistrationSe ? null : contentModerationRecordMapper.selectById(application.getContentModerationRecordId()); return new WorkbenchRegistrationStatusVO(application.getId(), application.getApplicationNo(), application.getRoleType(), application.getStatus(), application.getRejectReason(), application.getShopId(), application.getShopName(), - moderation == null ? null : moderation.getStatus(), moderation == null ? null : moderation.getReason()); + moderation == null ? null : moderation.getStatus(), moderation == null ? null : moderation.getReason(), + application.getCreateTime()); } private WorkbenchRegistrationReviewVO toReviewVO(WorkbenchRegistrationApplicationDO application, UserDO applicant, diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/registration/vo/WorkbenchRegistrationStatusVO.java b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/registration/vo/WorkbenchRegistrationStatusVO.java index 133d0e1c..011bee69 100644 --- a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/registration/vo/WorkbenchRegistrationStatusVO.java +++ b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/registration/vo/WorkbenchRegistrationStatusVO.java @@ -3,6 +3,8 @@ package com.xiaowang.jayucloud.salon.core.modules.registration.vo; import lombok.AllArgsConstructor; import lombok.Getter; +import java.time.LocalDateTime; + @Getter @AllArgsConstructor public class WorkbenchRegistrationStatusVO { @@ -15,4 +17,5 @@ public class WorkbenchRegistrationStatusVO { private String shopName; private String contentModerationStatus; private String contentModerationReason; + private LocalDateTime createTime; } diff --git a/JC-Salon-WeChat/api/employees.js b/JC-Salon-WeChat/api/employees.js index 31d6c648..bbd7e454 100644 --- a/JC-Salon-WeChat/api/employees.js +++ b/JC-Salon-WeChat/api/employees.js @@ -30,6 +30,13 @@ module.exports = { }) }, + unlinkedCandidates(params) { + return request({ + url: '/manager/employees/users/unlinked-candidates', + params + }) + }, + schedules(params) { return request({ url: '/manager/employees/schedules', @@ -68,6 +75,13 @@ module.exports = { }) }, + scheduleExceptions(params) { + return request({ + url: '/manager/employees/schedule-exceptions', + params + }) + }, + reviewSummary() { return request({ url: '/user/workbench/registration/summary' diff --git a/JC-Salon-WeChat/api/planning.js b/JC-Salon-WeChat/api/planning.js index 3532cc58..67469d32 100644 --- a/JC-Salon-WeChat/api/planning.js +++ b/JC-Salon-WeChat/api/planning.js @@ -14,6 +14,13 @@ module.exports = { }) }, + orderPreview(params) { + return request({ + url: '/manager/orders/preview', + params + }) + }, + createAppointment(data) { return request({ url: '/manager/planning/appointments', diff --git a/JC-Salon-WeChat/app.wxss b/JC-Salon-WeChat/app.wxss index 26add3f9..8d2f1e55 100644 --- a/JC-Salon-WeChat/app.wxss +++ b/JC-Salon-WeChat/app.wxss @@ -185,7 +185,7 @@ button::after { .field { display: flex; align-items: center; - min-height: 108rpx; + min-height: 112rpx; border-bottom: 1rpx solid var(--theme-border); } diff --git a/JC-Salon-WeChat/components/entity-selector-sheet/index.wxss b/JC-Salon-WeChat/components/entity-selector-sheet/index.wxss index bbc14c3c..c544d764 100644 --- a/JC-Salon-WeChat/components/entity-selector-sheet/index.wxss +++ b/JC-Salon-WeChat/components/entity-selector-sheet/index.wxss @@ -54,7 +54,7 @@ display: flex; align-items: center; justify-content: space-between; - min-height: 92rpx; + min-height: 96rpx; padding: 0 28rpx; } @@ -96,7 +96,7 @@ .selector-search-wrap { display: flex; align-items: center; - min-height: 80rpx; + min-height: 83rpx; margin: 0 28rpx 18rpx; padding: 0 22rpx; border: 1rpx solid #e7ece9; @@ -155,7 +155,7 @@ .selector-sort { flex: 0 0 auto; color: #476259; } .selector-search { - height: 78rpx; + height: 81rpx; flex: 1; color: #17211f; font-size: 27rpx; @@ -174,9 +174,9 @@ .selector-item { display: flex; align-items: center; - min-height: 112rpx; + min-height: 156rpx; margin-bottom: 14rpx; - padding: 20rpx; + padding: 26rpx; border: 1rpx solid #e7ece9; border-radius: 24rpx; background: #fff; @@ -209,8 +209,8 @@ .selector-item.card-view .selector-check { position: absolute; right: 18rpx; bottom: 16rpx; } .selector-avatar { - width: 76rpx; - height: 76rpx; + width: 80rpx; + height: 80rpx; flex: 0 0 auto; border-radius: 50%; background: #e7ece9; diff --git a/JC-Salon-WeChat/pages/appointment-detail/index.js b/JC-Salon-WeChat/pages/appointment-detail/index.js index 98947bf6..75286708 100644 --- a/JC-Salon-WeChat/pages/appointment-detail/index.js +++ b/JC-Salon-WeChat/pages/appointment-detail/index.js @@ -18,6 +18,8 @@ Page({ data: { id: '', appointment: {}, + coverImages: [], + coverIndex: 0, avatarText: '', timeText: '', isUnassigned: false, @@ -74,8 +76,13 @@ Page({ remarkText: displayValue(safeAppointment.remark, '暂无备注'), cancelReasonText: displayValue(safeAppointment.cancelReason, '') } + const coverImages = Array.isArray(safeAppointment.coverImages) + ? safeAppointment.coverImages.filter(item => Boolean(item)) + : [] this.setData({ appointment: normalizedAppointment, + coverImages, + coverIndex: 0, isUnassigned, avatarText: normalizedAppointment.customerNameText.slice(0, 1), timeText, @@ -87,6 +94,10 @@ Page({ }) }, + onCoverChange(event) { + this.setData({ coverIndex: Number(event.detail.current) || 0 }) + }, + async updateStatus(status) { if (this.data.updating || !this.data.appointment.orderId) return if (status !== 3 && this.data.isUnassigned) { diff --git a/JC-Salon-WeChat/pages/appointment-detail/index.wxml b/JC-Salon-WeChat/pages/appointment-detail/index.wxml index 285f2f7c..055889d1 100644 --- a/JC-Salon-WeChat/pages/appointment-detail/index.wxml +++ b/JC-Salon-WeChat/pages/appointment-detail/index.wxml @@ -56,6 +56,24 @@ + + + 项目图片 + {{coverIndex + 1}} / {{coverImages.length}} + + + + + + + + + + + + 左滑查看更多项目图 + + 备注 {{appointment.remarkText}} diff --git a/JC-Salon-WeChat/pages/appointment-detail/index.wxss b/JC-Salon-WeChat/pages/appointment-detail/index.wxss index 3a59b98d..8986f73c 100644 --- a/JC-Salon-WeChat/pages/appointment-detail/index.wxss +++ b/JC-Salon-WeChat/pages/appointment-detail/index.wxss @@ -164,6 +164,75 @@ overflow-wrap: anywhere; } +.cover-section { + margin-top: 28rpx; +} + +.cover-head { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 16rpx; +} + +.cover-count { + color: #71807a; + font-size: 22rpx; +} + +.cover-card { + box-sizing: border-box; + width: 100%; + height: 304rpx; + padding: 20rpx; + border-radius: 24rpx; + background: #fbfdfb; + border: 1rpx solid #e7ece9; +} + +.cover-swiper { + width: 100%; + height: 208rpx; + border-radius: 16rpx; + overflow: hidden; +} + +.cover-image { + width: 100%; + height: 208rpx; + border-radius: 16rpx; + background: #e5f4ed; +} + +.cover-dots { + display: flex; + align-items: center; + justify-content: center; + gap: 10rpx; + height: 56rpx; +} + +.cover-dot { + width: 10rpx; + height: 10rpx; + border-radius: 50%; + background: #d5ddd9; + transition: width 0.2s; +} + +.cover-dot.active { + width: 26rpx; + border-radius: 6rpx; + background: #247b63; +} + +.cover-hint { + display: block; + margin-top: 12rpx; + color: #a1aca6; + font-size: 20rpx; +} + .note-card { padding: 24rpx; color: #71807a; diff --git a/JC-Salon-WeChat/pages/employee-create/index.js b/JC-Salon-WeChat/pages/employee-create/index.js index 3ccf5857..9de1ca76 100644 --- a/JC-Salon-WeChat/pages/employee-create/index.js +++ b/JC-Salon-WeChat/pages/employee-create/index.js @@ -12,6 +12,13 @@ Page({ employeeColors: EMPLOYEE_COLORS, onboardingVisible: false, createdEmployee: null, + userPickerVisible: false, + userLoading: false, + userKeyword: '', + userCandidates: [], + userItems: [], + selectedWechatUserId: '', + selectedWechatUser: null, associationSheetVisible: false, associationLoading: false, associationApplications: [], @@ -53,6 +60,68 @@ Page({ this.setData({ 'form.color': event.currentTarget.dataset.color }) }, + async openUserPicker() { + if (this.data.creating || this.data.avatarUploading) return + this.setData({ userPickerVisible: true, userLoading: true, userKeyword: '' }) + try { + const list = await employeesApi.unlinkedCandidates() + this.applyUserCandidates(Array.isArray(list) ? list : (list && list.list) || []) + } catch (error) { + showErrorToast(error, '微信用户加载失败') + } finally { + this.setData({ userLoading: false }) + } + }, + + applyUserCandidates(candidates) { + this.setData({ + userCandidates: candidates, + userItems: candidates.map(item => ({ + id: String(item.id), + title: item.nickname || '微信用户', + subtitle: [item.maskedPhone || item.phone, item.createTime && String(item.createTime).replace('T', ' ').slice(0, 10)].filter(Boolean).join(' · ') || '已登录小程序', + meta: item.wechatId || '', + avatar: item.avatar || '' + })) + }) + }, + + onUserSearch(event) { + const userKeyword = String(event.detail.value || '').trim().toLowerCase() + const candidates = this.data.userCandidates + const userItems = candidates + .filter(item => !userKeyword || [item.nickname, item.maskedPhone, item.phone, item.wechatId] + .some(value => String(value || '').toLowerCase().includes(userKeyword))) + .map(item => ({ + id: String(item.id), + title: item.nickname || '微信用户', + subtitle: [item.maskedPhone || item.phone, item.createTime && String(item.createTime).replace('T', ' ').slice(0, 10)].filter(Boolean).join(' · ') || '已登录小程序', + meta: item.wechatId || '', + avatar: item.avatar || '' + })) + this.setData({ userKeyword, userItems }) + }, + + selectWechatUser(event) { + const item = event.detail && event.detail.item + if (!item) return + const candidate = this.data.userCandidates.find(user => String(user.id) === String(item.id)) + if (!candidate) return + this.setData({ + userPickerVisible: false, + selectedWechatUserId: String(candidate.id), + selectedWechatUser: item, + 'form.nickname': candidate.nickname || '', + 'form.avatar': candidate.avatar || '', + 'form.avatarUrl': candidate.avatar || '' + }) + }, + + closeUserPicker() { + if (this.data.userLoading) return + this.setData({ userPickerVisible: false }) + }, + async chooseAvatar() { if (this.data.avatarUploading || this.data.creating) return try { @@ -95,6 +164,32 @@ Page({ const nickname = String(form.nickname || '').trim() const phone = String(form.phone || '').trim() const wechatId = String(form.wechatId || '').trim() + if (this.data.selectedWechatUserId) { + if (!nickname) { + wx.showToast({ title: '请填写美甲师姓名', icon: 'none' }) + return + } + this.setData({ creating: true }) + try { + const saved = await employeesApi.save({ + userId: this.data.selectedWechatUserId, + nickname, + color: form.color, + avatar: form.avatar || undefined + }) + const id = saved && typeof saved === 'object' ? (saved.userId || saved.id) : this.data.selectedWechatUserId + this.setData({ + createdEmployee: { id, name: nickname, title: nickname, avatar: form.avatar || '' }, + applicationApproved: false + }) + await this.offerPendingAssociation() + } catch (error) { + showErrorToast(error, '新增失败') + } finally { + this.setData({ creating: false }) + } + return + } if (!nickname || !phone) { wx.showToast({ title: '请补全美甲师信息', icon: 'none' }) return diff --git a/JC-Salon-WeChat/pages/employee-create/index.wxml b/JC-Salon-WeChat/pages/employee-create/index.wxml index 72166b04..8cef095d 100644 --- a/JC-Salon-WeChat/pages/employee-create/index.wxml +++ b/JC-Salon-WeChat/pages/employee-create/index.wxml @@ -24,10 +24,11 @@ 手机号 - + diff --git a/JC-Salon-WeChat/pages/employee-create/index.wxss b/JC-Salon-WeChat/pages/employee-create/index.wxss index 8140d5d1..79b10094 100644 --- a/JC-Salon-WeChat/pages/employee-create/index.wxss +++ b/JC-Salon-WeChat/pages/employee-create/index.wxss @@ -37,7 +37,8 @@ .login-unlinked-label { color: #536b5d; font-size: 24rpx; font-weight: 700; } .login-unlinked-status { margin-left: 18rpx; color: #247b63; font-size: 24rpx; font-weight: 700; } -.login-unlinked-note { flex-basis: 100%; margin-top: 10rpx; color: #829287; font-size: 21rpx; } +.login-unlinked-note { flex: 1; flex-basis: 100%; margin-top: 10rpx; color: #829287; font-size: 21rpx; } +.login-unlinked-arrow { flex-shrink: 0; margin-left: 8rpx; color: #247b63; font-size: 30rpx; font-weight: 600; line-height: 1; } .avatar-card { display: flex; diff --git a/JC-Salon-WeChat/pages/employee-detail/index.js b/JC-Salon-WeChat/pages/employee-detail/index.js index 6c5a6147..5ac37e77 100644 --- a/JC-Salon-WeChat/pages/employee-detail/index.js +++ b/JC-Salon-WeChat/pages/employee-detail/index.js @@ -3,6 +3,12 @@ const { toUserMessage } = require('../../utils/toast') const EMPLOYEE_COLORS = ['#7AA9C2', '#8EB99B', '#BDA7D8', '#D7B17D', '#D98D8D'] +function formatAmount(value) { + const amount = Number(value || 0) + if (!Number.isFinite(amount)) return '0' + return amount.toLocaleString('zh-CN', { maximumFractionDigits: 2 }) +} + Page({ data: { id: '', @@ -30,7 +36,9 @@ Page({ color: data.color || EMPLOYEE_COLORS[0], monthOrders, monthAmount, - avgAmount: monthOrders > 0 ? Math.round(monthAmount / monthOrders) : 0 + monthAmountText: formatAmount(monthAmount), + avgAmount: monthOrders > 0 ? Math.round(monthAmount / monthOrders) : 0, + avgAmountText: formatAmount(monthOrders > 0 ? Math.round(monthAmount / monthOrders) : 0) } }) } catch (error) { diff --git a/JC-Salon-WeChat/pages/employee-detail/index.wxml b/JC-Salon-WeChat/pages/employee-detail/index.wxml index b4e82f9f..23d5bb34 100644 --- a/JC-Salon-WeChat/pages/employee-detail/index.wxml +++ b/JC-Salon-WeChat/pages/employee-detail/index.wxml @@ -19,11 +19,11 @@ 本月订单 - ¥{{employee.monthAmount}} + ¥{{employee.monthAmountText}} 本月营业额 - ¥{{employee.avgAmount}} + ¥{{employee.avgAmountText}} 平均客单价 diff --git a/JC-Salon-WeChat/pages/export/index.js b/JC-Salon-WeChat/pages/export/index.js index 6d1fc727..97dabf95 100644 --- a/JC-Salon-WeChat/pages/export/index.js +++ b/JC-Salon-WeChat/pages/export/index.js @@ -11,13 +11,6 @@ function shortDateTime(value) { return text.length > 16 ? text.slice(0, 16) : text || '-' } -function timeRange(item) { - const start = String(item.startTime || '').slice(11, 16) - const end = String(item.endTime || '').slice(11, 16) - if (!start && !end) return '-' - return `${start || '-'}-${end || '-'}` -} - function scheduleSummary(item) { const mode = item.scheduleModeSummary || item.scheduleMode || '' const time = item.scheduleTimeSummary || item.ruleTimeSummary || '' @@ -73,21 +66,20 @@ Page({ }, async loadOrderPreview() { - const data = await planningApi.calendar({ + const data = await planningApi.orderPreview({ startDate: this.data.startDate, endDate: this.data.endDate }) - const rows = (data.appointments || []).slice(0, PREVIEW_SIZE).map((item, index) => ({ - key: `order-${item.orderItemId || index}`, - date: item.date || String(item.startTime || '').slice(0, 10) || '-', - customer: item.customerName || '到店客户', - product: item.productTitle || '预约作品', - artist: item.artistName || '未分配', - time: timeRange(item), - status: item.statusText || '-' + const list = Array.isArray(data) ? data : (data.list || []) + const rows = list.slice(0, PREVIEW_SIZE).map((item, index) => ({ + key: `order-${item.orderNo || item.id || index}`, + orderNo: item.orderNo || '-', + amount: item.actualAmount === null || item.actualAmount === undefined ? '-' : `¥${item.actualAmount}`, + status: item.statusText || '-', + createTime: shortDateTime(item.createTime && String(item.createTime).replace('T', ' ')) })) this.setData({ - previewColumns: ['日期', '客户', '项目', '美甲师', '时间', '状态'], + previewColumns: ['订单编号', '实付金额', '状态', '创建时间'], previewRows: rows }) }, diff --git a/JC-Salon-WeChat/pages/export/index.wxml b/JC-Salon-WeChat/pages/export/index.wxml index a00067c5..e3b00c34 100644 --- a/JC-Salon-WeChat/pages/export/index.wxml +++ b/JC-Salon-WeChat/pages/export/index.wxml @@ -19,12 +19,10 @@ - {{item.date}} - {{item.customer}} - {{item.product}} - {{item.artist}} - {{item.time}} + {{item.orderNo}} + {{item.amount}} {{item.status}} + {{item.createTime}} {{item.name}} diff --git a/JC-Salon-WeChat/pages/export/index.wxss b/JC-Salon-WeChat/pages/export/index.wxss index 8e68e0ab..c92f58c6 100644 --- a/JC-Salon-WeChat/pages/export/index.wxss +++ b/JC-Salon-WeChat/pages/export/index.wxss @@ -38,12 +38,13 @@ } .preview-table { - min-width: 920rpx; + width: 100%; } .preview-row { display: flex; - min-height: 58rpx; + align-items: center; + min-height: 68rpx; border-bottom: 1rpx solid #e7ece9; } @@ -52,25 +53,32 @@ } .preview-row-head { - border-radius: 8rpx; - background: #f3f7f4; + min-height: 64rpx; + border-bottom: 0; + border-radius: 12rpx; + background: #f5f7f4; } .preview-cell { display: flex; align-items: center; - width: 150rpx; - min-width: 150rpx; + flex: 1; + min-width: 0; padding: 0 12rpx; overflow: hidden; - color: #5e564d; + color: #17211f; font-size: 22rpx; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; } +.preview-cell.order-no { + flex: 1.35; + font-family: "SF Mono", Menlo, monospace; +} + .preview-row-head .preview-cell { - color: #17211f; - font-weight: 800; + color: #71807a; + font-weight: 700; } diff --git a/JC-Salon-WeChat/pages/leave-management/index.js b/JC-Salon-WeChat/pages/leave-management/index.js index 7dcaa999..eaa2e4ed 100644 --- a/JC-Salon-WeChat/pages/leave-management/index.js +++ b/JC-Salon-WeChat/pages/leave-management/index.js @@ -1,11 +1,186 @@ +const employeesApi = require('../../api/employees') +const dateUtil = require('../../utils/date') +const { showErrorToast, toUserMessage } = require('../../utils/toast') + +function displayDate(value) { + const text = String(value || '').slice(0, 10) + return text || '-' +} + +function exceptionText(item) { + const type = String(item.exceptionType || '').toUpperCase() + if (type.includes('FULL')) return '全天请假' + const start = String(item.startTime || '').slice(0, 5) + const end = String(item.endTime || '').slice(0, 5) + if (start || end) return `${start || '-'}-${end || '-'} 请假` + return '请假' +} + 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: '下午请假' } - ] + days: [], + records: [], + artists: [], + artistNames: {}, + loading: false, + loadError: '', + formVisible: false, + saving: false, + form: { + artistIndex: 0, + workDate: dateUtil.formatDate(new Date()), + exceptionType: 'FULL_DAY', + startTime: '09:00', + endTime: '18:00', + remark: '' + } }, - add() { wx.showToast({ title: '请选择日期后保存', icon: 'none' }) }, + + onLoad() { + this.month = new Date() + this.loadRecords() + this.loadArtists() + }, + + async loadArtists() { + try { + const data = await employeesApi.list() + const list = data.list || data || [] + const artists = list.map(item => ({ + id: item.userId || item.id, + name: item.nickname || item.name || item.artistName || '美甲师' + })).filter(item => item.id) + const artistNames = artists.reduce((map, item) => { + map[item.id] = item.name + return map + }, {}) + this.setData({ artists, artistNames }) + } catch (error) { + // 美甲师列表失败不阻塞请假记录展示。 + } + }, + + async loadRecords() { + const month = this.month + const startDate = `${month.getFullYear()}-${String(month.getMonth() + 1).padStart(2, '0')}-01` + const daysInMonth = new Date(month.getFullYear(), month.getMonth() + 1, 0).getDate() + const endDate = `${month.getFullYear()}-${String(month.getMonth() + 1).padStart(2, '0')}-${String(daysInMonth).padStart(2, '0')}` + this.setData({ loading: true, loadError: '' }) + try { + const list = await employeesApi.scheduleExceptions({ startDate, endDate }) + const exceptions = Array.isArray(list) ? list : (list && list.list) || [] + const restDates = new Set(exceptions.map(item => String(item.workDate || '').slice(0, 10))) + const days = Array.from({ length: daysInMonth }).map((_, index) => { + const date = `${month.getFullYear()}-${String(month.getMonth() + 1).padStart(2, '0')}-${String(index + 1).padStart(2, '0')}` + return { date, day: index + 1, rest: restDates.has(date) } + }) + const artistNames = this.data.artistNames || {} + const records = exceptions + .slice() + .sort((left, right) => String(left.workDate).localeCompare(String(right.workDate))) + .map(item => ({ + key: item.id || `${item.workDate}-${item.artistId}`, + date: displayDate(item.workDate), + text: [exceptionText(item), artistNames[item.artistId]].filter(Boolean).join(' · ') + })) + this.setData({ days, records }) + } catch (error) { + this.setData({ records: [], loadError: toUserMessage(error, '请假记录加载失败') }) + } finally { + this.setData({ loading: false }) + } + }, + + add() { + const artists = this.data.artists || [] + if (!artists.length) { + wx.showToast({ title: '暂无可请假的美甲师', icon: 'none' }) + return + } + const app = getApp() + const userInfo = app.globalData.userInfo || {} + const ownIndex = artists.findIndex(item => String(item.id) === String(userInfo.id)) + this.setData({ + formVisible: true, + form: { + artistIndex: ownIndex >= 0 ? ownIndex : 0, + workDate: dateUtil.formatDate(new Date()), + exceptionType: 'FULL_DAY', + startTime: '09:00', + endTime: '18:00', + remark: '' + } + }) + }, + + closeForm() { + if (this.data.saving) return + this.setData({ formVisible: false }) + }, + + stopTouchMove() {}, + + noop() {}, + + onArtistChange(event) { + this.setData({ 'form.artistIndex': Number(event.detail.value) }) + }, + + onDateChange(event) { + this.setData({ 'form.workDate': event.detail.value }) + }, + + selectType(event) { + this.setData({ 'form.exceptionType': event.currentTarget.dataset.type }) + }, + + onStartTimeChange(event) { + this.setData({ 'form.startTime': event.detail.value }) + }, + + onEndTimeChange(event) { + this.setData({ 'form.endTime': event.detail.value }) + }, + + onRemarkInput(event) { + this.setData({ 'form.remark': event.detail.value }) + }, + + async save() { + if (this.data.saving) return + const form = this.data.form + const artist = this.data.artists[form.artistIndex] + if (!artist) { + wx.showToast({ title: '请选择美甲师', icon: 'none' }) + return + } + if (!form.workDate) { + wx.showToast({ title: '请选择日期后保存', icon: 'none' }) + return + } + if (form.exceptionType !== 'FULL_DAY' && dateUtil.minutesOfDay(form.endTime) <= dateUtil.minutesOfDay(form.startTime)) { + wx.showToast({ title: '结束时间需晚于开始时间', icon: 'none' }) + return + } + this.setData({ saving: true }) + try { + await employeesApi.saveScheduleException({ + artistId: artist.id, + workDate: form.workDate, + exceptionType: form.exceptionType, + startTime: form.exceptionType === 'FULL_DAY' ? undefined : form.startTime, + endTime: form.exceptionType === 'FULL_DAY' ? undefined : form.endTime, + remark: form.remark || undefined + }) + this.setData({ formVisible: false }) + wx.showToast({ title: '请假已保存' }) + this.loadRecords() + } catch (error) { + showErrorToast(error, '请假保存失败') + } finally { + this.setData({ saving: false }) + } + }, + back() { wx.navigateBack() } }) diff --git a/JC-Salon-WeChat/pages/leave-management/index.wxml b/JC-Salon-WeChat/pages/leave-management/index.wxml index 66086590..1ef93b6c 100644 --- a/JC-Salon-WeChat/pages/leave-management/index.wxml +++ b/JC-Salon-WeChat/pages/leave-management/index.wxml @@ -1,12 +1,72 @@ - - {{item.day}} + + + {{item.day}} + - 请假记录 - - {{item.date}} {{item.text}} + + 请假记录 + 加载中 + + {{loadError}} + 暂无请假记录 + + + {{item.date}} + {{item.text}} + + + + + + + + + 新增请假 + × + + + + 美甲师 + + {{artists[form.artistIndex].name || '请选择'}} + + + + 请假日期 + + {{form.workDate}} + + + + 请假类型 + + 全天 + 时段 + + + + 请假时段 + + + {{form.startTime}} + + 至 + + {{form.endTime}} + + + + + 备注 + + + + + + + - diff --git a/JC-Salon-WeChat/pages/leave-management/index.wxss b/JC-Salon-WeChat/pages/leave-management/index.wxss index ccb8a6c5..5600d219 100644 --- a/JC-Salon-WeChat/pages/leave-management/index.wxss +++ b/JC-Salon-WeChat/pages/leave-management/index.wxss @@ -1,22 +1,192 @@ -.mini-calendar { - display: grid; - grid-template-columns: repeat(7, 1fr); - gap: 10rpx; - padding: 18rpx; +.leave-card { + padding: 20rpx; } -.mini-day { +.leave-calendar { + display: grid; + grid-template-columns: repeat(7, 1fr); + gap: 8rpx; +} + +.leave-day { display: flex; align-items: center; justify-content: center; - height: 64rpx; + height: 66rpx; border-radius: 10rpx; background: #f3f7f4; color: #71807a; + font-size: 29rpx; font-weight: 700; } -.mini-day.rest { +.leave-day.rest { background: #e7f0f6; color: #6e9fbd; } + +.section-head { + display: flex; + align-items: center; + justify-content: space-between; +} + +.section-note { + color: #71807a; + font-size: 22rpx; +} + +.record-empty { + padding: 36rpx 24rpx; + color: #71807a; + font-size: 24rpx; + text-align: center; +} + +.record-card { + display: flex; + align-items: center; + min-height: 92rpx; + padding: 0 26rpx; +} + +.record-date { + color: #17211f; + font-size: 29rpx; + font-weight: 700; +} + +.record-text { + margin-left: 16rpx; + color: #71807a; + font-size: 26rpx; +} + +.leave-add { + height: 80rpx; + border-radius: 24rpx; + font-size: 27rpx; + font-weight: 700; +} + +.sheet-mask { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 60; + display: flex; + align-items: flex-end; + background: rgba(23, 33, 31, 0.42); +} + +.sheet { + box-sizing: border-box; + width: 100%; + padding: 30rpx 28rpx calc(28rpx + env(safe-area-inset-bottom)); + border-radius: 28rpx 28rpx 0 0; + background: #ffffff; +} + +.sheet-head { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 12rpx; +} + +.sheet-title { + color: #17211f; + font-size: 32rpx; + font-weight: 800; +} + +.sheet-close { + padding: 0 10rpx; + color: #71807a; + font-size: 40rpx; + line-height: 1; +} + +.sheet-field { + display: flex; + align-items: center; + justify-content: space-between; + min-height: 88rpx; + border-bottom: 1rpx solid #e7ece9; +} + +.sheet-label { + flex-shrink: 0; + color: #71807a; + font-size: 26rpx; +} + +.sheet-value { + min-width: 240rpx; + color: #17211f; + font-size: 28rpx; + font-weight: 600; + text-align: right; +} + +.sheet-input { + flex: 1; + margin-left: 24rpx; + color: #17211f; + font-size: 28rpx; + text-align: right; +} + +.type-switch { + display: flex; + gap: 10rpx; +} + +.type-option { + padding: 10rpx 26rpx; + border-radius: 999rpx; + background: #f3f7f4; + color: #71807a; + font-size: 25rpx; + font-weight: 700; +} + +.type-option.selected { + background: #e5f4ed; + color: #247b63; +} + +.time-row { + display: flex; + align-items: center; + gap: 14rpx; +} + +.time-value { + padding: 10rpx 22rpx; + border-radius: 12rpx; + background: #f3f7f4; + color: #17211f; + font-size: 27rpx; + font-weight: 600; +} + +.time-separator { + color: #71807a; + font-size: 24rpx; +} + +.sheet-actions { + display: flex; + gap: 16rpx; + margin-top: 28rpx; +} + +.sheet-btn { + flex: 1; + height: 80rpx; + border-radius: 20rpx; + font-size: 27rpx; +} diff --git a/JC-Salon-WeChat/pages/planning/index.js b/JC-Salon-WeChat/pages/planning/index.js index 32baa04d..86a46111 100644 --- a/JC-Salon-WeChat/pages/planning/index.js +++ b/JC-Salon-WeChat/pages/planning/index.js @@ -18,6 +18,8 @@ function resolveCalendarErrorMessage(error) { return toUserMessage(error, '日程数据加载失败') } +const LANE_TINTS = ['#EAF3FA', '#FBF1EB', '#EEF5EF'] + function toLocalDate(value) { return value instanceof Date ? new Date(value.getTime()) : new Date(String(value).replace(/-/g, '/')) } @@ -657,7 +659,8 @@ Page({ top: (cursor - startMinute) * minuteScale + laneHeaderHeight }) } - const employeeLanes = filteredArtists.map(artist => { + const employeeLanes = filteredArtists.map((artist, artistIndex) => { + const tint = LANE_TINTS[artistIndex % LANE_TINTS.length] const blocks = dayAppointments .filter(item => String(item.artistId) === String(artist.id)) .filter(item => item.startTime) @@ -670,7 +673,8 @@ Page({ left: 12, width: 224, compact: Number(item.durationMinutes || 60) <= 15, - timeText: resolveAppointmentTimeText(item) + timeText: resolveAppointmentTimeText(item), + tint } }) return { ...artist, artistId: artist.id, blocks, width: 248 } @@ -682,7 +686,7 @@ Page({ laneHeaderHeight, 248 ) - const unassignedBlocks = unassignedLayout.blocks + const unassignedBlocks = unassignedLayout.blocks.map(block => ({ ...block, tint: '#FFF3E7' })) const lanes = this.data.selectedArtistId ? employeeLanes : [{ id: '__unassigned__', artistId: '__unassigned__', diff --git a/JC-Salon-WeChat/pages/planning/index.wxml b/JC-Salon-WeChat/pages/planning/index.wxml index 3298d7c9..092e4dd7 100644 --- a/JC-Salon-WeChat/pages/planning/index.wxml +++ b/JC-Salon-WeChat/pages/planning/index.wxml @@ -110,7 +110,7 @@ 不占档期 - + {{block.customerName}} {{block.timeText}} · {{block.productTitle}} @@ -132,6 +132,10 @@ + + 本周概览 + {{weekRange}} + {{item.weekName}}{{item.statusText}} diff --git a/JC-Salon-WeChat/pages/planning/index.wxss b/JC-Salon-WeChat/pages/planning/index.wxss index 4c7bcc55..2245e481 100644 --- a/JC-Salon-WeChat/pages/planning/index.wxss +++ b/JC-Salon-WeChat/pages/planning/index.wxss @@ -341,13 +341,14 @@ } .summary-item { + min-height: 116rpx; padding: 16rpx; } .summary-value { display: block; color: #17211f; - font-size: 34rpx; + font-size: 36rpx; font-weight: 800; } @@ -457,8 +458,8 @@ gap: 2rpx; overflow: hidden; padding: 6rpx 10rpx; - border-left: 8rpx solid #7ba7c7; - border-radius: 10px; + border-left: 6rpx solid #7ba7c7; + border-radius: 16rpx; background: #fff7ee; border-top: 1rpx solid rgba(58, 48, 34, 0.06); border-right: 1rpx solid rgba(58, 48, 34, 0.06); @@ -554,6 +555,10 @@ font-size: 22rpx; } +.week-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12rpx; } +.week-head-title { color: #17211f; font-size: 25rpx; font-weight: 600; } +.week-head-range { color: #71807a; font-size: 20rpx; } + .week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); @@ -572,7 +577,8 @@ } .week-day-card.active { - outline: 3rpx solid #8fb89a; + background: #e5f4ed; + border-color: #cfe4d9; } .week-name, @@ -796,7 +802,7 @@ } .month-cell { - min-height: 168rpx; + min-height: 136rpx; padding: 8rpx 5rpx; border-right: 1rpx solid #e7ece9; border-bottom: 1rpx solid #e7ece9; diff --git a/JC-Salon-WeChat/pages/profile/index.js b/JC-Salon-WeChat/pages/profile/index.js index b1be8665..0caa33ae 100644 --- a/JC-Salon-WeChat/pages/profile/index.js +++ b/JC-Salon-WeChat/pages/profile/index.js @@ -21,10 +21,21 @@ function resolveIdentityRole(type) { return '' } +const MANAGER_MENUS = [ + { title: '个人信息', url: '/pages/profile-edit/index' }, + { title: '店铺信息', url: '/pages/shop-settings/index' }, + { title: '账号安全', url: '/pages/account-settings/index' }, + { title: '订单数据', url: '/pages/export/index' }, + { title: '关于系统', url: '/pages/about/index' } +] + +const ARTIST_MENUS = MANAGER_MENUS.filter(item => item.title !== '店铺信息') + Page({ data: { roleText: '管理端', identityRole: '', + activeRole: '', profileCard: buildProfileCard({}, BRAND_CONFIG.defaultShopName), overviewLoading: false, overview: { @@ -37,13 +48,7 @@ Page({ shopOpen: true, shopStatus: '营业中' }, - menus: [ - { title: '个人信息', url: '/pages/profile-edit/index' }, - { title: '店铺信息', url: '/pages/shop-settings/index' }, - { title: '账号安全', url: '/pages/account-settings/index' }, - { title: '订单数据', url: '/pages/export/index' }, - { title: '关于系统', url: '/pages/about/index' } - ] + menus: MANAGER_MENUS }, onShow() { @@ -88,13 +93,26 @@ Page({ const app = getApp() const userInfo = app.globalData.userInfo || {} const fallbackShopName = app.globalData.shopName || BRAND_CONFIG.defaultShopName + const identityRole = resolveIdentityRole(userInfo.type) + const activeRole = this.data.activeRole || identityRole this.setData({ roleText: resolveRoleText(userInfo.type), - identityRole: resolveIdentityRole(userInfo.type), + identityRole, + activeRole, + menus: activeRole === 'artist' ? ARTIST_MENUS : MANAGER_MENUS, profileCard: buildProfileCard(userInfo, fallbackShopName) }) }, + switchRole(event) { + const role = event.currentTarget.dataset.role + if (!role || role === this.data.activeRole) return + this.setData({ + activeRole: role, + menus: role === 'artist' ? ARTIST_MENUS : MANAGER_MENUS + }) + }, + go(event) { wx.navigateTo({ url: event.currentTarget.dataset.url }) }, @@ -150,9 +168,13 @@ Page({ shopName: nextUserInfo.shopName || session.shopName, userInfo: nextUserInfo }) + const identityRole = resolveIdentityRole(nextUserInfo.type) + const activeRole = this.data.activeRole || identityRole this.setData({ roleText: resolveRoleText(nextUserInfo.type), - identityRole: resolveIdentityRole(nextUserInfo.type), + identityRole, + activeRole, + menus: activeRole === 'artist' ? ARTIST_MENUS : MANAGER_MENUS, profileCard: buildProfileCard(nextUserInfo, BRAND_CONFIG.defaultShopName) }) } diff --git a/JC-Salon-WeChat/pages/profile/index.wxml b/JC-Salon-WeChat/pages/profile/index.wxml index ecc85ed0..61fd49f4 100644 --- a/JC-Salon-WeChat/pages/profile/index.wxml +++ b/JC-Salon-WeChat/pages/profile/index.wxml @@ -11,8 +11,8 @@ - 店长 - 美甲师 + 店长 + 美甲师 {{roleText}} diff --git a/JC-Salon-WeChat/pages/register/index.js b/JC-Salon-WeChat/pages/register/index.js index 679abe47..f16353db 100644 --- a/JC-Salon-WeChat/pages/register/index.js +++ b/JC-Salon-WeChat/pages/register/index.js @@ -157,11 +157,15 @@ Page({ RETRY: '资料内容待重新审核,审核完成前不会展示', MISSING: '资料尚未进入审核,请联系门店负责人确认' }[moderationStatus] || '' + const submittedAt = result && result.createTime + ? this.formatSubmissionTime(new Date(String(result.createTime).replace('T', ' ').replace(/-/g, '/'))) + : '' return { registrationStatus: result || null, registrationStatusText: statusText, contentStatusText, - contentStatusReason: result && result.contentModerationReason || '' + contentStatusReason: result && result.contentModerationReason || '', + ...(submittedAt ? { applicationSubmittedAt: submittedAt } : {}) } }, diff --git a/JC-Salon-WeChat/pages/register/index.wxss b/JC-Salon-WeChat/pages/register/index.wxss index c381f6ee..26977b2c 100644 --- a/JC-Salon-WeChat/pages/register/index.wxss +++ b/JC-Salon-WeChat/pages/register/index.wxss @@ -238,7 +238,7 @@ display: flex; flex-direction: column; align-items: center; - padding-top: 64rpx; + padding-top: 48rpx; text-align: center; } @@ -246,12 +246,12 @@ display: flex; align-items: center; justify-content: center; - width: 92rpx; - height: 92rpx; + width: 144rpx; + height: 144rpx; border-radius: 50%; background: #e5f4ed; color: #247b63; - font-size: 48rpx; + font-size: 40rpx; font-weight: 800; } .result-icon.approved { background: #e5f4ed; color: #247b63; } @@ -259,14 +259,14 @@ .content-review-status { width: 100%; box-sizing: border-box; margin-top: 16rpx; padding: 16rpx 20rpx; border-radius: 12rpx; background: #f3f7f4; color: #587061; font-size: 22rpx; line-height: 1.5; } .content-review-reason { display: block; margin-top: 6rpx; color: #a24f42; } -.result-card .section-title { margin-top: 24rpx; } -.result-status { margin-top: 28rpx; padding: 18rpx 28rpx; border-radius: 12rpx; background: #e5f4ed; color: #75887b; font-size: 24rpx; } -.result-status text { color: #c28b47; font-weight: 700; } -.registration-details { width: 100%; box-sizing: border-box; margin-top: 20rpx; padding: 8rpx 18rpx; border-radius: 14rpx; background: #f3f8f3; text-align: left; } -.registration-detail { display: flex; align-items: flex-start; justify-content: space-between; gap: 20rpx; padding: 12rpx 0; border-bottom: 1rpx solid #e2ebe3; font-size: 22rpx; line-height: 1.45; } +.result-card .section-title { margin-top: 36rpx; } +.result-status { width: 100%; box-sizing: border-box; margin-top: 32rpx; color: #17211f; font-size: 25rpx; text-align: left; } +.result-status text { color: #d59a52; font-weight: 700; } +.registration-details { width: 100%; box-sizing: border-box; margin-top: 12rpx; padding: 0; background: transparent; text-align: left; } +.registration-detail { display: flex; align-items: flex-start; justify-content: space-between; gap: 20rpx; padding: 16rpx 0; border-bottom: 1rpx solid #ededed; font-size: 23rpx; line-height: 1.45; } .registration-detail:last-child { border-bottom: 0; } -.registration-detail text:first-child { flex: none; color: #8b9a91; } -.registration-detail text:last-child { min-width: 0; color: #425b4c; text-align: right; overflow-wrap: anywhere; } +.registration-detail text:first-child { flex: none; color: #71807a; } +.registration-detail text:last-child { min-width: 0; color: #17211f; text-align: right; overflow-wrap: anywhere; } .safe-note { margin-top: 28rpx; color: #9aa9a0; font-size: 21rpx; line-height: 1.5; text-align: center; } .avatar-pick-field { margin-top: 26rpx; } .avatar-pick {