From 35f1f84a94e12662677c25b2e7c71866f7911680 Mon Sep 17 00:00:00 2001 From: WindowBird <13870814+windows-bird@user.noreply.gitee.com> Date: Sat, 16 Aug 2025 14:39:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=A7=9F=E8=B5=81=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E8=83=8C=E6=99=AF=E5=9B=BE=EF=BC=8C=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AF=BC=E8=88=AA=E6=A0=8F=E6=A0=B7=E5=BC=8F=EF=BC=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/style/common-style.scss | 14 + .../custom-nav-bar2/custom-nav-bar2.vue | 2 - enum/commonEnum.js | 2 + pages.json | 7 + pages/agents/agents.vue | 674 ++++++++++++++++++ pages/lease/lease.vue | 57 +- utils/system.js | 31 +- 7 files changed, 740 insertions(+), 47 deletions(-) create mode 100644 pages/agents/agents.vue diff --git a/common/style/common-style.scss b/common/style/common-style.scss index 7de1934..e7375d3 100644 --- a/common/style/common-style.scss +++ b/common/style/common-style.scss @@ -1,3 +1,17 @@ +view, swiper, swiper-item { + box-sizing: border-box; +} + +.pageBg { + background: linear-gradient(to bottom, transparent, #fff 400rpx), + linear-gradient(to right, #beecd8 20%, #F4E2D8); + min-height: 80vh; +} + +.loadingLayout { + padding: 30rpx 0; +} + .safe-area-inset-bottom { height: env(safe-area-inset-bottom); } diff --git a/components/custom-nav-bar2/custom-nav-bar2.vue b/components/custom-nav-bar2/custom-nav-bar2.vue index 3de3242..39dc4e3 100644 --- a/components/custom-nav-bar2/custom-nav-bar2.vue +++ b/components/custom-nav-bar2/custom-nav-bar2.vue @@ -9,7 +9,6 @@ {{ title }} - @@ -38,7 +37,6 @@ defineProps({ left: 0; width: 100%; z-index: 10; - background: #ffddca; .statusBar { } diff --git a/enum/commonEnum.js b/enum/commonEnum.js index 5fb43c8..c89706e 100644 --- a/enum/commonEnum.js +++ b/enum/commonEnum.js @@ -15,6 +15,8 @@ export const commonEnum = { FIRE: 'https://api.ccttiot.com/image-1755063906561.png', DOWN_ARROW: 'https://api.ccttiot.com/image-1755068355306.png', FIRE_BACKGROUND: 'https://api.ccttiot.com/image-1755070666020.png', + FIRE_BACKGROUND_FULL: 'https://api.ccttiot.com/image-1755325033599.png', + COIN_BACKGROUND: 'https://api.ccttiot.com/image-1755070887001.png', REQUEST_AGENT: 'https://api.ccttiot.com/image-1755071317260.png', AGENCY_INTERESTS: 'https://api.ccttiot.com/image-1755071348347.png', diff --git a/pages.json b/pages.json index 102143a..702109a 100644 --- a/pages.json +++ b/pages.json @@ -50,6 +50,13 @@ "style": { "navigationBarTitleText": "" } + }, + { + "path" : "pages/agents/agents", + "style" : + { + "navigationStyle": "custom" + } } ], "tabBar": { diff --git a/pages/agents/agents.vue b/pages/agents/agents.vue new file mode 100644 index 0000000..d542a3e --- /dev/null +++ b/pages/agents/agents.vue @@ -0,0 +1,674 @@ + + + + + diff --git a/pages/lease/lease.vue b/pages/lease/lease.vue index 9d8a7a0..7eaa7df 100644 --- a/pages/lease/lease.vue +++ b/pages/lease/lease.vue @@ -3,15 +3,11 @@ - - - 渝锦汇节能灶燃烧器 - 租来节能,灶就省钱 - - - - - + @@ -295,52 +291,25 @@ export default { .lease-page { position: relative; background: #f3f5f6; + border: #120d0d solid 2rpx; } // 头部区域 .header { - padding: 50rpx 14rpx 10rpx 40rpx; + position: relative; //border: #120d0d solid 2rpx; + background: white; - background: linear-gradient(to bottom, #ffdecb 0, #f7ede6 600rpx); - - .header-content { - position: relative; - } - - .product-info { - margin-bottom: 40rpx; - //border: red solid 2rpx; - - .product-name { - display: block; - font-size: 48rpx; - font-weight: bold; - margin-bottom: 20rpx; - color: #722b03; - } - - .product-slogan { - font-size: 28rpx; - color: #f15a04; - } - } - - .header-graphic { - position: absolute; - right: 0; - top: -85rpx; - //border: red solid 2rpx; - - .fire { - width: 252rpx; - height: 224rpx; - } + .fire-background-full { + width: 750rpx; + height: 592rpx; } } // 主要内容区域 .main-content { + position: relative; + top: -220rpx; background: #ffffff; border-radius: 40rpx 40rpx 0 0; margin: 0 30rpx; diff --git a/utils/system.js b/utils/system.js index e65bbe8..d3e4c8a 100644 --- a/utils/system.js +++ b/utils/system.js @@ -1,27 +1,56 @@ +/** + * 获取系统信息对象(同步获取,只获取一次避免重复调用开销) + */ const SYSTEM_INFO = uni.getSystemInfoSync() +/** + * 获取状态栏高度(单位:px) + * @returns {number} 状态栏高度,默认兜底值15px + */ export const getStatusBarHeight = () => SYSTEM_INFO.statusBarHeight || 15 +/** + * 获取标题栏高度(包含状态栏到标题栏底部的总高度) + * @returns {number} 标题栏高度(单位:px) + * @description + * - 小程序端通过胶囊按钮位置计算 + * - 非小程序端返回默认值40px + */ export const getTitleBarHeight = () => { + // 检查是否在小程序环境(支持获取菜单按钮位置) if (uni.getMenuButtonBoundingClientRect) { + // 获取小程序菜单按钮(胶囊按钮)的布局信息 let { top, height } = uni.getMenuButtonBoundingClientRect() + // 计算公式:按钮高度 + (按钮顶部到状态栏底部的距离) * 2 return height + (top - getStatusBarHeight()) * 2 } else { + // 非小程序环境(如H5/App)返回默认高度 return 40 } } +/** + * 获取整个导航栏高度(状态栏 + 标题栏) + * @returns {number} 导航栏总高度(单位:px) + */ export const getNavBarHeight = () => getStatusBarHeight() + getTitleBarHeight() +/** + * 获取左侧返回按钮的右侧边界坐标(用于特殊平台布局计算) + * @returns {number} 左侧图标右侧的X坐标(单位:px) + * @platform 今日头条小程序专属逻辑 + */ export const getLeftIconLeft = () => { // #ifdef MP-TOUTIAO + // 今日头条小程序获取自定义按钮位置信息 let { leftIcon: { left, width }, } = tt.getCustomButtonBoundingClientRect() - return left + parseInt(width) + return left + parseInt(width) // 返回按钮右侧边界坐标 // #endif // #ifndef MP-TOUTIAO + // 其他平台返回0(表示不需要特殊处理) return 0 // #endif }