Browse Source

Merge branch 'jiangcheng/feature-20260326164657-金币日常优化3.0' into milestone-20260328-金币日常优化3.0

jiangcheng/feature-20260326164657-金币日常优化3.0
jiangcheng 3 weeks ago
parent
commit
a80191fec9
  1. 40
      src/views/moneyManage/receiveDetail/receiveFinance.vue
  2. 39
      src/views/moneyManage/receiveDetail/receiveManage.vue
  3. 45
      src/views/moneyManage/receiveDetail/receiveService.vue

40
src/views/moneyManage/receiveDetail/receiveFinance.vue

@ -1289,14 +1289,19 @@ const submitEditForm = async () => {
// 2.6 // 2.6
// //
//
const previewImage = (imageUrl) => { const previewImage = (imageUrl) => {
if (!imageUrl) return; if (!imageUrl) return;
const imageElement = document.createElement('img'); const imageElement = document.createElement('img');
imageElement.src = imageUrl; imageElement.src = imageUrl;
imageElement.style.maxWidth = '80vw';
imageElement.style.maxHeight = '80vh';
imageElement.style.objectFit = 'contain';
imageElement.style.maxWidth = '90vw';
imageElement.style.maxHeight = '90vh';
imageElement.style.display = 'block';
imageElement.style.transition = 'transform 0.2s ease-out';
imageElement.style.cursor = 'zoom-in';
imageElement.style.transformOrigin = 'center center'; //
const viewer = document.createElement('div'); const viewer = document.createElement('div');
viewer.style.position = 'fixed'; viewer.style.position = 'fixed';
@ -1305,15 +1310,36 @@ const previewImage = (imageUrl) => {
viewer.style.width = '100vw'; viewer.style.width = '100vw';
viewer.style.height = '100vh'; viewer.style.height = '100vh';
viewer.style.backgroundColor = 'rgba(0, 0, 0, 0.7)'; viewer.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
viewer.style.display = 'flex'; viewer.style.display = 'flex';
viewer.style.justifyContent = 'center'; viewer.style.justifyContent = 'center';
viewer.style.alignItems = 'center'; viewer.style.alignItems = 'center';
viewer.style.zIndex = '9999';
viewer.style.overflow = 'hidden';
viewer.style.zIndex = '999999';
viewer.appendChild(imageElement); viewer.appendChild(imageElement);
//
viewer.addEventListener('click', () => {
document.body.removeChild(viewer);
let currentScale = 1;
const scaleStep = 0.2;
const handleWheel = (e) => {
e.preventDefault();
if (e.deltaY > 0) {
currentScale += scaleStep;
} else {
currentScale -= scaleStep;
}
if (currentScale < 0.5) currentScale = 0.5;
imageElement.style.transform = `scale(${currentScale})`;
imageElement.style.cursor = currentScale > 1 ? 'zoom-out' : 'zoom-in';
};
viewer.addEventListener('wheel', handleWheel, { passive: false });
viewer.addEventListener('click', (e) => {
if (e.target === viewer) {
document.body.removeChild(viewer);
viewer.removeEventListener('wheel', handleWheel);
}
}); });
document.body.appendChild(viewer); document.body.appendChild(viewer);

39
src/views/moneyManage/receiveDetail/receiveManage.vue

@ -1294,9 +1294,13 @@ const previewImage = (imageUrl) => {
const imageElement = document.createElement('img'); const imageElement = document.createElement('img');
imageElement.src = imageUrl; imageElement.src = imageUrl;
imageElement.style.maxWidth = '80vw';
imageElement.style.maxHeight = '80vh';
imageElement.style.objectFit = 'contain';
imageElement.style.maxWidth = '90vw';
imageElement.style.maxHeight = '90vh';
imageElement.style.display = 'block';
imageElement.style.transition = 'transform 0.2s ease-out';
imageElement.style.cursor = 'zoom-in';
imageElement.style.transformOrigin = 'center center'; //
const viewer = document.createElement('div'); const viewer = document.createElement('div');
viewer.style.position = 'fixed'; viewer.style.position = 'fixed';
@ -1305,15 +1309,36 @@ const previewImage = (imageUrl) => {
viewer.style.width = '100vw'; viewer.style.width = '100vw';
viewer.style.height = '100vh'; viewer.style.height = '100vh';
viewer.style.backgroundColor = 'rgba(0, 0, 0, 0.7)'; viewer.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
viewer.style.display = 'flex'; viewer.style.display = 'flex';
viewer.style.justifyContent = 'center'; viewer.style.justifyContent = 'center';
viewer.style.alignItems = 'center'; viewer.style.alignItems = 'center';
viewer.style.zIndex = '9999';
viewer.style.overflow = 'hidden';
viewer.style.zIndex = '999999';
viewer.appendChild(imageElement); viewer.appendChild(imageElement);
//
viewer.addEventListener('click', () => {
document.body.removeChild(viewer);
let currentScale = 1;
const scaleStep = 0.2;
const handleWheel = (e) => {
e.preventDefault();
if (e.deltaY > 0) {
currentScale += scaleStep;
} else {
currentScale -= scaleStep;
}
if (currentScale < 0.5) currentScale = 0.5;
imageElement.style.transform = `scale(${currentScale})`;
imageElement.style.cursor = currentScale > 1 ? 'zoom-out' : 'zoom-in';
};
viewer.addEventListener('wheel', handleWheel, { passive: false });
viewer.addEventListener('click', (e) => {
if (e.target === viewer) {
document.body.removeChild(viewer);
viewer.removeEventListener('wheel', handleWheel);
}
}); });
document.body.appendChild(viewer); document.body.appendChild(viewer);

45
src/views/moneyManage/receiveDetail/receiveService.vue

@ -1166,10 +1166,18 @@ const customUpload = async (options) => {
// //
const previewImage = (imageUrl) => { const previewImage = (imageUrl) => {
if (!imageUrl) return;
const imageElement = document.createElement('img'); const imageElement = document.createElement('img');
imageElement.src = imageUrl; imageElement.src = imageUrl;
imageElement.style.maxWidth = '80vw';
imageElement.style.maxHeight = '80vh';
imageElement.style.maxWidth = '90vw';
imageElement.style.maxHeight = '90vh';
imageElement.style.display = 'block';
imageElement.style.transition = 'transform 0.2s ease-out';
imageElement.style.cursor = 'zoom-in';
imageElement.style.transformOrigin = 'center center'; //
const viewer = document.createElement('div'); const viewer = document.createElement('div');
viewer.style.position = 'fixed'; viewer.style.position = 'fixed';
viewer.style.top = '0'; viewer.style.top = '0';
@ -1177,16 +1185,39 @@ const previewImage = (imageUrl) => {
viewer.style.width = '100vw'; viewer.style.width = '100vw';
viewer.style.height = '100vh'; viewer.style.height = '100vh';
viewer.style.backgroundColor = 'rgba(0, 0, 0, 0.7)'; viewer.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
viewer.style.display = 'flex'; viewer.style.display = 'flex';
viewer.style.justifyContent = 'center'; viewer.style.justifyContent = 'center';
viewer.style.alignItems = 'center'; viewer.style.alignItems = 'center';
viewer.style.zIndex = '9999';
viewer.style.overflow = 'auto';
viewer.style.overflow = 'hidden';
viewer.style.zIndex = '999999';
viewer.appendChild(imageElement); viewer.appendChild(imageElement);
document.body.appendChild(viewer);
viewer.addEventListener('click', () => {
document.body.removeChild(viewer);
let currentScale = 1;
const scaleStep = 0.2;
const handleWheel = (e) => {
e.preventDefault();
if (e.deltaY > 0) {
currentScale += scaleStep;
} else {
currentScale -= scaleStep;
}
if (currentScale < 0.5) currentScale = 0.5;
imageElement.style.transform = `scale(${currentScale})`;
imageElement.style.cursor = currentScale > 1 ? 'zoom-out' : 'zoom-in';
};
viewer.addEventListener('wheel', handleWheel, { passive: false });
viewer.addEventListener('click', (e) => {
if (e.target === viewer) {
document.body.removeChild(viewer);
viewer.removeEventListener('wheel', handleWheel);
}
}); });
document.body.appendChild(viewer);
}; };
// ===================== 退/ ===================== // ===================== 退/ =====================

Loading…
Cancel
Save