Browse Source

merge: 整合远程沙龙线与登录协议提交,冲突按 ui-kit 归属裁决

远程 5 提交(cfc 活动打通/时区序列化/草稿发布/侧栏沙龙入口/登录协议勾选)与本地 UI 改造分叉,
冲突 3 处均按 UI 方案归属裁决:

1. train-frontend/pages.json(1 冲突):保留本地 48 页全部条目 + 追加远程新增 policy/agreement、
   policy/privacy 两协议页 → 50 页;tabBar V4 色与全局标题不动。
2. train-web/src/views/Layout.vue(1 冲突):保留本地分组 submenu 结构(groupDefs/groupVisible,
   4 分组),远程扁平分菜单结构弃用;远程新增的 /salons 入口在 groupDefs.training 中已有归属(培训组)。
3. train-web/src/views/Salons.vue(1 冲突):保留本地 ui-kit 内容工具栏(页头由外壳接管),
   远程旧 page-header 结构弃用;远程时区/草稿发布/状态机改造完整保留。

品牌纪律:远程 5 提交基于旧品牌基线,带入 5 处「爱伴·AI之旅」(SalonCfcSyncService×2、
agreement.vue、privacy.vue、AdminSalonController)→ 按硬约束统一替换为「爱伴-健康之旅」;
全文案仅「爱伴」单词引用保留不变。

验证:train-backend BUILD SUCCESS / train-frontend build:h5 DONE / train-web build DONE
liaoxg 13 hours ago
parent
commit
dc36fc8fa7

+ 62 - 0
train-backend/src/main/java/com/train/cfc/entity/CfcTask.java

@@ -0,0 +1,62 @@
+package com.train.cfc.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * cfc 任务(tasks 表,位于 cfc 同库 zxyj)。
+ * 仅保留沙龙签到回写所需字段子集。
+ */
+@Data
+@TableName("tasks")
+public class CfcTask implements Serializable {
+
+    @TableId(type = IdType.AUTO)
+    private Long id;
+
+    private Long familyId;
+
+    private Long creatorId;
+
+    private Long childId;
+
+    /** child / parent */
+    private String executorType;
+
+    private Long executorId;
+
+    private String title;
+
+    private String description;
+
+    private Integer points;
+
+    private Date deadline;
+
+    private String repeatType;
+
+    private String category;
+
+    private Integer needReview;
+
+    private Integer reviewByCategory;
+
+    private String status;
+
+    private Date completedAt;
+
+    private Date createdAt;
+
+    private Date updatedAt;
+
+    private String taskType;
+
+    private String sourceType;
+
+    private Long sourceId;
+}

+ 10 - 0
train-backend/src/main/java/com/train/cfc/mapper/CfcTaskMapper.java

@@ -0,0 +1,10 @@
+package com.train.cfc.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.train.cfc.entity.CfcTask;
+
+/**
+ * cfc 任务(tasks 表)Mapper,供沙龙签到回写使用。
+ */
+public interface CfcTaskMapper extends BaseMapper<CfcTask> {
+}

+ 32 - 9
train-backend/src/main/java/com/train/controller/SalonController.java

@@ -19,6 +19,7 @@ import com.train.mapper.TrainSalonFeedbackMapper;
 import com.train.mapper.TrainSalonMapper;
 import com.train.mapper.TrainUserMapper;
 import com.train.service.CfcReferralSyncService;
+import com.train.service.SalonCfcSyncService;
 import com.train.service.ScoreService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
@@ -30,12 +31,14 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.TimeZone;
 
 @Tag(name = "沙龙", description = "沙龙期次列表、沙龙报名、我的沙龙报名")
 @RestController
