增加金币支付

This commit is contained in:
yezian 2024-06-12 22:15:20 +08:00
parent 2d641e73b1
commit 8d172da89e
1 changed files with 17 additions and 1 deletions

View File

@ -122,6 +122,22 @@ export default function Vip() {
return;
}
switch (type) {
case "coin":
window.ReactNativeWebView.postMessage(
JSON.stringify({
type: "COINPAY",
data: {
url: "/api/vas/create_order",
body: { product_id: data.data.product.id },
product: data.data.product.name,
coinPrice: data.data.product.real_coin_price,
validity: "永久",
info: "",
onPurchaseDone: () => {},
},
})
);
break;
case "iap":
window.ReactNativeWebView.postMessage(
JSON.stringify({
@ -290,7 +306,7 @@ export default function Vip() {
<div className="flex flex-row justify-between">
<div className="w-full px-2">
<div
onClick={() => createOrder("iap")}
onClick={() => createOrder("coin")}
className="flex flex-row cursor-pointer gap-1.5 h-11 items-center justify-center bg-primary rounded-full"
>
<p className="text-white text-base font-medium whitespace-nowrap">