From cf9c62d75136aba382ee63ee35f3b609e1521b17 Mon Sep 17 00:00:00 2001 From: zyn Date: Wed, 23 Aug 2023 13:57:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E5=B0=8F=E7=A6=8F-=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=90=8E=E5=9B=BE=E6=A0=87=E5=81=8F=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/customerService.vue | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/components/customerService.vue b/src/components/customerService.vue index 566aa45d6..664467477 100644 --- a/src/components/customerService.vue +++ b/src/components/customerService.vue @@ -53,8 +53,11 @@ export default { var disy = e.pageY - drag.offsetTop; clientOffset.clientX = event.clientX; clientOffset.clientY = event.clientY; + // 解决点击后图标偏移 start (1/3) + drag.style.left = e.pageX - disx + "px"; + drag.style.top = e.pageY - disy + "px"; + // 解决点击后图标偏移 end document.onmousemove = function (e) { - console.log(11) drag.style.left = e.pageX - disx + "px"; drag.style.top = e.pageY - disy + "px"; }; @@ -97,6 +100,11 @@ export default { styles.height = "470px"; styles.width = "580px"; + // 解决点击后图标偏移 start (2/3) + styles.left = (styles.left.slice(0,styles.left.indexOf('px')) - 509) + 'px' + styles.top = (styles.top.slice(0,styles.top.indexOf('px')) - 470 + 99) + 'px' + // 解决点击后图标偏移 end + iframe.style.pointerEvents = ""; } else if (e.data == "close") { iframe.setAttribute("height", "100"); @@ -105,6 +113,11 @@ export default { styles.height = "99px"; styles.width = "71px"; + // 解决点击后图标偏移 start (3/3) + styles.left = (styles.left.slice(0,styles.left.indexOf('px')) / 1 + 509) + 'px' + styles.top = (styles.top.slice(0,styles.top.indexOf('px')) / 1 + 470 - 99) + 'px' + // 解决点击后图标偏移 end + iframe.style.pointerEvents = "none"; } },