dangdang 2 周之前
父节点
当前提交
9b0256939c
共有 2 个文件被更改,包括 13 次插入8 次删除
  1. 1 4
      src/views/DetailView.vue
  2. 12 4
      src/views/ResultView.vue

+ 1 - 4
src/views/DetailView.vue

@@ -16,11 +16,8 @@ const roleOptions = [{ text: "25岁年轻客户", value: "25岁年轻客户" }];
 
 
 // 5/10/20/30/40
 // 5/10/20/30/40
 const roundsOptions = [
 const roundsOptions = [
-  { text: 5, value: 5 },
-  { text: 10, value: 10 },
   { text: 15, value: 15 },
   { text: 15, value: 15 },
-  { text: 20, value: 20 },
-  { text: 30, value: 30 },
+  { text: 25, value: 25 },
   { text: 40, value: 40 },
   { text: 40, value: 40 },
 ];
 ];
 
 

+ 12 - 4
src/views/ResultView.vue

@@ -1,10 +1,7 @@
 <script setup lang="ts">
 <script setup lang="ts">
 import {
 import {
   ref,
   ref,
-  reactive,
-  toRefs,
   onMounted,
   onMounted,
-  watch,
   computed,
   computed,
   onBeforeUnmount,
   onBeforeUnmount,
 } from "vue";
 } from "vue";
@@ -34,6 +31,16 @@ const nameMapping = {
   defects: "评分详解"
   defects: "评分详解"
 };
 };
 
 
+const maxScoreMap = {
+  introduction_profession: 15,
+  product_advantage: 35,
+  purchase_intent: 10,
+  basic_information:20,
+  invitation_results: 20,
+  penalty_points: 0,
+  defects: 0
+};
+
 const handleResult = async () => {
 const handleResult = async () => {
   let res;
   let res;
   let shouldContinue = true; // 控制是否继续调用接口的标志
   let shouldContinue = true; // 控制是否继续调用接口的标志
@@ -63,6 +70,7 @@ const handleResult = async () => {
         acc[key] = {
         acc[key] = {
           ...res.body[key],
           ...res.body[key],
           name: nameMapping[key], // 添加 name 字段
           name: nameMapping[key], // 添加 name 字段
+          maxScore: maxScoreMap[key] || 20
         };
         };
       }
       }
       return acc;
       return acc;
@@ -134,7 +142,7 @@ onBeforeUnmount(() => {
         </div>
         </div>
         <div class="standard-content" v-for="(item, key) in scoresList" :key="key">
         <div class="standard-content" v-for="(item, key) in scoresList" :key="key">
           <div class="standard-subtitle">
           <div class="standard-subtitle">
-            <span class="pro">{{ item.name == "扣分项" ? item.name : `${item.name}(20分)` }}:</span>
+            <span class="pro">{{ item.name == "扣分项" ? item.name : `${item.name}(${item.maxScore}分)` }}:</span>
             <span>{{ item.score }}</span>
             <span>{{ item.score }}</span>
           </div>
           </div>
           <p>
           <p>