Explorar el Código

修正点击事件延时功能

Administrator hace 7 años
padre
commit
94ef35b179
Se han modificado 2 ficheros con 20 adiciones y 4 borrados
  1. 10 2
      components/supplier/details.vue
  2. 10 2
      components/supplier/resource.vue

+ 10 - 2
components/supplier/details.vue

@@ -114,7 +114,7 @@
         </ul>
       </div>
       <span slot="footer" class="dialog-footer">
-        <a type="button" @click="goPublish">询价提交</a>
+        <button @click="goPublish" :disabled="isClick">询价提交</button>
       </span>
     </el-dialog>
   </div>
@@ -126,6 +126,7 @@
     name: 'DetailsView',
     data () {
       return {
+        isClick: false,
         hasDown: false,
         height300: {
           maxHeight: '306px'
@@ -205,6 +206,11 @@
       },
       // 请求询价信息
       goPublish () {
+        let _this = this
+        this.isClick = true
+        setTimeout(function () {
+          _this.isClick = false
+        }, 1000)
         if (this.checkAll()) {
           let inquiry = {}
           let inquiryItem = {}
@@ -281,8 +287,10 @@
     }
     .el-dialog__footer{
       text-align: center;
-      a{
+      button{
         display:inline-block;
+        border:0;
+        box-shadow: none;
         background: #3c7cf5;
         color:#fff;
         font-size: 14px;

+ 10 - 2
components/supplier/resource.vue

@@ -154,7 +154,7 @@
         </ul>
       </div>
       <span slot="footer" class="dialog-footer">
-        <a type="button" @click="goPublish">询价提交</a>
+        <button @click="goPublish" :disabled="isClick">询价提交</button>
       </span>
     </el-dialog>
   </div>
@@ -168,6 +168,7 @@
     name: 'ResourceView',
     data () {
       return {
+        isClick: false,
         applyObj: {
           cmpCode: '',
           brand: '',
@@ -285,6 +286,11 @@
       },
       // 请求询价信息
       goPublish () {
+        let _this = this
+        this.isClick = true
+        setTimeout(function () {
+          _this.isClick = false
+        }, 1000)
         if (this.checkAll()) {
           let inquiry = {}
           let inquiryItem = {}
@@ -361,7 +367,7 @@
     }
     .el-dialog__footer{
       text-align: center;
-      a{
+      button{
         display:inline-block;
         background: #3c7cf5;
         color:#fff;
@@ -369,6 +375,8 @@
         line-height: 30px;
         height:30px;
         padding:0 10px;
+        box-shadow: none;
+        border: 0;
         border-radius:5px;
       }
     }