diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/user/service/impl/UserServiceImpl.java b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/user/service/impl/UserServiceImpl.java index 547d964a..0ffc6eb4 100644 --- a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/user/service/impl/UserServiceImpl.java +++ b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/user/service/impl/UserServiceImpl.java @@ -370,10 +370,10 @@ public class UserServiceImpl extends ServiceImpl implements @Override @Transactional(rollbackFor = Exception.class) public Long createUser(UserDTO userDTO) { - return createUserInternal(userDTO, false); + return createUserInternal(userDTO); } - private Long createUserInternal(UserDTO userDTO, boolean allowMissingCustomerPhone) { + private Long createUserInternal(UserDTO userDTO) { String validatedAccount = AccountValidationUtils.requireValidAccount(userDTO.getAccount()); // 检查账号是否已存在 UserDO existingUser = findUserByAccount(validatedAccount); @@ -390,7 +390,7 @@ public class UserServiceImpl extends ServiceImpl implements Long validatedShopId = pickPrimaryShopId(validatedShopIds); Integer userType = userDTO.getType(); String validatedPhone = Integer.valueOf(0).equals(userType) - ? validateCustomerPhone(userDTO.getPhone(), !(allowMissingCustomerPhone && Integer.valueOf(0).equals(userType))) + ? validateCustomerPhone(userDTO.getPhone(), false) : validateUserPhone(userDTO.getPhone(), null, true); String validatedWechatId = UserProfileFieldSupport.normalizeOptionalText(userDTO.getWechatId()); if (Integer.valueOf(0).equals(userType)) { @@ -532,7 +532,7 @@ public class UserServiceImpl extends ServiceImpl implements customer.setShopIds(List.of(shopId)); customer.setLevel(VIP_LEVEL_NORMAL); customer.setVipId(0L); - return createUserInternal(customer, true); + return createUserInternal(customer); } @Override @@ -665,7 +665,9 @@ public class UserServiceImpl extends ServiceImpl implements userDO.setPassword(passwordEncoder.encode(userDTO.getPassword())); } if (userDTO.getPhone() != null) { - userDO.setPhone(validateUserPhone(userDTO.getPhone(), id, true)); + userDO.setPhone(Integer.valueOf(0).equals(userDO.getType()) + ? validateCustomerPhone(userDTO.getPhone(), false) + : validateUserPhone(userDTO.getPhone(), id, true)); } if (userDTO.getContactPhone() != null) { userDO.setContactPhone(UserProfileFieldSupport.normalizeOptionalText(userDTO.getContactPhone())); @@ -733,6 +735,9 @@ public class UserServiceImpl extends ServiceImpl implements userDO.setCustomerIdentityHash(customerIdentityHash(userDO.getNickname(), userDO.getWechatId(), customerPhone)); } else { userDO.setCustomerIdentityHash(null); + if (StringUtils.hasText(userDO.getPhone()) && !isDeletedPlaceholderPhone(userDO.getPhone())) { + ensurePhoneNotUsed(userDO.getPhone(), id); + } } List validatedShopIds = null; boolean shopBindingChanged = userDTO.getShopIds() != null || userDTO.getShopId() != null; @@ -3234,6 +3239,7 @@ public class UserServiceImpl extends ServiceImpl implements private void ensurePhoneNotUsed(String phone, Long currentUserId) { LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(UserDO.class) .eq(UserDO::getPhoneHash, phoneCrypto.index(phone)) + .ne(UserDO::getType, 0) .eq(UserDO::getIsDelete, 0); if (currentUserId != null) { wrapper.ne(UserDO::getId, currentUserId); @@ -3347,6 +3353,7 @@ public class UserServiceImpl extends ServiceImpl implements String normalized = phone.trim(); UserDO user = userMapper.selectOne(Wrappers.lambdaQuery(UserDO.class) .eq(UserDO::getPhoneHash, phoneCrypto.index(normalized)) + .ne(UserDO::getType, 0) .eq(UserDO::getIsDelete, 0) .last("limit 1")); if (user == null) { diff --git a/JC-Salon-Core/src/main/resources/db/migration/V8__客户联系方式去重和美甲师专属颜色_20261029.sql b/JC-Salon-Core/src/main/resources/db/migration/V8__客户联系方式去重和美甲师专属颜色_20261029.sql index 67f1de48..ca0b4603 100644 --- a/JC-Salon-Core/src/main/resources/db/migration/V8__客户联系方式去重和美甲师专属颜色_20261029.sql +++ b/JC-Salon-Core/src/main/resources/db/migration/V8__客户联系方式去重和美甲师专属颜色_20261029.sql @@ -93,6 +93,10 @@ CALL salon_v8_add_column_if_missing( 't_user', 'active_customer_identity_hash', 'char(64) GENERATED ALWAYS AS (CASE WHEN type = 0 AND COALESCE(is_delete, 0) = 0 THEN customer_identity_hash ELSE NULL END) STORED COMMENT ''有效客户组合身份索引''' ); +CALL salon_v8_add_column_if_missing( + 't_user', 'active_service_phone_hash', + 'char(64) GENERATED ALWAYS AS (CASE WHEN type <> 0 AND COALESCE(is_delete, 0) = 0 THEN phone_hash ELSE NULL END) STORED COMMENT ''有效員工和管理員手机号唯一索引''' +); CALL salon_v8_add_column_if_missing( 't_nail_artist_info', 'color', 'varchar(7) NULL COMMENT ''美甲师规划专属颜色''' @@ -103,6 +107,9 @@ CALL salon_v8_add_index_if_missing('t_user', 'idx_user_phone_hash', '(`phone_has CALL salon_v8_add_unique_index_if_missing( 't_user', 'uk_user_active_customer_identity_hash', '(`active_customer_identity_hash`)' ); +CALL salon_v8_add_unique_index_if_missing( + 't_user', 'uk_user_active_service_phone_hash', '(`active_service_phone_hash`)' +); DROP PROCEDURE IF EXISTS salon_v8_add_column_if_missing; DROP PROCEDURE IF EXISTS salon_v8_add_index_if_missing; diff --git a/JC-Salon-WeChat/pages/employee-create/index.js b/JC-Salon-WeChat/pages/employee-create/index.js index c2d3fbaf..5f960386 100644 --- a/JC-Salon-WeChat/pages/employee-create/index.js +++ b/JC-Salon-WeChat/pages/employee-create/index.js @@ -147,7 +147,7 @@ Page({ status: 1, remark: '新建美甲师默认全天可预约,可在排班设置中调整' }).then(() => { - this.finishCreated(!this.data.pickerMode, false) + this.finishCreated(!this.data.pickerMode, true) }).catch(error => { wx.showModal({ title: '默认排班设置失败', diff --git a/JC-Salon-WeChat/pages/employee-create/index.wxml b/JC-Salon-WeChat/pages/employee-create/index.wxml index b78e183e..02de22ca 100644 --- a/JC-Salon-WeChat/pages/employee-create/index.wxml +++ b/JC-Salon-WeChat/pages/employee-create/index.wxml @@ -53,8 +53,9 @@ ✓ 美甲师已创建 {{pickerMode ? '设置常规排班后,可继续把当前预约分配给该美甲师。' : '为新美甲师设置首个常规排班,之后即可正常承接预约。'}} + 不立即设置时,将默认全年无休、全天可预约(00:00-23:59),之后可在排班设置中调整。 - + diff --git a/JC-Salon-WeChat/pages/employee-create/index.wxss b/JC-Salon-WeChat/pages/employee-create/index.wxss index 1ec7a624..4f1c34da 100644 --- a/JC-Salon-WeChat/pages/employee-create/index.wxss +++ b/JC-Salon-WeChat/pages/employee-create/index.wxss @@ -136,5 +136,6 @@ .onboarding-title { margin-top: 22rpx; color: #17211f; font-size: 32rpx; font-weight: 900; } .onboarding-desc { margin-top: 12rpx; color: #837b72; font-size: 23rpx; line-height: 1.7; text-align: center; } +.onboarding-default-note { margin-top: 14rpx; padding: 14rpx 16rpx; border-radius: 12rpx; background: #eff7f2; color: #39705d; font-size: 21rpx; line-height: 1.55; text-align: left; } .onboarding-primary { width: 100%; margin-top: 30rpx; } .onboarding-skip { margin-top: 12rpx; background: transparent; color: #7e776f; font-size: 23rpx; } diff --git a/JC-Salon-WeChat/pages/planning/index.js b/JC-Salon-WeChat/pages/planning/index.js index e5a7b426..531ae68f 100644 --- a/JC-Salon-WeChat/pages/planning/index.js +++ b/JC-Salon-WeChat/pages/planning/index.js @@ -493,7 +493,7 @@ Page({ return { ...item, top: Math.max(0, itemStart - startMinute) * minuteScale + laneHeaderHeight, - height: Math.max(100, (item.durationMinutes || 60) * minuteScale), + height: Math.max(60, (item.durationMinutes || 60) * minuteScale), compact: Number(item.durationMinutes || 60) <= 15, timeText: resolveAppointmentTimeText(item) } @@ -508,7 +508,7 @@ Page({ return { ...item, top: Math.max(0, itemStart - startMinute) * minuteScale + laneHeaderHeight, - height: Math.max(100, (item.durationMinutes || 60) * minuteScale), + height: Math.max(60, (item.durationMinutes || 60) * minuteScale), compact: Number(item.durationMinutes || 60) <= 15, timeText: resolveAppointmentTimeText(item) } diff --git a/JC-Salon-WeChat/pages/planning/index.wxml b/JC-Salon-WeChat/pages/planning/index.wxml index 0950c886..3a67550b 100644 --- a/JC-Salon-WeChat/pages/planning/index.wxml +++ b/JC-Salon-WeChat/pages/planning/index.wxml @@ -98,12 +98,16 @@ {{block.customerName}} {{block.timeText}} · {{block.productTitle}} - {{block.statusText}} - - 确认 - {{block.assignmentStatus === 'UNASSIGNED' ? '分配' : '改派'}} - 取消 - 完成 + + + {{block.statusText}} + + 确认 + {{block.assignmentStatus === 'UNASSIGNED' ? '分配' : '改派'}} + 取消 + 完成 + + {{item.emptyText || '全天可约'}} diff --git a/JC-Salon-WeChat/pages/planning/index.wxss b/JC-Salon-WeChat/pages/planning/index.wxss index c1001795..2a4c179e 100644 --- a/JC-Salon-WeChat/pages/planning/index.wxss +++ b/JC-Salon-WeChat/pages/planning/index.wxss @@ -72,7 +72,7 @@ } .control-card { - padding: 12rpx 16rpx; + padding: 8rpx 14rpx; } .calendar-error-card { @@ -145,12 +145,12 @@ } .icon-btn.small { - width: 52rpx; - min-width: 52rpx; - max-width: 52rpx; - height: 52rpx; - min-height: 52rpx; - font-size: 34rpx; + width: 44rpx; + min-width: 44rpx; + max-width: 44rpx; + height: 44rpx; + min-height: 44rpx; + font-size: 30rpx; } .date-center { @@ -162,21 +162,21 @@ .date-main { color: #17211f; - font-size: 32rpx; + font-size: 30rpx; font-weight: 800; } .date-sub { color: #71807a; - font-size: 22rpx; + font-size: 20rpx; } .segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8rpx; - margin-top: 10rpx; - padding: 6rpx; + margin-top: 6rpx; + padding: 4rpx; border-radius: 12px; background: #f1ece4; } @@ -185,7 +185,7 @@ display: flex; align-items: center; justify-content: center; - height: 46rpx; + height: 40rpx; border-radius: 10px; color: #7d756c; font-size: 24rpx; @@ -203,14 +203,15 @@ .artist-filter { display: flex; width: 100%; - margin-top: 10rpx; + height: 44rpx; + margin-top: 6rpx; white-space: nowrap; } .artist-chip { display: inline-flex; align-items: center; - height: 52rpx; + height: 44rpx; margin-right: 10rpx; padding: 0 16rpx; border-radius: 999rpx; @@ -242,8 +243,8 @@ .unassigned-notice { display: flex; align-items: center; - margin-top: 14rpx; - padding: 14rpx 16rpx; + margin-top: 8rpx; + padding: 10rpx 12rpx; border-radius: 12rpx; background: #fff4e5; color: #8b5e24; @@ -344,6 +345,7 @@ flex-shrink: 0; border-right: 1rpx solid #e7ece9; background-image: linear-gradient(to bottom, rgba(203, 220, 213, 0.45) 1rpx, transparent 1rpx); + background-position: 0 54rpx; background-size: 100% 240rpx; } @@ -367,6 +369,7 @@ left: 12rpx; display: flex; flex-direction: column; + box-sizing: border-box; gap: 2rpx; overflow: hidden; padding: 6rpx 10rpx; @@ -400,10 +403,17 @@ line-height: 1.25; } +.block-footer { + display: flex; + align-items: center; + justify-content: space-between; + min-height: 18rpx; +} + .block-actions { display: flex; gap: 10rpx; - margin-top: 2rpx; + margin-top: 0; color: #247b63; font-size: 18rpx; font-weight: 800; @@ -433,6 +443,10 @@ display: none; } +.appointment-block.compact .block-footer { + display: none; +} + .lane-empty { position: absolute; top: 76rpx;