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"; } },