Преглед на файлове

chore: auto bump version and changelog [skip ci]

iwt преди 1 седмица
родител
ревизия
4c93a2ed12
променени са 3 файла, в които са добавени 119 реда и са изтрити 8 реда
  1. 45 7
      cfc-frontend/pages/growth/caution-detail.vue
  2. 73 0
      cfc-frontend/pages/growth/mini-trend.vue
  3. 1 1
      cfc-web/.last_build_commit

+ 45 - 7
cfc-frontend/pages/growth/caution-detail.vue

@@ -248,6 +248,29 @@ export default {
 .banner-icon { font-size: 32rpx; }
 .banner-text { font-size: 24rpx; color: #856404; flex: 1; }
 
+.member-bar {
+  display: flex;
+  overflow-x: auto;
+  padding: 16rpx 30rpx 8rpx;
+  background: #fff;
+  border-bottom: 1rpx solid #f0f0f0;
+  gap: 16rpx;
+  -webkit-overflow-scrolling: touch;
+}
+.member-tab {
+  flex-shrink: 0;
+  padding: 8rpx 20rpx;
+  border-radius: 20rpx;
+  background: #f5f5f5;
+  color: #666;
+  font-size: 26rpx;
+  font-weight: 500;
+}
+.member-tab.active {
+  background: linear-gradient(135deg, #EF4444, #DC2626);
+  color: #fff;
+}
+
 .content {
   padding: 20rpx 30rpx;
   height: calc(100vh - 160rpx);
@@ -272,6 +295,18 @@ export default {
   font-weight: 600;
   color: #1a1a1a;
 }
+.score-badge-group {
+  display: flex;
+  align-items: center;
+  gap: 12rpx;
+}
+.score-value {
+  font-size: 28rpx;
+  font-weight: 700;
+  color: #EF4444;
+  min-width: 60rpx;
+  text-align: right;
+}
 .caution-badge {
   padding: 4rpx 16rpx;
   background: #EF4444;
@@ -280,6 +315,16 @@ export default {
   font-size: 22rpx;
   font-weight: 500;
 }
+.change-row {
+  display: flex;
+  align-items: center;
+  gap: 8rpx;
+  margin-bottom: 12rpx;
+  font-size: 24rpx;
+}
+.change-label { color: #999; }
+.change-up { color: #10B981; font-weight: 600; }
+.change-down { color: #EF4444; font-weight: 600; }
 .food-meta {
   margin-bottom: 16rpx;
 }
@@ -317,13 +362,6 @@ export default {
 .score-bar-fill.danger {
   background: linear-gradient(90deg, #EF4444, #DC2626);
 }
-.score-value {
-  font-size: 28rpx;
-  font-weight: 700;
-  color: #EF4444;
-  min-width: 60rpx;
-  text-align: right;
-}
 .score-label {
   font-size: 24rpx;
   color: #999;

+ 73 - 0
cfc-frontend/pages/growth/mini-trend.vue

@@ -0,0 +1,73 @@
+<template>
+  <view class="mini-trend">
+    <canvas :canvas-id="canvasId" class="trend-canvas"></canvas>
+  </view>
+</template>
+
+<script>
+export default {
+  props: {
+    data: {
+      type: Array,
+      default: function() { return [] }
+    }
+  },
+  data: function() {
+    return {
+      canvasId: 'trend-' + Math.random().toString(36).substr(2, 9),
+      drawn: false
+    }
+  },
+  mounted: function() {
+    this.$nextTick(this.drawChart)
+  },
+  watch: {
+    data: function() {
+      this.$nextTick(this.drawChart)
+    }
+  },
+  methods: {
+    drawChart: function() {
+      var ctx = uni.createCanvasContext(this.canvasId, this)
+      var width = 600 // rpx
+      var height = 60
+      var data = this.data
+      if (!data.length) return
+      var min = Math.min.apply(null, data)
+      var max = Math.max.apply(null, data)
+      var range = max - min || 1
+      var stepX = width / (data.length - 1 || 1)
+      ctx.setStrokeStyle('#EF4444')
+      ctx.setLineWidth(3)
+      ctx.beginPath()
+      for (var i = 0; i < data.length; i++) {
+        var x = i * stepX
+        var y = height - (data[i] - min) / range * (height - 10) - 5
+        if (i === 0) ctx.moveTo(x, y)
+        else ctx.lineTo(x, y)
+      }
+      ctx.stroke()
+      // 末端圆点
+      var lastX = (data.length - 1) * stepX
+      var lastY = height - (data[data.length - 1] - min) / range * (height - 10) - 5
+      ctx.setFillStyle('#EF4444')
+      ctx.beginPath()
+      ctx.arc(lastX, lastY, 4, 0, 2 * Math.PI)
+      ctx.fill()
+      ctx.draw()
+      this.drawn = true
+    }
+  }
+}
+</script>
+
+<style scoped>
+.mini-trend {
+  margin: 12rpx 0;
+  width: 100%;
+}
+.trend-canvas {
+  width: 100%;
+  height: 60rpx;
+}
+</style>

+ 1 - 1
cfc-web/.last_build_commit

@@ -1 +1 @@
-ce4a7adc71861fe36ac1019b8a0f04391ba90356
+a775b4a352af5c0d051b03814e0b7ba141d2c783