wenliming 3 år sedan
förälder
incheckning
ea3843e6ab
3 ändrade filer med 11 tillägg och 12 borttagningar
  1. 10 10
      library/paypal.html
  2. 0 1
      src/entry/content.js
  3. 1 1
      src/view/components/paypal-button.vue

+ 10 - 10
library/paypal.html

@@ -84,19 +84,19 @@
             })
 
             function loadPaypal() {
-                let amount = 0;
+                let amount = getQueryString('amount');
                 isOnMessage = true;
                 window.parent.postMessage({ actionType: "iframeLoaded" }, "*");
-                window.addEventListener("message", function (event) {
-                    if (event.data && event.data.actionType) {
-                        switch (event.data.actionType) {
-                            case "setAmount":
-                                amount = event.data.amount;
+                // window.addEventListener("message", function (event) {
+                //     if (event.data && event.data.actionType) {
+                //         switch (event.data.actionType) {
+                //             case "setAmount":
+                //                 amount = event.data.amount;
                                 initPaypal(amount);
-                                break;
-                            }
-                    }
-                });
+                //                 break;
+                //             }
+                //     }
+                // });
             }
 
             function initPaypal(amount) {

+ 0 - 1
src/entry/content.js

@@ -26,7 +26,6 @@ chrome.storage.onChanged.addListener(changes => {
     if (changes.executeScript) {
         let item = JSON.parse(changes.executeScript.newValue)
         if (item.executeScript) {
-            location.reload()
             init()
             console.log('yeeee')
         }

+ 1 - 1
src/view/components/paypal-button.vue

@@ -8,7 +8,7 @@
             <iframe
                 class="iframe-pay"
                 ref="iframe"
-                :src="`${payConfig.paypalHtml}?paypalClientId=${payConfig.paypalClientId}&a=${props.finalAmountData.finalAmountValue}`"></iframe>
+                :src="`${payConfig.paypalHtml}?paypalClientId=${payConfig.paypalClientId}&amount=${props.finalAmountData.finalAmountValue}`"></iframe>
         </div>
     </div>
 </template>