Riku
2024-08-13 cf693a5227f17bbf2201512128d267281a8c5695
miniprogram_npm/tdesign-miniprogram/image-viewer/image-viewer.js
@@ -91,14 +91,23 @@
                        },
                    };
                }
                const scaledHeight = ratio * windowHeight * 2;
                if (scaledHeight < windowWidth) {
                return {
                    styleObj: {
                        width: `${ratio * windowHeight * 2}rpx`,
                            width: `${scaledHeight}rpx`,
                        height: '100vh',
                        left: '50%',
                        transform: 'translate(-50%, -50%)',
                    },
                };
                }
                return {
                    styleObj: {
                        width: '100vw',
                        height: `${(windowWidth / imageWidth) * imageHeight * 2}rpx`,
                    },
                };
            },
            onImageLoadSuccess(e) {
                const { detail: { width, height }, currentTarget: { dataset: { index }, }, } = e;