From 5e0d63ccef8c8fc5763cf663aee0c1778113a818 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期五, 03 四月 2026 13:24:38 +0800
Subject: [PATCH] 首页快捷入口替换

---
 src/pages/index.vue |  146 +++++++++++++++++++++++++++++++++++-------------
 1 files changed, 106 insertions(+), 40 deletions(-)

diff --git a/src/pages/index.vue b/src/pages/index.vue
index 0c17b0f..4560bf4 100644
--- a/src/pages/index.vue
+++ b/src/pages/index.vue
@@ -19,10 +19,10 @@
             :key="item.label"
             @click="handleQuickTool(item)"
           >
-            <view class="quick-icon" :style="{ background: item.bgColor }">
-              <image :src="item.icon" class="quick-icon-img" mode="aspectFit" />
+            <view class="icon-container">
+              <image :src="item.icon" class="item-icon" mode="aspectFit" />
             </view>
-            <text class="quick-text">{{ item.label }}</text>
+            <text class="item-label">{{ item.label }}</text>
           </up-grid-item>
         </up-grid>
       </view>
@@ -55,7 +55,6 @@
                 </view>
               </view>
             </view>
-            <image class="card-icon" :src="imgSales" mode="widthFix" />
           </view>
 
           <view class="overview-card purchase">
@@ -72,7 +71,6 @@
                 </view>
               </view>
             </view>
-            <image class="card-icon" :src="imgPurchase" mode="widthFix" />
           </view>
 
           <view class="overview-card stock">
@@ -89,7 +87,6 @@
                 </view>
               </view>
             </view>
-            <image class="card-icon" :src="imgStock" mode="widthFix" />
           </view>
         </view>
       </view>
@@ -207,37 +204,50 @@
 import { computed, onMounted, ref } from "vue";
 import { analysisCustomerContractAmounts, getBusiness } from "@/api/viewIndex";
 
-const imgSales = "/static/images/index/xiaoshoushuju.png";
-const imgPurchase = "/static/images/index/caigoushuju.png";
-const imgStock = "/static/images/index/kucunshuju.png";
 const imgNum1 = "/static/images/index/num1.png";
 const imgNum2 = "/static/images/index/num2.png";
 const imgNum3 = "/static/images/index/num3.png";
 
 const quickTools = [
-  {
-    label: "鐢熶骇鎶ュ伐",
-    icon: "/static/images/icon/shengchanbaogong@2x.png",
-    bgColor: "linear-gradient(135deg,#3b82f6,#2563eb)",
-    route: "/pages/productionManagement/productionReport/index",
+  // {
+  //   label: "鐢熶骇鎶ュ伐",
+  //   icon: "/static/images/icon/shengchanbaogong.svg",
+  //   action: "scan",
+  // },
+  // {
+  //   label: "璁惧宸℃",
+  //   icon: "/static/images/icon/xunjianshangchuan.svg",
+  //   route: "/pages/inspectionUpload/index",
+  // },
+  // {
+  //   label: "璁惧淇濆吇",
+  //   icon: "/static/images/icon/shebeibaoyang.svg",
+  //   route: "/pages/equipmentManagement/upkeep/index",
+  // },
+  // {
+  //   label: "璁惧鎶ヤ慨",
+  //   icon: "/static/images/icon/shebeibaoxiu.svg",
+  //   route: "/pages/equipmentManagement/repair/index",
+  // },
+    {
+    label: "閿�鍞彴璐�",
+    icon: "/static/images/icon/xiaoshoutaizhang.svg",
+    route: "/pages/sales/salesAccount/index",
   },
   {
-    label: "璁惧宸℃",
-    icon: "/static/images/icon/xunjianshangchuan@2x.png",
-    bgColor: "linear-gradient(135deg,#22c55e,#16a34a)",
-    route: "/pages/inspectionUpload/index",
+    label: "閲囪喘鍙拌处",
+    icon: "/static/images/icon/caigoutaizhang.svg",
+    route: "/pages/procurementManagement/procurementLedger/index",
   },
   {
-    label: "璁惧淇濆吇",
-    icon: "/static/images/icon/shbeibaoyang@2x.png",
-    bgColor: "linear-gradient(135deg,#f97316,#ea580c)",
-    route: "/pages/equipmentManagement/upkeep/index",
+    label: "瀹㈡埛寰�鏉�",
+    icon: "/static/images/icon/kehuwanglai.svg",
+    route: "/pages/sales/receiptPaymentLedger/index",
   },
   {
-    label: "璁惧鎶ヤ慨",
-    icon: "/static/images/icon/shbeibaoxiu@2x.png",
-    bgColor: "linear-gradient(135deg,#a855f7,#7c3aed)",
-    route: "/pages/equipmentManagement/repair/index",
+    label: "搴撳瓨绠$悊",
+    icon: "/static/images/icon/xiaoshoutaizhang.svg",
+    route: "/pages/inventoryManagement/stockManagement/index",
   },
 ];
 
@@ -256,6 +266,28 @@
 }
 
 function handleQuickTool(item) {
+  // if (item?.action === "scan") {
+  //   // 鐢熶骇鎶ュ伐 - 璋冪敤鎵爜
+  //   uni.scanCode({
+  //     success: (res) => {
+  //       console.log("鎵爜缁撴灉:", res);
+  //       // 瑙f瀽鎵爜缁撴灉骞惰烦杞埌鐢熶骇鎶ュ伐椤甸潰
+  //       try {
+  //         const scanResult = JSON.parse(res.result);
+  //         uni.navigateTo({
+  //           url: `/pages/productionManagement/productionReport/index?orderRow=${encodeURIComponent(JSON.stringify(scanResult))}`
+  //         });
+  //       } catch (e) {
+  //         console.error("鎵爜缁撴灉瑙f瀽澶辫触:", e);
+  //         uni.showToast({ title: "鏃犳晥鐨勪簩缁寸爜", icon: "none" });
+  //       }
+  //     },
+  //     fail: (err) => {
+  //       console.error("鎵爜澶辫触:", err);
+  //     }
+  //   });
+  //   return;
+  // }
   if (!item?.route) return;
   uni.navigateTo({ url: item.route });
 }
