Browse Source

feat(train-frontend): M3 评价四层与晋升中心落地

- pages/eval/index.vue:四层评价卡片(客户/机构绩效/培训考核+综合评级置顶),avg/composite
  toFixed(2)、training 展示累计学时(分钟/60)+通过门数,latest 用 defaultLatest 本地文案兜底
- pages/eval/submit.vue:1-5 星点选 + 200 字评语 + 提交成功覆盖层;成功判定 code===200 && data.evalId
  (重复评价 200 幂等);文案「评价仅服务人员可查看,用于档案沉淀,机构用于评定」
- pages/promotion/index.vue:T1-T4 认证轨道 + 学时环 + 申请晋升 + unmet 缺口清单(单位换算表:
  rating ×100/100、学时分钟/60、order_count/exam_score 原生)+ 晋升履历时间线 + 达标成功弹层
- components:star-rating(只读/提交双模式,toFixed(2))、ring-progress(SVG)、promo-track(四档轨)、
  timeline-item;status-tag 补 promoted/evaluated 文案
- api/eval.js、api/promotion.js 契约对齐 f1dc175;work/detail 加「去评价/已评价」入口(本地记忆,
  不依赖后端不存在的 evalDone 字段);档案页激活「我的评价」「晋升中心」入口
- npm run build:h5 exit 0;无 ?./??/CSS Grid/中文类名;五态全覆盖
liaoxg 2 days ago
parent
commit
1d4aaf76d9

+ 66 - 0
train-frontend/api/eval.js

@@ -0,0 +1,66 @@
+/**
+ * api/eval.js — 四层评价域接口(服务人员侧)
+ * 契约见《健康服务人员助手_后端服务设计_v1.0》§7.3 评价线(四层)
+ * 复用 utils/api.js 的统一 request 封装。
+ *
+ * 四层口径(单一事实源):
+ *   客户服务评价(E1)← /api/eval/submit,only-after-confirmed
+ *   机构绩效考核(E2)← /api/eval/org(机构/讲师录入,本侧只读)
+ *   培训考核成绩(E3)← /api/eval/training(讲师录入,本侧只读)
+ *   综合评级(E4)   ← 后端聚合,本侧只读
+ *
+ * 单位/脱敏说明:score 1-5 整数;avg 为后端聚合的小数(0.0-5.0,直接展示,勿再换算);
+ *   无金额字段,无敏感字段;mustOwn(只能读本人)。
+ */
+import { request } from '@/utils/api.js'
+
+/**
+ * 四层评价汇总(本侧主视图)
+ * 入参:无(后端按当前登录人聚合)
+ * 出参:{client:{avg,count}, org:{avg,count}, training:{avg,count,creditTotal,passCount}, composite}
+ *   avg/composite 后端已 round2(2 位小数,如 4.12),直接展示;
+ *   training.creditTotal 单位=**分钟**(红线),展示层才做 /60 换算
+ *   ⚠ 无 latest 字段(后端确认),仅展示 avg/count + 引导文案
+ * 错误:401 需登录 / 500 查询失败
+ * silent:无评价是正常空态,由页面展示引导,不弹全局 toast
+ */
+export function getEvalMine() {
+  return request('/api/eval/mine', 'POST', {}, { silent: true })
+}
+
+/**
+ * 客户服务评价提交 ★only-after-confirmed(幂等)
+ * 入参:{orderId:Long, score:int(1-5), comment?:String}(dimension 后端缺省 'service',无需传)
+ * 出参:Result<EvalRecord>,data 含 evalId/evalType/orderId/userId/scorerId/score/dimension/comment/status/createdAt
+ *   ⚠ 重复评价:返回 **200 success + data.evalId(不是 error)**,幂等不报错——
+ *   前端「已评价 ✓」判定用 res.code==200 && data.evalId 有值 + 本地记忆 evalSubmittedOrders
+ * 校验:order.status==confirmed 且 userId==order.workerId
+ * 错误:404「工单不存在或不属于您」(orderId 为空/不属于本人)/ 500「工单未确认,暂不可评价」
+ *       500「评分须为1-5星」
+ * 注意:本接口**不做** silent——业务拒绝(未确认/评分非法)需要前端明确 toast 提示,
+ *       页面按 err.message 展示。
+ */
+export function submitClientEval(orderId, score, comment) {
+  var body = { orderId: orderId, score: score }
+  if (comment) body.comment = comment
+  return request('/api/eval/submit', 'POST', body)
+}
+
+/**
+ * 机构侧录入绩效评价(本侧不发起,仅占位说明契约)
+ * 入参:{userId:Long(被评), score, dimension, comment}
+ * 权限:RoleGuard.requireOrgOrTeacher,学员端调用会 401
+ */
+export function submitOrgEval(data) {
+  return request('/api/eval/org', 'POST', data || {})
+}
+
+/**
+ * 培训考核成绩录入(双达标触发发证)
+ * 入参:{userId, examScore:int, creditHours:int}
+ * ⚠ creditHours 在此为「学时(整数小时)」——讲师授权录入口径,
+ *    与 /api/credit/* 的「分钟」口径不同,勿混用。
+ */
+export function submitTrainingEval(data) {
+  return request('/api/eval/training', 'POST', data || {})
+}

+ 52 - 0
train-frontend/api/promotion.js

@@ -0,0 +1,52 @@
+/**
+ * api/promotion.js — 晋升域接口(服务人员侧)
+ * 契约见《健康服务人员助手_后端服务设计_v1.0》§7.6 晋升
+ * 复用 utils/api.js 的统一 request 封装。
+ *
+ * 晋升状态机:evaluated → {promoted, rejected};达标自动写 train_promotion_record + 升级(同事务)。
+ * 单位/脱敏:metric current/threshold 数值由后端按规则返回(order_count=单量、rating=分、credit_hours=小时/分钟视规则配置);
+ *   前端仅展示 label 与文本缺口,不做二次换算;无敏感字段;mustOwn。
+ */
+import { request } from '@/utils/api.js'
+
+/**
+ * 提交晋升断言
+ * 入参:{authLevel:String}(如 'T2',目标档位,大小写容错)
+ * 出参:{eligible:boolean, promoted:boolean, authLevel, unmet:[{metric,label,current,threshold}], recordId?, message?}
+ *   eligible=true 达标自动晋升;false 返回缺口清单
+ *   label 后端已给中文(接单量/综合评分/理论学时/总学时/考核成绩),前端优先后端 label
+ *   ⚠ current/threshold 单位换算表(均 metric 原生单位,展示层换算):
+ *     serve_count/order_count → 单;rating → ×100(412 → 4.12 分,展示 /100);
+ *     theory_hours/total_hours/credit_hours → 分钟(展示 /60);exam_score → 分(0-100)
+ *   特殊:目标≤当前 → 200 {eligible:false, message:"当前已是该认证等级"};
+ *         未配置规则 → error「未配置该等级的晋升规则」
+ * 错误:401 需登录
+ * silent:不达标是正常业务态,缺口清单由页面渲染,不弹全局 toast
+ */
+export function applyPromotion(authLevel) {
+  return request('/api/promotion/apply', 'POST', { authLevel: authLevel }, { silent: true })
+}
+
+/**
+ * 晋升履历
+ * 入参:{page?:int=1, size?:int=10}
+ * 出参:{total,page,size,**list**}(键为 list,非 records),mustOwn
+ *   每项:id(=recordId)/title("T2 讲师认证")/time(=appliedAt ISO)/desc(=status)/
+ *         recordId/authLevel/pass(boolean)/unmet/status/appliedAt/promotedAt/createdAt
+ *   status 值域 = promoted / evaluated / rejected
+ * 空列表是正常空态,页面展示「暂无晋升记录」
+ */
+export function getPromotionRecords(page, size) {
+  var data = { page: page || 1, size: size || 20 }
+  return request('/api/promotion/records', 'POST', data, { silent: true })
+}
+
+/**
+ * 解锁判定(闸口,只读)
+ * 入参:{orderId?, serviceType?}
+ * 出参:{allowed:boolean, reason:String}
+ * 本侧晋升中心不直接调用,由派单/接单链路上游使用;占位固化契约注释。
+ */
+export function checkPromotionUnlock(data) {
+  return request('/api/promotion/unlock', 'POST', data || {})
+}

