许成详 6 years ago
parent
commit
3a2e2321cb

+ 21
- 2
src/pages/system/cardAndCouponManager/cardManager/index.vue View File

@@ -87,7 +87,14 @@
87 87
               size="mini"
88 88
               type="danger"
89 89
               @click="sendCard(scope.$index, scope.row)">赠送客户</el-button>
90
-            <a v-if="scope.row.SendType === 'channel'" class="copyBtn" :data-clipboard-text="'www.baidu.com'" :ref="'copy' + scope.$index" @click="toCopy(scope.$index, scope.row)">点击复制链接</a>
90
+            <el-button
91
+              size="mini"
92
+              type="success"
93
+              v-if="scope.row.SendType === 'channel'"
94
+              v-clipboard:copy="'www.baidu.com' + scope.$index"
95
+              v-clipboard:success="onCopy"
96
+              v-clipboard:error="onError"
97
+              >点击复制链接</el-button>
91 98
           </template>
92 99
         </el-table-column>
93 100
       </el-table>
@@ -380,7 +387,19 @@ export default {
380 387
     },
381 388
     addCard () {
382 389
       this.$router.push({ name: 'editCard', query: {} })
383
-    }
390
+    },
391
+    onCopy () {
392
+      this.$message({
393
+        type: 'success',
394
+        message: '复制成功!'
395
+      })
396
+    },
397
+    onError () {
398
+      this.$message({
399
+        type: 'error',
400
+        message: '复制失败!'
401
+      })
402
+    },
384 403
   }
385 404
 }
386 405
 </script>

+ 18
- 3
src/pages/system/cardAndCouponManager/couponManager/index.vue View File

@@ -89,10 +89,13 @@
89 89
               type="danger"
90 90
               @click="sendCoupon(scope.$index, scope.row)">赠送客户</el-button>
91 91
             <el-button
92
-              v-if="scope.row.SendType === 'channel'"
93 92
               size="mini"
94 93
               type="success"
95
-              @click="handleDelete(scope.$index, scope.row)">点击复制链接</el-button>
94
+              v-if="scope.row.SendType === 'channel'"
95
+              v-clipboard:copy="'www.baidu.com' + scope.$index"
96
+              v-clipboard:success="onCopy"
97
+              v-clipboard:error="onError"
98
+              >点击复制链接</el-button>
96 99
           </template>
97 100
         </el-table-column>
98 101
       </el-table>
@@ -360,7 +363,19 @@ export default {
360 363
         this.centerDialogVisible = false
361 364
         this.getList()
362 365
       })
363
-    }
366
+    },
367
+    onCopy () {
368
+      this.$message({
369
+        type: 'success',
370
+        message: '复制成功!'
371
+      })
372
+    },
373
+    onError () {
374
+      this.$message({
375
+        type: 'error',
376
+        message: '复制失败!'
377
+      })
378
+    },
364 379
   }
365 380
 }
366 381
 </script>