|
|
@@ -237,34 +237,35 @@ export default {
|
|
|
this.canvasImageUrl = imageUrl;
|
|
|
|
|
|
// 图片加载完成后设置滚动容器高度
|
|
|
- const img = new Image();
|
|
|
- img.onload = () => {
|
|
|
- const scrollContainer = this.$refs.html2canvas.querySelector('.scroll-container');
|
|
|
- // 根据图片实际高度设置容器高度(增加20px缓冲)
|
|
|
- // 根据设备像素比调整图片高度
|
|
|
- // 使用实际渲染高度而非原始图片高度
|
|
|
- const imgHeight = img.offsetHeight + 20;
|
|
|
- // 设置容器最小高度保证内容显示,同时允许自动扩展
|
|
|
- scrollContainer.style.minHeight = `${imgHeight}px`;
|
|
|
- // 保持父容器为可见滚动
|
|
|
- scrollContainer.parentElement.style.overflow = 'visible';
|
|
|
- // 强制浏览器重排
|
|
|
- // scrollContainer.style.display = 'none';
|
|
|
- // scrollContainer.offsetHeight; // 触发重排
|
|
|
- // scrollContainer.style.display = 'block';
|
|
|
+ // const img = new Image();
|
|
|
+ // img.onload = () => {
|
|
|
+ // const scrollContainer = this.$refs.html2canvas.querySelector('.scroll-container');
|
|
|
+ // // 根据图片实际高度设置容器高度(增加20px缓冲)
|
|
|
+ // // 根据设备像素比调整图片高度
|
|
|
+ // // 使用实际渲染高度而非原始图片高度
|
|
|
+ // const imgHeight = img.offsetHeight + 20;
|
|
|
+ // // 设置容器最小高度保证内容显示,同时允许自动扩展
|
|
|
+ // scrollContainer.style.minHeight = `${imgHeight}px`;
|
|
|
+ // // 保持父容器为可见滚动
|
|
|
+ // scrollContainer.parentElement.style.overflow = 'visible';
|
|
|
+ // // 强制浏览器重排
|
|
|
+ // scrollContainer.style.display = 'none';
|
|
|
+ // scrollContainer.offsetHeight; // 触发重排
|
|
|
+ // scrollContainer.style.display = 'block';
|
|
|
|
|
|
- // 添加移动端滚动优化
|
|
|
- // requestAnimationFrame(() => {
|
|
|
- // scrollContainer.style.overflow = 'auto';
|
|
|
- // scrollContainer.style.overflowScrolling = 'touch';
|
|
|
- // scrollContainer.style.webkitOverflowScrolling = 'touch';
|
|
|
- // scrollContainer.style.overscrollBehavior = 'contain';
|
|
|
- // scrollContainer.style.touchAction = 'pan-y';
|
|
|
- // });
|
|
|
- };
|
|
|
- img.src = imageUrl;
|
|
|
+ // // 添加移动端滚动优化
|
|
|
+ // requestAnimationFrame(() => {
|
|
|
+ // scrollContainer.style.overflow = 'auto';
|
|
|
+ // scrollContainer.style.overflowScrolling = 'touch';
|
|
|
+ // scrollContainer.style.webkitOverflowScrolling = 'touch';
|
|
|
+ // scrollContainer.style.overscrollBehavior = 'contain';
|
|
|
+ // scrollContainer.style.touchAction = 'pan-y';
|
|
|
+ // });
|
|
|
+ // };
|
|
|
+ // img.src = imageUrl;
|
|
|
this.zIndex = 9;
|
|
|
this.$emit('setShareImg', true);
|
|
|
+ this.$emit('setDailyDetailsBox', false);
|
|
|
})
|
|
|
.catch((error) => {
|
|
|
this.toastLoading().clear();
|
|
|
@@ -309,6 +310,7 @@ export default {
|
|
|
closeShare() {
|
|
|
this.canvasImageUrl = '';
|
|
|
this.$emit('setShareImg', false);
|
|
|
+ this.$emit('setDailyDetailsBox', true);
|
|
|
},
|
|
|
},
|
|
|
};
|