+ 99 - 0
train-frontend/components/promo-track.vue

@@ -0,0 +1,99 @@
+<template>
+  <view class="pt-track">
+    <view
+      v-for="seg in segments"
+      :key="seg.key"
+      class="pt-seg"
+      :class="seg.cls"
+    >
+      <text class="pt-seg-name">{{ seg.key }}</text>
+      <text class="pt-seg-desc">{{ seg.desc }}</text>
+    </view>
+  </view>
+</template>
+
+<script>
+/**
+ * PromoTrack — 晋升四档轨道(分子级,T1→T4 自绘)
+ * 视觉口径(与档案页一致):
+ *   未达档位(frozen)置灰:本档未解锁
+ *   已解锁档位(done)填浅绿:历史已达成
+ *   当前档位(current)高亮蓝:正在所处档
+ * 用法:<PromoTrack :current-index="1" :unmet-index="2" />
+ * 契约:currentIndex 0-3(-1=未认证);unmetIndex 下一缺口档位(用于置灰缺口提示,可选)
+ */
+var LEVELS = [
+  { key: 'T1', desc: '入门' },
+  { key: 'T2', desc: '熟练' },
+  { key: 'T3', desc: '骨干' },
+  { key: 'T4', desc: '专家' }
+]
+
+export default {
+  name: 'PromoTrack',
+  props: {
+    // 当前档位索引 0-3;-1 表示未认证(全部灰)
+    currentIndex: { type: Number, default: -1 },
+    // 缺口档位索引(下一目标),用于挂缺口提示样式
+    unmetIndex: { type: Number, default: -1 }
+  },
+  computed: {
+    segments() {
+      var arr = []
+      for (var i = 0; i < LEVELS.length; i++) {
+        var lv = LEVELS[i]
+        var cls = ''
+        var ci = this.currentIndex
+        if (ci < 0) {
+          cls = 'pt-frozen'
+        } else if (i < ci) {
+          cls = 'pt-done'
+        } else if (i === ci) {
+          cls = 'pt-current'
+        } else {
+          cls = 'pt-frozen'
+        }
+        arr.push({ key: lv.key, desc: lv.desc, cls: cls })
+      }
+      return arr
+    }
+  }
+}
+</script>
+
+<style scoped>
+.pt-track {
+  display: flex;
+  justify-content: space-between;
+  width: 100%;
+}
+.pt-seg {
+  width: 23%;
+  border-radius: 14rpx;
+  padding: 18rpx 0;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  background: #F0F5FA;
+  border: 1rpx solid #E3EEF7;
+}
+.pt-seg-name { font-size: 30rpx; font-weight: 700; }
+.pt-seg-desc { font-size: 22rpx; margin-top: 6rpx; }
+/* 未解锁 */
+.pt-frozen .pt-seg-name { color: #9DB3C9; }
+.pt-frozen .pt-seg-desc { color: #9DB3C9; }
+/* 已解锁 */
+.pt-done {
+  background: #E4F3EA;
+  border-color: #CBE6D6;
+}
+.pt-done .pt-seg-name { color: #0E8A4F; }
+.pt-done .pt-seg-desc { color: #0E8A4F; }
+/* 当前档 */
+.pt-current {
+  background: #2E6FA8;
+  border-color: #2E6FA8;
+}
+.pt-current .pt-seg-name { color: #FFFFFF; }
+.pt-current .pt-seg-desc { color: rgba(255, 255, 255, 0.85); }
+</style>

+ 123 - 0
train-frontend/components/ring-progress.vue

@@ -0,0 +1,123 @@
+<template>
+  <view class="rp-wrap" :style="wrapStyle">
+    <!-- SVG 环形:圆环 stroke-dasharray 实现进度 -->
+    <svg :viewBox="viewBox" class="rp-svg" :style="svgStyle">
+      <circle :cx="center" :cy="center" :r="radius" :stroke="trackColor" :stroke-width="strokeW" fill="none" />
+      <circle
+        :cx="center"
+        :cy="center"
+        :r="radius"
+        :stroke="barColor"
+        :stroke-width="strokeW"
+        fill="none"
+        :stroke-linecap="'round'"
+        :stroke-dasharray="dashArray"
+        :stroke-dashoffset="dashOffset"
+        :transform="'rotate(-90 ' + center + ' ' + center + ')'"
+      />
+    </svg>
+    <view class="rp-center">
+      <text class="rp-value" :style="{ fontSize: valueFont }">{{ valueText }}</text>
+      <text v-if="label" class="rp-label">{{ label }}</text>
+    </view>
+  </view>
+</template>
+
+<script>
+/**
+ * RingProgress — 环形进度(原子级,SVG 自绘,rpx 自适应)
+ * 用途:学时达标 / 认证进度 / 综合评级环
+ * 契约:percent 0-100;valueText 居中数字;label 下方文字
+ */
+export default {
+  name: 'RingProgress',
+  props: {
+    percent: { type: Number, default: 0 },
+    // 展示尺寸(px,组件内部按 rpx 换算)
+    size: { type: Number, default: 160 },
+    color: { type: String, default: '#2E6FA8' },
+    label: { type: String, default: '' },
+    valueText: { type: String, default: '' }
+  },
+  data() {
+    return {
+      trackColor: '#E3EEF7',
+      strokeW: 10
+    }
+  },
+  computed: {
+    center() {
+      return this.size / 2
+    },
+    radius() {
+      return (this.size - this.strokeW) / 2
+    },
+    viewBox() {
+      return '0 0 ' + this.size + ' ' + this.size
+    },
+    svgStyle() {
+      return {
+        width: this.size + 'px',
+        height: this.size + 'px'
+      }
+    },
+    wrapStyle() {
+      return {
+        width: this.size + 'px',
+        height: this.size + 'px'
+      }
+    },
+    circumference() {
+      return 2 * Math.PI * this.radius
+    },
+    dashArray() {
+      return this.circumference + ''
+    },
+    dashOffset() {
+      var p = this.percent
+      if (p < 0) p = 0
+      if (p > 100) p = 100
+      return this.circumference * (1 - p / 100)
+    },
+    barColor() {
+      return this.color
+    },
+    valueFont() {
+      return Math.round(this.size * 0.24) + 'px'
+    }
+  }
+}
+</script>
+
+<style scoped>
+.rp-wrap {
+  position: relative;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+.rp-svg {
+  display: block;
+}
+.rp-center {
+  position: absolute;
+  left: 0;
+  right: 0;
+  top: 0;
+  bottom: 0;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+}
+.rp-value {
+  font-weight: 700;
+  color: #12395F;
+  line-height: 1.2;
+}
+.rp-label {
+  font-size: 20rpx;
+  color: #7A97B5;
+  margin-top: 4rpx;
+}
+</style>

+ 103 - 0
train-frontend/components/star-rating.vue

@@ -0,0 +1,103 @@
+<template>
+  <view class="sr-wrap">
+    <view class="sr-row">
+      <text
+        v-for="s in stars"
+        :key="s.index"
+        class="sr-star"
+        :class="s.cls"
+        @click="handleTap(s.index)"
+      >★</text>
+    </view>
+    <text v-if="showValue" class="sr-value">{{ valueText }}</text>
+  </view>
+</template>
+
+<script>
+/**
+ * StarRating — 星级组件(原子级:1-5 星,只读/提交双模式)
+ * 说明:
+ *   - 需求明确「半颗不用」,只读沿用整数星:value=4.7 → 5 星满;value=4.2 → 4 星满
+ *     (四舍五入,展示「★x5」+ 数字文本给精确值,避免误导)
+ *   - 提交模式:点选 1-5,emit input
+ * 用法(只读):<StarRating :value="4.7" :show-value="true" readonly />
+ * 用法(提交):<StarRating :value="score" :readonly="false" @input="score = $event" />
+ */
+export default {
+  name: 'StarRating',
+  props: {
+    // 当前星级:只读 0-5 小数;提交 1-5 整数
+    value: { type: Number, default: 0 },
+    readonly: { type: Boolean, default: true },
+    showValue: { type: Boolean, default: false }
+  },
+  data() {
+    return {
+      picked: 0
+    }
+  },
+  computed: {
+    stars() {
+      var arr = []
+      var filled = this.readonly ? this.roundValue() : this.picked
+      for (var i = 1; i <= 5; i++) {
+        arr.push({
+          index: i,
+          cls: i <= filled ? 'sr-filled' : 'sr-empty'
+        })
+      }
+      return arr
+    },
+    valueText() {
+      if (!this.showValue) return ''
+      var v = this.value || 0
+      // 后端评分已 round2(2 位小数),展示保留 2 位保持一致
+      return v > 0 ? v.toFixed(2) : '—'
+    }
+  },
+  watch: {
+    // 父级传入的值更新时同步本地选择(提交模式初始化)
+    value: {
+      immediate: true,
+      handler(val) {
+        this.picked = val || 0
+      }
+    }
+  },
+  methods: {
+    roundValue() {
+      var v = this.value || 0
+      if (v <= 0) return 0
+      return Math.round(v)
+    },
+    handleTap(idx) {
+      if (this.readonly) return
+      this.picked = idx
+      this.$emit('input', idx)
+    }
+  }
+}
+</script>
+
+<style scoped>
+.sr-wrap {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
+.sr-row {
+  display: flex;
+}
+.sr-star {
+  font-size: 44rpx;
+  margin: 0 6rpx;
+  line-height: 1;
+}
+.sr-filled { color: #E8A33D; }
+.sr-empty { color: #D9E4EF; }
+.sr-value {
+  font-size: 24rpx;
+  color: #5B7A99;
+  margin-top: 8rpx;
+}
+</style>

+ 7 - 2
train-frontend/components/status-tag.vue

@@ -63,7 +63,10 @@ export default {
         invalid: '码无效',
         // 通用
         accepted: '已通过',
-        rejected2: '未通过'
+        rejected2: '未通过',
+        // 晋升
+        promoted: '已晋升',
+        evaluated: '评定中'
       }
       if (this.type === 'credit') {
         return map
@@ -86,7 +89,9 @@ export default {
         success: 'green',
         dupe: 'blue',
         invalid: 'red',
-        accepted: 'green'
+        accepted: 'green',
+        promoted: 'green',
+        evaluated: 'blue'
       }
       return map
     }

+ 95 - 0
train-frontend/components/timeline-item.vue

@@ -0,0 +1,95 @@
+<template>
+  <view class="tl-item">
+    <view class="tl-left">
+      <view class="tl-dot" :class="dotCls"></view>
+      <view v-if="isLast" class="tl-line tl-line-empty"></view>
+      <view v-else class="tl-line"></view>
+    </view>
+    <view class="tl-body">
+      <view class="tl-head">
+        <text class="tl-title">{{ title }}</text>
+        <StatusTag :status="status" type="promo" :text="statusText" />
+      </view>
+      <text v-if="time" class="tl-time">{{ time }}</text>
+      <text v-if="desc" class="tl-desc">{{ desc }}</text>
+    </view>
+  </view>
+</template>
+
+<script>
+import StatusTag from '@/components/status-tag.vue'
+
+/**
+ * TimeLineItem — 时间线条目(分子级)
+ * 用法:<TimeLineItem title="晋升 T2" time="2026-08-20" desc="依据:客户评分4.8达标" status="promoted" :is-last="true" />
+ * 契约:status∈{promoted, evaluated, rejected};statusText 覆盖默认映射
+ */
+export default {
+  name: 'TimeLineItem',
+  components: { StatusTag },
+  props: {
+    title: { type: String, default: '' },
+    time: { type: String, default: '' },
+    desc: { type: String, default: '' },
+    status: { type: String, default: '' },
+    statusText: { type: String, default: '' },
+    isLast: { type: Boolean, default: false }
+  },
+  computed: {
+    dotCls() {
+      if (this.status === 'promoted') return 'dot-green'
+      if (this.status === 'rejected') return 'dot-red'
+      return 'dot-grey'
+    }
+  }
+}
+</script>
+
+<style scoped>
+.tl-item {
+  display: flex;
+  align-items: stretch;
+}
+.tl-left {
+  width: 40rpx;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  margin-right: 20rpx;
+}
+.tl-dot {
+  width: 20rpx;
+  height: 20rpx;
+  border-radius: 50%;
+  margin-top: 8rpx;
+  flex-shrink: 0;
+}
+.dot-green { background: #0E8A4F; }
+.dot-grey { background: #9DB3C9; }
+.dot-red { background: #C0392B; }
+.tl-line {
+  width: 2rpx;
+  flex: 1;
+  background: #E3EEF7;
+  min-height: 60rpx;
+}
+.tl-line-empty {
+  background: transparent;
+}
+.tl-body {
+  flex: 1;
+  background: #FFFFFF;
+  border: 1rpx solid #E3EEF7;
+  border-radius: 14rpx;
+  padding: 20rpx 22rpx;
+  margin-bottom: 24rpx;
+}
+.tl-head {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+.tl-title { font-size: 28rpx; font-weight: 700; color: #12395F; }
+.tl-time { display: block; font-size: 22rpx; color: #7A97B5; margin-top: 8rpx; }
+.tl-desc { display: block; font-size: 24rpx; color: #5B7A99; line-height: 1.6; margin-top: 8rpx; }
+</style>

+ 18 - 0
train-frontend/pages.json

@@ -263,6 +263,24 @@
       "style": {
         "navigationBarTitleText": "学时账户"
       }
+    },
+    {
+      "path": "pages/eval/index",
+      "style": {
+        "navigationBarTitleText": "我的评价"
+      }
+    },
+    {
+      "path": "pages/eval/submit",
+      "style": {
+        "navigationBarTitleText": "服务评价"
+      }
+    },
+    {
+      "path": "pages/promotion/index",
+      "style": {
+        "navigationBarTitleText": "晋升中心"
+      }
     }
   ],
   "globalStyle": {

+ 226 - 0
train-frontend/pages/eval/index.vue

@@ -0,0 +1,226 @@
+<template>
+  <view class="eval-page">
+    <!-- 加载骨架 -->
+    <LoadingSkeleton v-if="loading" :rows="4" />
+
+    <!-- 错误态 -->
+    <ErrorState v-else-if="error" message="评价加载失败" @retry="loadData" />
+
+    <!-- 空态:四层全部为空 -->
+    <EmptyState
+      v-else-if="isEmpty"
+      icon="⭐"
+      title="暂无评价记录"
+      desc="完成并确认服务后可收到客户评价,机构绩效考核与培训成绩将在评定后沉淀"
+    />
+
+    <!-- 正常态:四层评价卡片 -->
+    <view v-else class="eval-content">
+      <view class="eval-head">
+        <text class="eval-title">我的评价</text>
+        <text class="eval-sub">评价用于档案沉淀,仅本人与机构可查看</text>
+      </view>
+
+      <!-- 综合评级(E4)置顶大卡 -->
+      <view class="composite-card">
+        <view class="composite-left">
+          <text class="composite-num">{{ compositeText }}</text>
+          <text class="composite-label">综合评级</text>
+        </view>
+        <view class="composite-right">
+          <StarRating :value="compositeNum" :show-value="true" readonly />
+          <text class="composite-count">{{ compositeCountText }}</text>
+        </view>
+      </view>
+
+      <!-- 四层:客户 / 机构 / 培训 -->
+      <view class="layer-card" v-for="layer in layers" :key="layer.name">
+        <view class="layer-head">
+          <text class="layer-name">{{ layer.name }}</text>
+          <view class="layer-score">
+            <StarRating :value="layer.avg" readonly />
+            <text class="layer-avg">{{ layer.avgText }}</text>
+          </view>
+        </view>
+        <view class="layer-meta">
+          <text class="layer-count">{{ layer.countText }}</text>
+          <text class="layer-latest">{{ layer.latestText }}</text>
+          <text v-if="layer.extraText" class="layer-extra">{{ layer.extraText }}</text>
+        </view>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+import { getEvalMine } from '@/api/eval.js'
+import { creditHours } from '@/utils/format.js'
+import StarRating from '@/components/star-rating.vue'
+import EmptyState from '@/components/empty-state.vue'
+import ErrorState from '@/components/error-state.vue'
+import LoadingSkeleton from '@/components/loading-skeleton.vue'
+
+export default {
+  components: { StarRating, EmptyState, ErrorState, LoadingSkeleton },
+  data() {
+    return {
+      loading: true,
+      error: false,
+      data: null
+    }
+  },
+  computed: {
+    isEmpty() {
+      // 四层全部无记录视为空态(客户端评价/机构绩效/培训成绩 avg 均无)
+      var d = this.data
+      if (!d) return true
+      var hasClient = d.client && (d.client.avg > 0 || d.client.count > 0)
+      var hasOrg = d.org && (d.org.avg > 0 || d.org.count > 0)
+      var hasTraining = d.training && (d.training.avg > 0 || d.training.count > 0)
+      return !hasClient && !hasOrg && !hasTraining
+    },
+    compositeNum() {
+      var d = this.data || {}
+      return this.num(d.composite)
+    },
+    compositeText() {
+      var n = this.compositeNum
+      // 后端已 round2(2 位小数,如 4.12),展示保留 2 位
+      return n > 0 ? n.toFixed(2) : '—'
+    },
+    compositeCountText() {
+      var d = this.data || {}
+      var count = 0
+      if (d.client) count += this.num(d.client.count)
+      if (d.org) count += this.num(d.org.count)
+      if (d.training) count += this.num(d.training.count)
+      return count > 0 ? '基于 ' + count + ' 条记录' : '暂无评定'
+    },
+    layers() {
+      var d = this.data || {}
+      return [
+        this.buildLayer('客户服务评价', 'client', d.client),
+        this.buildLayer('机构绩效考核', 'org', d.org),
+        this.buildTraining(d.training)
+      ]
+    }
+  },
+  onLoad() {
+    this.loadData()
+  },
+  methods: {
+    num(v) {
+      var n = Number(v)
+      return isNaN(n) ? 0 : n
+    },
+    buildLayer(name, item) {
+      var avg = item ? this.num(item.avg) : 0
+      var count = item ? this.num(item.count) : 0
+      return {
+        name: name,
+        avg: avg,
+        // 后端已 round2(2 位小数),直接 toFixed(2) 展示
+        avgText: avg > 0 ? avg.toFixed(2) : '—',
+        countText: count > 0 ? count + ' 条记录' : '暂无记录',
+        latestText: this.defaultLatest(name),
+        extraText: ''
+      }
+    },
+    // 培训成绩:后端多返 creditTotal(分钟) + passCount,一并展示(红线:分钟→小时仅展示层换算)
+    buildTraining(item) {
+      var layer = this.buildLayer('培训考核成绩', item)
+      layer.extraText = item ? ('累计学时 ' + creditHours(this.num(item.creditTotal)) + ' h' +
+        ' · 通过 ' + this.num(item.passCount) + ' 门') : ''
+      return layer
+    },
+    defaultLatest(name) {
+      var map = {
+        '客户服务评价': '完成并确认服务后自动沉淀',
+        '机构绩效考核': '机构定期评定后更新',
+        '培训考核成绩': '培训考核通过后更新'
+      }
+      return map[name] || ''
+    },
+    loadData() {
+      var self = this
+      self.loading = true
+      self.error = false
+      getEvalMine().then(function(res) {
+        self.loading = false
+        self.data = (res && res.data) ? res.data : null
+      }).catch(function() {
+        self.loading = false
+        self.error = true
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+.eval-page {
+  min-height: 100vh;
+  background: #F4F8FC;
+  padding: 20rpx 24rpx 48rpx;
+}
+.eval-content { padding-top: 4rpx; }
+.eval-head {
+  padding: 8rpx 4rpx 20rpx;
+}
+.eval-title { font-size: 38rpx; font-weight: 700; color: #12395F; }
+.eval-sub { display: block; font-size: 24rpx; color: #7A97B5; margin-top: 8rpx; }
+.composite-card {
+  background: linear-gradient(135deg, #12395F, #2E6FA8);
+  border-radius: 20rpx;
+  padding: 32rpx 28rpx;
+  margin-bottom: 20rpx;
+  display: flex;
+  align-items: center;
+}
+.composite-left {
+  flex: 1;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
+.composite-num { font-size: 72rpx; font-weight: 700; color: #FFFFFF; line-height: 1.1; }
+.composite-label { font-size: 24rpx; color: rgba(255, 255, 255, 0.85); margin-top: 8rpx; }
+.composite-right {
+  flex: 1;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
+.composite-count { font-size: 22rpx; color: rgba(255, 255, 255, 0.75); margin-top: 12rpx; }
+.layer-card {
+  background: #FFFFFF;
+  border: 1px solid #E3EEF7;
+  border-radius: 20rpx;
+  padding: 26rpx 24rpx;
+  margin-bottom: 20rpx;
+}
+.layer-head {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+.layer-name { font-size: 30rpx; font-weight: 700; color: #12395F; }
+.layer-score {
+  display: flex;
+  align-items: center;
+}
+.layer-avg {
+  font-size: 26rpx;
+  font-weight: 700;
+  color: #B9770E;
+  margin-left: 12rpx;
+}
+.layer-meta {
+  margin-top: 14rpx;
+  display: flex;
+  flex-direction: column;
+}
+.layer-count { font-size: 24rpx; color: #2E6FA8; font-weight: 600; }
+.layer-latest { font-size: 22rpx; color: #7A97B5; margin-top: 6rpx; }
+.layer-extra { font-size: 22rpx; color: #7A97B5; margin-top: 6rpx; }
+</style>

+ 270 - 0
train-frontend/pages/eval/submit.vue

@@ -0,0 +1,270 @@
+<template>
+  <view class="eval-submit-page">
+    <!-- 错误态(无订单参数/订单加载失败) -->
+    <ErrorState v-if="error" message="评价信息加载失败" @retry="loadOrder" />
+
+    <!-- 正常态 -->
+    <view v-else>
+      <!-- 订单信息卡(只读展示) -->
+      <view class="order-card">
+        <view class="order-head">
+          <text class="order-no">{{ order.orderNo || '' }}</text>
+          <text class="order-status">已确认</text>
+        </view>
+        <text class="order-family">{{ order.familyName || '客户家' }}</text>
+        <text class="order-time">{{ orderText }}</text>
+      </view>
+
+      <!-- 评分卡:1-5 星大星点选 -->
+      <view class="rate-card">
+        <text class="rate-title">服务评分</text>
+        <StarRating :value="score" :readonly="false" @input="onScore" />
+        <text class="rate-hint">{{ scoreText }}</text>
+      </view>
+
+      <!-- 评语卡 -->
+      <view class="comment-card">
+        <text class="comment-title">评价内容</text>
+        <textarea
+          class="comment-input"
+          v-model="comment"
+          placeholder="说说本次服务体验(选填,200 字以内)"
+          maxlength="200"
+        ></textarea>
+        <text class="comment-count">{{ comment.length }}/200</text>
+      </view>
+
+      <!-- 提交大按钮 -->
+      <button class="big-btn submit-btn" :disabled="submitting || score === 0" @click="doSubmit">
+        {{ submitting ? '提交中...' : '提交评价' }}
+      </button>
+      <text class="privacy-tip">评价仅服务人员可查看,用于档案沉淀,机构用于评定</text>
+    </view>
+
+    <!-- 成功覆盖层 -->
+    <view v-if="success" class="success-mask">
+      <view class="success-card">
+        <text class="success-icon">✓</text>
+        <text class="success-title">评价成功</text>
+        <text class="success-desc">您的评价已沉淀到健康服务档案</text>
+        <button class="big-btn success-btn" @click="goBack">返回工单</button>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+import { submitClientEval } from '@/api/eval.js'
+import { getServiceOrderDetail } from '@/utils/api.js'
+import StarRating from '@/components/star-rating.vue'
+import ErrorState from '@/components/error-state.vue'
+
+var SUBMITTED_KEY = 'evalSubmittedOrders'
+
+export default {
+  components: { StarRating, ErrorState },
+  data() {
+    return {
+      orderId: null,
+      order: {},
+      score: 0,
+      comment: '',
+      submitting: false,
+      error: false,
+      success: false
+    }
+  },
+  computed: {
+    orderText() {
+      var o = this.order
+      if (o.startAt) return (o.startAt || '') + (o.endAt ? ' ~ ' + o.endAt : '')
+      return '服务时间待定'
+    },
+    scoreText() {
+      if (this.score <= 0) return '请点亮星星评分'
+      var map = { 1: '非常不满意', 2: '不满意', 3: '一般', 4: '满意', 5: '非常满意' }
+      return map[this.score] || ''
+    }
+  },
+  onLoad(options) {
+    this.orderId = options && options.orderId ? options.orderId : null
+    if (!this.orderId) {
+      this.error = true
+      return
+    }
+    this.loadOrder()
+  },
+  methods: {
+    onScore(val) {
+      this.score = val
+    },
+    loadOrder() {
+      var self = this
+      if (!this.orderId) return
+      getServiceOrderDetail(this.orderId).then(function(res) {
+        var data = (res && res.data) ? res.data : null
+        if (data) {
+          self.order = data
+        } else {
+          self.error = true
+        }
+      }).catch(function() {
+        self.error = true
+      })
+    },
+    doSubmit() {
+      var self = this
+      if (self.submitting || self.score <= 0) return
+      // 重复提交本地防抖(服务端 uk order_id 幂等兜底)
+      if (self.alreadySubmitted()) {
+        uni.showToast({ title: '该工单已评价', icon: 'none' })
+        return
+      }
+      self.submitting = true
+      submitClientEval(self.orderId, self.score, self.comment).then(function(res) {
+        self.submitting = false
+        // 判定已评价:code==200 && data.evalId 有值(后端幂等:重复评价也返 200 + evalId)
+        var data = (res && res.data) ? res.data : null
+        var ok = res && res.code === 200 && data && data.evalId
+        if (!ok) {
+          uni.showToast({ title: (res && res.message) || '评价提交失败', icon: 'none' })
+          return
+        }
+        self.markSubmitted()
+        self.success = true
+      }).catch(function(err) {
+        self.submitting = false
+        var msg = (err && err.message) || '评价提交失败'
+        // 未确认/未通过校验由后端 message 明确,直接 toast
+        uni.showToast({ title: msg, icon: 'none' })
+        // 重复评价若以 error 形态返回(兼容旧后端),也标记本地防重
+        if (msg.indexOf('已评价') >= 0 || msg.indexOf('已提交') >= 0) {
+          self.markSubmitted()
+        }
+      })
+    },
+    alreadySubmitted() {
+      var arr = this.submittedList()
+      for (var i = 0; i < arr.length; i++) {
+        if (String(arr[i]) === String(this.orderId)) return true
+      }
+      return false
+    },
+    submittedList() {
+      var arr = uni.getStorageSync(SUBMITTED_KEY)
+      return Array.isArray(arr) ? arr : []
+    },
+    markSubmitted() {
+      var arr = this.submittedList()
+      var found = false
+      for (var i = 0; i < arr.length; i++) {
+        if (String(arr[i]) === String(this.orderId)) { found = true; break }
+      }
+      if (!found) {
+        arr.push(this.orderId)
+        uni.setStorageSync(SUBMITTED_KEY, arr)
+      }
+    },
+    goBack() {
+      // 回 work/detail 显示「已评价 ✓」;无返回栈则回工单列表
+      var pages = getCurrentPages()
+      if (pages && pages.length > 1) {
+        uni.navigateBack({ delta: 1 })
+      } else {
+        uni.redirectTo({ url: '/pages/work/detail?orderId=' + this.orderId })
+      }
+    }
+  }
+}
+</script>
+
+<style scoped>
+.eval-submit-page {
+  min-height: 100vh;
+  background: #F4F8FC;
+  padding: 20rpx 24rpx 48rpx;
+}
+.order-card,
+.rate-card,
+.comment-card {
+  background: #FFFFFF;
+  border: 1px solid #E3EEF7;
+  border-radius: 20rpx;
+  padding: 26rpx 24rpx;
+  margin-bottom: 20rpx;
+}
+.order-head {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin-bottom: 10rpx;
+}
+.order-no { font-size: 22rpx; color: #9DB3C9; }
+.order-status { font-size: 22rpx; color: #0E8A4F; }
+.order-family { display: block; font-size: 32rpx; font-weight: 700; color: #12395F; }
+.order-time { display: block; font-size: 24rpx; color: #7A97B5; margin-top: 10rpx; }
+.rate-card {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
+.rate-title { font-size: 30rpx; font-weight: 700; color: #12395F; margin-bottom: 20rpx; }
+.rate-hint { font-size: 24rpx; color: #5B7A99; margin-top: 14rpx; }
+.comment-title { font-size: 30rpx; font-weight: 700; color: #12395F; margin-bottom: 16rpx; }
+.comment-input {
+  width: 100%;
+  height: 220rpx;
+  background: #F8FAFC;
+  border: 1px solid #E3EEF7;
+  border-radius: 12rpx;
+  padding: 20rpx;
+  font-size: 28rpx;
+  color: #12395F;
+  box-sizing: border-box;
+}
+.comment-count { display: block; font-size: 22rpx; color: #9DB3C9; text-align: right; margin-top: 10rpx; }
+.big-btn {
+  width: 100%;
+  height: 88rpx;
+  line-height: 88rpx;
+  background: #2E6FA8;
+  color: #FFFFFF;
+  font-size: 32rpx;
+  font-weight: 600;
+  border-radius: 44rpx;
+  border: none;
+  padding: 0;
+}
+.big-btn:active { opacity: 0.9; }
+.big-btn[disabled] { background: #9DB3C9; }
+.submit-btn { margin-top: 8rpx; }
+.privacy-tip {
+  display: block;
+  font-size: 22rpx;
+  color: #9DB3C9;
+  text-align: center;
+  margin-top: 20rpx;
+}
+.success-mask {
+  position: fixed;
+  left: 0; top: 0; right: 0; bottom: 0;
+  background: rgba(18, 57, 95, 0.55);
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  z-index: 999;
+}
+.success-card {
+  width: 78%;
+  background: #FFFFFF;
+  border-radius: 20rpx;
+  padding: 56rpx 40rpx 40rpx;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
+.success-icon { font-size: 96rpx; color: #0E8A4F; font-weight: 700; margin-bottom: 20rpx; }
+.success-title { font-size: 34rpx; font-weight: 700; color: #12395F; margin-bottom: 12rpx; }
+.success-desc { font-size: 26rpx; color: #5B7A99; margin-bottom: 36rpx; }
+.success-btn { width: 100%; }
+</style>

+ 15 - 4
train-frontend/pages/practitioner/index.vue

@@ -108,15 +108,20 @@
           <text class="entry-name">学时账户</text>
           <text class="entry-sub">年度达标</text>
         </view>
-        <view class="entry-item disabled">
+        <view class="entry-item active" @click="goEval">
           <text class="entry-icon">⭐</text>
           <text class="entry-name">我的评价</text>
-          <text class="entry-sub">二期开通</text>
+          <text class="entry-sub">四层评价</text>
         </view>
-        <view class="entry-item disabled">
+        <view class="entry-item active" @click="goPromotion">
           <text class="entry-icon">🚀</text>
           <text class="entry-name">晋升中心</text>
-          <text class="entry-sub">二期开通</text>
+          <text class="entry-sub">T1-T4 晋升</text>
+        </view>
+        <view class="entry-item disabled">
+          <text class="entry-icon">📦</text>
+          <text class="entry-name">证据包</text>
+          <text class="entry-sub">四期开通</text>
         </view>
         <view class="entry-item active" @click="goDetail">
           <text class="entry-icon">📄</text>
@@ -292,6 +297,12 @@ export default {
     goCredit() {
       uni.navigateTo({ url: '/pages/credit/index' })
     },
+    goEval() {
+      uni.navigateTo({ url: '/pages/eval/index' })
+    },
+    goPromotion() {
+      uni.navigateTo({ url: '/pages/promotion/index' })
+    },
     goDetail() {
       uni.navigateTo({ url: '/pages/practitioner/detail' })
     }

+ 523 - 0
train-frontend/pages/promotion/index.vue

@@ -0,0 +1,523 @@
+<template>
+  <view class="promo-page">
+    <!-- 加载骨架 -->
+    <LoadingSkeleton v-if="loading" :rows="4" />
+
+    <!-- 错误态 -->
+    <ErrorState v-else-if="error" message="晋升信息加载失败" @retry="loadAll" />
+
+    <!-- 未认证引导 -->
+    <EmptyState
+      v-else-if="!profile"
+      icon="🎓"
+      title="尚未完成培训认证"
+      desc="先完成培训认证,才能查看晋升进度"
+      action-text="去报名培训"
+      @action="goCohort"
+    />
+
+    <!-- 正常态 -->
+    <view v-else class="promo-content">
+      <!-- 当前档位头部 -->
+      <view class="head-card">
+        <view class="head-top">
+          <text class="head-title">晋升中心</text>
+          <StatusTag :status="promoStatus" :text="statusText" />
+        </view>
+        <text class="head-level">{{ authLevelText }}</text>
+        <text class="head-desc">{{ currentDesc }}</text>
+      </view>
+
+      <!-- 认证等级轨道 T1→T4 -->
+      <view class="section-card">
+        <text class="section-title">认证等级</text>
+        <PromoTrack :current-index="trackIndex" />
+        <view v-if="nextGapText" class="gap-box">
+          <text class="gap-text">下一档缺口:{{ nextGapText }}</text>
+        </view>
+      </view>
+
+      <!-- 综合达标环形(学时达标) -->
+      <view class="section-card">
+        <view class="ring-wrap">
+          <RingProgress
+            :percent="creditPercent"
+            size="150"
+            color="#2E6FA8"
+            :value-text="creditHoursText"
+            label="学时达标"
+          />
+          <view class="ring-legend">
+            <text class="legend-title">学时进度</text>
+            <text class="legend-desc">年度目标 90.0 学时,含理论 40 + 实践 20</text>
+          </view>
+        </view>
+      </view>
+
+      <!-- 申请晋升大按钮 -->
+      <view class="action-block">
+        <button class="big-btn" :disabled="applying || reachedTop" @click="doApply">
+          {{ applying ? '评定中...' : (reachedTop ? '已是最高档' : '申请晋升') }}
+        </button>
+        <text v-if="unmet.length" class="unmet-count">尚有 {{ unmet.length }} 项未达标</text>
+      </view>
+
+      <!-- 缺口清单(eligible=false 展开) -->
+      <view v-if="unmet.length" class="unmet-card">
+        <text class="unmet-title">未达标项</text>
+        <view class="unmet-item" v-for="u in unmet" :key="u.metric">
+          <view class="unmet-head">
+            <text class="unmet-label">{{ u.label }}</text>
+            <text class="unmet-gap">{{ u.gapText }}</text>
+          </view>
+          <text class="unmet-desc">{{ u.desc }}</text>
+          <text class="unmet-goto" @click="goByMetric(u.metric)">
+            {{ u.gotoText }}
+          </text>
+        </view>
+      </view>
+
+      <!-- 晋升履历时间线 -->
+      <view class="section-card">
+        <text class="section-title">晋升履历</text>
+        <view v-if="records.length === 0" class="records-empty">
+          <text class="records-empty-text">暂无晋升记录</text>
+        </view>
+        <TimeLineItem
+          v-for="(r, idx) in records"
+          :key="r.id || idx"
+          :title="r.title"
+          :time="r.time"
+          :desc="r.desc"
+          :status="r.status"
+          :is-last="idx === records.length - 1"
+        />
+      </view>
+    </view>
+
+    <!-- 达标成功页 + 徽章弹层 -->
+    <view v-if="successVisible" class="success-mask">
+      <view class="success-card">
+        <view class="badge-ring">
+          <text class="badge-icon">🏅</text>
+        </view>
+        <text class="success-title">晋升成功</text>
+        <text class="success-desc">{{ successTitle }}</text>
+        <button class="big-btn success-btn" @click="closeSuccess">我知道了</button>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+import { getMyPractitioner } from '@/api/practitioner.js'
+import { applyPromotion, getPromotionRecords } from '@/api/promotion.js'
+import { creditHours, formatDateTime } from '@/utils/format.js'
+import PromoTrack from '@/components/promo-track.vue'
+import RingProgress from '@/components/ring-progress.vue'
+import StatusTag from '@/components/status-tag.vue'
+import TimeLineItem from '@/components/timeline-item.vue'
+import EmptyState from '@/components/empty-state.vue'
+import ErrorState from '@/components/error-state.vue'
+import LoadingSkeleton from '@/components/loading-skeleton.vue'
+
+var LEVELS = ['T1', 'T2', 'T3', 'T4']
+var TARGET_TOTAL = 5400
+
+export default {
+  components: { PromoTrack, RingProgress, StatusTag, TimeLineItem, EmptyState, ErrorState, LoadingSkeleton },
+  data() {
+    return {
+      loading: true,
+      error: false,
+      profile: null,
+      applying: false,
+      eligible: null,
+      unmet: [],
+      applyMessage: '',
+      records: [],
+      successVisible: false,
+      successTitle: ''
+    }
+  },
+  computed: {
+    authLevel() {
+      var p = this.profile || {}
+      return p.authLevel || p.auth_level || ''
+    },
+    trackIndex() {
+      var i = LEVELS.indexOf(this.authLevel)
+      return i < 0 ? -1 : i
+    },
+    authLevelText() {
+      var map = { T1: 'T1 入门', T2: 'T2 熟练', T3: 'T3 骨干', T4: 'T4 专家' }
+      return map[this.authLevel] || this.authLevel
+    },
+    reachedTop() {
+      return this.trackIndex === LEVELS.length - 1
+    },
+    nextLevel() {
+      var i = this.trackIndex + 1
+      return i < LEVELS.length ? LEVELS[i] : ''
+    },
+    nextGapText() {
+      if (this.reachedTop) return '已至最高档'
+      if (this.eligible === true) return '条件已满足,可立即申请'
+      if (this.applyMessage) return this.applyMessage
+      if (this.unmet.length) return '还差 ' + this.unmet[0].gapText
+      return ''
+    },
+    creditTotal() {
+      var p = this.profile || {}
+      return Number(p.creditTotal) || 0
+    },
+    creditHoursText() {
+      return creditHours(this.creditTotal)
+    },
+    creditPercent() {
+      if (TARGET_TOTAL <= 0) return 0
+      var p = (this.creditTotal / TARGET_TOTAL) * 100
+      if (p < 0) return 0
+      if (p > 100) return 100
+      return Math.round(p)
+    },
+    promoStatus() {
+      if (this.eligible === true) return 'published'
+      if (this.eligible === false) return 'pending'
+      return ''
+    },
+    statusText() {
+      if (this.reachedTop) return '最高档'
+      if (this.eligible === true) return '可晋升'
+      if (this.eligible === false) return '条件未满足'
+      return '当前档'
+    },
+    currentDesc() {
+      if (this.reachedTop) return '已是最高认证档,可继续积累学时与评价'
+      return '当前档位,申请后由系统按规则评定下一档'
+    }
+  },
+  onLoad() {
+    this.loadAll()
+  },
+  methods: {
+    loadAll() {
+      this.loadProfile()
+      this.loadRecords()
+    },
+    loadProfile() {
+      var self = this
+      self.loading = true
+      self.error = false
+      getMyPractitioner().then(function(res) {
+        self.loading = false
+        var data = (res && res.data) ? res.data : null
+        self.profile = data
+        if (data) {
+          uni.setStorageSync('healthServiceProfile', true)
+          self.preCheck()
+        }
+      }).catch(function(err) {
+        self.loading = false
+        var code = err && err.code
+        // 404 / 未建档 → 走未认证引导空态
+        if (code === 404) {
+          self.profile = null
+        } else {
+          self.error = true
+        }
+      })
+    },
+    // 预检下一档达标情况(不写库,仅取缺口清单)
+    preCheck() {
+      var self = this
+      if (!self.nextLevel) return
+      self.applyMessage = ''
+      applyPromotion(self.nextLevel).then(function(res) {
+        var data = (res && res.data) ? res.data : {}
+        self.eligible = data.eligible === true
+        self.unmet = self.toUnmet(data.unmet || [])
+        // 特殊:目标≤当前 → eligible:false + message(如「当前已是该认证等级」)
+        if (data.eligible === false && !self.unmet.length && data.message) {
+          self.applyMessage = data.message
+        }
+      }).catch(function(err) {
+        // 未配置规则等走 error(如「未配置该等级的晋升规则」),按 message 展示,不阻塞页面
+        self.eligible = null
+        self.unmet = []
+        self.applyMessage = (err && err.message) || ''
+      })
+    },
+    doApply() {
+      var self = this
+      if (self.applying || !self.nextLevel) return
+      self.applying = true
+      self.applyMessage = ''
+      applyPromotion(self.nextLevel).then(function(res) {
+        self.applying = false
+        var data = (res && res.data) ? res.data : {}
+        if (data.eligible === true) {
+          // 达标:本地档升级 + 成功弹层
+          self.successTitle = '已晋升至 ' + self.nextLevel
+          self.successVisible = true
+          self.profile = Object.assign({}, self.profile, { authLevel: self.nextLevel })
+          self.loadRecords()
+        } else {
+          self.eligible = false
+          self.unmet = self.toUnmet(data.unmet || [])
+          if (data.message && !self.unmet.length) {
+            // 目标≤当前等特殊 message:直接 toast + 展示
+            self.applyMessage = data.message
+            uni.showToast({ title: data.message, icon: 'none' })
+          } else {
+            uni.showToast({ title: '条件尚未满足', icon: 'none' })
+          }
+        }
+      }).catch(function(err) {
+        self.applying = false
+        uni.showToast({ title: (err && err.message) || '评定失败', icon: 'none' })
+      })
+    },
+    toUnmet(list) {
+      var arr = []
+      for (var i = 0; i < list.length; i++) {
+        var item = list[i] || {}
+        var metric = item.metric || ''
+        // label 优先后端中文(接单量/综合评分/理论学时/总学时/考核成绩),落空才前端 map
+        var label = item.label || this.metricLabel(metric)
+        var curNative = this.num(item.current)
+        var thrNative = this.num(item.threshold)
+        var curText = this.formatValue(metric, curNative)
+        var thrText = this.formatValue(metric, thrNative)
+        arr.push({
+          metric: metric,
+          label: label,
+          desc: '当前 ' + curText + ',目标 ' + thrText,
+          gapText: this.formatGap(metric, thrNative - curNative),
+          gotoText: this.gotoText(metric)
+        })
+      }
+      return arr
+    },
+    num(v) {
+      var n = Number(v)
+      return isNaN(n) ? 0 : n
+    },
+    // 单位换算表(metric 原生单位 → 展示):红线学时一律分钟 /60(复用 creditHours),评分 ×100 /100 保留 1 位
+    formatValue(metric, v) {
+      if (metric === 'rating') return (v / 100).toFixed(1) + ' 分'
+      if (metric === 'theory_hours' || metric === 'total_hours' || metric === 'credit_hours') {
+        return creditHours(v) + ' 学时'
+      }
+      if (metric === 'exam_score') return v + ' 分'
+      return v + ' 单'
+    },
+    formatGap(metric, gap) {
+      if (isNaN(gap) || gap <= 0) return '已达标'
+      if (metric === 'rating') return (gap / 100).toFixed(1) + ' 分'
+      if (metric === 'theory_hours' || metric === 'total_hours' || metric === 'credit_hours') {
+        return creditHours(gap) + ' 学时'
+      }
+      if (metric === 'exam_score') return gap + ' 分'
+      return gap + ' 单'
+    },
+    metricLabel(metric) {
+      // 后端已给中文 label,此处仅为兜底(后端缺 label 时)
+      var map = {
+        serve_count: '上门服务量',
+        order_count: '上门服务量',
+        rating: '综合评分',
+        theory_hours: '理论学时',
+        total_hours: '总学时',
+        credit_hours: '总学时',
+        exam_score: '考核成绩'
+      }
+      return map[metric] || metric
+    },
+    isHours(metric) {
+      var arr = ['theory_hours', 'total_hours', 'credit_hours']
+      for (var i = 0; i < arr.length; i++) {
+        if (metric === arr[i]) return true
+      }
+      return false
+    },
+    gotoText(metric) {
+      if (this.isHours(metric)) return '去学时账户 →'
+      if (metric === 'rating') return '去评价 →'
+      if (metric === 'exam_score') return '去培训报名 →'
+      return '去接单 →'
+    },
+    goByMetric(metric) {
+      if (this.isHours(metric)) return uni.navigateTo({ url: '/pages/credit/index' })
+      if (metric === 'rating') return uni.navigateTo({ url: '/pages/eval/index' })
+      if (metric === 'exam_score') return uni.navigateTo({ url: '/pages/cohort/index' })
+      uni.navigateTo({ url: '/pages/work/index' })
+    },
+    loadRecords() {
+      var self = this
+      getPromotionRecords(1, 50).then(function(res) {
+        var data = (res && res.data) ? res.data : {}
+        var list = data.list || data.records || data
+        self.records = self.toRecords(Array.isArray(list) ? list : [])
+      }).catch(function() {
+        self.records = []
+      })
+    },
+    toRecords(list) {
+      var arr = []
+      for (var i = 0; i < list.length; i++) {
+        var r = list[i] || {}
+        var raw = r.time || r.appliedAt || r.createTime || r.createdAt || ''
+        var title = r.title || ('晋升至 ' + (r.authLevel || r.toLevel || ''))
+        // desc 优先后端 status 文案;无则回退 reason/ruleName
+        var desc = r.desc || r.reason || r.ruleName || (r.status ? this.statusDesc(r.status) : '')
+        arr.push({
+          id: r.id || r.recordId,
+          title: title,
+          time: formatDateTime(raw),
+          desc: desc,
+          status: r.status || 'promoted'
+        })
+      }
+      return arr
+    },
+    statusDesc(status) {
+      var map = { promoted: '评定通过,已晋升', evaluated: '评定中,条件未达标', rejected: '评定未通过' }
+      return map[status] || ''
+    },
+    closeSuccess() {
+      this.successVisible = false
+      this.preCheck()
+    },
+    goCohort() {
+      uni.navigateTo({ url: '/pages/cohort/index' })
+    }
+  }
+}
+</script>
+
+<style scoped>
+.promo-page {
+  min-height: 100vh;
+  background: #F4F8FC;
+  padding: 20rpx 24rpx 48rpx;
+}
+.head-card {
+  background: linear-gradient(135deg, #12395F, #2E6FA8);
+  border-radius: 20rpx;
+  padding: 32rpx 28rpx;
+  margin-bottom: 20rpx;
+}
+.head-top {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  margin-bottom: 16rpx;
+}
+.head-title { font-size: 34rpx; font-weight: 700; color: #FFFFFF; }
+.head-level { font-size: 30rpx; color: #FFFFFF; }
+.head-desc { display: block; font-size: 24rpx; color: rgba(255, 255, 255, 0.8); margin-top: 10rpx; }
+.section-card {
+  background: #FFFFFF;
+  border: 1px solid #E3EEF7;
+  border-radius: 20rpx;
+  padding: 28rpx 24rpx;
+  margin-bottom: 20rpx;
+}
+.section-title { font-size: 30rpx; font-weight: 700; color: #12395F; margin-bottom: 20rpx; }
+.gap-box {
+  margin-top: 20rpx;
+  background: #FFF7E6;
+  border-radius: 10rpx;
+  padding: 16rpx 20rpx;
+}
+.gap-text { font-size: 24rpx; color: #B9770E; }
+.ring-wrap {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+.ring-legend { margin-left: 32rpx; }
+.legend-title { font-size: 28rpx; font-weight: 600; color: #12395F; }
+.legend-desc { display: block; font-size: 22rpx; color: #7A97B5; margin-top: 10rpx; line-height: 1.6; }
+.action-block {
+  padding: 8rpx 0;
+}
+.big-btn {
+  width: 100%;
+  height: 88rpx;
+  line-height: 88rpx;
+  background: #2E6FA8;
+  color: #FFFFFF;
+  font-size: 32rpx;
+  font-weight: 600;
+  border-radius: 44rpx;
+  border: none;
+  padding: 0;
+}
+.big-btn:active { opacity: 0.9; }
+.big-btn[disabled] { background: #9DB3C9; }
+.unmet-count {
+  display: block;
+  font-size: 24rpx;
+  color: #B9770E;
+  text-align: center;
+  margin-top: 14rpx;
+}
+.unmet-card {
+  background: #FFFFFF;
+  border: 1px solid #E3EEF7;
+  border-radius: 20rpx;
+  padding: 24rpx 22rpx;
+  margin-bottom: 20rpx;
+}
+.unmet-title { font-size: 28rpx; font-weight: 700; color: #12395F; }
+.unmet-item {
+  padding: 18rpx 0;
+  border-bottom: 1rpx solid #F0F5FA;
+}
+.unmet-item:last-child { border-bottom: none; }
+.unmet-head {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+}
+.unmet-label { font-size: 26rpx; color: #1E3A5F; font-weight: 600; }
+.unmet-gap { font-size: 24rpx; color: #C0392B; }
+.unmet-desc { display: block; font-size: 22rpx; color: #7A97B5; margin-top: 6rpx; }
+.unmet-goto { display: block; font-size: 24rpx; color: #2E6FA8; margin-top: 8rpx; }
+.records-empty { padding: 20rpx 0; }
+.records-empty-text { font-size: 24rpx; color: #9DB3C9; }
+.success-mask {
+  position: fixed;
+  left: 0; top: 0; right: 0; bottom: 0;
+  background: rgba(18, 57, 95, 0.55);
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  z-index: 999;
+}
+.success-card {
+  width: 80%;
+  background: #FFFFFF;
+  border-radius: 24rpx;
+  padding: 56rpx 40rpx 40rpx;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
+.badge-ring {
+  width: 160rpx;
+  height: 160rpx;
+  border-radius: 50%;
+  background: #FFF7E6;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  margin-bottom: 24rpx;
+}
+.badge-icon { font-size: 80rpx; }
+.success-title { font-size: 34rpx; font-weight: 700; color: #12395F; margin-bottom: 12rpx; }
+.success-desc { font-size: 26rpx; color: #5B7A99; margin-bottom: 36rpx; }
+.success-btn { width: 100%; }
+</style>

+ 39 - 0
train-frontend/pages/work/detail.vue

@@ -95,6 +95,14 @@
         <text class="done-title">本单已完成</text>
         <text class="done-sub">¥{{ fenToYuan(order.staffIncome) }} 已计入收入</text>
       </view>
+      <!-- M3 评价入口:confirmed 且未评过(后端 evalDone / 本地已提交记忆)才展示 -->
+      <view v-if="!evalDone" class="eval-entry">
+        <button class="main-btn eval-btn" @click="goEval">去评价</button>
+        <text class="hint">评价仅服务人员可查看,用于档案沉淀</text>
+      </view>
+      <view v-else class="eval-done-box">
+        <text class="eval-done-text">已评价 ✓ 感谢您的反馈</text>
+      </view>
     </view>
 
     <view class="back-tip">
@@ -128,6 +136,17 @@ export default {
       locating: false
     }
   },
+  computed: {
+    // 是否已评价:后端 order/detail 无 evalDone 字段(M3 回执确认),只用本地提交记忆 evalSubmittedOrders
+    evalDone() {
+      var arr = uni.getStorageSync('evalSubmittedOrders')
+      if (!Array.isArray(arr)) return false
+      for (var i = 0; i < arr.length; i++) {
+        if (String(arr[i]) === String(this.orderId)) return true
+      }
+      return false
+    }
+  },
   onLoad(options) {
     this.orderId = options.orderId || null
     this.loadDetail()
@@ -313,6 +332,9 @@ export default {
         uni.showToast({ title: '确认失败', icon: 'none' })
       })
     },
+    goEval() {
+      uni.navigateTo({ url: '/pages/eval/submit?orderId=' + this.orderId })
+    },
     statusText(status) {
       if (status === 'accepted') return '已接单'
       if (status === 'arrived') return '已到岗'
@@ -445,6 +467,23 @@ export default {
 .done-icon { display: block; font-size: 72rpx; color: #0E8A4F; font-weight: 700; }
 .done-title { display: block; font-size: 32rpx; font-weight: 700; color: #1E3A5F; margin-top: 8rpx; }
 .done-sub { display: block; font-size: 25rpx; color: #5B7A99; margin-top: 8rpx; }
+.eval-entry {
+  margin-top: 16rpx;
+  border-top: 1rpx solid #F0F5FA;
+  padding-top: 20rpx;
+}
+.eval-btn { margin-top: 0; }
+.eval-done-box {
+  margin-top: 16rpx;
+  border-top: 1rpx solid #F0F5FA;
+  padding-top: 20rpx;
+  text-align: center;
+}
+.eval-done-text {
+  font-size: 26rpx;
+  color: #0E8A4F;
+  font-weight: 600;
+}
 .back-tip { text-align: center; padding: 16rpx 0; }
 .back-text { font-size: 23rpx; color: #A8BCD0; }
 </style>