修改用户登陆认证流程
This commit is contained in:
@@ -27,6 +27,7 @@ import { withAuth, RefundPopup, GeneralNavbar } from "@/components";
|
||||
import img from "@/config/images";
|
||||
import CustomerIcon from "@/static/order/customer.svg";
|
||||
import { handleCustomerService } from "@/services/userService";
|
||||
import { requireLoginWithPhone } from "@/utils/helper";
|
||||
import { DECLAIMER } from "./config";
|
||||
import styles from "./index.module.scss";
|
||||
|
||||
@@ -583,6 +584,11 @@ const OrderCheck = () => {
|
||||
}
|
||||
|
||||
async function getPaymentParams() {
|
||||
// 检查登录状态和手机号(创建订单前检查)
|
||||
if (!requireLoginWithPhone()) {
|
||||
throw new Error("请先绑定手机号");
|
||||
}
|
||||
|
||||
const unPaidRes = await orderService.getUnpaidOrder(detail.id);
|
||||
if (unPaidRes.code === 0 && unPaidRes.data.has_unpaid_order) {
|
||||
return unPaidRes.data.payment_params;
|
||||
@@ -596,6 +602,10 @@ const OrderCheck = () => {
|
||||
|
||||
//TODO: get order msg from id
|
||||
const handlePay = async () => {
|
||||
// 检查登录状态和手机号
|
||||
if (!requireLoginWithPhone()) {
|
||||
return; // 未登录或未绑定手机号,已跳转到登录页
|
||||
}
|
||||
setPaying(true);
|
||||
Taro.showLoading({
|
||||
title: "支付中...",
|
||||
|
||||
@@ -17,7 +17,7 @@ import { withAuth, RefundPopup, GeneralNavbar } from "@/components";
|
||||
import { payOrder, generateOrderActions } from "@/utils";
|
||||
import emptyContent from "@/static/emptyStatus/publish-empty.png";
|
||||
import CustomerIcon from "@/static/order/customer.svg";
|
||||
import { insertDotInTags, genNTRPRequirementText } from "@/utils/helper";
|
||||
import { insertDotInTags, genNTRPRequirementText, requireLoginWithPhone } from "@/utils/helper";
|
||||
import styles from "./index.module.scss";
|
||||
|
||||
dayjs.locale("zh-cn");
|
||||
@@ -111,6 +111,11 @@ const OrderList = () => {
|
||||
}
|
||||
|
||||
async function handlePayNow(item) {
|
||||
// 检查登录状态和手机号
|
||||
if (!requireLoginWithPhone()) {
|
||||
return; // 未登录或未绑定手机号,已跳转到登录页
|
||||
}
|
||||
|
||||
try {
|
||||
const unPaidRes = await orderService.getUnpaidOrder(item.game_info?.id);
|
||||
if (unPaidRes.code === 0 && unPaidRes.data.has_unpaid_order) {
|
||||
|
||||
Reference in New Issue
Block a user