f
This commit is contained in:
2
.env
2
.env
@@ -9,7 +9,7 @@ VITE_INQUIRE_AES_KEY=ff83609b2b24fc73196aac3d3dfb874f
|
|||||||
VITE_WECHAT_APP_ID=wx442ee1ac1ee75917
|
VITE_WECHAT_APP_ID=wx442ee1ac1ee75917
|
||||||
|
|
||||||
VITE_ICP_RECORD=琼ICP备2024048057号-2
|
VITE_ICP_RECORD=琼ICP备2024048057号-2
|
||||||
VITE_PUBLIC_SECURITY_RECORD=琼公网安备46010002000584号
|
VITE_PUBLIC_SECURITY_RECORD=琼公网安备46010002000443号
|
||||||
VITE_SHOW_PUBLIC_SECURITY_RECORD=true
|
VITE_SHOW_PUBLIC_SECURITY_RECORD=true
|
||||||
|
|
||||||
VITE_CHAT_AES_KEY=qw5w6SFE2D1jmxyd
|
VITE_CHAT_AES_KEY=qw5w6SFE2D1jmxyd
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ VITE_COMPANY_NAME=海南海宇大数据有限公司
|
|||||||
VITE_APP_NAME=全能查
|
VITE_APP_NAME=全能查
|
||||||
|
|
||||||
VITE_ICP_RECORD=琼ICP备2024038584号-10
|
VITE_ICP_RECORD=琼ICP备2024038584号-10
|
||||||
VITE_PUBLIC_SECURITY_RECORD=琼公网安备46010002000584号
|
VITE_PUBLIC_SECURITY_RECORD=琼公网安备46010002000443号
|
||||||
VITE_SHOW_PUBLIC_SECURITY_RECORD=false
|
VITE_SHOW_PUBLIC_SECURITY_RECORD=false
|
||||||
|
|
||||||
VITE_SERVICE_URL=https://work.weixin.qq.com/kfid/kfc82d4424e4b19e5f3
|
VITE_SERVICE_URL=https://work.weixin.qq.com/kfid/kfc82d4424e4b19e5f3
|
||||||
|
|||||||
@@ -70,6 +70,7 @@
|
|||||||
import { ref, computed, onMounted } from "vue";
|
import { ref, computed, onMounted } from "vue";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
const { isWeChat } = useEnv();
|
const { isWeChat } = useEnv();
|
||||||
|
import { showConfirmDialog, showToast } from "vant";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
@@ -113,50 +114,63 @@ const router = useRouter();
|
|||||||
const discountPrice = ref(false); // 是否应用折扣
|
const discountPrice = ref(false); // 是否应用折扣
|
||||||
|
|
||||||
async function getPayment() {
|
async function getPayment() {
|
||||||
const { data, error } = await useApiFetch("/pay/payment")
|
showConfirmDialog({
|
||||||
.post({
|
title: '重要安全声明',
|
||||||
id: props.id,
|
message:
|
||||||
pay_method: selectedPaymentMethod.value,
|
'为保障您的个人信息与资金安全,请您务必知悉以下事项:\n\n关于平台业务:本平台官方服务仅限于大数据报告查询,不涉及也从未开展“央行征信修复”、“贷款办理”或“征信洗白”等相关业务。请注意,本平台出具的报告仅供决策参考,不可作为任何官方征信凭证或贷款依据。\n\n关于诈骗警示:任何自称与本平台合作,或以“内部渠道”、“百分百包下款”、“修复征信”等为由,诱导您进行支付的行为,均属欺诈。请您切勿相信,谨慎对待任何支付要求。\n\n关于安全提示:请您时刻保持警惕,妥善保管个人敏感信息。如遇任何索款要求或可疑承诺,请务必首先通过我平台官方公布的联系方式进行核实,切勿轻信他人。',
|
||||||
pay_type: props.type,
|
})
|
||||||
})
|
.then(async () => {
|
||||||
.json();
|
const { data, error } = await useApiFetch("/pay/payment")
|
||||||
|
.post({
|
||||||
|
id: props.id,
|
||||||
|
pay_method: selectedPaymentMethod.value,
|
||||||
|
pay_type: props.type,
|
||||||
|
})
|
||||||
|
.json();
|
||||||
|
|
||||||
if (data.value && !error.value) {
|
if (data.value && !error.value) {
|
||||||
// 测试支付模式:直接跳转到结果页面
|
// 测试支付模式:直接跳转到结果页面
|
||||||
if (selectedPaymentMethod.value === "test" || selectedPaymentMethod.value === "test_empty") {
|
if (selectedPaymentMethod.value === "test" || selectedPaymentMethod.value === "test_empty") {
|
||||||
orderNo.value = data.value.data.order_no;
|
orderNo.value = data.value.data.order_no;
|
||||||
router.push({
|
router.push({
|
||||||
path: "/payment/result",
|
path: "/payment/result",
|
||||||
query: { orderNo: data.value.data.order_no },
|
query: { orderNo: data.value.data.order_no },
|
||||||
});
|
});
|
||||||
} else if (selectedPaymentMethod.value === "alipay") {
|
} else if (selectedPaymentMethod.value === "alipay") {
|
||||||
orderNo.value = data.value.data.order_no;
|
orderNo.value = data.value.data.order_no;
|
||||||
// 存储订单ID以便支付宝返回时获取
|
// 存储订单ID以便支付宝返回时获取
|
||||||
const prepayUrl = data.value.data.prepay_id;
|
const prepayUrl = data.value.data.prepay_id;
|
||||||
const paymentForm = document.createElement("form");
|
const paymentForm = document.createElement("form");
|
||||||
paymentForm.method = "POST";
|
paymentForm.method = "POST";
|
||||||
paymentForm.action = prepayUrl;
|
paymentForm.action = prepayUrl;
|
||||||
paymentForm.style.display = "none";
|
paymentForm.style.display = "none";
|
||||||
document.body.appendChild(paymentForm);
|
document.body.appendChild(paymentForm);
|
||||||
paymentForm.submit();
|
paymentForm.submit();
|
||||||
} else {
|
} else {
|
||||||
const payload = data.value.data.prepay_data;
|
const payload = data.value.data.prepay_data;
|
||||||
WeixinJSBridge.invoke(
|
WeixinJSBridge.invoke(
|
||||||
"getBrandWCPayRequest",
|
"getBrandWCPayRequest",
|
||||||
payload,
|
payload,
|
||||||
function (res) {
|
function (res) {
|
||||||
if (res.err_msg == "get_brand_wcpay_request:ok") {
|
if (res.err_msg == "get_brand_wcpay_request:ok") {
|
||||||
// 支付成功,直接跳转到结果页面
|
// 支付成功:短延迟再跳转,给后端回调与异步任务留出时间,避免结果页查报告报错
|
||||||
router.push({
|
showToast({ message: "支付成功,正在跳转...", type: "success" });
|
||||||
path: "/payment/result",
|
setTimeout(() => {
|
||||||
query: { orderNo: data.value.data.order_no },
|
router.push({
|
||||||
});
|
path: "/payment/result",
|
||||||
}
|
query: { orderNo: data.value.data.order_no },
|
||||||
|
});
|
||||||
|
}, 1500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
);
|
}
|
||||||
}
|
show.value = false;
|
||||||
}
|
})
|
||||||
show.value = false;
|
.catch(() => {
|
||||||
|
return;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -135,9 +135,30 @@ const getReport = async () => {
|
|||||||
} else if (data.value.code === 200003) {
|
} else if (data.value.code === 200003) {
|
||||||
isEmpty.value = true;
|
isEmpty.value = true;
|
||||||
isDone.value = true;
|
isDone.value = true;
|
||||||
} else if (data.value.code === 200002) {
|
} else if (data.value.code === 200002 || data.value.code === 100005) {
|
||||||
isPending.value = true;
|
// 200002:报告生成中;100005:兼容旧后端“报告未就绪”时的 DB_ERROR,按生成中轮询
|
||||||
isDone.value = true;
|
queryState.value = "pending";
|
||||||
|
if (!pollingInterval.value) {
|
||||||
|
pollingInterval.value = setInterval(() => {
|
||||||
|
getReport();
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (data.value?.code === 200002) {
|
||||||
|
// 接口返回 200002 时可能走不到上面分支,单独处理
|
||||||
|
queryState.value = "pending";
|
||||||
|
if (!pollingInterval.value) {
|
||||||
|
pollingInterval.value = setInterval(() => {
|
||||||
|
getReport();
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
|
} else if (data.value?.code === 100005) {
|
||||||
|
// 兼容:报告未就绪时后端返回 100005,按“生成中”轮询
|
||||||
|
queryState.value = "pending";
|
||||||
|
if (!pollingInterval.value) {
|
||||||
|
pollingInterval.value = setInterval(() => {
|
||||||
|
getReport();
|
||||||
|
}, 2000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user