diff --git a/app/pay/[weixin]/page.jsx b/app/pay/[weixin]/page.jsx
index ab66dec..d2e39b0 100644
--- a/app/pay/[weixin]/page.jsx
+++ b/app/pay/[weixin]/page.jsx
@@ -66,13 +66,13 @@ export default function Weixin({ params }) {
diff --git a/app/pay/page.jsx b/app/pay/page.jsx
index aa8f08e..2d5f803 100644
--- a/app/pay/page.jsx
+++ b/app/pay/page.jsx
@@ -67,7 +67,7 @@ export default function Pay() {
//创建充值订单
const [isLoading, setIsLoading] = useState(false);
- const createOrder = async () => {
+ const createOrder = async (type = "alipay_h5") => {
if (!selectedPrice.id && !customCoin.selected) {
Toast.show({
content: "请选择充值档位",
@@ -86,7 +86,7 @@ export default function Pay() {
...base,
product_id: customCoin.selected ? "h5_custom_coin" : selectedPrice.id,
custom_coins: customCoin.selected ? customCoin.num : 0,
- pay_type: "alipay_h5",
+ pay_type: type,
from: "app",
};
const signature = generateSignature(body);
@@ -108,7 +108,19 @@ export default function Pay() {
});
return;
}
- router.push(`${data.data.alipay_h5_param_str}`);
+ switch (type) {
+ case "alipay_h5":
+ router.push(`${data.data.alipay_h5_param_str}`);
+ break;
+ case "wxpay_native":
+ router.push(
+ `/pay/${encodeURIComponent(data.data.wxpay_native_param_str)}`
+ );
+ break;
+ default:
+ router.push(`${data.data.alipay_h5_param_str}`);
+ break;
+ }
} catch (error) {
console.error(error);
} finally {
@@ -116,28 +128,6 @@ export default function Pay() {
}
};
- //跳转联系客服
- const handleContact = () => {
- if (navigator.userAgent.includes("FromWebview")) {
- window.ReactNativeWebView.postMessage(
- JSON.stringify({
- type: "NAVIGATE",
- data: {
- page: "MessageDetail",
- params: {
- mid: 1,
- },
- },
- })
- );
- } else {
- Toast.show({
- content: "请下载app联系客服充值",
- });
- }
- document.getElementById("manual_pay_modal").close();
- };
-
const PriceItem = ({ item }) => {
const handleClickPrice = (item) => {
setSelectedPrice(item);
@@ -263,20 +253,12 @@ export default function Pay() {
-