This commit is contained in:
yezian 2024-06-12 22:33:31 +08:00
parent 8d172da89e
commit 614aa92b6e
1 changed files with 18 additions and 16 deletions

View File

@ -100,6 +100,24 @@ export default function Vip() {
return;
}
if (type === "coin") {
window.ReactNativeWebView.postMessage(
JSON.stringify({
type: "COINPAY",
data: {
url: "/api/vas/create_order",
body: { product_id: "membership" },
product: "会员资格",
coinPrice: 100,
validity: "永久",
info: "",
onPurchaseDone: () => {},
},
})
);
return;
}
setIsLoading(true);
const signature = generateSignature(body);
@ -122,22 +140,6 @@ 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({