瀏覽代碼

Merge branch 'test' of https://git.yishihui.com/DeNet/de-net into test

zhangwei 3 年之前
父節點
當前提交
dba1a3e32b
共有 3 個文件被更改,包括 20 次插入20 次删除
  1. 5 6
      src/logic/twitter.js
  2. 5 5
      src/view/components/follow-input.vue
  3. 10 9
      src/view/components/options-transactions.vue

+ 5 - 6
src/logic/twitter.js

@@ -363,16 +363,15 @@ function _deNetBtnClick(port) {
  */
 let isSetContent = false;
 function _setPublishContent(content) {
-    setTimeout(() => {
-        if (!isSetContent) {
-            isSetContent = true;
+    if (!isSetContent) {
+        isSetContent = true;
+        setTimeout(() => {
             document.execCommand("insertText", false, content);
             setTimeout(() => {
                 isSetContent = false;
             }, 2000)
-        }
-
-    }, 1000);
+        }, 1000);
+    }
 }
 
 /**

+ 5 - 5
src/view/components/follow-input.vue

@@ -18,8 +18,7 @@
                     @mouseenter="iptMouseenter"/>
 
             <template v-if="currentIptIndex == index && userList.length">
-                <div class="user-list-wrapper"
-                    :style="{ left: domStyle.left + 'px', top: domStyle.top + 'px' }">
+                <div class="user-list-wrapper">
                     <div class="item" 
                         v-for="(item, index) in userList"
                         :key="index"
@@ -210,9 +209,10 @@ const iptMouseenter = (e) => {
 const rectClick = (event) => {
     //获取相对于当前所指向对象的位置坐标
     console.log(event,'x:' + event.clientX + "  y:" +  event.clientY);
+    let dom = event.target;
     domStyle.value = {
-        left : event.clientX / 2,
-        top: event.clientY
+        left : (dom.getBoundingClientRect().left / 2) - 140,
+        top: dom.getBoundingClientRect().top + 20
     }
 }
 
@@ -302,7 +302,7 @@ const onUserMouseLeave = (params, index) => {
             .user-list-wrapper {
                 width: 284px;
                 max-height: 430px;
-                position: fixed;
+                position: absolute;
                 box-shadow: 0px 4px 20px 0px #0000004D;
                 overflow-y: scroll;
                 background-color: #fff; 

+ 10 - 9
src/view/components/options-transactions.vue

@@ -8,10 +8,11 @@
             />
             Transactions
         </div> -->
-        <div class="list-wrapper" ref="listContent">
+
             <template v-if="!dataList.length">
                 <img class="icon-empty" :src="require('@/assets/svg/icon-empty-list.svg')" />
             </template>
+        <div class="list-wrapper" ref="listContent">
             <div>
                 <div class="cell" v-for="(item, index) in dataList" :key="index">
                     <div class="img-wrapper">
@@ -210,8 +211,16 @@ const listScroll = (e) => {
 <style lang="scss" scoped>
 .com-wrapper {
     height: 100%;
+    position: relative;
     overflow-y: auto;
 
+    .icon-empty {
+        position: absolute;
+        left: 50%;
+        top: 20%;
+        transform: translateX(-50%);
+    }
+
     .com-nav-bar {
         padding: 14px;
         box-sizing: border-box;
@@ -231,14 +240,6 @@ const listScroll = (e) => {
         width: 100%;
         // height: calc(100% - 51px);
         // height: 100%;
-        position: relative;
-
-        .icon-empty {
-            position: absolute;
-            left: 50%;
-            top: 20%;
-            transform: translateX(-50%);
-        }
 
         .cell {
             display: flex;