Browse Source

update copy and goto

fengchang 1 year ago
parent
commit
70a0fafb07
1 changed files with 5 additions and 3 deletions
  1. 5 3
      hichina-admin-front/src/pages/SkuGroupPage.vue

+ 5 - 3
hichina-admin-front/src/pages/SkuGroupPage.vue

@@ -311,11 +311,10 @@ export default {
       this.popupBindDestinationWindow = true;
       this.popupBindDestinationWindow = true;
     },
     },
     copyTextAndOpen(text) {
     copyTextAndOpen(text) {
-      this.copyText(text);
       var goto = this.mainsiteBaseUrl + "/product-detail/" + text;
       var goto = this.mainsiteBaseUrl + "/product-detail/" + text;
-      window.location.href = goto;
+      this.copyText(text, goto);
     },
     },
-    copyText(text) {
+    copyText(text, goto) {
       const unsecuredCopyToClipboard = (text) => {
       const unsecuredCopyToClipboard = (text) => {
         const textArea = document.createElement("textarea");
         const textArea = document.createElement("textarea");
         textArea.value = text;
         textArea.value = text;
@@ -337,6 +336,9 @@ export default {
         unsecuredCopyToClipboard(text);
         unsecuredCopyToClipboard(text);
         this.showNotifyMessageSucceed("成功复制" + text + "到剪贴板");
         this.showNotifyMessageSucceed("成功复制" + text + "到剪贴板");
       }
       }
+      if (goto?.trim()) {
+        window.location.href = goto;
+      }
     },
     },
     enableGroup(skuGroupId) {
     enableGroup(skuGroupId) {
       api
       api