Showing
1 changed file
with
27 additions
and
1 deletions
@@ -9,7 +9,9 @@ | @@ -9,7 +9,9 @@ | ||
9 | 收货人地址: {{ appraiseAddress.addressName }} | 9 | 收货人地址: {{ appraiseAddress.addressName }} |
10 | </p> | 10 | </p> |
11 | <p class="area">{{ appraiseAddress.address }}</p> | 11 | <p class="area">{{ appraiseAddress.address }}</p> |
12 | - <p class="mobile">{{ appraiseAddress.mobile }}</p> | 12 | + <p class="mobile"> |
13 | + {{ appraiseAddress.mobile }}<i ref="copy" class="copy"></i> | ||
14 | + </p> | ||
13 | </div> | 15 | </div> |
14 | </div> | 16 | </div> |
15 | <router-link | 17 | <router-link |
@@ -39,6 +41,7 @@ | @@ -39,6 +41,7 @@ | ||
39 | 41 | ||
40 | <script> | 42 | <script> |
41 | import { createNamespacedHelpers } from "vuex"; | 43 | import { createNamespacedHelpers } from "vuex"; |
44 | +import Clipboard from "clipboard"; | ||
42 | const { mapGetters } = createNamespacedHelpers("order/orderDetail"); | 45 | const { mapGetters } = createNamespacedHelpers("order/orderDetail"); |
43 | 46 | ||
44 | export default { | 47 | export default { |
@@ -50,6 +53,20 @@ export default { | @@ -50,6 +53,20 @@ export default { | ||
50 | }, | 53 | }, |
51 | computed: { | 54 | computed: { |
52 | ...mapGetters(["userAddress", "appraiseAddress"]) | 55 | ...mapGetters(["userAddress", "appraiseAddress"]) |
56 | + }, | ||
57 | + activated() { | ||
58 | + this.copyBtn = new Clipboard(this.$refs.copy, { | ||
59 | + text: () => { | ||
60 | + const { addressName, address, mobile } = this.appraiseAddress; | ||
61 | + return `${addressName} ${address} ${mobile}`; | ||
62 | + } | ||
63 | + }); | ||
64 | + this.copyBtn.on("success", () => { | ||
65 | + this.$createToast({ | ||
66 | + txt: "复制成功", | ||
67 | + type: "txt" | ||
68 | + }).show(); | ||
69 | + }); | ||
53 | } | 70 | } |
54 | }; | 71 | }; |
55 | </script> | 72 | </script> |
@@ -98,6 +115,15 @@ export default { | @@ -98,6 +115,15 @@ export default { | ||
98 | font-weight: bold; | 115 | font-weight: bold; |
99 | } | 116 | } |
100 | 117 | ||
118 | + .copy { | ||
119 | + width: 50px; | ||
120 | + height: 25px; | ||
121 | + display: inline-block; | ||
122 | + background: url("~statics/image/order/copy@3x.png") no-repeat; | ||
123 | + background-size: contain; | ||
124 | + background-position: center; | ||
125 | + } | ||
126 | + | ||
101 | .address-icon { | 127 | .address-icon { |
102 | width: 48px; | 128 | width: 48px; |
103 | height: 48px; | 129 | height: 48px; |
-
Please register or login to post a comment