From e5406a27ba11338bd86f988f5ef7c20430f56209 Mon Sep 17 00:00:00 2001 From: jinhhanhan <1683105490@qq.com> Date: Fri, 14 Aug 2026 09:09:07 +0800 Subject: [PATCH] =?UTF-8?q?chore:=E8=8B=B9=E6=9E=9Cios=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=AD=A3=E5=B8=B8=EF=BC=8C=E5=95=86=E5=93=81?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E7=9A=84=E8=A7=86=E9=A2=91=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E7=AB=96=E7=89=88=E6=A8=AA=E6=9D=BF=E8=A7=86?= =?UTF-8?q?=E9=A2=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .local.config.js | 6 ++- common/css/goods_detail.scss | 2 + .../goods-detail-view/goods-detail-view.vue | 51 +++++++++++++++++-- pages_tool/form/formdata.vue | 15 +++++- 4 files changed, 69 insertions(+), 5 deletions(-) diff --git a/.local.config.js b/.local.config.js index c272e47..1430734 100644 --- a/.local.config.js +++ b/.local.config.js @@ -164,6 +164,10 @@ const localDevConfig = ({ uniacid: 2797, domain: 'https://xcx.aigc-quickapp.com/', }, + '5g-95': { // 商品分类,没有立即咨询文字 + uniacid: 95, + domain: 'https://5g.aigc-quickapp.com/', + }, // })['5g-237']; // 商品分类,没有立即咨询文字 // })['5g-97']; // 大宗商品贸易,支持自定义字体大小、颜色 // })['5g-50']; // 燃气安全产品机器人,购物车无反应 @@ -177,7 +181,7 @@ const localDevConfig = ({ // })['2724']; // 生物菌肥 // })['2811']; // 选择要使用的环境配置 // })['local-11']; // 选择要使用的环境配置 -})['2797']; // 本地 +})['1']; // 本地 // })['local-2']; // 本地 // })['local-11']; // 本地 // })['1-test']; // test diff --git a/common/css/goods_detail.scss b/common/css/goods_detail.scss index f34c2bc..8d6fe96 100644 --- a/common/css/goods_detail.scss +++ b/common/css/goods_detail.scss @@ -118,6 +118,8 @@ .goods-video video { width: 100%; height: 100%; + object-fit: contain; + object-position: center; } .goods-video .uni-video-cover { diff --git a/pages_goods/_components/goods-detail-view/goods-detail-view.vue b/pages_goods/_components/goods-detail-view/goods-detail-view.vue index ae42c1e..5ca54cb 100644 --- a/pages_goods/_components/goods-detail-view/goods-detail-view.vue +++ b/pages_goods/_components/goods-detail-view/goods-detail-view.vue @@ -37,7 +37,8 @@ :info="goodsSkuDetail.barrageData" /> - + + - + @@ -538,6 +540,8 @@ export default { data() { // 商品详情骨架屏:模拟「轮播图 + 价格行 + 标题简介 + 规格行 + 商家 + 详情 + 推荐」 return { + // 视频元数据(宽/高),用于竖屏视频自适应容器高度 + videoInfo: { width: 0, height: 0 }, // 1. 轮播图:方形 banner 占位 skeletonBanner: { padding: '0', @@ -662,6 +666,27 @@ export default { }; }, computed: { + // 媒体容器高度:视频激活且为竖屏时按视频比例撑高,否则保持图片 swiper 高度 + mediaHeight() { + if ( + this.switchMedia === 'video' && + this.videoInfo.width && + this.videoInfo.height && + this.videoInfo.height > this.videoInfo.width + ) { + try { + const sys = uni.getSystemInfoSync(); + const ratio = this.videoInfo.height / this.videoInfo.width; + const videoHeight = sys.windowWidth * ratio; + // 竖屏视频最大高度限制为屏幕宽度的 5:4,防止 9:16 等过长视频占满整屏 + const maxHeight = sys.windowWidth * 1.25; + return Math.min(videoHeight, maxHeight) + 'px'; + } catch (e) { + // 异常时回退到图片高度 + } + } + return this.goodsSkuDetail.swiperHeight; + }, aiAvatarUrl() { return this.$util.img(IMAGE_CONFIG.aiAvatar); }, @@ -686,6 +711,26 @@ export default { return this.goodsSkuDetail && Number(this.goodsSkuDetail.goods_id) > 0; } }, + watch: { + // 切换商品/视频源时重置视频元数据,防止旧数据影响新视频的高度计算 + 'goodsSkuDetail.video_url'(newVal, oldVal) { + if (newVal !== oldVal) { + this.videoInfo = { width: 0, height: 0 }; + } + } + }, + methods: { + // 视频元数据加载后记录宽高,用于竖屏视频自适应容器高度 + onVideoLoadedMetadata(e) { + const detail = e.detail || {}; + if (detail.width && detail.height) { + this.videoInfo = { + width: Number(detail.width), + height: Number(detail.height) + }; + } + } + }, mixins: [scroll, detail] }; diff --git a/pages_tool/form/formdata.vue b/pages_tool/form/formdata.vue index 2f371e6..9e6136c 100644 --- a/pages_tool/form/formdata.vue +++ b/pages_tool/form/formdata.vue @@ -420,9 +420,22 @@ page { background: #fff; } +// iOS 兼容:确保页面内容区域可滚动,避免提交按钮被推出屏幕后无法访问 +.page { + min-height: 100vh; + // iOS Safari / WebView 需要显式开启 overflow 才能正确滚动 + overflow-y: auto; + -webkit-overflow-scrolling: touch; // iOS 惯性滚动 + box-sizing: border-box; +} + .system-form-wrap { - overflow: hidden; + // 移除 overflow: hidden,避免 iOS 上 textarea 撑开高度时裁剪掉提交按钮 + // 改用 overflow-visible 让内容自然流动,提交按钮始终可见 + overflow: visible; margin: 0 0 60rpx 0; + // 确保 iOS 上表单区域有足够的底部空间显示提交按钮 + padding-bottom: env(safe-area-inset-bottom, 40rpx); } // 穿透 diy-form 包装层:消除其自带的 10rpx 圆角与白色背景,