diff --git a/.local.config.js b/.local.config.js index e78d1de..85293e8 100644 --- a/.local.config.js +++ b/.local.config.js @@ -160,6 +160,18 @@ const localDevConfig = ({ uniacid: 228, domain: 'https://5g.aigc-quickapp.com/', }, + '2797': { // + uniacid: 2797, + domain: 'https://xcx.aigc-quickapp.com/', + }, + '5g-95': { // 商品分类,没有立即咨询文字 + uniacid: 95, + domain: 'https://5g.aigc-quickapp.com/', + }, + '5g-160': { // 商品分类,没有立即咨询文字 + uniacid: 160, + domain: 'https://5g.aigc-quickapp.com/', + }, // })['5g-237']; // 商品分类,没有立即咨询文字 // })['5g-97']; // 大宗商品贸易,支持自定义字体大小、颜色 // })['5g-50']; // 燃气安全产品机器人,购物车无反应 @@ -173,7 +185,7 @@ const localDevConfig = ({ // })['2724']; // 生物菌肥 // })['2811']; // 选择要使用的环境配置 // })['local-11']; // 选择要使用的环境配置 -})['228']; // 本地 +})['5g-160']; // 本地 // })['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/components-diy/diy-video-list.vue b/components-diy/diy-video-list.vue index 2b651f2..2c3138e 100644 --- a/components-diy/diy-video-list.vue +++ b/components-diy/diy-video-list.vue @@ -54,17 +54,21 @@ - @@ -144,41 +148,21 @@ export default { // 弹窗视频容器样式 popupVideoStyle() { - let style = 'position:fixed;width:100%;left:0;'; - const defaultRatio = 9 / 16; - - let ratio = defaultRatio; - if (this.popupVideoWidth && this.popupVideoHeight) { - ratio = this.popupVideoHeight / this.popupVideoWidth; - } - - const isPortrait = ratio > 1; - - if (isPortrait) { - style += 'top:50%;transform:translateY(-50%);'; - } else { - style += 'top:20%;'; - } - - // #ifdef H5 - style += 'padding-top: ' + (ratio * 100) + '%;'; - // #endif - - // #ifdef MP-WEIXIN - style += 'padding-top: ' + (ratio * 100) + '%;'; - // #endif - - // #ifdef MP-HARMONY - style += 'height: ' + (this.windowWidth * ratio) + 'px;'; - // #endif - + // 容器横向铺满,黑色背景填满左右边界 + // 视频用 object-fit:contain 保持原比例居中,左右黑边由容器黑色背景填充 + let style = 'position:fixed;width:100%;height:50vh;left:50%;top:50%;transform:translate(-50%,-50%);border-radius:0;'; return style; } }, methods: { // 显示视频播放弹窗 showVideo(item) { - this.video_url = item.videoUrl; + let url = item.videoUrl || ''; + // 处理视频URL:完整链接直接使用,否则通过 $util.img() 转换 + if (url && url.indexOf('http://') !== 0 && url.indexOf('https://') !== 0) { + url = this.$util.img(url); + } + this.video_url = url; this.popupVideoWidth = 0; this.popupVideoHeight = 0; this.$refs.videoPopup.open(); @@ -625,22 +609,6 @@ export default { left: 0; } -/* #ifdef MP-WEIXIN */ -.adaptive-video { - position: absolute; - top: 0; - left: 0; -} -/* #endif */ - -/* #ifdef MP-HARMONY */ -.adaptive-video { - position: static; - display: block; - box-sizing: border-box; -} -/* #endif */ - .video-nav { padding: 16rpx; box-sizing: border-box; diff --git a/components-diy/diy-video.vue b/components-diy/diy-video.vue index f770f7a..3638023 100644 --- a/components-diy/diy-video.vue +++ b/components-diy/diy-video.vue @@ -11,6 +11,9 @@ :style="videoWarpCss" controls preload="metadata" + playsinline + webkit-playsinline + x5-playsinline @loadedmetadata="onVideoLoaded" @click="handlerClick(videoUrl)" > @@ -106,11 +109,11 @@ export default { } // #ifdef H5 - style += 'padding-top: ' + (ratio * 100) + '%;'; + style += 'height:0;padding-top: ' + (ratio * 100) + '%;'; // #endif // #ifdef MP-WEIXIN - style += 'padding-top: ' + (ratio * 100) + '%;'; + style += 'height:0;padding-top: ' + (ratio * 100) + '%;'; // #endif // #ifdef MP-HARMONY diff --git a/components/ns-video-player-popup/ns-video-player-popup.vue b/components/ns-video-player-popup/ns-video-player-popup.vue index e698390..7854046 100644 --- a/components/ns-video-player-popup/ns-video-player-popup.vue +++ b/components/ns-video-player-popup/ns-video-player-popup.vue @@ -9,9 +9,13 @@ {{ $lang('components.ns-video-player-popup.videoUrlNotExist') }} @@ -22,6 +26,8 @@