فهرست منبع

fix(template): 修复 5 处 :style 内未加引号的 hex 表达式

- mbti-test / psych-assessment:进度条 :style 里的 background: #xxxxxx 属非法 JS 表达式
  (模板编译会报 Invalid expression),改为背景色进 class(\-wisdom / \-wealth),
  内联只留动态 width
- message-history:3 处 :style='{ color: x >= 0 ? #10B981 : #EF4444 }' 改为
  :class 切换 amount-pos / amount-neg(\-success / \-danger)
- 全站模板表达式 hex 违规清零(剩余 prop=#hex 属小程序组件属性色值,编译期不可达 SCSS,
  按计划边界保留)
- 3 文件 node --check + dart-sass 编译通过;硬编码色 493 -> 485
liaoxg 5 روز پیش
والد
کامیت
7f1e95fbb9

+ 2 - 2
cfc-frontend/pages/family/mbti-test.vue

@@ -4,7 +4,7 @@
       <text class="mbt-progress-text">{{ currentIndex + 1 }} / {{ questions.length }}</text>
     </view>
     <view class="mbt-progress-bar">
-      <view class="mbt-progress-fill" :style="{ width: progress + '%', background: #6366F1 }"></view>
+      <view class="mbt-progress-fill" :style="{ width: progress + '%' }"></view>
     </view>
     <view class="mbt-loading" v-if="loading">
       <text>加载题库...</text>
@@ -110,7 +110,7 @@ export default {
 .mbt-header { padding: 20rpx 30rpx; text-align: right }
 .mbt-progress-text { font-size: 24rpx; color: $facade-text-muted }
 .mbt-progress-bar { height: 6rpx; background: $accent-indigo-tint; margin: 0 30rpx; border-radius: 3rpx; overflow: hidden }
-.mbt-progress-fill { height: 100%; transition: width .3s }
+.mbt-progress-fill { height: 100%; background: $dim-wisdom; transition: width .3s }
 .mbt-loading { display: flex; justify-content: center; padding: 100rpx 0 }
 .mbt-card { background: $app-surface; margin: 20rpx 30rpx; border-radius: 24rpx; padding: 30rpx 24rpx; box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.05) }
 .mbt-dim-tag { display: inline-block; font-size: 22rpx; color: $app-surface; padding: 4rpx 16rpx; border-radius: 16rpx; margin-bottom: 16rpx }

+ 11 - 3
cfc-frontend/pages/profile/message-history.vue

@@ -70,7 +70,7 @@
           </view>
           <view class="message-content">
             <text class="message-title">{{ msg.fullText || msg.description }}</text>
-            <text v-if="msg.amount !== 0" class="message-amount" :style="{ color: msg.amount >= 0 ? #10B981 : #EF4444 }">
+            <text v-if="msg.amount !== 0" :class="['message-amount', msg.amount >= 0 ? 'amount-pos' : 'amount-neg']">
               {{ msg.amount >= 0 ? '+' : '' }}{{ msg.amount }}
             </text>
           </view>
@@ -91,7 +91,7 @@
           </view>
           <view class="message-content">
             <text class="message-title">{{ msg.fullText || msg.description }}</text>
-            <text v-if="msg.amount !== 0" class="message-amount" :style="{ color: msg.amount >= 0 ? #10B981 : #EF4444 }">
+            <text v-if="msg.amount !== 0" :class="['message-amount', msg.amount >= 0 ? 'amount-pos' : 'amount-neg']">
               {{ msg.amount >= 0 ? '+' : '' }}{{ msg.amount }}
             </text>
           </view>
@@ -112,7 +112,7 @@
           </view>
           <view class="message-content">
             <text class="message-title">{{ msg.fullText || msg.description }}</text>
-            <text v-if="msg.amount !== 0" class="message-amount" :style="{ color: msg.amount >= 0 ? #10B981 : #EF4444 }">
+            <text v-if="msg.amount !== 0" :class="['message-amount', msg.amount >= 0 ? 'amount-pos' : 'amount-neg']">
               {{ msg.amount >= 0 ? '+' : '' }}{{ msg.amount }}
             </text>
           </view>
@@ -616,6 +616,14 @@ export default {
   margin-top: 4rpx;
 }
 
+.message-amount.amount-pos {
+  color: $status-success;
+}
+
+.message-amount.amount-neg {
+  color: $status-danger;
+}
+
 .message-meta {
   display: flex;
   flex-direction: column;

+ 2 - 1
cfc-frontend/pages/psych-assessment/index.vue

@@ -93,7 +93,7 @@
           <text class="score-unit">分</text>
         </view>
         <view class="score-bar">
-          <view class="score-bar-fill" :style="{ width: getResesPercent(scores.reses) + '%', background: #F59E0B }"></view>
+          <view class="score-bar-fill" :style="{ width: getResesPercent(scores.reses) + '%' }"></view>
         </view>
       </view>
     </view>
@@ -495,6 +495,7 @@ export default {
 .score-bar-fill {
   height: 100%;
   border-radius: 8rpx;
+  background: $dim-wealth;
   transition: width 0.3s ease;
 }