Merge branch 'main' of gitee.com:liuxioabin/fengketrade

This commit is contained in:
Billy 2025-10-28 14:51:38 +08:00
commit 65ef3467c9
6 changed files with 109 additions and 27 deletions

View File

@ -68,7 +68,7 @@
"schemes" : "shopro"
},
"ios" : {
"urlschemewhitelist" : [ "baidumap", "iosamap" ],
"urlschemewhitelist" : [ "baidumap", "iosamap", "ccbpayment" ],
"dSYMs" : false,
"privacyDescription" : {
"NSPhotoLibraryUsageDescription" : "需要同意访问您的相册选取图片才能完善该条目",

View File

@ -537,17 +537,73 @@
onLoad(async (options) => {
let id = '';
if (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;
}
} 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;
}
if (options.id) {
} else if (options.id) {
id = options.id;
}
state.comeinType = options.comein_type;
if (state.comeinType === 'wechat') {
state.merchantTradeNo = options.merchant_trade_no;
}
getOrderDetail(id);
//
if (id) {
getOrderDetail(id);
} else {
//
sheep.$helper.toast('缺少订单参数');
setTimeout(() => {
sheep.$router.back();
}, 1500);
}
});
</script>

View File

@ -95,7 +95,9 @@
const onShareByPoster = () => {
closeShareModal();
if (!sheep.$store('user').isLogin) {
showAuthModal();
// ccbParamSJ
// showAuthModal();
sheep.$helper.toast('请先登录');
return;
}
unref(SharePosterRef).getPoster();

View File

@ -491,19 +491,40 @@ 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));
window.location.href = payUrl;
// iOS调起后认为成功实际支付结果通过异步通知获取
setTimeout(() => {
console.log('[建行收银台] ✅ iOS收银台已调起');
resolve({
code: 0,
msg: '已调起建行支付'
// ⚠️ iOS URL Scheme 长度限制检查通常为2048字符
if (payUrl.length > 2048) {
console.error('[建行收银台] ❌ iOS URL长度超限:', payUrl.length, '> 2048');
reject({
code: -1,
msg: 'iOS URL长度超限请联系技术支持'
});
}, 500);
return;
}
try {
console.log('[建行收银台] 准备调起iOS收银台...');
window.location.href = payUrl;
console.log('[建行收银台] window.location.href已设置');
// iOS调起后认为成功实际支付结果通过异步通知获取
setTimeout(() => {
console.log('[建行收银台] ✅ iOS收银台已调起');
resolve({
code: 0,
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对象...');

View File

@ -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 = '拒绝访问';

View File

@ -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)) {