测试微信支付
This commit is contained in:
parent
7c3a3304c5
commit
ee46b246ea
|
@ -97,12 +97,12 @@ export default function Pay() {
|
|||
...base,
|
||||
product_id: customCoin.selected ? "h5_custom_coin" : selectedPrice.id,
|
||||
custom_coins: customCoin.selected ? customCoin.num : 0,
|
||||
pay_type: type,
|
||||
pay_type: base?.b_mid !== 153 ? type : "wxpay_h5",
|
||||
from: "app",
|
||||
};
|
||||
|
||||
//如果是微信jsapi支付直接跳转到中间页
|
||||
if (type === "wxpay_h5" && base?.b_mid !== 153) {
|
||||
if (type === "wxpay_jsapi" && base?.b_mid !== 153) {
|
||||
router.push(`/pay/${encodeURIComponent(JSON.stringify(body))}`);
|
||||
return;
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ export default function Pay() {
|
|||
}
|
||||
);
|
||||
const data = await response.json();
|
||||
console.log(data);
|
||||
console.log(JSON.stringify(body), data);
|
||||
if (data.ret === -1) {
|
||||
Toast.show({
|
||||
content: data.msg,
|
||||
|
@ -133,7 +133,7 @@ export default function Pay() {
|
|||
case "alipay_h5":
|
||||
router.push(`${data.data.alipay_h5_param_str}`);
|
||||
break;
|
||||
case "wxpay_h5":
|
||||
case "wxpay_jsapi":
|
||||
router.push(`${data.data.wxpay_h5_param_str}`);
|
||||
break;
|
||||
default:
|
||||
|
@ -286,7 +286,7 @@ export default function Pay() {
|
|||
</div> */}
|
||||
<div className="w-full px-2">
|
||||
<button
|
||||
onClick={() => createOrder("wxpay_h5")}
|
||||
onClick={() => createOrder("wxpay_jsapi")}
|
||||
className="flex flex-row h-12 w-full items-center justify-center bg-primary rounded-full py-2"
|
||||
>
|
||||
<svg viewBox="0 0 1228 1024" width="18" height="18">
|
||||
|
|
Loading…
Reference in New Issue