Ver Fonte

微信h5

xiongzhu há 4 anos atrás
pai
commit
76573bbc06

+ 15 - 15
src/main/nine-space/src/views/Submit.vue

@@ -149,24 +149,24 @@ export default {
     },
     methods: {
         submit() {
-            if (this.payType === 'ALIPAY') {
-                this.$http
-                    .post('/order/create?collectionId=' + this.$route.query.id + '&qty=1')
-                    .then(res => {
-                        this.orderId = res.id;
-                        this.$router.replace('/submit?orderId=' + res.id);
-                        this.$nextTick(() => {
+            this.$http
+                .post('/order/create?collectionId=' + this.$route.query.id + '&qty=1')
+                .then(res => {
+                    this.orderId = res.id;
+                    this.$router.replace('/submit?orderId=' + res.id);
+                    this.$nextTick(() => {
+                        if (this.payType === 'ALIPAY') {
                             document.location.replace(path.resolve(this.$baseUrl, 'payOrder/alipay?id=' + res.id));
-                        });
-                    })
-                    .catch(e => {
-                        if (e) {
-                            this.$toast(e.error);
+                        } else if (this.payType === 'WEIXIN') {
+                            document.location.replace(path.resolve(this.$baseUrl, 'payOrder/weixin_h5?id=' + res.id));
                         }
                     });
-            } else {
-                this.wait();
-            }
+                })
+                .catch(e => {
+                    if (e) {
+                        this.$toast(e.error);
+                    }
+                });
         }
     }
 };

+ 1 - 1
src/main/resources/templates/WeixinPayHtml.ftlh

@@ -57,7 +57,7 @@
 </#if>
 <#if !weixin && payUrl??>
     <script>
-        window.location = "${payUrl?no_esc}";
+        document.location.replace("${payUrl?no_esc}");
     </script>
 </#if>
 <!-- 引入 Vue 和 Vant 的 JS 文件 -->