From 6afb492942b17ebdb80f8e57af1b0df7ba5ee821 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期四, 09 四月 2026 15:29:50 +0800
Subject: [PATCH] fix: 版本更新修改
---
src/pages/index.vue | 245 +++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 209 insertions(+), 36 deletions(-)
diff --git a/src/pages/index.vue b/src/pages/index.vue
index 8f7a18a..3998a68 100644
--- a/src/pages/index.vue
+++ b/src/pages/index.vue
@@ -1,8 +1,16 @@
<template>
<view class="page">
- <view class="safe-top" />
-
<scroll-view class="scroll" scroll-y>
+ <!-- 椤堕儴 Banner锛氭斁鍏ユ粴鍔ㄥ尯鍩燂紝闅忛〉闈竴璧锋粴鍔紝涓嶅浐瀹氬湪椤堕儴 -->
+ <view class="hero-section">
+ <view class="bg-img">
+ <view class="hero-content">
+ <!-- 棰勭暀锛氬鍚庣画闇�瑕佸彲鍦ㄦ鏀� logo 鎴栫畝鐭彁绀� -->
+ </view>
+ <view class="hero-wave"></view>
+ </view>
+ </view>
+
<!-- 蹇嵎鍏ュ彛 -->
<view class="quick-section">
<up-grid :border="false" col="4">
@@ -11,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>
@@ -47,7 +55,6 @@
</view>
</view>
</view>
- <image class="card-icon" :src="imgSales" mode="widthFix" />
</view>
<view class="overview-card purchase">
@@ -64,7 +71,6 @@
</view>
</view>
</view>
- <image class="card-icon" :src="imgPurchase" mode="widthFix" />
</view>
<view class="overview-card stock">
@@ -81,7 +87,6 @@
</view>
</view>
</view>
- <image class="card-icon" :src="imgStock" mode="widthFix" />
</view>
</view>
</view>
@@ -192,16 +197,17 @@
<view class="bottom-space" />
</scroll-view>
+ <DownloadProgressMask />
</view>
</template>
<script setup>
import { computed, onMounted, ref } from "vue";
+import { onShow } from "@dcloudio/uni-app";
import { analysisCustomerContractAmounts, getBusiness } from "@/api/viewIndex";
+import { createVersionUpgradeChecker } from "@/utils/versionUpgrade";
+import DownloadProgressMask from "@/components/DownloadProgressMask.vue";
-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";
@@ -209,26 +215,22 @@
const quickTools = [
{
label: "鐢熶骇鎶ュ伐",
- icon: "/static/images/icon/shengchanbaogong@2x.png",
- bgColor: "linear-gradient(135deg,#3b82f6,#2563eb)",
- route: "/pages/productionManagement/productionReport/index",
+ icon: "/static/images/icon/shengchanbaogong.svg",
+ action: "scan",
},
{
label: "璁惧宸℃",
- icon: "/static/images/icon/xunjianshangchuan@2x.png",
- bgColor: "linear-gradient(135deg,#22c55e,#16a34a)",
+ icon: "/static/images/icon/xunjianshangchuan.svg",
route: "/pages/inspectionUpload/index",
},
{
label: "璁惧淇濆吇",
- icon: "/static/images/icon/shbeibaoyang@2x.png",
- bgColor: "linear-gradient(135deg,#f97316,#ea580c)",
+ icon: "/static/images/icon/shebeibaoyang.svg",
route: "/pages/equipmentManagement/upkeep/index",
},
{
label: "璁惧鎶ヤ慨",
- icon: "/static/images/icon/shbeibaoxiu@2x.png",
- bgColor: "linear-gradient(135deg,#a855f7,#7c3aed)",
+ icon: "/static/images/icon/shebeibaoxiu.svg",
route: "/pages/equipmentManagement/repair/index",
},
];
@@ -243,11 +245,35 @@
// 瀹㈡埛鍚堝悓閲戦鍒嗘瀽锛氭棤闇�绛涢�夐」锛堟寜鎺ュ彛榛樿杩斿洖灞曠ず锛�
+const { triggerVersionCheck } = createVersionUpgradeChecker({ logPrefix: "[version-index]" });
+
function toggleOverview() {
overviewExpanded.value = !overviewExpanded.value;
}
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 });
}
@@ -445,14 +471,127 @@
} catch (e) {
isCanvas2d.value = false;
}
+ triggerVersionCheck("onMounted");
loadHome();
+});
+
+onShow(() => {
+ triggerVersionCheck("onShow");
});
</script>
<style scoped lang="scss">
.page {
- min-height: 100vh;
- background: #f5f6fa;
+ background: #f6f7fb;
+ min-height: 100vh;
+ // padding: 12px;
+ /* 涓烘墍鏈夎澶囪缃熀纭�padding-top锛堝寘鍚畨鍏ㄥ尯锛� */
+ padding-top: calc(env(safe-area-inset-top) + 30px);
+ position: relative;
+
+ /* 涓哄畨鍗撹澶囪缃洿澶х殑椤堕儴鍐呰竟璺� */
+ /* #ifdef APP-PLUS && !MP && !H5 */
+ padding-top: calc(env(safe-area-inset-top) + 45px);
+ /* #endif */
+
+ /* H5鍜屽皬绋嬪簭骞冲彴鐨勯�氱敤鏍峰紡 */
+ /* #ifdef H5 || MP */
+ padding-top: calc(env(safe-area-inset-top) + 30px);
+ /* #endif */
+ &::before {
+ content: "";
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="24" height="24" patternUnits="userSpaceOnUse"><circle cx="12" cy="12" r="1" fill="rgba(41, 121, 255, 0.02)"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
+ pointer-events: none;
+ z-index: -1;
+ }
+
+ &::after {
+ content: "";
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: radial-gradient(
+ circle at 20% 80%,
+ rgba(41, 121, 255, 0.02) 0%,
+ transparent 55%
+ ),
+ radial-gradient(
+ circle at 80% 20%,
+ rgba(156, 39, 176, 0.015) 0%,
+ transparent 55%
+ );
+ pointer-events: none;
+ z-index: -1;
+ }
+}
+.hero-section {
+ margin: 0 12px;
+ margin-bottom: 12px;
+ animation: fadeInUp 0.6s ease-out 0.1s both;
+}
+
+.bg-img {
+ width: 100%;
+ height: 9.25rem;
+ background-image: url("../static/images/banner/backview.png");
+ background-size: cover;
+ border-radius: 14px;
+ position: relative;
+ overflow: hidden;
+ box-shadow: 0 10px 26px rgba(17, 24, 39, 0.08);
+
+ &::before {
+ content: "";
+ position: absolute;
+ top: -50%;
+ left: -50%;
+ width: 200%;
+ height: 200%;
+ background: conic-gradient(
+ from 0deg,
+ transparent,
+ rgba(255, 255, 255, 0.1),
+ transparent,
+ rgba(255, 255, 255, 0.05),
+ transparent
+ );
+ animation: rotate 20s linear infinite;
+ }
+
+ &::after {
+ content: "";
+ position: absolute;
+ top: 0;
+ right: 0;
+ width: 7.5rem;
+ height: 7.5rem;
+ background: radial-gradient(
+ circle,
+ rgba(255, 255, 255, 0.15) 0%,
+ transparent 70%
+ );
+ border-radius: 50%;
+ transform: translate(2.5rem, -2.5rem);
+ }
+}
+
+.hero-content {
+ position: relative;
+ z-index: 1;
+
+ padding: 14px 14px 18px 14px;
+ margin: 0 12px;
+ height: 100%;
+}
+.hero-wave {
+ height: 2.75rem;
}
.safe-top {
@@ -460,7 +599,7 @@
}
.scroll {
- height: calc(100vh - env(safe-area-inset-top) - 10px);
+ min-height: calc(100vh - env(safe-area-inset-top) - 10px);
}
.section {
@@ -472,27 +611,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 {
@@ -570,13 +729,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 {
@@ -915,4 +1077,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