Browse Source

增加选中颜色

zk 1 year ago
parent
commit
79fc9416fe
2 changed files with 16 additions and 6 deletions
  1. 1 1
      src/utils/UIInteractions.js
  2. 15 5
      src/views/home/cpns/MiForChange.vue

+ 1 - 1
src/utils/UIInteractions.js

@@ -379,7 +379,7 @@ export function ueCallCloseRlt() {    // 关闭轮渡客流
 
 export function ueCallChangeMi (consmi) {    //更改米深
   callUIInteractionFormat({
-    "ActionName":"close_water",
+    "ActionName":"change_mi",
     "Parameters":{"mi":consmi}
 
   })

+ 15 - 5
src/views/home/cpns/MiForChange.vue

@@ -2,7 +2,7 @@
   <div>
     <div id="MiForChange">
       <ul>
-        <li v-for="item,index in hightLightSomeOne" :class="{'highlight': item.status}">
+        <li v-for="item,index in hightLightSomeOne" :class="{'highlight'  : item.status}">
           <span @click="showMi(item,index)">{{ item.name }}</span>
         </li>
       </ul>
@@ -32,6 +32,12 @@ const hightLightSomeOne = reactive([
 // eslint-disable-next-line no-unused-vars
 function showMi(mi,index){
   hightLightSomeOne[index].status= !hightLightSomeOne[index].status
+  hightLightSomeOne.forEach((item,indexs)=>{
+    if (index!=indexs) {
+      item.status = false
+    }
+  })
+
   ueCallChangeMi(mi.name)
 }
 
@@ -52,11 +58,15 @@ function showMi(mi,index){
     float: left;
     margin-right: 10px;
     font-size: 18px;
-    font-weight: bold;
-    .highlight{
-      background: #1A5482;
-    }
+    font-weight: bold;}
+
+   ul .highlight{
+         span {
+           color: #1A5482;
+         }
+
   }
+
 }