@@ -62,6 +65,8 @@ public class SalonController {
     private ScoreService scoreService;
     @Resource
     private CfcReferralSyncService cfcReferralSyncService;
+    @Resource
+    private SalonCfcSyncService salonCfcSyncService;
 
     /** 占用名额的报名状态 */
     private static final List<String> OCCUPY_STATUS = Arrays.asList("pending", "paid", "confirmed");
@@ -75,10 +80,16 @@ public class SalonController {
     @Operation(summary = "可报名沙龙期次列表")
     @PostMapping("/list")
     public Result<List<Map<String, Object>>> list(@RequestBody(required = false) Map<String, Object> body) {
-        List<TrainSalon> salons = trainSalonMapper.selectList(
-                new LambdaQueryWrapper<TrainSalon>()
-                        .eq(TrainSalon::getStatus, "active")
-                        .orderByAsc(TrainSalon::getId));
+        List<TrainSalon> allSalons = trainSalonMapper.selectList(
+                new LambdaQueryWrapper<TrainSalon>().orderByAsc(TrainSalon::getId));
+        List<TrainSalon> salons = new ArrayList<>();
+        for (TrainSalon salon : allSalons) {
+            // 以 cfc 活动状态为准回写(cfc 后台结束活动后,爱伴不再展示该期次)
+            salonCfcSyncService.syncStatusFromActivity(salon);
+            if ("active".equals(salon.getStatus())) {
+                salons.add(salon);
+            }
+        }
         List<Map<String, Object>> result = new ArrayList<>();
         for (TrainSalon salon : salons) {
             int salonPrice = salon.getPrice() == null ? 0 : salon.getPrice();
@@ -109,9 +120,9 @@ public class SalonController {
             row.put("occupied", occupied == null ? 0L : occupied);
             row.put("num", num);
             row.put("status", salon.getStatus());
-            row.put("startAt", salon.getStartAt());
-            row.put("endAt", salon.getEndAt());
-            row.put("createdAt", salon.getCreatedAt());
+            row.put("startAt", formatTime(salon.getStartAt()));
+            row.put("endAt", formatTime(salon.getEndAt()));
+            row.put("createdAt", formatTime(salon.getCreatedAt()));
             result.add(row);
         }
         return Result.success(result);
@@ -254,8 +265,8 @@ public class SalonController {
             row.put("orderNo", order == null ? null : order.getOrderNo());
             // 沙龙状态(前端据此决定是否显示签到入口)
             row.put("salonStatus", s == null ? null : s.getStatus());
-            row.put("salonStartAt", s == null ? null : s.getStartAt());
-            row.put("salonEndAt", s == null ? null : s.getEndAt());
+            row.put("salonStartAt", s == null ? null : formatTime(s.getStartAt()));
+            row.put("salonEndAt", s == null ? null : formatTime(s.getEndAt()));
             // 沙龙展示状态(对齐 cfc applyDisplayState 语义):ended/ongoing/pending_start/active/draft
             row.put("displayStatus", calcDisplayStatus(s));
             // 已签到标记
@@ -350,6 +361,8 @@ public class SalonController {
             // 积分发放失败不阻塞签到
             org.slf4j.LoggerFactory.getLogger(getClass()).warn("沙龙签到积分发放失败: {}", e.getMessage());
         }
+        // 回写 cfc:生成家长签到任务并累加活动签到人数(不重复发 cfc 积分)
+        salonCfcSyncService.syncCheckin(salon, userId);
         Map<String, Object> result = new HashMap<>();
         result.put("pointsEarned", points);
         result.put("alreadyCompleted", false);
@@ -415,6 +428,16 @@ public class SalonController {
         return Result.success(true);
     }
 
+    /** 时间输出统一 Asia/Shanghai 本地字符串(yyyy-MM-dd HH:mm:ss) */
+    private String formatTime(Date d) {
+        if (d == null) {
+            return null;
+        }
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        sdf.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
+        return sdf.format(d);
+    }
+
     /**
      * 沙龙展示状态(对齐 cfc 活动 applyDisplayState 语义):
      * ended=已结束 / ongoing=进行中(时间窗内) / pending_start=未开始 / active=进行中(无时间窗) / draft=草稿

+ 222 - 34
train-backend/src/main/java/com/train/controller/admin/AdminSalonController.java

@@ -1,17 +1,23 @@
 package com.train.controller.admin;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.train.common.Result;
 import com.train.entity.TrainSalon;
 import com.train.entity.TrainEnrollment;
 import com.train.entity.TrainSalonCheckin;
 import com.train.entity.TrainSalonFeedback;
+import com.train.entity.TrainUser;
 import com.train.mapper.TrainSalonMapper;
 import com.train.mapper.TrainEnrollmentMapper;
 import com.train.mapper.TrainSalonCheckinMapper;
 import com.train.mapper.TrainSalonFeedbackMapper;
+import com.train.mapper.TrainUserMapper;
 import com.train.cfc.entity.CfcActivity;
+import com.train.cfc.entity.CfcActivityRegistration;
 import com.train.cfc.mapper.CfcActivityMapper;
+import com.train.cfc.mapper.CfcActivityRegistrationMapper;
+import com.train.service.SalonCfcSyncService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import org.springframework.web.bind.annotation.*;
@@ -19,6 +25,7 @@ import org.springframework.web.bind.annotation.*;
 import javax.annotation.Resource;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
+import java.time.format.DateTimeFormatter;
 import java.util.*;
 
 @Tag(name = "管理端-沙龙", description = "沙龙管理")
@@ -36,6 +43,12 @@ public class AdminSalonController {
     private TrainSalonCheckinMapper trainSalonCheckinMapper;
     @Resource
     private TrainSalonFeedbackMapper trainSalonFeedbackMapper;
+    @Resource
+    private CfcActivityRegistrationMapper cfcActivityRegistrationMapper;
+    @Resource
+    private TrainUserMapper trainUserMapper;
+    @Resource
+    private SalonCfcSyncService salonCfcSyncService;
 
     private static final List<String> OCCUPY_STATUS = Arrays.asList("pending", "paid", "confirmed");
 
@@ -67,41 +80,18 @@ public class AdminSalonController {
                 price = 6800;
             }
         }
-// 开始时间:优先 yyyy-MM-dd HH:mm:ss,其次 yyyy-MM-dd,解析失败留空
-        Date startAt = null;
-        if (body.get("startAt") != null && !body.get("startAt").toString().trim().isEmpty()) {
-            String startAtStr = body.get("startAt").toString().trim();
-            try {
-                startAt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(startAtStr);
-            } catch (ParseException e) {
-                try {
-                    startAt = new SimpleDateFormat("yyyy-MM-dd").parse(startAtStr);
-                } catch (ParseException ex) {
-                    startAt = null;
-                }
-            }
-        }
-        // 结束时间:同 startAt 解析规则,可留空(留空则签到不限结束时间,需手动结束沙龙)
-        Date endAt = null;
-        if (body.get("endAt") != null && !body.get("endAt").toString().trim().isEmpty()) {
-            String endAtStr = body.get("endAt").toString().trim();
-            try {
-                endAt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(endAtStr);
-            } catch (ParseException e) {
-                try {
-                    endAt = new SimpleDateFormat("yyyy-MM-dd").parse(endAtStr);
-                } catch (ParseException ex) {
-                    endAt = null;
-                }
-            }
-        }
+        // 开始/结束时间:统一走 parseSalonDate(显式 Asia/Shanghai,避免 JVM 时区波动导致前后端显示偏移)
+        Date startAt = parseSalonDate(body.get("startAt"));
+        // 结束时间可留空(留空则签到不限结束时间,需手动结束沙龙)
+        Date endAt = parseSalonDate(body.get("endAt"));
         TrainSalon salon = new TrainSalon();
         salon.setTheme(theme);
         salon.setTitle(title);
         salon.setTime(time);
         salon.setPlace(place);
         salon.setCapacity(capacity);
-        salon.setStatus("active");
+        // 对齐 cfc 活动流程:新建为草稿,需手动发布后才对外展示/可报名
+        salon.setStatus("draft");
         salon.setPrice(price);
         salon.setStartAt(startAt);
         salon.setEndAt(endAt);
@@ -116,7 +106,8 @@ public class AdminSalonController {
             activity.setDescription("爱伴-健康之旅周末沙龙:" + title);
             activity.setActivityType("offline");
             activity.setDimensionCode("wealth,health,growth");
-            activity.setStatus("published");
+            // 与 train_salon 保持同源状态:draft(发布时同步为 published)
+            activity.setStatus("draft");
             activity.setAuditStatus("approved");
             activity.setLocation(place);
             activity.setStartTime(startAt);
@@ -128,6 +119,7 @@ public class AdminSalonController {
             activity.setVisibility("restricted");
             activity.setCheckinPoints(5);
             activity.setPlatformPoints(10);
+            salonCfcSyncService.markSource(activity);
             Date syncNow = new Date();
             activity.setCreatedAt(syncNow);
             activity.setUpdatedAt(syncNow);
@@ -142,6 +134,142 @@ public class AdminSalonController {
         return Result.success(salon);
     }
 
+    @Operation(summary = "编辑沙龙")
+    @PostMapping("/update")
+    public Result<TrainSalon> update(@RequestBody Map<String, Object> body) {
+        if (body.get("id") == null) {
+            return Result.error("缺少沙龙ID");
+        }
+        Long id = Long.valueOf(body.get("id").toString());
+        TrainSalon salon = trainSalonMapper.selectById(id);
+        if (salon == null) {
+            return Result.error("沙龙不存在");
+        }
+        if (body.get("title") != null && !body.get("title").toString().trim().isEmpty()) {
+            salon.setTitle(body.get("title").toString().trim());
+        }
+        if (body.containsKey("theme")) {
+            salon.setTheme(emptyToNull(body.get("theme")));
+        }
+        if (body.containsKey("time")) {
+            salon.setTime(emptyToNull(body.get("time")));
+        }
+        if (body.containsKey("place")) {
+            salon.setPlace(emptyToNull(body.get("place")));
+        }
+        if (body.get("capacity") != null) {
+            try {
+                salon.setCapacity(Integer.parseInt(body.get("capacity").toString()));
+            } catch (NumberFormatException ignored) {
+            }
+        }
+        if (body.get("price") != null) {
+            try {
+                salon.setPrice(Integer.valueOf(body.get("price").toString()));
+            } catch (NumberFormatException ignored) {
+            }
+        }
+        if (body.containsKey("startAt")) {
+            salon.setStartAt(parseSalonDate(body.get("startAt")));
+        }
+        if (body.containsKey("endAt")) {
+            salon.setEndAt(parseSalonDate(body.get("endAt")));
+        }
+        salon.setUpdatedAt(new Date());
+        // 显式 set:允许把时间/文本字段清空(updateById 默认跳过 null)
+        LambdaUpdateWrapper<TrainSalon> uw = new LambdaUpdateWrapper<>();
+        uw.eq(TrainSalon::getId, id)
+                .set(TrainSalon::getTheme, salon.getTheme())
+                .set(TrainSalon::getTitle, salon.getTitle())
+                .set(TrainSalon::getTime, salon.getTime())
+                .set(TrainSalon::getPlace, salon.getPlace())
+                .set(TrainSalon::getCapacity, salon.getCapacity())
+                .set(TrainSalon::getPrice, salon.getPrice())
+                .set(TrainSalon::getStartAt, salon.getStartAt())
+                .set(TrainSalon::getEndAt, salon.getEndAt())
+                .set(TrainSalon::getUpdatedAt, salon.getUpdatedAt());
+        trainSalonMapper.update(null, uw);
+        // 同步 cfc 活动内容(标题/描述/地点/时间/容量/价格)
+        if (salon.getActivityId() != null) {
+            try {
+                CfcActivity activity = cfcActivityMapper.selectById(salon.getActivityId());
+                if (activity != null) {
+                    activity.setTitle(salon.getTitle());
+                    activity.setDescription("爱伴-健康之旅周末沙龙:" + salon.getTitle());
+                    activity.setLocation(salon.getPlace());
+                    activity.setStartTime(salon.getStartAt());
+                    activity.setEndTime(salon.getEndAt());
+                    activity.setMaxParticipants(salon.getCapacity());
+                    activity.setPrice(salon.getPrice());
+                    activity.setMemberPrice(salon.getPrice());
+                    if (activity.getVendorName() == null) {
+                        salonCfcSyncService.markSource(activity);
+                    }
+                    activity.setUpdatedAt(new Date());
+                    LambdaUpdateWrapper<CfcActivity> au = new LambdaUpdateWrapper<>();
+                    au.eq(CfcActivity::getId, activity.getId())
+                            .set(CfcActivity::getTitle, activity.getTitle())
+                            .set(CfcActivity::getDescription, activity.getDescription())
+                            .set(CfcActivity::getLocation, activity.getLocation())
+                            .set(CfcActivity::getStartTime, activity.getStartTime())
+                            .set(CfcActivity::getEndTime, activity.getEndTime())
+                            .set(CfcActivity::getMaxParticipants, activity.getMaxParticipants())
+                            .set(CfcActivity::getPrice, activity.getPrice())
+                            .set(CfcActivity::getMemberPrice, activity.getMemberPrice())
+                            .set(CfcActivity::getVendorName, activity.getVendorName())
+                            .set(CfcActivity::getUpdatedAt, activity.getUpdatedAt());
+                    cfcActivityMapper.update(null, au);
+                }
+            } catch (Exception e) {
+                org.slf4j.LoggerFactory.getLogger(getClass())
+                        .warn("同步 cfc 活动内容失败: {}", e.getMessage());
+            }
+        }
+        return Result.success(salon);
+    }
+
+    private String emptyToNull(Object value) {
+        if (value == null) {
+            return null;
+        }
+        String s = value.toString().trim();
+        return s.isEmpty() ? null : s;
+    }
+
+    private Date parseSalonDate(Object value) {
+        if (value == null) {
+            return null;
+        }
+        String s = value.toString().trim();
+        if (s.isEmpty()) {
+            return null;
+        }
+        // 显式 Asia/Shanghai:前后端以本地时间字符串交互,与展示一致
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        sdf.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
+        try {
+            return sdf.parse(s);
+        } catch (ParseException e) {
+            SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd");
+            sdfDate.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
+            try {
+                return sdfDate.parse(s);
+            } catch (ParseException ex) {
+                return null;
+            }
+        }
+    }
+
+    /** 时间输出统一 Asia/Shanghai 本地字符串(yyyy-MM-dd HH:mm:ss),Map 中 Date 不受实体 @JsonFormat 覆盖 */
+    private String formatTime(Date d) {
+        if (d == null) {
+            return null;
+        }
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        sdf.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
+        return sdf.format(d);
+    }
+
     @Operation(summary = "沙龙列表")
     @PostMapping("/list")
     public Result<List<Map<String, Object>>> list(@RequestBody(required = false) Map<String, Object> body) {
@@ -149,6 +277,8 @@ public class AdminSalonController {
                 new LambdaQueryWrapper<TrainSalon>().orderByDesc(TrainSalon::getId));
         List<Map<String, Object>> result = new ArrayList<>();
         for (TrainSalon s : salons) {
+            // 以 cfc 活动状态为准回写(cfc 后台结束/下线该活动后,爱伴同步更新)
+            salonCfcSyncService.syncStatusFromActivity(s);
             Long occupied = trainEnrollmentMapper.selectCount(
                     new LambdaQueryWrapper<TrainEnrollment>()
                             .eq(TrainEnrollment::getSalonId, s.getId())
@@ -185,9 +315,9 @@ public class AdminSalonController {
             row.put("occupied", occupied);
             row.put("num", num);
 row.put("status", s.getStatus());
-            row.put("startAt", s.getStartAt());
-            row.put("endAt", s.getEndAt());
-            row.put("createdAt", s.getCreatedAt());
+            row.put("startAt", formatTime(s.getStartAt()));
+            row.put("endAt", formatTime(s.getEndAt()));
+            row.put("createdAt", formatTime(s.getCreatedAt()));
             result.add(row);
         }
         return Result.success(result);
@@ -244,11 +374,14 @@ TrainSalon salon = trainSalonMapper.selectById(id);
             return Result.error("缺少沙龙ID");
         }
         Long salonId = Long.valueOf(body.get("salonId").toString());
+        TrainSalon salon = trainSalonMapper.selectById(salonId);
         List<TrainEnrollment> enrollments = trainEnrollmentMapper.selectList(
                 new LambdaQueryWrapper<TrainEnrollment>()
                         .eq(TrainEnrollment::getSalonId, salonId)
                         .orderByDesc(TrainEnrollment::getId));
         List<Map<String, Object>> result = new ArrayList<>();
+        List<Long> uids = new ArrayList<>();
+        Set<String> enrolledPhones = new HashSet<>();
         for (TrainEnrollment e : enrollments) {
             Map<String, Object> row = new HashMap<>();
             row.put("id", e.getId());
@@ -258,12 +391,67 @@ TrainSalon salon = trainSalonMapper.selectById(id);
             row.put("source", e.getSource());
             row.put("inviteCode", e.getInviteCode());
             row.put("status", e.getStatus());
-row.put("createdAt", e.getCreatedAt());
+            row.put("createdAt", e.getCreatedAt());
             result.add(row);
+            if (e.getUid() != null) {
+                uids.add(e.getUid());
+            }
+            if (e.getPhone() != null && !e.getPhone().trim().isEmpty()) {
+                enrolledPhones.add(e.getPhone().trim());
+            }
+        }
+        // 合并 cfc 侧报名(仅关联 activity_id 的该沙龙;cfc 新建的活动不进入爱伴)。
+        // 只读合并,不改 cfc 数据;按 cfc_user_id 优先、手机号兜底去重。
+        if (salon != null && salon.getActivityId() != null) {
+            Set<Long> enrolledCfcUserIds = new HashSet<>();
+            if (!uids.isEmpty()) {
+                List<TrainUser> trainUsers = trainUserMapper.selectBatchIds(uids);
+                for (TrainUser u : trainUsers) {
+                    if (u.getCfcUserId() != null) {
+                        enrolledCfcUserIds.add(u.getCfcUserId());
+                    }
+                }
+            }
+            List<CfcActivityRegistration> cfcRegs = cfcActivityRegistrationMapper.selectList(
+                    new LambdaQueryWrapper<CfcActivityRegistration>()
+                            .eq(CfcActivityRegistration::getActivityId, salon.getActivityId())
+                            .orderByDesc(CfcActivityRegistration::getId));
+            DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+            for (CfcActivityRegistration r : cfcRegs) {
+                boolean duplicate = (r.getUserId() != null && enrolledCfcUserIds.contains(r.getUserId()))
+                        || (r.getRegistrantPhone() != null && enrolledPhones.contains(r.getRegistrantPhone().trim()));
+                if (duplicate) {
+                    continue;
+                }
+                Map<String, Object> row = new HashMap<>();
+                row.put("id", "cfc-" + r.getId());
+                row.put("uid", null);
+                row.put("name", r.getRegistrantName());
+                row.put("phone", r.getRegistrantPhone());
+                row.put("source", "cfc");
+                row.put("inviteCode", null);
+                row.put("status", mapCfcRegistrationStatus(r.getStatus()));
+                row.put("cfcStatus", r.getStatus());
+                row.put("createdAt", r.getRegisteredAt() != null
+                        ? r.getRegisteredAt().format(fmt)
+                        : (r.getCreatedAt() != null ? r.getCreatedAt().format(fmt) : null));
+                result.add(row);
+            }
         }
         return Result.success(result);
     }
 
+    /** cfc 报名状态 → 爱伴报名状态展示 */
+    private String mapCfcRegistrationStatus(String cfcStatus) {
+        if ("approved".equals(cfcStatus)) {
+            return "confirmed";
+        }
+        if ("rejected".equals(cfcStatus)) {
+            return "rejected";
+        }
+        return "pending";
+    }
+
     @Operation(summary = "沙龙签到名单")
     @PostMapping("/checkins")
     public Result<List<Map<String, Object>>> checkins(@RequestBody Map<String, Object> body) {

+ 12 - 1
train-backend/src/main/java/com/train/entity/TrainSalon.java

@@ -3,6 +3,7 @@ package com.train.entity;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -27,8 +28,18 @@ public class TrainSalon implements Serializable {
     private Integer capacity;
     private Integer price; // 价格(分),默认 6800
     private String status; // draft/active/finished
+
+    /** 开始时间:固定 Asia/Shanghai 时区序列化/反序列化(对齐 cfc 活动时间为本地时间字符串) */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date startAt;
+
+    /** 结束时间:固定 Asia/Shanghai 时区序列化/反序列化 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date endAt;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date createdAt;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date updatedAt;
-}
+}

+ 166 - 0
train-backend/src/main/java/com/train/service/SalonCfcSyncService.java

@@ -0,0 +1,166 @@
+package com.train.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.train.cfc.entity.CfcActivity;
+import com.train.cfc.entity.CfcTask;
+import com.train.cfc.entity.CfcUser;
+import com.train.cfc.mapper.CfcActivityMapper;
+import com.train.cfc.mapper.CfcTaskMapper;
+import com.train.cfc.mapper.CfcUserMapper;
+import com.train.entity.TrainSalon;
+import com.train.entity.TrainUser;
+import com.train.mapper.TrainSalonMapper;
+import com.train.mapper.TrainUserMapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.Calendar;
+import java.util.Date;
+
+/**
+ * 沙龙 ↔ cfc 活动数据同步:
+ * 1. 创建 cfc 活动时打来源标识(activities.vendor_name);
+ * 2. 以 cfc 活动状态为准回写 train_salon.status;
+ * 3. 沙龙签到回写 cfc(生成 parent 任务 + 活动签到人数 +1,不重复发 cfc 积分)。
+ */
+@Service
+public class SalonCfcSyncService {
+
+    private static final Logger log = LoggerFactory.getLogger(SalonCfcSyncService.class);
+
+    /** cfc 活动来源标识(复用 vendor_name 字段,不改 cfc 表结构) */
+    public static final String SOURCE_NAME = "爱伴-健康之旅";
+
+    @Resource
+    private TrainSalonMapper trainSalonMapper;
+    @Resource
+    private TrainUserMapper trainUserMapper;
+    @Resource
+    private CfcActivityMapper cfcActivityMapper;
+    @Resource
+    private CfcUserMapper cfcUserMapper;
+    @Resource
+    private CfcTaskMapper cfcTaskMapper;
+
+    /** 创建 cfc 活动时打来源标识 */
+    public void markSource(CfcActivity activity) {
+        if (activity != null) {
+            activity.setVendorName(SOURCE_NAME);
+        }
+    }
+
+    /**
+     * 以 cfc 活动为准回写 train_salon.status。
+     * 映射:published→active、ended→finished、draft→draft;其它状态不处理。
+     * 仅当状态变化时才落库。
+     */
+    public void syncStatusFromActivity(TrainSalon salon) {
+        if (salon == null || salon.getActivityId() == null) {
+            return;
+        }
+        try {
+            CfcActivity activity = cfcActivityMapper.selectById(salon.getActivityId());
+            if (activity == null || activity.getStatus() == null) {
+                return;
+            }
+            String mapped;
+            switch (activity.getStatus()) {
+                case "published":
+                    mapped = "active";
+                    break;
+                case "ended":
+                    mapped = "finished";
+                    break;
+                case "draft":
+                    mapped = "draft";
+                    break;
+                default:
+                    return;
+            }
+            if (!mapped.equals(salon.getStatus())) {
+                salon.setStatus(mapped);
+                salon.setUpdatedAt(new Date());
+                trainSalonMapper.updateById(salon);
+            }
+        } catch (Exception e) {
+            log.warn("回写沙龙状态失败: salonId={}, err={}", salon.getId(), e.getMessage());
+        }
+    }
+
+    /**
+     * 沙龙签到回写 cfc:
+     * - 生成 parent 任务(executor_type=parent,executor_id=cfcUserId,child_id=NULL);
+     * - points=0,cfc 积分不重复发,train 积分保持权威;
+     * - activities.current_participants +1(与 cfc 活动签到语义一致);
+     * - 幂等:source_type=activity + source_id + executor_type=parent + executor_id 已存在则跳过。
+     */
+    public void syncCheckin(TrainSalon salon, Long userId) {
+        if (salon == null || salon.getActivityId() == null || userId == null) {
+            return;
+        }
+        try {
+            TrainUser trainUser = trainUserMapper.selectById(userId);
+            if (trainUser == null || trainUser.getCfcUserId() == null) {
+                log.warn("沙龙签到未回写 cfc:学员无 cfc 会员ID, uid={}", userId);
+                return;
+            }
+            Long cfcUserId = trainUser.getCfcUserId();
+            CfcUser cfcUser = cfcUserMapper.selectById(cfcUserId);
+            if (cfcUser == null || cfcUser.getFamilyId() == null) {
+                log.warn("沙龙签到未回写 cfc:会员无家庭ID, cfcUserId={}", cfcUserId);
+                return;
+            }
+            Long existed = cfcTaskMapper.selectCount(
+                    new LambdaQueryWrapper<CfcTask>()
+                            .eq(CfcTask::getSourceType, "activity")
+                            .eq(CfcTask::getSourceId, salon.getActivityId())
+                            .eq(CfcTask::getExecutorType, "parent")
+                            .eq(CfcTask::getExecutorId, cfcUserId));
+            if (existed != null && existed > 0) {
+                return;
+            }
+            String title = salon.getTitle() == null ? "" : salon.getTitle();
+            Date now = new Date();
+            CfcTask task = new CfcTask();
+            task.setFamilyId(cfcUser.getFamilyId());
+            task.setCreatorId(cfcUserId);
+            task.setExecutorType("parent");
+            task.setExecutorId(cfcUserId);
+            task.setTitle("活动签到: " + title);
+            task.setDescription("由爱伴-健康之旅沙龙签到同步(不重复发放 cfc 积分)");
+            task.setPoints(0);
+            task.setRepeatType("none");
+            task.setCategory("行动类");
+            task.setNeedReview(0);
+            task.setReviewByCategory(0);
+            task.setTaskType("onetime");
+            task.setSourceType("activity");
+            task.setSourceId(salon.getActivityId());
+            task.setStatus("completed");
+            task.setCompletedAt(now);
+            task.setCreatedAt(now);
+            task.setUpdatedAt(now);
+            Calendar cal = Calendar.getInstance();
+            cal.set(Calendar.HOUR_OF_DAY, 23);
+            cal.set(Calendar.MINUTE, 59);
+            cal.set(Calendar.SECOND, 59);
+            cal.set(Calendar.MILLISECOND, 0);
+            task.setDeadline(cal.getTime());
+            cfcTaskMapper.insert(task);
+
+            CfcActivity activity = cfcActivityMapper.selectById(salon.getActivityId());
+            if (activity != null) {
+                activity.setCurrentParticipants(
+                        activity.getCurrentParticipants() == null ? 1 : activity.getCurrentParticipants() + 1);
+                activity.setUpdatedAt(now);
+                cfcActivityMapper.updateById(activity);
+            }
+            log.info("沙龙签到已回写 cfc: salonId={}, activityId={}, cfcUserId={}, taskId={}",
+                    salon.getId(), salon.getActivityId(), cfcUserId, task.getId());
+        } catch (Exception e) {
+            log.warn("沙龙签到回写 cfc 失败: salonId={}, err={}", salon.getId(), e.getMessage());
+        }
+    }
+}

+ 12 - 0
train-frontend/pages.json

@@ -287,6 +287,18 @@
       "style": {
         "navigationBarTitleText": "证据包"
       }
+    },
+    {
+      "path": "pages/policy/agreement",
+      "style": {
+        "navigationBarTitleText": "用户协议"
+      }
+    },
+    {
+      "path": "pages/policy/privacy",
+      "style": {
+        "navigationBarTitleText": "隐私政策"
+      }
     }
   ],
   "globalStyle": {

+ 55 - 5
train-frontend/pages/index/index.vue

@@ -140,17 +140,27 @@
             <text class="sheet-sub">登录以解锁更多成长功能</text>
           </view>
           <!-- #ifdef MP-WEIXIN -->
-          <button class="sheet-login-btn" open-type="getPhoneNumber" @getphonenumber="handleLoginPhone" :loading="loginLoading" :disabled="loginLoading">
+          <button class="sheet-login-btn" open-type="getPhoneNumber" @getphonenumber="handleLoginPhone" :loading="loginLoading" :disabled="!agreed || loginLoading">
             微信一键登录
           </button>
           <!-- #endif -->
           <!-- #ifndef MP-WEIXIN -->
-          <button class="sheet-login-btn" @click="handleLogin" :loading="loginLoading" :disabled="loginLoading">
+          <button class="sheet-login-btn" @click="handleLogin" :loading="loginLoading" :disabled="!agreed || loginLoading">
             微信一键登录
           </button>
           <!-- #endif -->
           <view class="sheet-footer">
-            <text class="sheet-footer-text">登录即代表同意服务协议</text>
+            <checkbox-group class="agreement-check" @change="onAgreementChange">
+              <label class="agreement-row">
+                <checkbox value="agree" :checked="agreed" color="#FC7A57" />
+                <text class="sheet-footer-text">我已阅读并同意</text>
+              </label>
+            </checkbox-group>
+            <view class="agreement-links">
+              <text class="agreement-link" @click="showAgreement">《用户协议》</text>
+              <text class="sheet-footer-text">和</text>
+              <text class="agreement-link" @click="showPrivacy">《隐私政策》</text>
+            </view>
           </view>
         </view>
       </view>
@@ -201,7 +211,8 @@ export default {
         growth: '孩子成长陪伴'
       },
       loginSheetVisible: false,
-      loginLoading: false
+      loginLoading: false,
+      agreed: false
     }
   },
   computed: {
@@ -416,8 +427,21 @@ export default {
     hideLoginSheet() {
       this.loginSheetVisible = false
     },
+    onAgreementChange(e) {
+      this.agreed = (e.detail.value || []).length > 0
+    },
+    showAgreement() {
+      uni.navigateTo({ url: '/pages/policy/agreement' })
+    },
+    showPrivacy() {
+      uni.navigateTo({ url: '/pages/policy/privacy' })
+    },
     handleLogin() {
       if (this.loginLoading) return
+      if (!this.agreed) {
+        uni.showToast({ title: '请先阅读并同意用户协议', icon: 'none' })
+        return
+      }
       this.loginLoading = true
       var self = this
       wx.login({
@@ -448,6 +472,10 @@ export default {
     },
     handleLoginPhone(e) {
       if (this.loginLoading) return
+      if (!this.agreed) {
+        uni.showToast({ title: '请先阅读并同意用户协议', icon: 'none' })
+        return
+      }
       var phoneCode = (e && e.detail && e.detail.code) ? e.detail.code : ''
       if (!phoneCode) {
         uni.showToast({ title: '请授权手机号后登录', icon: 'none' })
@@ -701,7 +729,29 @@ export default {
   opacity: 0.9;
 }
 .sheet-footer {
-  text-align: center;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  margin-top: 8rpx;
+}
+.agreement-check {
+  display: flex;
+}
+.agreement-row {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+.agreement-links {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  margin-top: 4rpx;
+}
+.agreement-link {
+  font-size: 22rpx;
+  color: #FC7A57;
 }
 .sheet-footer-text {
   font-size: 22rpx;

+ 245 - 0
train-frontend/pages/policy/agreement.vue

@@ -0,0 +1,245 @@
+<template>
+  <view class="policy-container">
+    <view class="policy-content">
+      <text class="policy-title">用户协议</text>
+      <text class="policy-update">更新日期:2026年8月</text>
+
+      <view class="policy-section">
+        <text class="section-title">一、总则</text>
+        <text class="section-text">
+          欢迎使用爱伴-健康之旅训练营服务平台(以下简称"本平台")。本平台由亿图腾(北京)科技有限公司(以下简称"我们")运营。
+        </text>
+        <text class="section-text">
+          在注册、登录并使用本平台前,请您仔细阅读本协议的全部内容。如您不同意本协议的任何条款,请立即停止注册或使用本平台服务。您点击"同意"或完成注册即视为您已充分理解并接受本协议的全部内容。
+        </text>
+      </view>
+
+      <view class="policy-section">
+        <text class="section-title">二、账号注册与管理</text>
+        <text class="section-text">
+          2.1 您通过微信账号授权登录本平台,即完成账号注册。在您主动点击"登录"按钮并完成授权后,我们将为您创建本平台账号。
+        </text>
+        <text class="section-text">
+          2.2 您应妥善保管您的账号信息,因您保管不当导致的账号被盗用、信息泄露等损失由您自行承担。
+        </text>
+        <text class="section-text">
+          2.3 一个家庭可关联多个家庭成员账号,家长账号为家庭主账号,有权管理家庭成员、创建孩子账号、审批任务及审核相关操作。家长账号对家庭管理和孩子账号的创建、管理、注销承担相应责任。
+        </text>
+        <text class="section-text">
+          2.4 如您发现账号存在安全漏洞或被他人非法使用,应立即通知我们。
+        </text>
+        <text class="section-text">
+          2.5 您应保证在注册和使用过程中提供的信息真实、准确、完整。如您提供的信息不实,我们有权限制或终止您使用本平台服务。
+        </text>
+      </view>
+
+      <view class="policy-section">
+        <text class="section-title">三、服务内容</text>
+        <text class="section-text">
+          3.1 本平台提供包括但不限于:家庭任务管理、五维能量评估、成长测评、活动课程报名、商城购物、成长规划师咨询、健康报告解析、成长助手等服务。
+        </text>
+        <text class="section-text">
+          3.2 我们有权根据业务发展需要调整、增加或减少服务内容,变更后的服务内容将在平台上公示。
+        </text>
+        <text class="section-text">
+          3.3 部分服务可能需要额外付费,付费标准以平台公示为准。
+        </text>
+      </view>
+
+      <view class="policy-section">
+        <text class="section-title">四、付费服务条款</text>
+        <text class="section-text">
+          4.1 本平台的付费服务包括但不限于:家庭会员服务(FAMILY/PREMIUM等级)、测评套餐、商城商品、订阅服务等。
+        </text>
+        <text class="section-text">
+          4.2 收费标准:各付费服务的价格以平台展示的当前价格为准。我们有权根据运营成本和市场情况调整服务价格,价格调整将提前30日在平台公示。已购买的服务按购买时的价格执行,不因调整而追溯。
+        </text>
+        <text class="section-text">
+          4.3 支付方式:本平台通过微信小程序虚拟支付渠道完成支付。您在下单购买前应确认购买的服务内容、价格和有效期限。
+        </text>
+        <text class="section-text">
+          4.4 自动续费:如您购买的是自动续费类服务,将按您选择的周期自动扣费。您可以随时在微信支付设置或平台相应页面中取消自动续费,取消后当前周期到期即不再续费。取消自动续费不影响您已支付周期的会员权益。
+        </text>
+        <text class="section-text">
+          4.5 家庭会员服务:家庭会员(FAMILY)支持年付。会员权益以平台公示的权益说明为准。购买家庭会员后,家庭内所有成员(家长及孩子)均可享受相应会员权益。
+        </text>
+        <text class="section-text">
+          4.6 测评套餐:测评套餐包含相应次数的测评服务。套餐有效期以购买时页面说明为准,逾期未使用的测评次数作废。
+        </text>
+      </view>
+
+      <view class="policy-section">
+        <text class="section-title">五、退款政策</text>
+        <text class="section-text">
+          5.1 会员服务退款:会员服务在购买后未使用的情况下,可申请全额退款。已开始使用的会员服务,退款金额按未使用天数占购买周期的比例计算,即:退款金额 = 实付金额 × 剩余天数 / 购买总天数。已享受的会员权益部分不予退还。
+        </text>
+        <text class="section-text">
+          5.2 测评套餐退款:测评套餐在购买后、未进行任何测评的情况下,可申请全额退款。已进行部分测评的,按未使用次数占套餐总次数的比例退款。
+        </text>
+        <text class="section-text">
+          5.3 商品退款:商城商品退款参照平台售后政策执行。虚拟商品(如测评次数、会员权益)一经使用,概不退款。
+        </text>
+        <text class="section-text">
+          5.4 退款时限:符合条件的退款申请,我们将在收到申请之日起7个工作日内完成退款处理(退款到账时间以支付渠道为准)。
+        </text>
+        <text class="section-text">
+          5.5 争议订单处理:如您对退款金额或处理结果有异议,可通过平台客服渠道提交争议,我们将于5个工作日内核实并答复。经核实确属我们责任的,将在答复后3个工作日内完成相关退款。
+        </text>
+        <text class="section-text">
+          5.6 下列情形不适用退款:因您违反本协议或法律法规导致的账号封禁;已完全使用完毕的服务;超过退款申请期限的服务。
+        </text>
+      </view>
+
+      <view class="policy-section">
+        <text class="section-title">六、用户行为规范</text>
+        <text class="section-text">
+          6.1 您承诺遵守国家法律法规,不得利用本平台从事任何违法违规活动。
+        </text>
+        <text class="section-text">
+          6.2 您不得利用本平台发布违法信息、侮辱诽谤他人、侵犯他人合法权益的内容,包括但不限于涉及色情、暴力、赌博、诈骗、传销等信息。
+        </text>
+        <text class="section-text">
+          6.3 您不得对本平台进行反向工程、反向汇编、反向编译,不得破坏本平台的安全措施,不得以任何方式干扰本平台的正常运行。
+        </text>
+        <text class="section-text">
+          6.4 您不得利用本平台从事危害网络安全、破坏数据安全的行为,不得非法获取、窃取、篡改他人个人信息。
+        </text>
+        <text class="section-text">
+          6.5 如您违反上述约定,我们有权采取警告、限制功能、封禁账号等措施,并保留追究法律责任的权利。
+        </text>
+      </view>
+
+      <view class="policy-section">
+        <text class="section-title">七、隐私保护</text>
+        <text class="section-text">
+          我们重视您的隐私保护,具体隐私政策请查阅《隐私政策》。我们采用业界通行的安全技术和管理措施保护您的个人信息安全。您同意我们按照《隐私政策》的约定收集、使用、存储、共享和保护您的个人信息。
+        </text>
+      </view>
+
+      <view class="policy-section">
+        <text class="section-title">八、服务商条款</text>
+        <text class="section-text">
+          8.1 本平台为符合条件的个人或机构提供服务商角色(包括成长规划师、活动规划师、商品供应商等)。服务商需通过平台审核后方可提供服务。
+        </text>
+        <text class="section-text">
+          8.2 入驻条件:服务商申请入驻时,应提供真实、准确、完整的资质信息和证明文件(包括但不限于身份证明、职业资质证书等)。我们有权对申请资料进行审核,审核不通过的,不予入驻。
+        </text>
+        <text class="section-text">
+          8.3 服务商的权利义务:服务商应按照平台规则和订单约定向用户提供真实、优质的服务,保证服务质量,不得虚假宣传、夸大承诺。服务商应遵守国家法律法规和平台各项规则。
+        </text>
+        <text class="section-text">
+          8.4 责任划分:服务商对其提供的服务质量、服务内容及与用户之间的服务纠纷承担相应责任。平台仅提供技术服务和技术支持,不成为服务商与用户之间服务合同的当事人。因服务商违约或侵权给用户造成的损失,由服务商自行承担。
+        </text>
+        <text class="section-text">
+          8.5 佣金与结算:服务商可依据平台规则获得相应佣金。佣金计算方式、结算周期、提现方式以平台公示的规则为准。我们对佣金规则保留调整权,调整将提前30日公示。
+        </text>
+        <text class="section-text">
+          8.6 退出机制:服务商可申请退出服务,退出前需完成处理中的订单。服务商违反平台规则或国家法律法规的,我们有权取消其服务商资格。
+        </text>
+      </view>
+
+      <view class="policy-section">
+        <text class="section-title">九、知识产权</text>
+        <text class="section-text">
+          本平台的所有内容,包括但不限于文字、图片、软件、界面设计、数据、测评体系、五维能量概念等,均属于我们或相关权利人所有,受知识产权法律法规保护。未经我们书面许可,您不得以任何方式复制、传播、修改、使用上述内容。
+        </text>
+      </view>
+
+      <view class="policy-section">
+        <text class="section-title">十、免责声明</text>
+        <text class="section-text">
+          10.1 本平台提供的健康评估、成长建议、测评结果等信息仅供参考,不构成医疗建议、诊断结论或治疗方案。如您或您的家人存在健康问题,请及时咨询专业医疗机构。
+        </text>
+        <text class="section-text">
+          10.2 心理测评结果仅反映测评当次的状态,不代表临床诊断结论。测评结果不应用于替代专业心理咨询或医疗诊断。
+        </text>
+        <text class="section-text">
+          10.3 助手(浠宝/福宝)生成的内容仅供参考,我们不保证其准确性、完整性和适用性。生成内容不构成专业建议。
+        </text>
+        <text class="section-text">
+          10.4 本平台服务商(成长规划师等)提供的服务及其结果,由其自身对服务质量负责,我们不对服务商提供的专业意见承担担保责任。
+        </text>
+        <text class="section-text">
+          10.5 因不可抗力、系统维护、网络故障、第三方服务中断等原因导致的服务中断或数据丢失,在法律允许的范围内,我们不承担相应的法律责任。
+        </text>
+        <text class="section-text">
+          10.6 我们将尽力保证平台服务的稳定性和安全性,但无法保证服务不会中断或完全没有错误。
+        </text>
+      </view>
+
+      <view class="policy-section">
+        <text class="section-title">十一、协议修改</text>
+        <text class="section-text">
+          我们有权根据需要修改本协议。修改后的协议将在平台公示,如您继续使用本平台服务,视为您接受修改后的协议。对于重大变更,我们将通过弹窗或其他方式通知您,并在必要时取得您的重新同意。
+        </text>
+      </view>
+
+      <view class="policy-section">
+        <text class="section-title">十二、争议解决</text>
+        <text class="section-text">
+          12.1 本协议的订立、效力、解释、履行及争议的解决均适用中华人民共和国法律。
+        </text>
+        <text class="section-text">
+          12.2 因本协议引起的或与本协议有关的任何争议,双方应首先友好协商解决。协商不成的,任何一方均可将争议提交本平台运营方所在地有管辖权的人民法院诉讼解决。
+        </text>
+      </view>
+
+      <view class="policy-section">
+        <text class="section-title">十三、联系我们</text>
+        <text class="section-text">
+          如您对本协议有任何疑问,请联系我们:service@etotem.com.cn
+        </text>
+        <text class="section-text">运营主体:亿图腾(北京)科技有限公司</text>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  data() { return {} }
+}
+</script>
+
+<style scoped lang="scss">
+.policy-container {
+  padding: 30rpx;
+  background: #FFFFFF;
+  min-height: 100vh;
+}
+.policy-content {
+  line-height: 1.8;
+}
+.policy-title {
+  font-size: 40rpx;
+  font-weight: bold;
+  color: #333333;
+  display: block;
+  text-align: center;
+  margin-bottom: 12rpx;
+}
+.policy-update {
+  font-size: 24rpx;
+  color: #999999;
+  display: block;
+  text-align: center;
+  margin-bottom: 40rpx;
+}
+.policy-section {
+  margin-bottom: 30rpx;
+}
+.section-title {
+  font-size: 30rpx;
+  font-weight: bold;
+  color: #333333;
+  display: block;
+  margin-bottom: 12rpx;
+}
+.section-text {
+  font-size: 26rpx;
+  color: #666666;
+  display: block;
+  margin-bottom: 8rpx;
+  text-indent: 2em;
+}
+</style>

+ 233 - 0
train-frontend/pages/policy/privacy.vue

@@ -0,0 +1,233 @@
+<template>
+  <view class="policy-container">
+    <view class="policy-content">
+      <text class="policy-title">隐私政策</text>
+      <text class="policy-update">更新日期:2026年8月</text>
+
+      <view class="policy-section">
+        <text class="section-title">一、引言</text>
+        <text class="section-text">
+          亿图腾(北京)科技有限公司(以下简称"我们"或"平台")深知个人信息对您的重要性,我们将按照《中华人民共和国个人信息保护法》《中华人民共和国数据安全法》《中华人民共和国网络安全法》《儿童个人信息网络保护规定》等法律法规的要求,尽全力保护您的个人信息安全。
+        </text>
+        <text class="section-text">
+          本隐私政策旨在向您说明我们在您使用爱伴-健康之旅训练营服务平台(以下简称"本平台")时如何收集、使用、存储、共享和保护您的个人信息。请您在使用本平台前仔细阅读并充分理解本隐私政策的全部内容。
+        </text>
+        <text class="section-text">
+          如您不同意本政策的任何内容,请立即停止使用本平台服务。您点击"同意"或继续使用本平台服务,即视为您已充分理解并同意本隐私政策的全部内容。
+        </text>
+      </view>
+
+      <view class="policy-section">
+        <text class="section-title">二、我们收集的信息</text>
+        <text class="section-text">在您使用本平台过程中,我们可能会收集以下类别的信息:</text>
+
+        <text class="section-text">2.1 微信授权信息:包括您的微信OpenID、UnionID、微信昵称、微信头像。这些信息用于登录认证、身份识别和账户关联。</text>
+
+        <text class="section-text">2.2 注册信息:您注册时提供的手机号码,用于账号创建和身份验证。</text>
+
+        <text class="section-text">2.3 个人资料:您在个人中心填写的昵称、真实姓名、性别、出生日期、出生时辰、头像照片。其中真实姓名和出生时辰用于为您提供个性化的成长评估服务。</text>
+
+        <text class="section-text">2.4 身份信息(敏感个人信息):您在认证或购买服务时提供的身份证号码。我们收集该信息仅用于实名认证和法律法规要求的身份核验。</text>
+
+        <text class="section-text">2.5 家庭信息:您创建或加入的家庭信息,包括家庭关系(爸爸/妈妈/爷爷/奶奶等)、家庭成员信息、家庭角色。其中家庭关系用于区分家庭成员角色和权限管理。</text>
+
+        <text class="section-text">2.6 详细个人资料:您可选填的民族、血型、最高学历、婚姻状况、兴趣爱好、饮食偏好、家庭角色。这些信息用于为您提供更加个性化的服务推荐。</text>
+
+        <text class="section-text">2.7 孩子信息(含14岁以下儿童个人信息——敏感个人信息):您为子女创建账号时提供的孩子姓名、年龄、性别、出生日期、身份证号(选填)、手机号(选填)、学校、年级、班级、身高、体重、家庭状况、父母学历、是否独生子女、在校成绩、紧急联系人姓名及电话。请注意,孩子的身份证号、学校、班级、紧急联系人信息属于敏感个人信息。</text>
+
+        <text class="section-text">2.8 心理测评数据(敏感个人信息):您或您孩子参加测评时产生的注意力得分、专注力得分、记忆力得分、逻辑思维得分、感知得分、空间思维得分、加工速度得分、情绪商数、心理韧性、压力应对能力、自我认知、开放性/尽责性/外向性/宜人性/神经质等大五人格维度评分、情绪管理能力、同理心、社会适应能力、自我激励能力、综合得分,以及测评过程中的游戏记录、分析报告和成长建议。</text>
+
+        <text class="section-text">2.9 健康数据(敏感个人信息):您上传或产生的体检报告数据、菌群检测报告数据,包括健康总分、菌群健康评分、慢病控制评分、营养均衡评分、肠道预测年龄、肠型分类、菌群平衡评分、多样性评分、有益菌/有害菌评分、核心菌属评分、健康评级等指标。</text>
+
+        <text class="section-text">2.10 使用记录:您在平台上的操作记录,包括任务创建和执行记录、打卡记录、心愿创建和兑换记录、积分变动记录、小游戏记录(舒尔特方格、猜数字、数独等)、成长记录、活动参与记录、课程学习记录。</text>
+
+        <text class="section-text">2.11 通讯内容:您与成长规划师之间的消息记录、您与助手(浠宝/福宝)的对话记录。请注意,AI对话内容可能会被记录并用于改进服务质量。</text>
+
+        <text class="section-text">2.12 位置信息:当您使用地址相关功能(如家庭地址设置、街道匹配)时,我们可能会收集您的位置信息。</text>
+
+        <text class="section-text">2.13 设备信息:设备型号、操作系统版本、网络状态、微信版本号、设备标识符,用于提供更好的服务体验和故障排查。</text>
+
+        <text class="section-text">2.14 媒体文件:您上传的图片、视频、音频文件,包括头像照片、测评相关图片、健康报告文件等。</text>
+
+        <text class="section-text">2.15 服务商信息:如您申请成为服务商(成长规划师/活动规划师/商品供应商),我们还会收集您的服务商资质信息、证书照片、审核材料、团队信息等。</text>
+      </view>
+
+      <view class="policy-section">
+        <text class="section-title">三、信息的使用目的</text>
+        <text class="section-text">我们收集的信息将用于以下目的:</text>
+        <text class="section-text">3.1 提供、维护和改进本平台的核心服务,包括家庭任务管理、五维能量评估、成长测评、活动课程、商城购物、成长规划师咨询等。</text>
+        <text class="section-text">3.2 个性化推荐和内容展示,根据您的使用习惯和偏好推荐适合的服务和内容。</text>
+        <text class="section-text">3.3 服务(经您单独同意后):用于对话分析、用户画像构建、推荐和成长建议生成。如您不同意,我们将不会将您的数据用于分析。</text>
+        <text class="section-text">3.4 与您沟通,发送服务通知、活动信息、系统公告等。</text>
+        <text class="section-text">3.5 数据分析和研究,用于优化产品功能、改进服务体验、提升平台安全性。</text>
+        <text class="section-text">3.6 履行法定义务,包括实名认证、税务合规、反洗钱、网络安全等法律法规要求。</text>
+        <text class="section-text">3.7 保障平台安全,检测和防范欺诈、滥用等违法违规行为。</text>
+      </view>
+
+      <view class="policy-section">
+        <text class="section-title">四、敏感个人信息的处理</text>
+        <text class="section-text">4.1 本平台收集的敏感个人信息包括:身份证号码、心理测评数据(注意力/专注力/记忆力/情绪商数/大五人格等各类评分)、健康数据(体检报告/菌群检测报告)、14岁以下儿童的个人信息。这些信息一旦泄露或被非法使用,可能对您的人格尊严和人身财产安全造成严重损害。</text>
+        <text class="section-text">4.2 我们处理上述敏感个人信息的目的和必要性:</text>
+        <text class="section-text">(a) 身份证号码:用于实名认证、法律法规要求的身份核验和支付安全。</text>
+        <text class="section-text">(b) 心理测评数据:用于生成专业的成长评估报告和个性化发展建议,是平台核心服务的基础。</text>
+        <text class="section-text">(c) 健康数据:用于生成健康分析和改善建议,帮助您了解自身健康状况。</text>
+        <text class="section-text">(d) 儿童个人信息:用于儿童成长管理和教育服务,家长作为监护人全程管理。</text>
+        <text class="section-text">4.3 我们处理敏感个人信息前,会通过弹窗等方式取得您的单独同意,并仅以最小必要原则收集和使用。</text>
+      </view>
+
+      <view class="policy-section">
+        <text class="section-title">五、儿童个人信息保护</text>
+        <text class="section-text">5.1 我们非常重视儿童个人信息的保护。本平台可能涉及收集14周岁以下儿童的个人信息,包括但不限于儿童姓名、年龄、性别、出生日期、身份证号、学校、年级、班级、身高、体重、心理测评数据、健康数据等。</text>
+        <text class="section-text">5.2 我们收集和处理儿童个人信息前,会通过家长(法定监护人)账号取得监护人的明确同意。监护人应仔细阅读本隐私政策,特别是本章节内容,并在同意后允许儿童使用本平台。</text>
+        <text class="section-text">5.3 监护人有权:</text>
+        <text class="section-text">(a) 查询和更正儿童的个人信息;</text>
+        <text class="section-text">(b) 要求删除儿童的个人信息;</text>
+        <text class="section-text">(c) 撤回对儿童个人信息处理的同意;</text>
+        <text class="section-text">(d) 注销儿童账号,注销后我们将删除或匿名化处理儿童的个人信息。</text>
+        <text class="section-text">5.4 我们采取以下措施保护儿童个人信息:</text>
+        <text class="section-text">(a) 指定专人负责儿童个人信息保护;</text>
+        <text class="section-text">(b) 对儿童个人信息采取加密存储和访问权限控制;</text>
+        <text class="section-text">(c) 严格限制儿童个人信息的使用范围,仅用于该儿童的教育和成长服务;</text>
+        <text class="section-text">(d) 不向第三方披露儿童个人信息,除非获得监护人同意或法律法规要求。</text>
+        <text class="section-text">5.5 如您是儿童的监护人,发现我们在未获监护人同意的情况下收集了儿童个人信息,请立即通过本政策底部联系方式与我们联系,我们将立即删除相关信息。</text>
+      </view>
+
+      <view class="policy-section">
+        <text class="section-title">六、信息的共享与披露</text>
+        <text class="section-text">6.1 我们不会将您的个人信息出售给任何第三方。</text>
+        <text class="section-text">6.2 在以下情况下,我们可能会共享您的信息:</text>
+        <text class="section-text">(a) 获得您的明确同意或单独授权;</text>
+        <text class="section-text">(b) 为提供服务需要与必要的合作伙伴共享,包括但不限于:</text>
+        <text class="section-text">—— 微信支付(深圳市腾讯计算机系统有限公司):处理虚拟支付交易,共享信息为订单号、支付金额、支付状态;</text>
+        <text class="section-text">—— 微信开放平台(深圳市腾讯计算机系统有限公司):提供微信登录和身份认证服务,共享信息为OpenID、UnionID、昵称、头像;</text>
+        <text class="section-text">—— Dify 平台(如适用):提供对话和分析服务,共享信息为对话内容、用户查询;</text>
+        <text class="section-text">(c) 成长规划师在为您提供服务时,可在您授权范围内查看家庭信息和测评结果;</text>
+        <text class="section-text">(d) 法律法规要求或有关国家机关依法要求;</text>
+        <text class="section-text">(e) 为保护我们或他人的合法权益所必需。</text>
+        <text class="section-text">6.3 我们与第三方合作时,会通过合同约定其数据安全保护义务,要求其遵循本隐私政策的规定,不得将您的个人信息用于其他目的。</text>
+      </view>
+
+      <view class="policy-section">
+        <text class="section-title">七、跨境数据传输</text>
+        <text class="section-text">
+          我们仅在中华人民共和国境内(为本隐私政策之目的,不含香港、澳门和台湾地区)存储和处理您的个人信息。如我们使用的AI服务提供商(如Dify)的服务器位于境外,我们将按照法律法规的要求进行个人信息保护影响评估,采取必要的安全措施,并在取得您的单独同意后方将数据传输至境外。如您不同意跨境传输,我们将无法为您提供相关的AI服务,但不影响您使用平台的其他功能。
+        </text>
+      </view>
+
+      <view class="policy-section">
+        <text class="section-title">八、信息安全措施</text>
+        <text class="section-text">我们采用业界通行的安全措施保护您的个人信息:</text>
+        <text class="section-text">8.1 传输加密:采用SSL/TLS加密协议保护数据传输过程中的安全。</text>
+        <text class="section-text">8.2 存储加密:对敏感个人信息(如身份证号、手机号、心理测评数据)进行加密存储。</text>
+        <text class="section-text">8.3 数据脱敏:在日志和显示中对身份证号、手机号、姓名等敏感信息进行脱敏处理。</text>
+        <text class="section-text">8.4 访问控制:实施严格的访问权限控制,仅授权人员可访问个人信息,且所有访问行为均有日志记录。</text>
+        <text class="section-text">8.5 安全审计:定期进行安全审计和漏洞扫描,持续改进安全能力。</text>
+        <text class="section-text">8.6 应急响应:建立数据安全事件应急响应机制,一旦发生数据泄露等安全事件,我们将立即启动应急预案,并在72小时内通知受影响的用户和监管部门。</text>
+        <text class="section-text">请注意,没有任何安全措施是100%完美的,我们将持续改进安全能力以保护您的信息安全。</text>
+      </view>
+
+      <view class="policy-section">
+        <text class="section-title">九、信息存储期限</text>
+        <text class="section-text">9.1 我们仅在实现本隐私政策所述目的所必需的最短期限内保留您的个人信息:</text>
+        <text class="section-text">(a) 用户基本资料:在您使用本平台期间持续保留,注销账号后180天内删除或匿名化处理;</text>
+        <text class="section-text">(b) 心理测评数据:自测评完成之日起保留7年(用于成长轨迹追踪),到期后匿名化处理;</text>
+        <text class="section-text">(c) 健康数据:自上传之日起保留5年,到期后匿名化处理;</text>
+        <text class="section-text">(d) 对话记录:自对话完成之日起保留1年,到期后匿名化处理;</text>
+        <text class="section-text">(e) 交易记录:自交易完成之日起保留不少于5年(根据《电子商务法》要求);</text>
+        <text class="section-text">(f) 日志记录:自产生之日起保留6个月,到期后自动删除。</text>
+        <text class="section-text">9.2 超出上述保留期限后,我们将删除或匿名化处理您的个人信息。匿名化后的信息无法识别特定个人,不属于个人信息,可不受限制地使用。</text>
+      </view>
+
+      <view class="policy-section">
+        <text class="section-title">十、您的权利</text>
+        <text class="section-text">根据《中华人民共和国个人信息保护法》,您对您的个人信息享有以下权利:</text>
+        <text class="section-text">10.1 查询和复制权:您可以通过个人中心查看您的个人信息,也可以联系我们获取个人信息的副本。</text>
+        <text class="section-text">10.2 更正权:如您的个人信息不准确或不完整,您可以在个人中心自行更正,或联系我们协助更正。</text>
+        <text class="section-text">10.3 删除权:在以下情况下,您可以要求我们删除您的个人信息:</text>
+        <text class="section-text">(a) 处理目的已实现、无法实现或不再必要;</text>
+        <text class="section-text">(b) 您撤回同意且我们无其他合法依据继续处理;</text>
+        <text class="section-text">(c) 我们违反法律法规或约定处理您的信息;</text>
+        <text class="section-text">(d) 您注销账号。</text>
+        <text class="section-text">10.4 撤回同意权:您可以撤回对个人信息处理的同意,撤回不影响此前基于同意进行的处理。您可以通过个人中心的"数据授权管理"功能撤回相关授权。</text>
+        <text class="section-text">10.5 注销账号权:您可以通过"我的—设置—注销账号"申请注销账号。注销后,我们将删除或匿名化处理您的个人信息,但法律法规另有要求的除外。</text>
+        <text class="section-text">10.6 数据可携带权:您可以要求我们将您的个人信息以结构化、常用、机器可读的格式提供给您,或转移给您指定的第三方。</text>
+        <text class="section-text">10.7 拒绝自动化决策权:您有权拒绝我们仅通过自动化决策方式做出对您权益有重大影响的决定。如您对测评结果或建议有异议,可以联系人工客服进行复核。</text>
+        <text class="section-text">10.8 逝者近亲属权利:已故用户的近亲属可以在符合法律法规规定的情况下,查阅、复制、更正、删除已故用户的个人信息。</text>
+        <text class="section-text">如您需要行使上述权利,请通过本政策底部的联系方式与我们联系。我们将在15个工作日内回复您的请求。</text>
+      </view>
+
+      <view class="policy-section">
+        <text class="section-title">十一、Cookie及类似技术</text>
+        <text class="section-text">
+          本平台使用微信小程序提供的本地存储功能(类似于Cookie技术)来存储您的登录状态和应用设置。这些信息仅存储在您的设备本地,我们不会通过Cookie技术追踪您的跨站行为。您可以在微信小程序设置中清除本地存储数据。
+        </text>
+      </view>
+
+      <view class="policy-section">
+        <text class="section-title">十二、政策变更</text>
+        <text class="section-text">
+          我们可能适时修订本隐私政策。修订后的隐私政策将在平台公示,更新日期将同步修改。对于重大变更,我们会通过弹窗、推送通知或站内信等方式通知您,并在取得您的重新同意后继续处理您的个人信息。重大变更包括但不限于:我们的服务模式发生重大变化;个人信息处理目的、方式发生变化;个人信息共享对象或目的发生变化;您行使权利的方式发生重大变化等。
+        </text>
+      </view>
+
+      <view class="policy-section">
+        <text class="section-title">十三、联系我们</text>
+        <text class="section-text">
+          如您对本隐私政策有任何疑问、意见或投诉,或需要行使您的个人信息相关权利,请通过以下方式联系我们:
+        </text>
+        <text class="section-text">电子邮件:service@etotem.com.cn</text>
+        <text class="section-text">运营主体:亿图腾(北京)科技有限公司</text>
+        <text class="section-text">我们将在收到您的请求后15个工作日内回复。如您对我们的回复不满意,或认为我们的个人信息处理行为损害了您的合法权益,您可以向网信办、工信部等监管部门投诉,或向有管辖权的人民法院提起诉讼。</text>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  data() { return {} }
+}
+</script>
+
+<style scoped lang="scss">
+.policy-container {
+  padding: 30rpx;
+  background: #FFFFFF;
+  min-height: 100vh;
+}
+.policy-content {
+  line-height: 1.8;
+}
+.policy-title {
+  font-size: 40rpx;
+  font-weight: bold;
+  color: #333333;
+  display: block;
+  text-align: center;
+  margin-bottom: 12rpx;
+}
+.policy-update {
+  font-size: 24rpx;
+  color: #999999;
+  display: block;
+  text-align: center;
+  margin-bottom: 40rpx;
+}
+.policy-section {
+  margin-bottom: 30rpx;
+}
+.section-title {
+  font-size: 30rpx;
+  font-weight: bold;
+  color: #333333;
+  display: block;
+  margin-bottom: 12rpx;
+}
+.section-text {
+  font-size: 26rpx;
+  color: #666666;
+  display: block;
+  margin-bottom: 8rpx;
+  text-indent: 2em;
+}
+</style>

+ 4 - 0
train-web/src/api/salon.js

@@ -4,6 +4,10 @@ export function createSalon(data) {
   return request.post('/api/admin/salon/create', data)
 }
 
+export function updateSalon(data) {
+  return request.post('/api/admin/salon/update', data)
+}
+
 export function salonList() {
   return request.post('/api/admin/salon/list', {})
 }

+ 1 - 0
train-web/src/config/menu-roles.js

@@ -4,6 +4,7 @@ const MENU_ROLES = {
   '/dashboard': ['admin', 'lecturer', 'assistant'],
   '/screen': ['admin', 'lecturer', 'assistant'],
   '/courses': ['admin'],
+  '/salons': ['admin'],
   '/classes': ['admin', 'assistant'],
   '/enrollments': ['admin', 'assistant'],
   '/orders': ['admin'],

+ 1 - 2
train-web/src/views/Layout.vue

@@ -17,8 +17,7 @@
           @select="handleMenuSelect"
         >
           <!-- 概览与现场(系统级) -->
-          <el-submenu index="group-overview" v-if="groupVisible(groupDefs.overview)">
-            <template slot="title">
+          <el-submenu index="group-overview" v-if="groupVisible(groupDefs.overview)">            <template slot="title">
               <i class="el-icon-s-platform"></i>
               <span class="group-title">概览与现场</span>
             </template>

+ 89 - 25
train-web/src/views/Salons.vue

@@ -7,8 +7,7 @@
       </div>
       <div class="toolbar-right">
         <el-button type="primary" icon="el-icon-plus" @click="showCreateDialog = true">新建沙龙</el-button>
-      </div>
-    </div>
+      </div>    </div>
 
     <el-table :data="list" v-loading="loading" border stripe style="width:100%">
       <el-table-column prop="id" label="ID" width="80" />
@@ -33,19 +32,20 @@
       <el-table-column prop="startAt" label="开始时间" width="170" :formatter="formatTime" />
       <el-table-column prop="endAt" label="结束时间" width="170" :formatter="formatTime" />
       <el-table-column prop="createdAt" label="创建时间" width="170" :formatter="formatTime" />
-      <el-table-column label="操作" width="200">
+      <el-table-column label="操作" width="260">
         <template slot-scope="{ row }">
           <el-button size="mini" @click="handleToggleStatus(row)">
-            {{ row.status === 'active' ? '结束' : '重新上架' }}
+            {{ row.status === 'active' ? '结束' : (row.status === 'draft' ? '发布' : '重新上架') }}
           </el-button>
+          <el-button size="mini" type="text" @click="openEdit(row)">编辑</el-button>
           <el-button size="mini" type="text" @click="viewRegistrations(row)">报名名单</el-button>
           <el-button size="mini" type="text" @click="viewFeedback(row)">反馈</el-button>
         </template>
       </el-table-column>
     </el-table>
 
-    <!-- 新建沙龙 Dialog -->
-    <el-dialog title="新建沙龙" :visible.sync="showCreateDialog" width="500px" @close="resetCreateForm">
+    <!-- 新建/编辑沙龙 Dialog -->
+    <el-dialog :title="editId ? '编辑沙龙' : '新建沙龙'" :visible.sync="showCreateDialog" width="500px" @close="resetCreateForm">
       <el-form :model="createForm" :rules="createRules" ref="createForm" label-width="80px">
         <el-form-item label="主题" prop="theme">
           <el-select v-model="createForm.theme" placeholder="请选择主题" style="width:100%">
@@ -67,7 +67,7 @@
         <el-form-item label="价格(元)">
           <el-input-number v-model="createForm.price" :min="0" :precision="2" />
         </el-form-item>
-        <el-form-item label="开始时间">
+        <el-form-item label="开始时间" prop="startAt">
           <el-date-picker 
             v-model="createForm.startAt" 
             type="datetime" 
@@ -76,7 +76,7 @@
             style="width:100%"
           />
         </el-form-item>
-        <el-form-item label="结束时间">
+        <el-form-item label="结束时间" prop="endAt">
           <el-date-picker 
             v-model="createForm.endAt" 
             type="datetime" 
@@ -129,7 +129,7 @@
 </template>
 
 <script>
-import { salonList, createSalon, salonStatus, salonRegistrations, salonCheckins, salonFeedbackList } from '@/api/salon'
+import { salonList, createSalon, updateSalon, salonStatus, salonRegistrations, salonCheckins, salonFeedbackList } from '@/api/salon'
 
 export default {
   name: 'Salons',
@@ -139,6 +139,7 @@ export default {
       loading: false,
       submitting: false,
       showCreateDialog: false,
+      editId: null,
       showRegDialog: false,
       regLoading: false,
       registrations: [],
@@ -169,6 +170,8 @@ export default {
       createRules: {
         theme: [{ required: true, message: '请选择主题', trigger: 'change' }],
         title: [{ required: true, message: '请输入标题', trigger: 'blur' }],
+        startAt: [{ required: true, message: '请选择开始时间', trigger: 'change' }],
+        endAt: [{ required: true, message: '请选择结束时间', trigger: 'change' }],
         capacity: [{ required: true, message: '请输入容量', trigger: 'blur' }]
       }
     }
@@ -213,6 +216,43 @@ export default {
         startAt: '',
         endAt: ''
       }
+      this.editId = null
+    },
+    openCreate: function () {
+      this.resetCreateForm()
+      this.showCreateDialog = true
+    },
+    openEdit: function (row) {
+      var self = this
+      self.createForm = {
+        theme: row.theme || '',
+        title: row.title || '',
+        time: row.time || '',
+        place: row.place || '',
+        capacity: row.capacity || 30,
+        price: row.price ? row.price / 100 : 0,
+        startAt: self.toDateTimeStr(row.startAt),
+        endAt: self.toDateTimeStr(row.endAt)
+      }
+      self.editId = row.id
+      self.showCreateDialog = true
+    },
+    toDateTimeStr: function (val) {
+      if (val === null || val === undefined || val === '') return ''
+      if (typeof val === 'number') {
+        var d = new Date(val)
+        if (isNaN(d.getTime())) return ''
+        function pad (n) { return n < 10 ? '0' + n : '' + n }
+        return d.getFullYear() + '-' + pad(d.getMonth() + 1) + '-' + pad(d.getDate()) +
+          ' ' + pad(d.getHours()) + ':' + pad(d.getMinutes()) + ':' + pad(d.getSeconds())
+      }
+      if (typeof val === 'string') {
+        if (/^\d+$/.test(val)) {
+          return this.toDateTimeStr(Number(val))
+        }
+        return val.replace('T', ' ').slice(0, 19)
+      }
+      return ''
     },
     handleCreate: function () {
       var self = this
@@ -225,26 +265,50 @@ export default {
         var payload = Object.assign({}, self.createForm)
         payload.price = Math.round(payload.price * 100)
         
-        createSalon(payload).then(function () {
-          self.$message.success('创建成功')
-          self.showCreateDialog = false
-          self.fetchList()
-        }).catch(function () {
-          self.$message.error('创建失败')
-        }).finally(function () {
-          self.submitting = false
-        })
+        if (self.editId) {
+          payload.id = self.editId
+          updateSalon(payload).then(function () {
+            self.$message.success('编辑成功')
+            self.showCreateDialog = false
+            self.fetchList()
+          }).catch(function () {
+            self.$message.error('编辑失败')
+          }).finally(function () {
+            self.submitting = false
+          })
+        } else {
+          createSalon(payload).then(function () {
+            self.$message.success('创建成功')
+            self.showCreateDialog = false
+            self.fetchList()
+          }).catch(function () {
+            self.$message.error('创建失败')
+          }).finally(function () {
+            self.submitting = false
+          })
+        }
       })
     },
     handleToggleStatus: function (row) {
       var self = this
-      var nextStatus = row.status === 'active' ? 'finished' : 'active'
-      salonStatus({ id: row.id, status: nextStatus }).then(function () {
-        self.$message.success('状态更新成功')
-        self.fetchList()
-      }).catch(function () {
-        self.$message.error('更新失败')
-      })
+      // 对齐 cfc 活动流程:draft→发布(active)、active→结束(finished)、finished→重新上架(active)
+      var nextStatus = 'active'
+      var confirmMsg = '确认发布该沙龙?发布后学员端可见并可报名'
+      if (row.status === 'active') {
+        nextStatus = 'finished'
+        confirmMsg = '确认结束该沙龙?'
+      } else if (row.status === 'finished') {
+        nextStatus = 'active'
+        confirmMsg = '确认重新上架该沙龙?'
+      }
+      self.$confirm(confirmMsg, '提示').then(function () {
+        salonStatus({ id: row.id, status: nextStatus }).then(function () {
+          self.$message.success('操作成功')
+          self.fetchList()
+        }).catch(function () {
+          self.$message.error('操作失败')
+        })
+      }).catch(function () {})
     },
     viewRegistrations: function (row) {
       var self = this