Browse Source

fix: 修复WXSS中文类名编译错误 + 恢复getPublicConfig函数

asus 1 month ago
parent
commit
cd1b1ed3cb
2 changed files with 23 additions and 8 deletions
  1. 18 8
      cfc-frontend/pages/health/report-confirm.vue
  2. 5 0
      cfc-frontend/utils/api.js

+ 18 - 8
cfc-frontend/pages/health/report-confirm.vue

@@ -174,8 +174,8 @@
             <view class="indicator-item" v-for="(ind, idx) in group.items" :key="idx">
               <view class="ind-header">
                 <text class="ind-help-btn" @click.stop="showHelp(ind)">?</text>
-                <input class="ind-name" :class="'ind-name-' + (ind.status || 'normal')" v-model="ind.indicatorName" />
-                <input class="ind-value" :class="'ind-value-' + (ind.status || 'normal')" v-model="ind.indicatorValue" />
+                <input class="ind-name" :class="'ind-name-' + _cssClass(ind.status)" v-model="ind.indicatorName" />
+                <input class="ind-value" :class="'ind-value-' + _cssClass(ind.status)" v-model="ind.indicatorValue" />
               </view>
               <view class="ind-detail" v-if="ind.unit || ind.refRange">
                 <text class="ind-ref" v-if="ind.refRange">参考: {{ ind.refRange }}</text>
@@ -185,6 +185,10 @@
                 <text class="ind-symptom-label">症状:</text>
                 <input class="ind-symptom-input" v-model="ind.symptoms" />
               </view>
+              <view class="ind-status-row">
+                <view class="status-tag" :class="'status-' + _cssClass(ind.status)">
+                  {{ statusText(ind.status) }}
+                </view>
               </view>
             </view>
           </view>
@@ -209,7 +213,7 @@
             </view>
             <view class="help-row">
               <text class="help-label">状态</text>
-              <text class="help-value" :class="'help-status-' + (helpData.status || 'normal')">{{ statusText(helpData.status) }}</text>
+              <text class="help-value" :class="'help-status-' + _cssClass(helpData.status)">{{ statusText(helpData.status) }}</text>
             </view>
             <view class="help-desc" v-if="helpData.description">
               <text class="help-desc-label">说明</text>
@@ -229,7 +233,7 @@
         <view class="flora-item" v-for="(flora, idx) in payload.gutFlora" :key="idx">
           <input class="flora-name" v-model="payload.gutFlora[idx].name" />
           <input class="flora-abundance" type="digit" v-model="payload.gutFlora[idx].abundance" />
-          <view class="status-tag" :class="'status-' + (flora.status || 'normal')">
+          <view class="status-tag" :class="'status-' + _cssClass(flora.status)">
             {{ statusText(flora.status) }}
           </view>
         </view>
@@ -516,6 +520,10 @@ export default {
       }
       this.groupExpandList = arr
     },
+    _cssClass(status) {
+      var map = { 'high': 'high', 'low': 'low', 'abnormal': 'abnormal', 'normal': 'normal', '缺乏': 'deficient', '偏低': 'low', '不足': 'insufficient', '正常': 'normal', '注意': 'warning', '偏高': 'high', '高风险': 'high-risk', '低风险': 'low-risk', '未检出': 'not-detected' }
+      return map[status] || 'normal'
+    },
     statusText(status) {
       if (status === 'high') return '偏高'
       if (status === 'low') return '偏低'
@@ -971,10 +979,12 @@ export default {
 .ind-name-high, .ind-value-high,
 .ind-name-low, .ind-value-low,
 .ind-name-abnormal, .ind-value-abnormal,
-.ind-name-缺乏, .ind-value-缺乏,
-.ind-name-偏低, .ind-value-偏低,
-.ind-name-不足, .ind-value-不足,
-.ind-name-注意, .ind-value-注意 {
+.ind-name-deficient, .ind-value-deficient,
+.ind-name-insufficient, .ind-value-insufficient,
+.ind-name-warning, .ind-value-warning,
+.ind-name-high-risk, .ind-value-high-risk,
+.ind-name-low-risk, .ind-value-low-risk,
+.ind-name-not-detected, .ind-value-not-detected {
   background: #FFF0F0;
   color: #C62828;
 }

+ 5 - 0
cfc-frontend/utils/api.js

@@ -1357,6 +1357,11 @@ export const vendorInfo = () => {
 
 //  幸福邻里部落 - 商品系统 
 
+// 获取公开配置(pages/health/report-upload 依赖此函数读取 report_upload_category_id)
+export const getPublicConfig = (key) => {
+  return request('/api/config/public/value', 'POST', { key: key })
+}
+
 // 商品分类树(公开)— pages/shop/index 依赖此函数加载分类,缺失会导致 onLoad 中断
 export const goodsCategory = () => {
   return request('/api/shop/category/tree', 'POST', {})