panhui hace 4 años
padre
commit
7ecdaf17d4
Se han modificado 1 ficheros con 11 adiciones y 5 borrados
  1. 11 5
      src/main/nine-space/src/views/Submit.vue

+ 11 - 5
src/main/nine-space/src/views/Submit.vue

@@ -52,6 +52,7 @@
                         立即支付
                     </van-button>
                 </div>
+                <a id="pay" :href="hrefUrl"></a>
             </div>
         </div>
     </div>
@@ -96,7 +97,8 @@ export default {
             inApp,
             couponList: [],
             collectionId: 0,
-            timer: null
+            timer: null,
+            hrefUrl: ''
         };
     },
     computed: {
@@ -218,10 +220,14 @@ export default {
                                     this.$http
                                         .get(`/payOrder/${this.inApp ? 'alipay_app' : 'alipay_h5'}?id=${res.id}`)
                                         .then(res => {
-                                            window.open(
-                                                'alipays://platformapi/startapp?saId=10000007&qrcode=' + res,
-                                                '_blank'
-                                            );
+                                            this.hrefUrl = 'alipays://platformapi/startapp?saId=10000007&qrcode=' + res;
+                                            // window.open(
+                                            //     'alipays://platformapi/startapp?saId=10000007&qrcode=' + res,
+                                            //     '_blank'
+                                            // );
+                                            this.$nextTick(() => {
+                                                document.getElementById('pay').click();
+                                            });
                                             if (!this.inApp) {
                                                 this.getOrder(true);
                                             }