Browse Source

支付宝生活支付成功后跳转改进

master
parent
commit
8149784686
  1. 7
      src/views/cashier/index.vue
  2. 21
      src/views/cashier/result.vue
  3. 4
      src/views/index/index.vue

7
src/views/cashier/index.vue

@ -213,8 +213,11 @@
} }
}, },
goToApp() { goToApp() {
window.location.href =decodeURIComponent(this.fromAppurl1);
AlipayJSBridge.call('openInBrowser', {
url: decodeURIComponent(this.fromAppurl1)
});
AlipayJSBridge.call('closeWebview');
// window.location.href=decodeURIComponent(this.fromAppurl1);
}, },
}, },

21
src/views/cashier/result.vue

@ -35,15 +35,32 @@ export default {
} }
this.price=price; this.price=price;
this.fromAppurl=fromAppurl; this.fromAppurl=fromAppurl;
this.ready();
}, },
methods: { methods: {
ready(callback) {
// jsbridge
if (window.AlipayJSBridge) {
callback && callback();
} else {
//
document.addEventListener('AlipayJSBridgeReady', callback, false);
}
},
goToApp() { goToApp() {
window.location.href=decodeURIComponent(this.fromAppurl);
AlipayJSBridge.call('openInBrowser', {
url: decodeURIComponent(this.fromAppurl)
});
AlipayJSBridge.call('closeWebview');
}, },
}, },
created() { created() {
// jsapi
const s = document.createElement("script");
s.type = "text/javascript";
s.src ="https://gw.alipayobjects.com/as/g/h5-lib/alipayjsapi/3.1.1/alipayjsapi.min.js";
document.body.appendChild(s);
}, },
}; };

4
src/views/index/index.vue

@ -21,8 +21,8 @@ export default {
}, },
methods: { methods: {
pay(){ pay(){
//window.location.href = 'alipays://platformapi/startapp?saId=10000007&qrcode='+encodeURIComponent('http://192.168.1.39:9103/alipay/auth?trainingOrderId=65aee95e818f4571b2480bdafba4cd4a&token=amlhcGVpMTY5NDE1MjM0MzU5NTM0OTQ2&fromAppurl=paymoney://car:8888/carstep')//
window.location.href="alipays://platformapi/startapp?appId=20000042&publicBizType=LIFE_APP&publicId=2021004116616163&url="+encodeURIComponent('http://192.168.1.39:9103/alipay/auth?trainingOrderId=65aee95e818f4571b2480bdafba4cd4a&token=amlhcGVpMTY5NDE1MjM0MzU5NTM0OTQ2&fromAppurl=paymoney://car:8888/carstep')//
//window.location.href = 'alipays://platformapi/startapp?saId=10000007&qrcode='+encodeURIComponent('http://192.168.1.39:9103/alipay/auth?trainingOrderId=506e9ae34e544f89abb220f0cec0c442&token=amlhcGVpMTY5NDU5MTE3NjIyMzA1NDc1&fromAppurl=paymoney://car:8888/carstep')//
window.location.href="alipays://platformapi/startapp?appId=20000042&publicBizType=LIFE_APP&publicId=2021004116616163&url="+encodeURIComponent('http://192.168.1.39:9103/alipay/auth?trainingOrderId=506e9ae34e544f89abb220f0cec0c442&token=amlhcGVpMTY5NDU5MTE3NjIyMzA1NDc1&fromAppurl=paymoney://car:8888/carstep')//
//window.location.href ='alipayqr://platformapi/startapp?saId=10000007&qrcode='+encodeURI('http://192.168.1.39:9103/alipay/auth?type=111&trainingOrderId=111&fromAppurl=111&token=111')// //window.location.href ='alipayqr://platformapi/startapp?saId=10000007&qrcode='+encodeURI('http://192.168.1.39:9103/alipay/auth?type=111&trainingOrderId=111&fromAppurl=111&token=111')//
} }
}, },

Loading…
Cancel
Save