mirror of
https://gitee.com/liuxioabin/fengketrade.git
synced 2026-04-17 21:03:17 +08:00
Merge branch 'main' of gitee.com:liuxioabin/fengketrade
This commit is contained in:
commit
65ef3467c9
@ -68,7 +68,7 @@
|
||||
"schemes" : "shopro"
|
||||
},
|
||||
"ios" : {
|
||||
"urlschemewhitelist" : [ "baidumap", "iosamap" ],
|
||||
"urlschemewhitelist" : [ "baidumap", "iosamap", "ccbpayment" ],
|
||||
"dSYMs" : false,
|
||||
"privacyDescription" : {
|
||||
"NSPhotoLibraryUsageDescription" : "需要同意访问您的相册选取图片才能完善该条目",
|
||||
|
||||
@ -537,17 +537,73 @@
|
||||
|
||||
onLoad(async (options) => {
|
||||
let id = '';
|
||||
if (options.orderSN) {
|
||||
id = options.orderSN;
|
||||
|
||||
// 处理建行加密参数
|
||||
if (options.ccbParamSJ) {
|
||||
try {
|
||||
// 显示加载提示
|
||||
uni.showLoading({
|
||||
title: '正在解析订单...',
|
||||
mask: true
|
||||
});
|
||||
|
||||
// 调用后端解密接口 (使用正确的API调用方式)
|
||||
const res = await sheep.$api.third.ccblife.decryptParam({
|
||||
ccbParamSJ: options.ccbParamSJ
|
||||
});
|
||||
|
||||
uni.hideLoading();
|
||||
|
||||
if (res.code === 1 && res.data) {
|
||||
// 从解密数据中获取订单ID
|
||||
// 支持多种可能的字段名(建行返回的是 orderid/ORDERID)
|
||||
id = res.data.orderid || res.data.ORDERID || res.data.order_id || res.data.order_sn || res.data.orderSN || res.data.orderId || res.data.id;
|
||||
|
||||
if (!id) {
|
||||
console.error('解密数据中未找到订单ID:', res.data);
|
||||
sheep.$helper.toast('无法获取订单信息');
|
||||
setTimeout(() => {
|
||||
sheep.$router.back();
|
||||
}, 1500);
|
||||
return;
|
||||
}
|
||||
if (options.id) {
|
||||
} else {
|
||||
sheep.$helper.toast(res.msg || '参数解析失败');
|
||||
setTimeout(() => {
|
||||
sheep.$router.back();
|
||||
}, 1500);
|
||||
return;
|
||||
}
|
||||
} catch (error) {
|
||||
uni.hideLoading();
|
||||
console.error('解密ccbParamSJ失败:', error);
|
||||
sheep.$helper.toast('参数解析失败');
|
||||
setTimeout(() => {
|
||||
sheep.$router.back();
|
||||
}, 1500);
|
||||
return;
|
||||
}
|
||||
} else if (options.orderSN) {
|
||||
id = options.orderSN;
|
||||
} else if (options.id) {
|
||||
id = options.id;
|
||||
}
|
||||
|
||||
state.comeinType = options.comein_type;
|
||||
if (state.comeinType === 'wechat') {
|
||||
state.merchantTradeNo = options.merchant_trade_no;
|
||||
}
|
||||
|
||||
// 获取订单详情
|
||||
if (id) {
|
||||
getOrderDetail(id);
|
||||
} else {
|
||||
// 如果没有任何有效的订单标识,提示用户并返回
|
||||
sheep.$helper.toast('缺少订单参数');
|
||||
setTimeout(() => {
|
||||
sheep.$router.back();
|
||||
}, 1500);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@ -95,7 +95,9 @@
|
||||
const onShareByPoster = () => {
|
||||
closeShareModal();
|
||||
if (!sheep.$store('user').isLogin) {
|
||||
showAuthModal();
|
||||
// ⚠️ 已禁用:建行生活场景用户已通过ccbParamSJ自动登录
|
||||
// showAuthModal();
|
||||
sheep.$helper.toast('请先登录');
|
||||
return;
|
||||
}
|
||||
unref(SharePosterRef).getPoster();
|
||||
|
||||
@ -491,10 +491,24 @@ const CcbLifePlatform = {
|
||||
console.log('[建行收银台] iOS: 使用官方URL Scheme调起');
|
||||
// 注意:需要对支付串进行encodeURIComponent编码
|
||||
const payUrl = 'ccbpayment://openCashier?params=' + encodeURIComponent(options.payment_string);
|
||||
console.log('[建行收银台] 跳转URL长度:', payUrl.length);
|
||||
console.log('[建行收银台] URL前100字符:', payUrl.substring(0, 100));
|
||||
console.log('[建行收银台] 支付串原始长度:', options.payment_string.length);
|
||||
console.log('[建行收银台] URL编码后总长度:', payUrl.length);
|
||||
console.log('[建行收银台] URL前200字符:', payUrl.substring(0, 200));
|
||||
|
||||
// ⚠️ iOS URL Scheme 长度限制检查(通常为2048字符)
|
||||
if (payUrl.length > 2048) {
|
||||
console.error('[建行收银台] ❌ iOS URL长度超限:', payUrl.length, '> 2048');
|
||||
reject({
|
||||
code: -1,
|
||||
msg: 'iOS URL长度超限,请联系技术支持'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
console.log('[建行收银台] 准备调起iOS收银台...');
|
||||
window.location.href = payUrl;
|
||||
console.log('[建行收银台] window.location.href已设置');
|
||||
|
||||
// iOS调起后认为成功(实际支付结果通过异步通知获取)
|
||||
setTimeout(() => {
|
||||
@ -504,6 +518,13 @@ const CcbLifePlatform = {
|
||||
msg: '已调起建行支付'
|
||||
});
|
||||
}, 500);
|
||||
} catch (error) {
|
||||
console.error('[建行收银台] ❌ iOS调起失败:', error);
|
||||
reject({
|
||||
code: -1,
|
||||
msg: 'iOS调起失败: ' + error.message
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// ⭐ Android: 使用官方文档的JSBridge方法(5.3.1章节)
|
||||
console.log('[建行收银台] Android: 检查CCBAndroid对象...');
|
||||
|
||||
@ -68,10 +68,11 @@ const http = new Request({
|
||||
*/
|
||||
http.interceptors.request.use(
|
||||
(config) => {
|
||||
if (config.custom.auth && !$store('user').isLogin) {
|
||||
showAuthModal();
|
||||
return Promise.reject();
|
||||
}
|
||||
// ⚠️ 已禁用:建行生活场景使用ccbParamSJ自动登录,不需要弹出登录框
|
||||
// if (config.custom.auth && !$store('user').isLogin) {
|
||||
// showAuthModal();
|
||||
// return Promise.reject();
|
||||
// }
|
||||
if (config.custom.showLoading) {
|
||||
LoadingInstance.count++;
|
||||
LoadingInstance.count === 1 &&
|
||||
@ -140,7 +141,8 @@ http.interceptors.response.use(
|
||||
errorMessage = '请先登录';
|
||||
}
|
||||
userStore.logout(true);
|
||||
showAuthModal();
|
||||
// ⚠️ 已禁用:建行生活场景会自动重新登录,不需要弹出登录框
|
||||
// showAuthModal();
|
||||
break;
|
||||
case 403:
|
||||
errorMessage = '拒绝访问';
|
||||
|
||||
@ -57,11 +57,12 @@ const _go = (
|
||||
return;
|
||||
}
|
||||
|
||||
// 页面登录拦截
|
||||
if (nextRoute.meta?.auth && !$store('user').isLogin) {
|
||||
showAuthModal();
|
||||
return;
|
||||
}
|
||||
// 页面登录拦截(已禁用 - 使用建行自动登录)
|
||||
// ⚠️ 建行生活场景:通过ccbParamSJ自动登录,不需要弹出登录框
|
||||
// if (nextRoute.meta?.auth && !$store('user').isLogin) {
|
||||
// showAuthModal();
|
||||
// return;
|
||||
// }
|
||||
|
||||
url = page;
|
||||
if (!isEmpty(query)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user