修改跳掉app逻辑

This commit is contained in:
Dragon
2024-02-01 14:46:45 +08:00
parent 7f12abf13f
commit bff8714b41
4 changed files with 16 additions and 31 deletions

View File

@@ -171,4 +171,4 @@
<script src="../../common/js/common2.js"></script>
<script src="../../common/js/layer.js"></script>
<script src="../../common/js/vconsole.min.js"></script>
<script src="./js/index.js?v=1.1"></script>
<script src="./js/index.js?v1.0"></script>

View File

@@ -219,6 +219,11 @@ $('.page1 .position').on('click', 'div', function () {
})
// 充值接口
function apply2New () {
if (border.app) {
failureUrl = urlPrefix + '/peko/modules/pay/result.html?channelType=4&app=1';
} else {
failureUrl = urlPrefix + '/peko/modules/pay/result.html?channelType=4&app=0';
}
apply2NewLock = false;
showLoading();
networkRequest({

View File

@@ -25,6 +25,7 @@ const toastMsg = (content = '操作完成', time = 2) => {
}
var chargeRecordId = null;//订单号
var chargeStatus = 0;
var isApp = 0;
$(function () {
if (EnvCheck() == 'test') {//degBug
new VConsole();
@@ -51,32 +52,6 @@ function getChargeResult () {
$('.result span').text(`原因:${res.message}`);
$('.err').show();
hideLoading(layerIndex);
// toastMsg(res.message);
// if (browser.app) {
// console.log('app内');
// //你已经准备好了整个queryString在这里的键->值的形式。
// //在有多个值的边缘情况下,该值是一个数组。
// var qs = AppRedirect.queryString;
// // Here we initiate the redirect process
// AppRedirect.redirect({
// iosApp: 'twitter://post?message=' + qs['message'],
// iosAppStore: 'https://itunes.apple.com/il/app/twitter/id333903271?mt=8&message=' + qs['message'],
// // 为此,你的应用需要有一个类别过滤器:android.intent.category.BROWSABLE
// android: {
// // 'host': 'post/?message=' + encodeURIComponent(qs['message']), // 自定义方案URL中的Host/path/querystring部分
// // 'action': " //相当于intent中的action
// // 'category': ' //相当于intent中的category
// // 'component': ' //相当于intent中的component
// // 'scheme': 'twitter', // 自定义方案URL中的方案部分
// // 'package': 'com.twitter.android', // Play store中的包名
// // 'fallback': 'https://play.google.com/store/apps/details?id=com.twitter.android&hl=en&message=' + qs['message']
// 'scheme': 'pekoapp',
// 'host': 'payment/resul'
// }
// });
// }
}
hideLoading(layerIndex);
},
@@ -87,8 +62,13 @@ function getChargeResult () {
});
}
$('.result .but').click(function () {
if (browser.android && browser.app) {
window.location.href = `pekoapp://payment/result?status=${chargeStatus}`;
isApp = getUrl.app;
if (isApp == 1) {
if (browser.app) {
window.location.href = urlPrefix + '/peko/modules/pay/index.html?channelType=4';
} else {
window.location.href = `pekoapp://payment/result?status=${chargeStatus}`;
}
} else {
window.location.href = urlPrefix + '/peko/modules/pay/index.html?channelType=4';
}

View File

@@ -16,7 +16,7 @@
<img src="./images/err.png" alt="">
<p>储值失败</p>
<span>原因xxxxx</span>
<div class="but">返回储值页面</div>
<div class="but">返回</div>
</div>
<div class="result success">
<img src="./images/success.png" alt="">
@@ -32,4 +32,4 @@
<script src="../../common/js/layer.js"></script>
<script src="../../common/js/vconsole.min.js"></script>
<script src="./js/redirect.js"></script>
<script src="./js/result.js"></script>
<script src="./js/result.js?v1.0"></script>