@@ -576,7 +608,7 @@
 }
 
 .scroll {
-  height: calc(100vh - env(safe-area-inset-top) - 10px);
+  min-height: calc(100vh - env(safe-area-inset-top) - 10px);
 }
 
 .section {
@@ -588,27 +620,47 @@
   padding: 6px 0 2px;
 }
 
-.quick-icon {
-  width: 44px;
-  height: 44px;
+.icon-container {
+  width: 36px;
+  height: 36px;
   border-radius: 12px;
   display: flex;
   align-items: center;
   justify-content: center;
-  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
+  margin-bottom: 0.375rem;
+  transition: all 0.2s ease;
+  position: relative;
+  overflow: hidden;
+  animation: fadeInScale 0.5s ease both;
 }
 
-.quick-icon-img {
-  width: 26px;
-  height: 26px;
+.item-icon {
+  width: 36px;
+  height: 36px;
+  display: block;
 }
 
-.quick-text {
-  margin-top: 6px;
+.icon-container:active {
+  transform: scale(0.97);
+}
+
+.item-label {
   font-size: 12px;
   color: #555555;
   text-align: center;
-  white-space: nowrap;
+  display: block;
+  line-height: 1.4;
+  font-weight: 500;
+  margin-top: 4px;
+  margin-bottom: 6px;
+}
+
+:deep(.up-grid-item) {
+  padding: 6px 0;
+}
+
+:deep(.up-grid-item__content) {
+  padding: 0;
 }
 
 .section-header {
@@ -686,13 +738,16 @@
 }
 
 .overview-card.sales {
-  background: linear-gradient(135deg, #e9fbff 0%, #d8fbff 100%);
+  background: url("/static/images/index/xiaoshoushuju.png") no-repeat center center;
+  background-size: cover;
 }
 .overview-card.purchase {
-  background: linear-gradient(135deg, #fff4e7 0%, #ffe7ce 100%);
+  background: url("/static/images/index/caigoushuju.png") no-repeat center center;
+  background-size: cover;
 }
 .overview-card.stock {
-  background: linear-gradient(135deg, #eaf0ff 0%, #dbe6ff 100%);
+  background: url("/static/images/index/kucunshuju.png") no-repeat center center;
+  background-size: cover;
 }
 
 .card-left {
@@ -1031,4 +1086,15 @@
     color: #e9edf3;
   }
 }
+
+@keyframes fadeInScale {
+  0% {
+    opacity: 0;
+    transform: translateY(0.5rem) scale(0.96);
+  }
+  100% {
+    opacity: 1;
+    transform: translateY(0) scale(1);
+  }
+}
 </style>
\ No newline at end of file

--
Gitblit v1.9.3