From 7635213630830c4cbb9ff6ada69ba9b5c8a35d42 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Thu, 03 Apr 2025 11:05:34 +0800
Subject: [PATCH] feat: 地图居中点调整

---
 src/views/Home/components/HomeRight/Synergy.vue |   51 ++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 34 insertions(+), 17 deletions(-)

diff --git a/src/views/Home/components/HomeRight/Synergy.vue b/src/views/Home/components/HomeRight/Synergy.vue
index 50f4622..6437da8 100644
--- a/src/views/Home/components/HomeRight/Synergy.vue
+++ b/src/views/Home/components/HomeRight/Synergy.vue
@@ -1,26 +1,43 @@
+<template>
+  <CommonTitle title="降本增效" />
+  <div :style="{ marginLeft: pxToRem(14) }">
+    <div class="synergy">
+      <div class="synergy-item" v-for="item in list">
+        <div class="title">{{ item.name }}</div>
+        <div class="value" :style="{ color: item.color }">{{ item.value }}</div>
+      </div>
+    </div>
+  </div>
+</template>
 <script setup>
 import CommonTitle from '@/components/CommonTitle.vue';
+import { pxToRem } from '@/utils/rem';
+import {  optimizeCostEfficiency } from '@/api/home/index.js'
 
 const list = ref([
   { name: '替代人工(人次)', value: 1174, color: '#FFFFFF' },
   { name: '替代车辆(公里)', value: 2345, color: '#FFA768' },
   { name: '节约成本(万元)', value: 12.07, color: '#68FFC8' },
 ]);
+
+const getStatisticalData = () => {
+  optimizeCostEfficiency().then((res) => {
+    if (res.data.code !== 200) return;
+    let result = res.data.data
+    list.value[0].value = result.replaced_manual_times;
+    list.value[1].value = result.saved_vehicle_kilometers;
+    list.value[2].value = result.total_cost_saved;
+  });
+};
+onMounted(() => {
+  getStatisticalData();
+});
 </script>
-<template>
-  <CommonTitle title="降本增效" />
-  <div class="synergy">
-    <div class="synergy-item" v-for="item in list">
-      <div class="title">{{ item.name }}</div>
-      <div class="value" :style="{ color: item.color }">{{ item.value }}</div>
-    </div>
-  </div>
-</template>
 
 <style scoped lang="scss">
 .synergy {
   width: 390px;
-  height: hToV(108);
+  height: 108px;
   background: linear-gradient(
     270deg,
     #1f3e7a 0%,
@@ -28,16 +45,16 @@
     rgba(31, 62, 122, 0) 100%
   );
   opacity: 0.85;
-  margin: hToV(2) 0 hToV(13) 0;
+  margin: 2px 0 13 0;
   display: flex;
   justify-content: space-between;
-  padding: hToV(11) 27px 0;
+  padding: 11px 27px 0;
 
   .synergy-item {
     width: 95px;
-    height: hToV(77);
-    padding-top: hToV(7);
-    background: url('@/assets/images/home/synergyBg.png') no-repeat center center / 100% 100%;
+    height: 77px;
+    padding-top: 7px;
+    background: url('@/assets/images/home/homeRight/synergyBg.png') no-repeat center center / 100% 100%;
 
     .title {
       font-family: Source Han Sans CN, Source Han Sans CN, serif;
@@ -47,7 +64,7 @@
       text-align: center;
       font-style: normal;
       text-transform: none;
-      margin-bottom: hToV(4);
+      margin-bottom: 4px;
     }
 
     .value {
@@ -55,7 +72,7 @@
       font-weight: 400;
       font-size: 26px;
       color: #ffffff;
-      line-height: hToV(26);
+      line-height: 26px;
       font-style: normal;
       text-transform: none;
       text-align: center;

--
Gitblit v1.9.3