From 960c042c17a8e6c73414bedfa337c2e438c8573d Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Mon, 12 Oct 2026 15:31:00 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E6=96=87=E6=A1=A3=EF=BC=9A=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E8=B5=84=E6=96=99=E5=BC=B9=E7=AA=97=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=A4=B4=E5=83=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...-10-12-salon资料弹窗默认头像优化-design.md | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 docs/superpowers/specs/2026-10-12-salon资料弹窗默认头像优化-design.md diff --git a/docs/superpowers/specs/2026-10-12-salon资料弹窗默认头像优化-design.md b/docs/superpowers/specs/2026-10-12-salon资料弹窗默认头像优化-design.md new file mode 100644 index 00000000..37cfef87 --- /dev/null +++ b/docs/superpowers/specs/2026-10-12-salon资料弹窗默认头像优化-design.md @@ -0,0 +1,28 @@ +# Salon 资料弹窗默认头像优化设计 + +## 目标 + +优化规划页首次资料完善弹窗中的头像选择区域:头像入口必须为圆形,并在用户尚未设置真实头像时显示统一的黑白人物轮廓,不再显示椭圆按钮、昵称首字或纯文字占位。 + +## 方案 + +- 将头像入口固定为圆形,图片使用 `aspectFill` 覆盖整个区域。 +- 新增本地黑白人物轮廓默认头像资源,避免依赖网络外链和首字生成。 +- `profileForm.avatar` 继续只保存真实头像地址;默认头像仅作为模板展示资源,保存时仍要求用户选择真实头像。 +- 圆形头像底部覆盖半透明“点击更换”提示,真实头像和默认头像下均可识别入口用途。 +- 上传期间禁止重复选择并显示“上传中”,上传失败后保留选择前状态。 + +## 验收 + +- 无真实头像时显示圆形黑白人物头像。 +- 有真实头像时圆形区域完整回显当前头像。 +- 点击头像仍能调用微信 `chooseAvatar`,成功后立即更新预览。 +- 默认图片地址不会作为用户头像提交。 +- 小程序页面测试、JavaScript 语法检查和差异检查通过。 + +## 实施清单 + +1. 增加本地默认人物头像资源。 +2. 调整规划页弹窗 WXML 与 WXSS。 +3. 补充默认头像与真实头像状态测试。 +4. 运行全量小程序测试并提交。 From 247472fcae32589fca5f1cb2b5a10ca3d3d09496 Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Mon, 12 Oct 2026 15:35:19 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E8=B5=84?= =?UTF-8?q?=E6=96=99=E5=BC=B9=E7=AA=97=E4=BD=BF=E7=94=A8=E5=9C=86=E5=BD=A2?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=A4=B4=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assets/images/default-user-avatar.png | Bin 0 -> 9205 bytes .../pages/planning/avatar-prompt.test.js | 16 ++++++ JC-Salon-WeChat/pages/planning/index.wxml | 5 +- JC-Salon-WeChat/pages/planning/index.wxss | 50 +++++++++++++++++- ...-10-12-salon资料弹窗默认头像优化-design.md | 2 +- 5 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 JC-Salon-WeChat/assets/images/default-user-avatar.png create mode 100644 JC-Salon-WeChat/pages/planning/avatar-prompt.test.js diff --git a/JC-Salon-WeChat/assets/images/default-user-avatar.png b/JC-Salon-WeChat/assets/images/default-user-avatar.png new file mode 100644 index 0000000000000000000000000000000000000000..703b5b23ceb3c41b6be03e0b783a119ec1b6763b GIT binary patch literal 9205 zcmW-nbzDW0Uk_KU;B^@zZn6$uXP z-3+8V_RjZ@`?;Uh?|shsK5=d=Okb0ll9dtw08nc^Q8NSph@k%tax#LX|6Nfz z;Y8$PsHp<@Jixw5XplH5>nQ^OHHlPL&q)bw3eP9zJ^%ns=f8vKmq)2R0KglkrKW8B z%6cdJ*?;WgDZj4MG$9wmiGg486V;l{vDWc5+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Iu?XC4zI_77MD z1%4Bez?^9AK3选择头像/) diff --git a/JC-Salon-WeChat/pages/planning/index.wxml b/JC-Salon-WeChat/pages/planning/index.wxml index da9a4d00..6f2ec1e4 100644 --- a/JC-Salon-WeChat/pages/planning/index.wxml +++ b/JC-Salon-WeChat/pages/planning/index.wxml @@ -33,7 +33,10 @@ 完善你的工作名片头像和昵称会用于门店协作展示,可暂时跳过。 - + diff --git a/JC-Salon-WeChat/pages/planning/index.wxss b/JC-Salon-WeChat/pages/planning/index.wxss index 55795a0e..ffd37c21 100644 --- a/JC-Salon-WeChat/pages/planning/index.wxss +++ b/JC-Salon-WeChat/pages/planning/index.wxss @@ -2,7 +2,55 @@ padding-top: 18rpx; } -.phone-banner { display:flex; align-items:center; margin-bottom:18rpx; padding:16rpx 18rpx; border-radius:14rpx; background:#fff2d8; color:#815f2b; overflow:hidden; }.phone-banner-track { display:flex; flex:1; width:0; gap:50rpx; white-space:nowrap; animation:phoneBannerScroll 10s linear infinite; font-size:22rpx; }.phone-banner-close { position:relative; z-index:2; margin-left:18rpx; padding:6rpx; background:#fff2d8; font-size:32rpx; }.profile-prompt-mask { position:fixed; z-index:30; inset:0; display:flex; align-items:center; justify-content:center; padding:40rpx; background:rgba(25,41,33,.55); }.profile-prompt { box-sizing:border-box; display:flex; width:100%; flex-direction:column; align-items:center; padding:36rpx; border-radius:24rpx; background:#fff; }.profile-prompt-title { color:#30483c; font-size:32rpx; font-weight:800; }.profile-prompt-desc { margin-top:10rpx; color:#89988f; font-size:22rpx; text-align:center; }.wechat-avatar { display:flex; align-items:center; justify-content:center; width:128rpx; height:128rpx; margin-top:28rpx; padding:0; border-radius:50%; background:#e6f0e9; color:#416c56; font-size:22rpx; overflow:hidden; }.wechat-avatar image { width:100%; height:100%; }.wechat-nickname { box-sizing:border-box; width:100%; height:80rpx; margin-top:24rpx; padding:0 22rpx; border:1rpx solid #dce8df; border-radius:13rpx; background:#f7faf8; }.profile-save { width:100%; height:80rpx; margin-top:22rpx; border-radius:14rpx; background:#35634d; color:#fff; line-height:80rpx; }.profile-skip { margin-top:12rpx; background:transparent; color:#7e8e85; font-size:23rpx; } +.phone-banner { display:flex; align-items:center; margin-bottom:18rpx; padding:16rpx 18rpx; border-radius:14rpx; background:#fff2d8; color:#815f2b; overflow:hidden; }.phone-banner-track { display:flex; flex:1; width:0; gap:50rpx; white-space:nowrap; animation:phoneBannerScroll 10s linear infinite; font-size:22rpx; }.phone-banner-close { position:relative; z-index:2; margin-left:18rpx; padding:6rpx; background:#fff2d8; font-size:32rpx; }.profile-prompt-mask { position:fixed; z-index:30; inset:0; display:flex; align-items:center; justify-content:center; padding:40rpx; background:rgba(25,41,33,.55); }.profile-prompt { box-sizing:border-box; display:flex; width:100%; flex-direction:column; align-items:center; padding:36rpx; border-radius:24rpx; background:#fff; }.profile-prompt-title { color:#30483c; font-size:32rpx; font-weight:800; }.profile-prompt-desc { margin-top:10rpx; color:#89988f; font-size:22rpx; text-align:center; }.wechat-nickname { box-sizing:border-box; width:100%; height:80rpx; margin-top:24rpx; padding:0 22rpx; border:1rpx solid #dce8df; border-radius:13rpx; background:#f7faf8; }.profile-save { width:100%; height:80rpx; margin-top:22rpx; border-radius:14rpx; background:#35634d; color:#fff; line-height:80rpx; }.profile-skip { margin-top:12rpx; background:transparent; color:#7e8e85; font-size:23rpx; } + +.wechat-avatar { + position: relative; + display: block; + flex: none; + width: 144rpx; + min-width: 144rpx; + max-width: 144rpx; + height: 144rpx; + min-height: 144rpx; + max-height: 144rpx; + margin-top: 28rpx; + padding: 0; + overflow: hidden; + border: 2rpx solid #d8dfdb; + border-radius: 50%; + background: #f3f4f3; + line-height: 1; +} + +.wechat-avatar[disabled] { + opacity: 0.78; +} + +.wechat-avatar-image { + display: block; + width: 100%; + height: 100%; +} + +.wechat-avatar-image.is-default { + box-sizing: border-box; + padding: 12rpx; +} + +.wechat-avatar-hint { + position: absolute; + right: 0; + bottom: 0; + left: 0; + height: 38rpx; + background: rgba(22, 27, 25, 0.68); + color: #fff; + font-size: 19rpx; + font-weight: 600; + line-height: 38rpx; + text-align: center; +} @keyframes phoneBannerScroll { from { transform:translateX(0); } to { transform:translateX(-48%); } } .today-btn { diff --git a/docs/superpowers/specs/2026-10-12-salon资料弹窗默认头像优化-design.md b/docs/superpowers/specs/2026-10-12-salon资料弹窗默认头像优化-design.md index 37cfef87..b513dda1 100644 --- a/docs/superpowers/specs/2026-10-12-salon资料弹窗默认头像优化-design.md +++ b/docs/superpowers/specs/2026-10-12-salon资料弹窗默认头像优化-design.md @@ -7,7 +7,7 @@ ## 方案 - 将头像入口固定为圆形,图片使用 `aspectFill` 覆盖整个区域。 -- 新增本地黑白人物轮廓默认头像资源,避免依赖网络外链和首字生成。 +- 新增本地 PNG 黑白人物轮廓默认头像资源,避免依赖网络外链、首字生成和 SVG 兼容差异。 - `profileForm.avatar` 继续只保存真实头像地址;默认头像仅作为模板展示资源,保存时仍要求用户选择真实头像。 - 圆形头像底部覆盖半透明“点击更换”提示,真实头像和默认头像下均可识别入口用途。 - 上传期间禁止重复选择并显示“上传中”,上传失败后保留选择前状态。 From e4aff0803a068129e7869b80767be5a9ed25749a Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Mon, 12 Oct 2026 16:45:42 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=9A=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=BA=97=E9=95=BF=E5=91=98=E5=B7=A5=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E4=B8=8E=E7=99=BB=E5=BD=95=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AdminWorkbenchRegistrationController.java | 10 +- ...orkbenchRegistrationApplicationMapper.java | 5 + .../service/WorkbenchRegistrationService.java | 6 +- .../WorkbenchRegistrationServiceImpl.java | 83 +++++++-- .../WorkbenchRegistrationReviewSummaryVO.java | 11 ++ .../vo/WorkbenchRegistrationReviewVO.java | 27 +++ ...enchRegistrationControllerMappingTest.java | 5 + JC-Salon-Frontend/src/api/admin.ts | 4 + .../src/views/admin/SystemSettingsView.vue | 51 +++++- JC-Salon-WeChat/api/employees.js | 27 +++ JC-Salon-WeChat/app-login-flow.test.js | 5 + JC-Salon-WeChat/app.js | 16 +- JC-Salon-WeChat/employees-review.test.js | 37 ++++ JC-Salon-WeChat/pages/employees/index.js | 107 +++++++++++ JC-Salon-WeChat/pages/employees/index.test.js | 52 ++++++ JC-Salon-WeChat/pages/employees/index.wxml | 31 ++++ JC-Salon-WeChat/pages/employees/index.wxss | 169 +++++++++++++++++- JC-Salon-WeChat/pages/login/index.js | 2 +- JC-Salon-WeChat/pages/planning/index.js | 37 +++- JC-Salon-WeChat/pages/planning/index.test.js | 20 ++- .../店长员工审核提醒参数_20261012.sql | 35 ++++ ...026-10-12-店长员工审核与登录提醒-design.md | 35 ++++ scripts/店长员工审核提醒参数说明_20261012.md | 18 ++ 23 files changed, 769 insertions(+), 24 deletions(-) create mode 100644 JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/registration/vo/WorkbenchRegistrationReviewSummaryVO.java create mode 100644 JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/registration/vo/WorkbenchRegistrationReviewVO.java create mode 100644 JC-Salon-WeChat/employees-review.test.js create mode 100644 JC-Salon-WeChat/pages/employees/index.test.js create mode 100644 docs/scripts/sql/versions/店长员工审核提醒参数_20261012.sql create mode 100644 docs/superpowers/specs/2026-10-12-店长员工审核与登录提醒-design.md create mode 100644 scripts/店长员工审核提醒参数说明_20261012.md diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/registration/controller/AdminWorkbenchRegistrationController.java b/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/registration/controller/AdminWorkbenchRegistrationController.java index f28b3584..88d74924 100644 --- a/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/registration/controller/AdminWorkbenchRegistrationController.java +++ b/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/registration/controller/AdminWorkbenchRegistrationController.java @@ -2,8 +2,9 @@ package com.xiaowang.jacyucloudsalon.core.modules.registration.controller; import com.xiaowang.jacyucloudsalon.core.common.Result; import com.xiaowang.jacyucloudsalon.core.modules.registration.dto.WorkbenchRegistrationRejectDTO; -import com.xiaowang.jacyucloudsalon.core.modules.registration.entity.WorkbenchRegistrationApplicationDO; import com.xiaowang.jacyucloudsalon.core.modules.registration.service.WorkbenchRegistrationService; +import com.xiaowang.jacyucloudsalon.core.modules.registration.vo.WorkbenchRegistrationReviewSummaryVO; +import com.xiaowang.jacyucloudsalon.core.modules.registration.vo.WorkbenchRegistrationReviewVO; import com.xiaowang.jacyucloudsalon.core.modules.user.entity.UserDO; import com.xiaowang.jacyucloudsalon.core.modules.user.mapper.UserMapper; import org.springframework.web.bind.annotation.GetMapping; @@ -28,12 +29,17 @@ public class AdminWorkbenchRegistrationController { } @GetMapping("/list") - public Result> list(HttpServletRequest request) { + public Result> list(HttpServletRequest request) { Long userId = requireUserId(request); UserDO user = userMapper.selectById(userId); return Result.success(registrationService.listForReviewer(userId, isPlatformAdmin(user))); } + @GetMapping("/summary") + public Result summary(HttpServletRequest request) { + return Result.success(registrationService.getReviewSummary(requireUserId(request))); + } + @PostMapping("/{id}/approve") public Result approve(HttpServletRequest request, @PathVariable Long id) { Long userId = requireUserId(request); diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/registration/mapper/WorkbenchRegistrationApplicationMapper.java b/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/registration/mapper/WorkbenchRegistrationApplicationMapper.java index 565ce2fe..2484cca4 100644 --- a/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/registration/mapper/WorkbenchRegistrationApplicationMapper.java +++ b/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/registration/mapper/WorkbenchRegistrationApplicationMapper.java @@ -2,6 +2,11 @@ package com.xiaowang.jacyucloudsalon.core.modules.registration.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.xiaowang.jacyucloudsalon.core.modules.registration.entity.WorkbenchRegistrationApplicationDO; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; public interface WorkbenchRegistrationApplicationMapper extends BaseMapper { + + @Select("SELECT * FROM t_workbench_registration_application WHERE id = #{id} AND is_delete = 0 FOR UPDATE") + WorkbenchRegistrationApplicationDO selectByIdForUpdate(@Param("id") Long id); } diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/registration/service/WorkbenchRegistrationService.java b/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/registration/service/WorkbenchRegistrationService.java index 1779df78..b879bedd 100644 --- a/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/registration/service/WorkbenchRegistrationService.java +++ b/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/registration/service/WorkbenchRegistrationService.java @@ -1,7 +1,8 @@ package com.xiaowang.jacyucloudsalon.core.modules.registration.service; import com.xiaowang.jacyucloudsalon.core.modules.registration.dto.WorkbenchRegistrationRequestDTO; -import com.xiaowang.jacyucloudsalon.core.modules.registration.entity.WorkbenchRegistrationApplicationDO; +import com.xiaowang.jacyucloudsalon.core.modules.registration.vo.WorkbenchRegistrationReviewSummaryVO; +import com.xiaowang.jacyucloudsalon.core.modules.registration.vo.WorkbenchRegistrationReviewVO; import com.xiaowang.jacyucloudsalon.core.modules.registration.vo.WorkbenchRegistrationStatusVO; import java.util.List; @@ -10,7 +11,8 @@ public interface WorkbenchRegistrationService { WorkbenchRegistrationStatusVO register(WorkbenchRegistrationRequestDTO request); WorkbenchRegistrationStatusVO getStatus(Long userId); WorkbenchRegistrationStatusVO resubmit(WorkbenchRegistrationRequestDTO request); - List listForReviewer(Long reviewerId, boolean platformAdmin); + List listForReviewer(Long reviewerId, boolean platformAdmin); + WorkbenchRegistrationReviewSummaryVO getReviewSummary(Long reviewerId); boolean approve(Long reviewerId, boolean platformAdmin, Long applicationId); boolean reject(Long reviewerId, boolean platformAdmin, Long applicationId, String reason); } diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/registration/service/impl/WorkbenchRegistrationServiceImpl.java b/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/registration/service/impl/WorkbenchRegistrationServiceImpl.java index 9aff03ff..204018fc 100644 --- a/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/registration/service/impl/WorkbenchRegistrationServiceImpl.java +++ b/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/registration/service/impl/WorkbenchRegistrationServiceImpl.java @@ -7,6 +7,8 @@ import com.xiaowang.jacyucloudsalon.core.modules.registration.entity.WorkbenchRe import com.xiaowang.jacyucloudsalon.core.modules.registration.entity.WorkbenchRegistrationStatus; import com.xiaowang.jacyucloudsalon.core.modules.registration.mapper.WorkbenchRegistrationApplicationMapper; import com.xiaowang.jacyucloudsalon.core.modules.registration.service.WorkbenchRegistrationService; +import com.xiaowang.jacyucloudsalon.core.modules.registration.vo.WorkbenchRegistrationReviewSummaryVO; +import com.xiaowang.jacyucloudsalon.core.modules.registration.vo.WorkbenchRegistrationReviewVO; import com.xiaowang.jacyucloudsalon.core.modules.registration.vo.WorkbenchRegistrationStatusVO; import com.xiaowang.jacyucloudsalon.core.modules.integration.service.WechatMiniAuthService; import com.xiaowang.jacyucloudsalon.core.modules.integration.dto.WechatMiniRegistrationTicket; @@ -18,13 +20,19 @@ import com.xiaowang.jacyucloudsalon.core.modules.shop.mapper.UserShopBindingMapp import com.xiaowang.jacyucloudsalon.core.modules.user.entity.UserDO; import com.xiaowang.jacyucloudsalon.core.modules.user.mapper.UserMapper; import com.xiaowang.jacyucloudsalon.core.modules.user.service.UserService; +import com.xiaowang.jacyucloudsalon.core.modules.system.service.SystemParameterConfigService; +import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.StringUtils; import java.time.LocalDateTime; import java.util.List; +import java.util.Map; +import java.util.Objects; import java.util.UUID; +import java.util.function.Function; +import java.util.stream.Collectors; @Service public class WorkbenchRegistrationServiceImpl implements WorkbenchRegistrationService { @@ -35,6 +43,7 @@ public class WorkbenchRegistrationServiceImpl implements WorkbenchRegistrationSe private final UserShopBindingSupport userShopBindingSupport; private final UserShopBindingMapper userShopBindingMapper; private final WechatMiniAuthService wechatMiniAuthService; + private final SystemParameterConfigService systemParameterConfigService; public WorkbenchRegistrationServiceImpl( WorkbenchRegistrationApplicationMapper applicationMapper, @@ -43,7 +52,8 @@ public class WorkbenchRegistrationServiceImpl implements WorkbenchRegistrationSe UserService userService, UserShopBindingSupport userShopBindingSupport, UserShopBindingMapper userShopBindingMapper, - WechatMiniAuthService wechatMiniAuthService + WechatMiniAuthService wechatMiniAuthService, + SystemParameterConfigService systemParameterConfigService ) { this.applicationMapper = applicationMapper; this.userMapper = userMapper; @@ -52,6 +62,7 @@ public class WorkbenchRegistrationServiceImpl implements WorkbenchRegistrationSe this.userShopBindingSupport = userShopBindingSupport; this.userShopBindingMapper = userShopBindingMapper; this.wechatMiniAuthService = wechatMiniAuthService; + this.systemParameterConfigService = systemParameterConfigService; } @Override @@ -158,13 +169,38 @@ public class WorkbenchRegistrationServiceImpl implements WorkbenchRegistrationSe } @Override - public List listForReviewer(Long reviewerId, boolean platformAdmin) { + public List listForReviewer(Long reviewerId, boolean platformAdmin) { + List applications; if (platformAdmin) { - return applicationMapper.selectList(Wrappers.lambdaQuery(WorkbenchRegistrationApplicationDO.class).eq(WorkbenchRegistrationApplicationDO::getStatus, WorkbenchRegistrationStatus.PENDING_ADMIN).eq(WorkbenchRegistrationApplicationDO::getIsDelete, 0).orderByAsc(WorkbenchRegistrationApplicationDO::getCreateTime)); + applications = applicationMapper.selectList(Wrappers.lambdaQuery(WorkbenchRegistrationApplicationDO.class).eq(WorkbenchRegistrationApplicationDO::getStatus, WorkbenchRegistrationStatus.PENDING_ADMIN).eq(WorkbenchRegistrationApplicationDO::getIsDelete, 0).orderByAsc(WorkbenchRegistrationApplicationDO::getCreateTime)); + } else { + UserDO reviewer = requireManager(reviewerId); + applications = applicationMapper.selectList(Wrappers.lambdaQuery(WorkbenchRegistrationApplicationDO.class).eq(WorkbenchRegistrationApplicationDO::getStatus, WorkbenchRegistrationStatus.PENDING_MANAGER).eq(WorkbenchRegistrationApplicationDO::getShopId, reviewer.getShopId()).eq(WorkbenchRegistrationApplicationDO::getIsDelete, 0).orderByAsc(WorkbenchRegistrationApplicationDO::getCreateTime)); } - UserDO reviewer = userMapper.selectById(reviewerId); - require(reviewer != null && Integer.valueOf(2).equals(reviewer.getType()), "仅店长可以审核店员申请"); - return applicationMapper.selectList(Wrappers.lambdaQuery(WorkbenchRegistrationApplicationDO.class).eq(WorkbenchRegistrationApplicationDO::getStatus, WorkbenchRegistrationStatus.PENDING_MANAGER).eq(WorkbenchRegistrationApplicationDO::getShopId, reviewer.getShopId()).eq(WorkbenchRegistrationApplicationDO::getIsDelete, 0).orderByAsc(WorkbenchRegistrationApplicationDO::getCreateTime)); + List applicantIds = applications.stream() + .map(WorkbenchRegistrationApplicationDO::getUserId) + .filter(Objects::nonNull) + .distinct() + .collect(Collectors.toList()); + Map applicants = applicantIds.isEmpty() + ? Map.of() + : userMapper.selectBatchIds(applicantIds).stream() + .collect(Collectors.toMap(UserDO::getId, Function.identity())); + return applications.stream() + .map(application -> toReviewVO(application, applicants.get(application.getUserId()))) + .collect(Collectors.toList()); + } + + @Override + public WorkbenchRegistrationReviewSummaryVO getReviewSummary(Long reviewerId) { + UserDO reviewer = requireManager(reviewerId); + Long pendingCount = applicationMapper.selectCount(Wrappers.lambdaQuery(WorkbenchRegistrationApplicationDO.class) + .eq(WorkbenchRegistrationApplicationDO::getStatus, WorkbenchRegistrationStatus.PENDING_MANAGER) + .eq(WorkbenchRegistrationApplicationDO::getShopId, reviewer.getShopId()) + .eq(WorkbenchRegistrationApplicationDO::getIsDelete, 0)); + boolean noticeEnabled = "true".equalsIgnoreCase(systemParameterConfigService.getEnabledValue( + "WORKBENCH", "MANAGER_REGISTRATION_REVIEW_NOTICE")); + return new WorkbenchRegistrationReviewSummaryVO(pendingCount == null ? 0L : pendingCount, noticeEnabled); } @Override @@ -204,14 +240,16 @@ public class WorkbenchRegistrationServiceImpl implements WorkbenchRegistrationSe } private WorkbenchRegistrationApplicationDO loadReviewable(Long reviewerId, boolean platformAdmin, Long applicationId) { - WorkbenchRegistrationApplicationDO application = applicationMapper.selectById(applicationId); - require(application != null && WorkbenchRegistrationStatus.REJECTED.equals(application.getStatus()) == false, "审核申请不存在或已处理"); + WorkbenchRegistrationApplicationDO application = applicationMapper.selectByIdForUpdate(applicationId); + require(application != null, "审核申请不存在或已处理"); if (platformAdmin) { require(WorkbenchRegistrationStatus.PENDING_ADMIN.equals(application.getStatus()), "管理员只能审核店长申请"); + require(WorkbenchRegistrationRole.MANAGER.equals(application.getRoleType()), "管理员只能审核店长申请"); } else { - UserDO reviewer = userMapper.selectById(reviewerId); - require(reviewer != null && Integer.valueOf(2).equals(reviewer.getType()) && reviewer.getShopId().equals(application.getShopId()), "无权审核该店铺申请"); + UserDO reviewer = requireManager(reviewerId); + require(Objects.equals(reviewer.getShopId(), application.getShopId()), "无权审核该店铺申请"); require(WorkbenchRegistrationStatus.PENDING_MANAGER.equals(application.getStatus()), "店长只能审核店员申请"); + require(WorkbenchRegistrationRole.STAFF.equals(application.getRoleType()), "店长只能审核店员申请"); } return application; } @@ -224,6 +262,31 @@ public class WorkbenchRegistrationServiceImpl implements WorkbenchRegistrationSe return new WorkbenchRegistrationStatusVO(application.getId(), application.getApplicationNo(), application.getRoleType(), application.getStatus(), application.getRejectReason(), application.getShopId(), application.getShopName()); } + private WorkbenchRegistrationReviewVO toReviewVO(WorkbenchRegistrationApplicationDO application, UserDO applicant) { + WorkbenchRegistrationReviewVO review = new WorkbenchRegistrationReviewVO(); + BeanUtils.copyProperties(application, review); + if (applicant != null) { + review.setApplicantNickname(applicant.getNickname()); + review.setApplicantAvatar(applicant.getAvatar()); + review.setApplicantMaskedPhone(maskPhone(applicant.getPhone())); + } + return review; + } + + private UserDO requireManager(Long reviewerId) { + UserDO reviewer = userMapper.selectById(reviewerId); + require(reviewer != null && Integer.valueOf(2).equals(reviewer.getType()) && reviewer.getShopId() != null, + "仅店长可以审核店员申请"); + return reviewer; + } + + private String maskPhone(String phone) { + if (!StringUtils.hasText(phone) || phone.length() < 7) { + return ""; + } + return phone.substring(0, 3) + "****" + phone.substring(phone.length() - 4); + } + private String requireText(String value, String message) { require(StringUtils.hasText(value), message); return value.trim(); diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/registration/vo/WorkbenchRegistrationReviewSummaryVO.java b/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/registration/vo/WorkbenchRegistrationReviewSummaryVO.java new file mode 100644 index 00000000..0d85a5f4 --- /dev/null +++ b/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/registration/vo/WorkbenchRegistrationReviewSummaryVO.java @@ -0,0 +1,11 @@ +package com.xiaowang.jacyucloudsalon.core.modules.registration.vo; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public class WorkbenchRegistrationReviewSummaryVO { + private final long pendingCount; + private final boolean noticeEnabled; +} diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/registration/vo/WorkbenchRegistrationReviewVO.java b/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/registration/vo/WorkbenchRegistrationReviewVO.java new file mode 100644 index 00000000..c58dd35b --- /dev/null +++ b/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/registration/vo/WorkbenchRegistrationReviewVO.java @@ -0,0 +1,27 @@ +package com.xiaowang.jacyucloudsalon.core.modules.registration.vo; + +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Getter +@Setter +public class WorkbenchRegistrationReviewVO { + private Long id; + private String applicationNo; + private Long userId; + private String roleType; + private Long shopId; + private String shopName; + private String shopAddress; + private String status; + private Long reviewerId; + private LocalDateTime reviewedAt; + private String rejectReason; + private LocalDateTime createTime; + private LocalDateTime updateTime; + private String applicantNickname; + private String applicantAvatar; + private String applicantMaskedPhone; +} diff --git a/JC-Salon-Core/src/test/java/com/xiaowang/jacyucloudsalon/core/modules/registration/controller/WorkbenchRegistrationControllerMappingTest.java b/JC-Salon-Core/src/test/java/com/xiaowang/jacyucloudsalon/core/modules/registration/controller/WorkbenchRegistrationControllerMappingTest.java index 23be5eef..9938e2d3 100644 --- a/JC-Salon-Core/src/test/java/com/xiaowang/jacyucloudsalon/core/modules/registration/controller/WorkbenchRegistrationControllerMappingTest.java +++ b/JC-Salon-Core/src/test/java/com/xiaowang/jacyucloudsalon/core/modules/registration/controller/WorkbenchRegistrationControllerMappingTest.java @@ -27,5 +27,10 @@ class WorkbenchRegistrationControllerMappingTest { GetMapping listMapping = listMethod.getAnnotation(GetMapping.class); assertNotNull(listMapping); assertEquals("/list", Arrays.stream(listMapping.value()).findFirst().orElse("")); + + Method summaryMethod = AdminWorkbenchRegistrationController.class.getMethod("summary", javax.servlet.http.HttpServletRequest.class); + GetMapping summaryMapping = summaryMethod.getAnnotation(GetMapping.class); + assertNotNull(summaryMapping); + assertEquals("/summary", Arrays.stream(summaryMapping.value()).findFirst().orElse("")); } } diff --git a/JC-Salon-Frontend/src/api/admin.ts b/JC-Salon-Frontend/src/api/admin.ts index d4240b76..90a90a39 100644 --- a/JC-Salon-Frontend/src/api/admin.ts +++ b/JC-Salon-Frontend/src/api/admin.ts @@ -1983,6 +1983,10 @@ export interface WorkbenchRegistrationApplication { status: 'PENDING_ADMIN' | 'PENDING_MANAGER' | 'APPROVED' | 'REJECTED' rejectReason?: string createTime?: string + updateTime?: string + applicantNickname?: string + applicantAvatar?: string + applicantMaskedPhone?: string } export const adminWorkbenchRegistrationApi = { diff --git a/JC-Salon-Frontend/src/views/admin/SystemSettingsView.vue b/JC-Salon-Frontend/src/views/admin/SystemSettingsView.vue index e0aebab3..51efcef9 100644 --- a/JC-Salon-Frontend/src/views/admin/SystemSettingsView.vue +++ b/JC-Salon-Frontend/src/views/admin/SystemSettingsView.vue @@ -27,6 +27,20 @@ 保存默认密码 + + + + + + + 保存审核提醒设置 + + @@ -38,7 +52,9 @@ import { adminSystemParameterConfigApi, type SystemParameterConfigVO } from '@/a const loading = ref(false) const saving = ref(false) const savingSmsProvider = ref(false) +const savingReviewNotice = ref(false) const enabled = ref(true) +const reviewNoticeEnabled = ref(true) const form = reactive({ configGroup: 'USER', configKey: 'DEFAULT_PASSWORD', @@ -55,13 +71,22 @@ const smsProviderForm = reactive({ configGroup: 'SMS', configKey: 'SMS_PROVIDER', configName: '短信供应商', configValue: 'SPUG', enabled: 1, remark: '全局切换短信供应商时同步验证码模板和 MessageHub 通道' }) +const reviewNoticeForm = reactive({ + configGroup: 'WORKBENCH', + configKey: 'MANAGER_REGISTRATION_REVIEW_NOTICE', + configName: '店长员工审核提醒', + configValue: 'true', + enabled: 1, + remark: '控制店长登录小程序后是否显式提示当前门店的待审核员工申请' +}) const load = async () => { loading.value = true try { - const [configs, smsConfigs] = await Promise.all([ + const [configs, smsConfigs, workbenchConfigs] = await Promise.all([ adminSystemParameterConfigApi.listConfigs('USER'), - adminSystemParameterConfigApi.listConfigs('SMS') + adminSystemParameterConfigApi.listConfigs('SMS'), + adminSystemParameterConfigApi.listConfigs('WORKBENCH') ]) const config = configs.find(item => item.configKey === 'DEFAULT_PASSWORD') if (config) { @@ -70,6 +95,11 @@ const load = async () => { } const smsProvider = smsConfigs.find(item => item.configKey === 'SMS_PROVIDER') if (smsProvider) Object.assign(smsProviderForm, smsProvider) + const reviewNotice = workbenchConfigs.find(item => item.configKey === 'MANAGER_REGISTRATION_REVIEW_NOTICE') + if (reviewNotice) { + Object.assign(reviewNoticeForm, reviewNotice) + reviewNoticeEnabled.value = reviewNotice.enabled === 1 && String(reviewNotice.configValue).toLowerCase() === 'true' + } } catch (error) { message.error(error instanceof Error ? error.message : '默认密码加载失败') } finally { @@ -113,6 +143,23 @@ const save = async () => { } } +const saveReviewNotice = async () => { + savingReviewNotice.value = true + try { + await adminSystemParameterConfigApi.saveConfig({ + ...reviewNoticeForm, + configValue: 'true', + enabled: reviewNoticeEnabled.value ? 1 : 0 + }) + message.success(reviewNoticeEnabled.value ? '店长员工审核提醒已开启' : '店长员工审核提醒已关闭') + await load() + } catch (error) { + message.error(error instanceof Error ? error.message : '审核提醒设置保存失败') + } finally { + savingReviewNotice.value = false + } +} + onMounted(() => { void load() }) diff --git a/JC-Salon-WeChat/api/employees.js b/JC-Salon-WeChat/api/employees.js index 9f3f02b4..6e86502b 100644 --- a/JC-Salon-WeChat/api/employees.js +++ b/JC-Salon-WeChat/api/employees.js @@ -66,5 +66,32 @@ module.exports = { method: 'POST', data }) + }, + + reviewSummary() { + return request({ + url: '/user/workbench/registration/summary' + }) + }, + + reviewApplications() { + return request({ + url: '/user/workbench/registration/list' + }) + }, + + approveApplication(id) { + return request({ + url: `/user/workbench/registration/${id}/approve`, + method: 'POST' + }) + }, + + rejectApplication(id, reason) { + return request({ + url: `/user/workbench/registration/${id}/reject`, + method: 'POST', + data: { reason } + }) } } diff --git a/JC-Salon-WeChat/app-login-flow.test.js b/JC-Salon-WeChat/app-login-flow.test.js index 1d55b4dd..3f9e4270 100644 --- a/JC-Salon-WeChat/app-login-flow.test.js +++ b/JC-Salon-WeChat/app-login-flow.test.js @@ -27,6 +27,8 @@ function reset(preference) { navigations.length = 0 appDefinition.globalData.userInfo = null appDefinition.globalData.wechatLoginState = null + appDefinition.globalData.reviewNoticeShown = true + appDefinition.globalData.openEmployeeReview = true codeSequence = 0 } @@ -40,6 +42,8 @@ async function run() { assert.strictEqual(appDefinition.globalData.userInfo.id, 1) assert.strictEqual(statusCalled, false) assert.strictEqual(codeSequence, 1) + assert.strictEqual(appDefinition.globalData.reviewNoticeShown, false) + assert.strictEqual(appDefinition.globalData.openEmployeeReview, false) reset({ rememberMe: false }) let quickLoginCalled = false @@ -66,6 +70,7 @@ async function run() { appDefinition.logoutDevice() assert.strictEqual(storage[LOGIN_PREFERENCE_KEY], undefined) assert.strictEqual(appDefinition.globalData.userInfo, null) + assert.strictEqual(appDefinition.globalData.reviewNoticeShown, false) } run().catch(error => { diff --git a/JC-Salon-WeChat/app.js b/JC-Salon-WeChat/app.js index ad652d57..b2c39486 100644 --- a/JC-Salon-WeChat/app.js +++ b/JC-Salon-WeChat/app.js @@ -9,7 +9,9 @@ App({ shopName: BRAND_CONFIG.defaultShopName, userInfo: null, planningNeedRefresh: false, - wechatLoginState: null + wechatLoginState: null, + reviewNoticeShown: false, + openEmployeeReview: false }, onLaunch() { @@ -55,7 +57,7 @@ App({ }) this.publishWechatLoginState(result) if (result.status === 'SUCCESS' && result.accessToken) { - this.setSession(result) + this.setSession(result, true) wx.reLaunch({ url: '/pages/planning/index' }) return } @@ -96,7 +98,11 @@ App({ } }, - setSession(session) { + setSession(session, newLoginSession = false) { + if (newLoginSession) { + this.globalData.reviewNoticeShown = false + this.globalData.openEmployeeReview = false + } auth.setSession(session) this.bootstrapSession() }, @@ -105,6 +111,8 @@ App({ auth.clearSession() profileCache.invalidate() this.globalData.userInfo = null + this.globalData.reviewNoticeShown = false + this.globalData.openEmployeeReview = false }, logoutDevice() { @@ -112,5 +120,7 @@ App({ profileCache.invalidate() this.globalData.userInfo = null this.globalData.wechatLoginState = null + this.globalData.reviewNoticeShown = false + this.globalData.openEmployeeReview = false } }) diff --git a/JC-Salon-WeChat/employees-review.test.js b/JC-Salon-WeChat/employees-review.test.js new file mode 100644 index 00000000..39852986 --- /dev/null +++ b/JC-Salon-WeChat/employees-review.test.js @@ -0,0 +1,37 @@ +const assert = require('assert') + +const requests = [] +const storage = {} +global.wx = { + getAccountInfoSync: () => ({ miniProgram: { envVersion: 'develop' } }), + getDeviceInfo: () => ({ platform: 'devtools' }), + getStorageSync: key => storage[key] || '', + setStorageSync: (key, value) => { storage[key] = value }, + removeStorageSync: key => { delete storage[key] }, + request: options => { + requests.push(options) + options.success({ statusCode: 200, data: { code: 200, data: {} } }) + } +} +global.getApp = () => ({ clearSession: () => {}, goLogin: () => {} }) + +const employeesApi = require('./api/employees') + +async function run() { + await employeesApi.reviewSummary() + await employeesApi.reviewApplications() + await employeesApi.approveApplication(12) + await employeesApi.rejectApplication(12, '资料不完整') + + assert.deepStrictEqual(requests.map(item => [item.method || 'GET', item.url, item.data]), [ + ['GET', 'http://127.0.0.1:80/api/admin/user/workbench/registration/summary', undefined], + ['GET', 'http://127.0.0.1:80/api/admin/user/workbench/registration/list', undefined], + ['POST', 'http://127.0.0.1:80/api/admin/user/workbench/registration/12/approve', undefined], + ['POST', 'http://127.0.0.1:80/api/admin/user/workbench/registration/12/reject', { reason: '资料不完整' }] + ]) +} + +run().catch(error => { + console.error(error) + process.exitCode = 1 +}) diff --git a/JC-Salon-WeChat/pages/employees/index.js b/JC-Salon-WeChat/pages/employees/index.js index d351c82f..e4add4f8 100644 --- a/JC-Salon-WeChat/pages/employees/index.js +++ b/JC-Salon-WeChat/pages/employees/index.js @@ -12,10 +12,28 @@ function buildScheduleSummary(item) { return time ? `${mode} ${time}` : mode } +function formatApplicationTime(value) { + if (!value) return '' + return String(value).replace('T', ' ').slice(0, 16) +} + +function confirmModal(options) { + return new Promise(resolve => { + wx.showModal({ ...options, success: resolve, fail: () => resolve({ confirm: false }) }) + }) +} + Page({ data: { employees: [], loadError: '', + isManager: false, + reviewExpanded: false, + reviewApplications: [], + reviewPendingCount: 0, + reviewLoading: false, + reviewError: '', + reviewingId: '', createModalVisible: false, creating: false, createForm: { @@ -31,7 +49,96 @@ Page({ }, onLoad() { + const userInfo = getApp().globalData.userInfo || {} + this.setData({ isManager: Number(userInfo.type) === 2 }) this.loadEmployees() + if (Number(userInfo.type) === 2) this.loadReviewSummary() + }, + + onShow() { + const app = getApp() + if (!this.data.isManager || !app.globalData.openEmployeeReview) return + app.globalData.openEmployeeReview = false + this.setData({ reviewExpanded: true }) + return this.loadReviewApplications() + }, + + async loadReviewSummary() { + if (!this.data.isManager) return + try { + const summary = await employeesApi.reviewSummary() + this.setData({ reviewPendingCount: Number(summary.pendingCount || 0) }) + } catch (error) { + // 审核摘要失败不影响员工列表。 + } + }, + + toggleReview() { + if (!this.data.isManager) return + const reviewExpanded = !this.data.reviewExpanded + this.setData({ reviewExpanded }) + if (reviewExpanded) this.loadReviewApplications() + }, + + async loadReviewApplications() { + if (!this.data.isManager || this.data.reviewLoading) return + this.setData({ reviewLoading: true, reviewError: '' }) + try { + const data = await employeesApi.reviewApplications() + const applications = (Array.isArray(data) ? data : []).map(item => ({ + ...item, + applicantNickname: item.applicantNickname || '待审核员工', + applicantAvatar: item.applicantAvatar || '', + applicantMaskedPhone: item.applicantMaskedPhone || '', + applicationTimeText: formatApplicationTime(item.createTime) + })) + this.setData({ reviewApplications: applications, reviewPendingCount: applications.length }) + } catch (error) { + this.setData({ reviewError: error.message || '审核申请加载失败' }) + } finally { + this.setData({ reviewLoading: false }) + } + }, + + async approveApplication(event) { + const id = event.currentTarget.dataset.id + if (!id || this.data.reviewingId) return + const result = await confirmModal({ title: '通过员工申请', content: '确认允许该员工加入当前门店吗?' }) + if (!result.confirm) return + await this.submitReview(id, () => employeesApi.approveApplication(id), '申请已通过') + }, + + async rejectApplication(event) { + const id = event.currentTarget.dataset.id + if (!id || this.data.reviewingId) return + const result = await confirmModal({ + title: '驳回员工申请', + content: '', + editable: true, + placeholderText: '请输入驳回原因', + confirmText: '确认驳回' + }) + if (!result.confirm) return + const reason = String(result.content || '').trim() + if (!reason) { + wx.showToast({ title: '请输入驳回原因', icon: 'none' }) + return + } + await this.submitReview(id, () => employeesApi.rejectApplication(id, reason), '申请已驳回') + }, + + async submitReview(id, action, successMessage) { + this.setData({ reviewingId: String(id) }) + try { + await action() + wx.showToast({ title: successMessage, icon: 'success' }) + await Promise.all([this.loadReviewApplications(), this.loadEmployees()]) + } catch (error) { + wx.showToast({ title: error.message || '申请状态已变化,请刷新重试', icon: 'none' }) + await this.loadReviewApplications() + } finally { + this.setData({ reviewingId: '' }) + } }, async loadEmployees() { diff --git a/JC-Salon-WeChat/pages/employees/index.test.js b/JC-Salon-WeChat/pages/employees/index.test.js new file mode 100644 index 00000000..3d118dce --- /dev/null +++ b/JC-Salon-WeChat/pages/employees/index.test.js @@ -0,0 +1,52 @@ +const assert = require('assert') + +global.wx = { + getAccountInfoSync: () => ({ miniProgram: { envVersion: 'develop' } }), + getDeviceInfo: () => ({ platform: 'devtools' }), + getStorageSync: () => '', + setStorageSync: () => {}, + removeStorageSync: () => {} +} + +const appMock = { + globalData: { + userInfo: { type: 2 }, + openEmployeeReview: true + } +} +global.getApp = () => appMock + +let definition +global.Page = value => { definition = value } +require('./index') + +function createPage() { + return { + ...definition, + data: { ...definition.data, isManager: true }, + setData(values) { Object.assign(this.data, values) } + } +} + +async function run() { + const employeesApi = require('../../api/employees') + employeesApi.reviewApplications = async () => [{ + id: 12, + applicationNo: 'SALON-001', + applicantNickname: '小周', + createTime: '2026-10-12T10:30:00' + }] + + const page = createPage() + await page.onShow() + + assert.strictEqual(appMock.globalData.openEmployeeReview, false) + assert.strictEqual(page.data.reviewExpanded, true) + assert.strictEqual(page.data.reviewPendingCount, 1) + assert.strictEqual(page.data.reviewApplications[0].applicationTimeText, '2026-10-12 10:30') +} + +run().catch(error => { + console.error(error) + process.exitCode = 1 +}) diff --git a/JC-Salon-WeChat/pages/employees/index.wxml b/JC-Salon-WeChat/pages/employees/index.wxml index 8ae50780..469ebcd1 100644 --- a/JC-Salon-WeChat/pages/employees/index.wxml +++ b/JC-Salon-WeChat/pages/employees/index.wxml @@ -1,9 +1,40 @@ 美甲师 + + + + 员工申请审核仅显示当前门店待处理申请 + {{reviewPendingCount}} 项 + + 正在加载申请… + + {{reviewError}} + + + 暂无待审核员工申请 + + + + + {{item.applicantNickname}} + {{item.applicantMaskedPhone}} + {{item.shopName || '当前门店'}} · {{item.applicationTimeText}} + 申请编号 {{item.applicationNo}} + + + + + + + + + {{loadError}} diff --git a/JC-Salon-WeChat/pages/employees/index.wxss b/JC-Salon-WeChat/pages/employees/index.wxss index 8cc01799..045fcdbd 100644 --- a/JC-Salon-WeChat/pages/employees/index.wxss +++ b/JC-Salon-WeChat/pages/employees/index.wxss @@ -9,7 +9,7 @@ font-weight: 800; } -.list-heading text { +.list-heading > text { flex: 1; } @@ -17,6 +17,173 @@ margin-left: auto; } +.list-heading .review-toggle { + position: relative; + margin-right: 12rpx; + margin-left: 0; + border-color: #c9d8d2; + background: #eef5f2; + color: #2f6f62; +} + +.list-heading .review-toggle.is-open { + background: #2f6f62; + color: #fff; +} + +.review-badge { + display: inline-flex; + align-items: center; + justify-content: center; + min-width: 30rpx; + height: 30rpx; + margin-left: 8rpx; + padding: 0 7rpx; + border-radius: 999rpx; + background: #d9685f; + color: #fff; + font-size: 19rpx; + line-height: 30rpx; +} + +.review-panel { + margin-bottom: 22rpx; + padding: 22rpx; + border: 1rpx solid #dce8e3; + background: #f8fcfa; +} + +.review-panel-head, +.review-item, +.review-actions { + display: flex; + align-items: center; +} + +.review-panel-head { + justify-content: space-between; + margin-bottom: 16rpx; +} + +.review-title, +.review-subtitle, +.review-name, +.review-meta, +.review-number { + display: block; +} + +.review-title { + color: #25211d; + font-size: 28rpx; + font-weight: 900; +} + +.review-subtitle { + margin-top: 4rpx; + color: #8b847c; + font-size: 21rpx; +} + +.review-count { + color: #2f6f62; + font-size: 23rpx; + font-weight: 800; +} + +.review-list { + display: grid; + gap: 14rpx; +} + +.review-item { + gap: 14rpx; + padding: 18rpx; + border-radius: 20rpx; + background: #fff; + box-shadow: 0 5rpx 18rpx rgba(47, 111, 98, 0.07); +} + +.review-avatar { + flex: 0 0 auto; + width: 72rpx; + height: 72rpx; + border-radius: 50%; + background: #eee9e1; +} + +.review-info { + min-width: 0; + flex: 1; +} + +.review-name { + color: #28231f; + font-size: 27rpx; + font-weight: 900; +} + +.review-meta, +.review-number { + margin-top: 4rpx; + overflow: hidden; + color: #817a72; + font-size: 20rpx; + text-overflow: ellipsis; + white-space: nowrap; +} + +.review-number { + color: #aaa198; + font-size: 18rpx; +} + +.review-actions { + flex: 0 0 auto; + gap: 8rpx; +} + +.review-action { + width: auto; + min-width: 82rpx; + height: 54rpx; + margin: 0; + padding: 0 15rpx; + border-radius: 999rpx; + font-size: 21rpx; + font-weight: 800; + line-height: 54rpx; +} + +.review-action.reject { + border: 1rpx solid #e7c7c2; + background: #fff5f3; + color: #a8554e; +} + +.review-action.approve { + border: 1rpx solid #2f6f62; + background: #2f6f62; + color: #fff; +} + +.review-state { + padding: 34rpx 12rpx; + color: #8c857d; + font-size: 23rpx; + text-align: center; +} + +.review-state.review-error { + color: #a8554e; +} + +.review-retry { + width: 150rpx; + min-width: 150rpx; + margin: 16rpx auto 0; +} + .employee-card { display: flex; align-items: center; diff --git a/JC-Salon-WeChat/pages/login/index.js b/JC-Salon-WeChat/pages/login/index.js index 6279f833..b94bb08a 100644 --- a/JC-Salon-WeChat/pages/login/index.js +++ b/JC-Salon-WeChat/pages/login/index.js @@ -183,7 +183,7 @@ Page({ }, finishLogin(result) { - getApp().setSession(result) + getApp().setSession(result, true) auth.setLoginPreference(this.data.rememberMe ? { rememberMe: true, preferredShopId: result.userInfo && result.userInfo.shopId, diff --git a/JC-Salon-WeChat/pages/planning/index.js b/JC-Salon-WeChat/pages/planning/index.js index 0163a490..4e93a4ff 100644 --- a/JC-Salon-WeChat/pages/planning/index.js +++ b/JC-Salon-WeChat/pages/planning/index.js @@ -5,6 +5,7 @@ const auth = require('../../utils/auth') const { uploadProfileImage } = require('../../utils/upload') const { normalizeAvatar } = require('../../utils/profile-card') const profileCache = require('../../utils/profile-cache') +const employeesApi = require('../../api/employees') function canCreateAppointment() { const app = getApp() @@ -110,6 +111,7 @@ Page({ }, async refreshAccountPrompts() { + let shouldShowProfilePrompt = false try { const profile = await profileCache.getProfile() const session = auth.getSession() @@ -119,14 +121,47 @@ Page({ const missingNickname = !String(profile.nickname || '').trim() || String(profile.nickname).startsWith('微信用户') const avatar = normalizeAvatar(profile.avatar) const skipped = wx.getStorageSync(auth.PROFILE_PROMPT_SKIPPED_KEY) === '1' + shouldShowProfilePrompt = !skipped && (missingNickname || !avatar) this.setData({ phoneBannerVisible: Number(profile.phoneVerified) !== 1 && dismissed !== today, - profilePromptVisible: !skipped && (missingNickname || !avatar), + profilePromptVisible: false, profileForm: { nickname: missingNickname ? '' : profile.nickname, avatar } }) } catch (error) { // 资料提醒失败不影响规划数据。 } + const navigatedToReview = await this.showEmployeeReviewNotice() + if (!navigatedToReview) { + this.setData({ profilePromptVisible: shouldShowProfilePrompt }) + } + }, + + async showEmployeeReviewNotice() { + const app = getApp() + const userInfo = app.globalData.userInfo || {} + if (Number(userInfo.type) !== 2 || app.globalData.reviewNoticeShown) return false + let summary + try { + summary = await employeesApi.reviewSummary() + } catch (error) { + return false + } + if (!summary.noticeEnabled || Number(summary.pendingCount || 0) <= 0) return false + app.globalData.reviewNoticeShown = true + const result = await new Promise(resolve => { + wx.showModal({ + title: '有员工申请待审核', + content: `当前有 ${summary.pendingCount} 条员工加入申请,是否立即处理?`, + cancelText: '稍后处理', + confirmText: '立即审核', + success: resolve, + fail: () => resolve({ confirm: false }) + }) + }) + if (!result.confirm) return false + app.globalData.openEmployeeReview = true + wx.switchTab({ url: '/pages/employees/index' }) + return true }, openAccountSettings() { wx.navigateTo({ url: '/pages/account-settings/index' }) }, diff --git a/JC-Salon-WeChat/pages/planning/index.test.js b/JC-Salon-WeChat/pages/planning/index.test.js index fb31ab3f..f3007179 100644 --- a/JC-Salon-WeChat/pages/planning/index.test.js +++ b/JC-Salon-WeChat/pages/planning/index.test.js @@ -7,9 +7,12 @@ global.wx = { getStorageSync: () => '', setStorageSync: () => {}, removeStorageSync: () => {}, - showToast: () => {} + showToast: () => {}, + showModal: ({ success }) => success({ confirm: false }), + switchTab: () => {} } -global.getApp = () => ({ globalData: { userInfo: {} } }) +const appMock = { globalData: { userInfo: {} } } +global.getApp = () => appMock let definition global.Page = value => { definition = value } @@ -69,6 +72,19 @@ async function run() { assert.strictEqual(calendarRequests, 1) resolveCalendar({ artists: [], appointments: [], daySummaries: [] }) await Promise.all([requestOne, requestTwo]) + + const employeesApi = require('../../api/employees') + const noticePage = createPage() + appMock.globalData.userInfo = { type: 2 } + appMock.globalData.reviewNoticeShown = false + employeesApi.reviewSummary = async () => ({ pendingCount: 2, noticeEnabled: true }) + let switched = false + global.wx.showModal = ({ success }) => success({ confirm: true }) + global.wx.switchTab = ({ url }) => { switched = url === '/pages/employees/index' } + assert.strictEqual(await noticePage.showEmployeeReviewNotice(), true) + assert.strictEqual(switched, true) + assert.strictEqual(appMock.globalData.reviewNoticeShown, true) + assert.strictEqual(appMock.globalData.openEmployeeReview, true) } run().catch(error => { diff --git a/docs/scripts/sql/versions/店长员工审核提醒参数_20261012.sql b/docs/scripts/sql/versions/店长员工审核提醒参数_20261012.sql new file mode 100644 index 00000000..818b43f3 --- /dev/null +++ b/docs/scripts/sql/versions/店长员工审核提醒参数_20261012.sql @@ -0,0 +1,35 @@ +USE jayucloud_salon; + +START TRANSACTION; + +INSERT INTO t_system_parameter_config ( + id, + config_group, + config_key, + config_name, + config_value, + enabled, + remark, + create_time, + update_time, + is_delete +) +VALUES ( + 313931273555139020, + 'WORKBENCH', + 'MANAGER_REGISTRATION_REVIEW_NOTICE', + '店长员工审核提醒', + 'true', + 1, + '控制店长登录小程序后是否显式提示当前门店的待审核员工申请', + NOW(), + NOW(), + 0 +) +ON DUPLICATE KEY UPDATE + config_name = VALUES(config_name), + remark = VALUES(remark), + is_delete = 0, + update_time = NOW(); + +COMMIT; diff --git a/docs/superpowers/specs/2026-10-12-店长员工审核与登录提醒-design.md b/docs/superpowers/specs/2026-10-12-店长员工审核与登录提醒-design.md new file mode 100644 index 00000000..a95cc9d4 --- /dev/null +++ b/docs/superpowers/specs/2026-10-12-店长员工审核与登录提醒-design.md @@ -0,0 +1,35 @@ +# 店长员工审核与登录提醒设计 + +## 目标 + +店长可在小程序员工页直接处理当前门店的员工注册申请。存在待审核申请时,系统根据后台动态参数,在每次成功登录会话中最多提醒一次,并提供直达审核区域的入口。 + +## 交互与数据流 + +1. 店长进入员工页时获取待审核摘要,并在“审核”按钮显示数量角标。 +2. 点击“审核”后在当前页面展开申请列表;通过操作需要确认,驳回操作必须填写原因。 +3. 登录进入规划页后获取审核摘要。开关开启且数量大于零时优先显示审核提醒。 +4. 点击“立即审核”切换到员工 Tab 并自动展开申请列表;点击“稍后处理”后本会话不再提醒,再继续处理资料完善弹窗。 +5. 摘要、列表或提醒请求失败不阻断员工列表、登录及规划页数据。 + +## 权限与一致性 + +- 只有 `type=2` 的店长可以读取本门店 `PENDING_MANAGER` 申请和执行审核。 +- 平台管理员继续通过原后台入口处理 `PENDING_ADMIN` 店长申请。 +- 审核事务使用数据库行锁串行处理同一申请,避免重复通过、驳回或权限同步。 +- 列表接口返回展示 VO,补充申请人的昵称、头像和脱敏手机号,不暴露 OpenID。 + +## 动态参数 + +参数 `WORKBENCH / MANAGER_REGISTRATION_REVIEW_NOTICE` 存储于 `t_system_parameter_config`。`config_value=true` 且 `enabled=1` 时显示登录提醒;停用只隐藏提醒,不关闭审核功能。 + +## 验收重点 + +- 店长仅能查看和审核本门店员工申请。 +- 通过后员工账号及门店关系启用,列表和角标同步减少;驳回原因不能为空。 +- 自动登录、手动登录和多门店确认登录均建立新的提醒会话。 +- 审核提醒与资料完善弹窗不重叠,审核提醒优先。 + +## 实施验证记录 + +当前 Codex 会话未提供 GitNexus `impact` 与 `detect_changes` 工具,因此无法执行图谱级影响分析和提交前变更检测。实施中改用静态调用链检索、Git 差异范围检查、Core 编译与单元测试、小程序测试、后台单元测试与生产构建进行替代验证。 diff --git a/scripts/店长员工审核提醒参数说明_20261012.md b/scripts/店长员工审核提醒参数说明_20261012.md new file mode 100644 index 00000000..309d74fa --- /dev/null +++ b/scripts/店长员工审核提醒参数说明_20261012.md @@ -0,0 +1,18 @@ +# 店长员工审核提醒参数说明 + +## 参数 + +- 分组:`WORKBENCH` +- 键:`MANAGER_REGISTRATION_REVIEW_NOTICE` +- 值:`true` +- 启用状态:`enabled=1` 时显示登录提醒,`enabled=0` 时隐藏登录提醒。 + +该参数存储在 `t_system_parameter_config`,由后台“系统设置”页面动态管理。它只控制店长成功登录小程序后的待审核弹窗,不影响员工页面的审核入口、待审核数量及审核能力。 + +## 发布步骤 + +1. 发布后端、后台和小程序代码。 +2. 在目标 Salon 数据库执行 `docs/scripts/sql/versions/店长员工审核提醒参数_20261012.sql`。 +3. 使用平台管理员进入后台“系统设置”,确认“店长员工审核提醒”状态。 + +脚本可重复执行,重复执行不会覆盖管理员已经选择的启用或停用状态。本次仓库变更不会连接或修改任何实际数据库及 Nacos 环境。 From 2714bd7201ec53d9450b4e0748ea30284e48c5e6 Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Mon, 12 Oct 2026 17:15:27 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E8=A7=84?= =?UTF-8?q?=E5=88=92=E6=97=A5=E6=9C=9F=E5=BF=AB=E6=8D=B7=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E9=A2=84=E7=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JC-Salon-WeChat/pages/planning/index.js | 35 +++++++++++------- JC-Salon-WeChat/pages/planning/index.test.js | 37 ++++++++++++++++++- JC-Salon-WeChat/pages/planning/index.wxml | 4 +- ...026-10-12-规划页日期快速新增预约-design.md | 22 +++++++++++ 4 files changed, 82 insertions(+), 16 deletions(-) create mode 100644 docs/superpowers/specs/2026-10-12-规划页日期快速新增预约-design.md diff --git a/JC-Salon-WeChat/pages/planning/index.js b/JC-Salon-WeChat/pages/planning/index.js index 4e93a4ff..abb3ee04 100644 --- a/JC-Salon-WeChat/pages/planning/index.js +++ b/JC-Salon-WeChat/pages/planning/index.js @@ -51,9 +51,9 @@ Page({ data: { viewMode: 'month', viewModes: [ - { value: 'day', label: '日' }, + { value: 'month', label: '月' }, { value: 'week', label: '周' }, - { value: 'month', label: '月' } + { value: 'day', label: '日' } ], monthDisplayMode: 'count', monthDisplayModes: [ @@ -234,14 +234,17 @@ Page({ this.loadCalendar() }, - 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() + quickCreateAppointment(event) { + if (!this.data.canCreateAppointment) { + wx.showToast({ title: '当前账号仅支持查看预约', icon: 'none' }) + return + } + const appointmentDate = dateUtil.formatDate(event.currentTarget.dataset.date) + if (appointmentDate < dateUtil.formatDate(new Date())) { + wx.showToast({ title: '不能为历史日期新增预约', icon: 'none' }) + return + } + this.openAppointmentForm(appointmentDate) }, prevRange() { @@ -545,9 +548,15 @@ Page({ wx.showToast({ title: '当前账号仅支持查看预约', icon: 'none' }) return } - wx.navigateTo({ - url: `/pages/appointment-form/index?date=${this.data.currentDateText}&artistId=${this.data.selectedArtistId || ''}` - }) + this.openAppointmentForm(this.data.currentDateText) + }, + + openAppointmentForm(appointmentDate) { + const query = [`date=${encodeURIComponent(appointmentDate)}`] + if (this.data.selectedArtistId) { + query.push(`artistId=${encodeURIComponent(this.data.selectedArtistId)}`) + } + wx.navigateTo({ url: `/pages/appointment-form/index?${query.join('&')}` }) }, openAppointment(event) { diff --git a/JC-Salon-WeChat/pages/planning/index.test.js b/JC-Salon-WeChat/pages/planning/index.test.js index f3007179..4682b513 100644 --- a/JC-Salon-WeChat/pages/planning/index.test.js +++ b/JC-Salon-WeChat/pages/planning/index.test.js @@ -1,5 +1,6 @@ const assert = require('assert') const planningApi = require('../../api/planning') +const dateUtil = require('../../utils/date') global.wx = { getAccountInfoSync: () => ({ miniProgram: { envVersion: 'develop' } }), @@ -9,7 +10,8 @@ global.wx = { removeStorageSync: () => {}, showToast: () => {}, showModal: ({ success }) => success({ confirm: false }), - switchTab: () => {} + switchTab: () => {}, + navigateTo: () => {} } const appMock = { globalData: { userInfo: {} } } global.getApp = () => appMock @@ -41,6 +43,9 @@ function createPage(data = {}) { } async function run() { + assert.deepStrictEqual(definition.data.viewModes.map(item => item.value), ['month', 'week', 'day']) + assert.strictEqual(definition.data.viewMode, 'month') + const page = createPage({ viewMode: 'week' }) let monthBuilds = 0 let weekBuilds = 0 @@ -85,6 +90,36 @@ async function run() { assert.strictEqual(switched, true) assert.strictEqual(appMock.globalData.reviewNoticeShown, true) assert.strictEqual(appMock.globalData.openEmployeeReview, true) + + const navigations = [] + const toasts = [] + global.wx.navigateTo = options => navigations.push(options.url) + global.wx.showToast = options => toasts.push(options.title) + + const quickCreatePage = createPage({ canCreateAppointment: true, selectedArtistId: '88' }) + const today = dateUtil.formatDate(new Date()) + quickCreatePage.quickCreateAppointment({ currentTarget: { dataset: { date: today } } }) + assert.strictEqual(navigations.pop(), `/pages/appointment-form/index?date=${today}&artistId=88`) + + quickCreatePage.quickCreateAppointment({ currentTarget: { dataset: { date: '2099-12-31' } } }) + assert.strictEqual(navigations.pop(), '/pages/appointment-form/index?date=2099-12-31&artistId=88') + + quickCreatePage.data.selectedArtistId = '' + quickCreatePage.quickCreateAppointment({ currentTarget: { dataset: { date: '2099-11-30' } } }) + assert.strictEqual(navigations.pop(), '/pages/appointment-form/index?date=2099-11-30') + + quickCreatePage.quickCreateAppointment({ currentTarget: { dataset: { date: '2000-01-01' } } }) + assert.strictEqual(navigations.length, 0) + assert.strictEqual(toasts.pop(), '不能为历史日期新增预约') + + const readonlyPage = createPage({ canCreateAppointment: false, selectedArtistId: '88' }) + readonlyPage.quickCreateAppointment({ currentTarget: { dataset: { date: '2099-12-31' } } }) + assert.strictEqual(navigations.length, 0) + assert.strictEqual(toasts.pop(), '当前账号仅支持查看预约') + + const fabPage = createPage({ canCreateAppointment: true, currentDateText: '2026-10-12', selectedArtistId: '99' }) + fabPage.createAppointment() + assert.strictEqual(navigations.pop(), '/pages/appointment-form/index?date=2026-10-12&artistId=99') } run().catch(error => { diff --git a/JC-Salon-WeChat/pages/planning/index.wxml b/JC-Salon-WeChat/pages/planning/index.wxml index 6f2ec1e4..7103e842 100644 --- a/JC-Salon-WeChat/pages/planning/index.wxml +++ b/JC-Salon-WeChat/pages/planning/index.wxml @@ -99,7 +99,7 @@ - + {{item.weekName}} {{item.day}} {{item.totalCount}}单 @@ -140,7 +140,7 @@ {{item}} - + {{item.day}} 满 diff --git a/docs/superpowers/specs/2026-10-12-规划页日期快速新增预约-design.md b/docs/superpowers/specs/2026-10-12-规划页日期快速新增预约-design.md new file mode 100644 index 00000000..fe3cefed --- /dev/null +++ b/docs/superpowers/specs/2026-10-12-规划页日期快速新增预约-design.md @@ -0,0 +1,22 @@ +# 规划页日期快速新增预约设计 + +## 目标 + +规划页视图入口按“月、周、日”排列。月视图和周视图中的日期点击统一改为快速新增预约,减少先进入日视图再点击新增的操作步骤。 + +## 交互 + +- 默认保持月视图,日视图仍可通过顶部“日”按钮进入。 +- 点击月历或周视图中的今天、未来日期,直接进入新增预约页并预填所点日期。 +- 当前筛选具体员工时一并传递员工 ID;“全部员工”状态下不预选员工。 +- 历史日期禁止新增并显示明确提示;只读员工优先提示无新增权限。 +- 月历中跨月显示的未来日期与本月日期行为一致。 +- 右下角“+”按钮继续按当前规划日期和员工筛选条件进入新增预约。 + +## 技术边界 + +复用新增预约页已有的 `date`、`artistId` 查询参数,不修改后端接口、数据库、Nacos、后台管理或 ArtList。 + +## 验证 + +覆盖视图顺序、默认视图、月周快速新增、员工参数、全部员工、历史日期、只读权限、跨月未来日期和原“+”按钮行为。当前会话未提供 GitNexus `impact` 与 `detect_changes` 工具,使用静态引用检查、小程序测试和 Git 差异检查替代。 From fa1fed006e7ca7c6fad3bb1d4384563b15319cc1 Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Mon, 12 Oct 2026 17:37:51 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E9=A2=84?= =?UTF-8?q?=E7=BA=A6=E4=BD=9C=E5=93=81=E5=BC=B9=E5=B1=82=E6=BB=9A=E5=8A=A8?= =?UTF-8?q?=E7=A9=BF=E9=80=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/appointment-form/index.js | 3 + .../pages/appointment-form/index.wxml | 72 ++++++++++--------- .../pages/appointment-form/index.wxss | 16 ++++- .../appointment-form/modal-scroll.test.js | 14 ++++ .../2026-10-12-预约作品弹层滚动修复-design.md | 16 +++++ 5 files changed, 84 insertions(+), 37 deletions(-) create mode 100644 JC-Salon-WeChat/pages/appointment-form/modal-scroll.test.js create mode 100644 docs/superpowers/specs/2026-10-12-预约作品弹层滚动修复-design.md diff --git a/JC-Salon-WeChat/pages/appointment-form/index.js b/JC-Salon-WeChat/pages/appointment-form/index.js index a027f887..f642a0f2 100644 --- a/JC-Salon-WeChat/pages/appointment-form/index.js +++ b/JC-Salon-WeChat/pages/appointment-form/index.js @@ -454,6 +454,9 @@ Page({ stopTap() { }, + stopTouchMove() { + }, + onProductSearch(event) { this.setData({ productKeyword: event.detail.value }) this.refreshProductCards() diff --git a/JC-Salon-WeChat/pages/appointment-form/index.wxml b/JC-Salon-WeChat/pages/appointment-form/index.wxml index 47fa1bc3..3515a539 100644 --- a/JC-Salon-WeChat/pages/appointment-form/index.wxml +++ b/JC-Salon-WeChat/pages/appointment-form/index.wxml @@ -79,7 +79,7 @@ {{conflictTip}} - + @@ -88,44 +88,46 @@ × - - {{productError}} - - - 图 - - - {{item.title}} - {{item.priceText}} - - {{item.artistText}} · {{item.durationText || '时长待定'}} - - {{tag}} + + + {{productError}} + + + 图 + + + {{item.title}} + {{item.priceText}} + + {{item.artistText}} · {{item.durationText || '时长待定'}} + + {{tag}} + + 暂无匹配作品 + + + 手动新增预约作品 + + + + +