h5调用第三方支付唤起支付宝支付

      // 接口返回的是url地址,h5调用第三方(首易信)支付宝
      var winRef = window.open("","_blank");
      this.$api.post(
        url,
        params,
        success => {
          this.$indicator.close();
          if (success.status === 10000) {
            console.log('支付宝外部H5支付 ALI_WAP');
            let redirect_url = success.data.credential.redirectUrl
            console.log('window.open在Safari中不能打开的问题 redirect_url:', redirect_url);
            winRef.location = redirect_url;
            setTimeout(()=>{
              window.location.replace('/bdh5std/oilcard.html#/payresult?orderNo=' +  this.$route.query.orderNo);
            }, 300)
          } else {
            this.$toast(success.info);
          }
        },
        fail => {
          this.$indicator.close();
          console.dir("请求失败");
        }
      );
    }

猜你喜欢

转载自blog.csdn.net/weixin_40918145/article/details/113182364