折叠微信支付
This commit is contained in:
parent
8d0527ed8d
commit
5de2a0d848
|
@ -10,16 +10,8 @@ import Link from "next/link";
|
|||
export default function Pay() {
|
||||
const router = useRouter();
|
||||
|
||||
const alipayBlock = () => {
|
||||
const base = webviewBaseRequest();
|
||||
if (base?.b_mid === 161) {
|
||||
createOrder("alipay_h5");
|
||||
return;
|
||||
}
|
||||
Toast.show({
|
||||
content: "支付渠道维护升级中,请24小时后再试",
|
||||
});
|
||||
};
|
||||
//是否显示被隐藏的支付方式
|
||||
const [isPaymentHided, setIsPaymentHided] = useState(true);
|
||||
|
||||
//商品列表
|
||||
const [productList, setProductList] = useState([]);
|
||||
|
@ -301,22 +293,41 @@ export default function Pay() {
|
|||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="basis-1/2 px-2">
|
||||
<div
|
||||
onClick={() => createOrder("wxpay_h5")}
|
||||
className="flex flex-row cursor-pointer gap-1.5 h-11 items-center justify-center bg-primary rounded-full"
|
||||
>
|
||||
<svg viewBox="0 0 1228 1024" width="18" height="18">
|
||||
<path
|
||||
d="M530.8928 703.1296a41.472 41.472 0 0 1-35.7376-19.8144l-2.7136-5.5808L278.272 394.752a18.7392 18.7392 0 0 1-2.048-8.1408 19.968 19.968 0 0 1 20.48-19.3536c4.608 0 8.8576 1.4336 12.288 3.84l234.3936 139.9296a64.4096 64.4096 0 0 0 54.528 5.9392L1116.2624 204.8C1004.9536 80.896 821.76 0 614.4 0 275.0464 0 0 216.576 0 483.6352c0 145.7152 82.7392 276.8896 212.2752 365.5168a38.1952 38.1952 0 0 1 17.2032 31.488 44.4928 44.4928 0 0 1-2.1504 12.3904l-27.6992 97.4848c-1.3312 4.608-3.328 9.3696-3.328 14.1312 0 10.752 9.216 19.3536 20.48 19.3536 4.4032 0 8.0384-1.536 11.776-3.584l134.5536-73.3184c10.1376-5.5296 20.7872-8.96 32.6144-8.96 6.2976 0 12.288 0.9216 18.0736 2.5088 62.72 17.0496 130.4576 26.5728 200.5504 26.5728C953.7024 967.168 1228.8 750.592 1228.8 483.6352c0-80.9472-25.4464-157.1328-70.0416-224.1024l-604.9792 436.992-4.4544 2.4064a42.1376 42.1376 0 0 1-18.432 4.1984z"
|
||||
fill="#FFFFFF"
|
||||
></path>
|
||||
</svg>
|
||||
<p className="text-white text-base font-medium whitespace-nowrap">
|
||||
微信支付
|
||||
</p>
|
||||
{isPaymentHided ? (
|
||||
<div className="basis-1/2 px-2">
|
||||
<div
|
||||
onClick={() => setIsPaymentHided(false)}
|
||||
className="flex flex-row cursor-pointer gap-1.5 h-11 items-center justify-center bg-[#2E2E2E] rounded-full"
|
||||
>
|
||||
<svg viewBox="0 0 1024 1024" width="18" height="18">
|
||||
<path
|
||||
d="M512 65.311495c-246.699682 0-446.688505 199.989847-446.688505 446.688505s199.989847 446.688505 446.688505 446.688505S958.688505 758.699682 958.688505 512 758.698658 65.311495 512 65.311495zM309.953308 567.255465c-30.517037 0-55.255465-24.738427-55.255465-55.255465s24.738427-55.255465 55.255465-55.255465 55.255465 24.738427 55.255465 55.255465S340.470345 567.255465 309.953308 567.255465zM512 567.255465c-30.517037 0-55.255465-24.738427-55.255465-55.255465s24.738427-55.255465 55.255465-55.255465c30.517037 0 55.255465 24.738427 55.255465 55.255465S542.517037 567.255465 512 567.255465zM714.046692 567.255465c-30.517037 0-55.255465-24.738427-55.255465-55.255465s24.738427-55.255465 55.255465-55.255465 55.255465 24.738427 55.255465 55.255465S744.56373 567.255465 714.046692 567.255465z"
|
||||
fill="#FFFFFF"
|
||||
></path>
|
||||
</svg>
|
||||
<p className="text-white text-base font-medium whitespace-nowrap">
|
||||
其他支付
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<div className="basis-1/2 px-2">
|
||||
<div
|
||||
onClick={() => createOrder("wxpay_h5")}
|
||||
className="flex flex-row cursor-pointer gap-1.5 h-11 items-center justify-center bg-primary rounded-full"
|
||||
>
|
||||
<svg viewBox="0 0 1228 1024" width="18" height="18">
|
||||
<path
|
||||
d="M530.8928 703.1296a41.472 41.472 0 0 1-35.7376-19.8144l-2.7136-5.5808L278.272 394.752a18.7392 18.7392 0 0 1-2.048-8.1408 19.968 19.968 0 0 1 20.48-19.3536c4.608 0 8.8576 1.4336 12.288 3.84l234.3936 139.9296a64.4096 64.4096 0 0 0 54.528 5.9392L1116.2624 204.8C1004.9536 80.896 821.76 0 614.4 0 275.0464 0 0 216.576 0 483.6352c0 145.7152 82.7392 276.8896 212.2752 365.5168a38.1952 38.1952 0 0 1 17.2032 31.488 44.4928 44.4928 0 0 1-2.1504 12.3904l-27.6992 97.4848c-1.3312 4.608-3.328 9.3696-3.328 14.1312 0 10.752 9.216 19.3536 20.48 19.3536 4.4032 0 8.0384-1.536 11.776-3.584l134.5536-73.3184c10.1376-5.5296 20.7872-8.96 32.6144-8.96 6.2976 0 12.288 0.9216 18.0736 2.5088 62.72 17.0496 130.4576 26.5728 200.5504 26.5728C953.7024 967.168 1228.8 750.592 1228.8 483.6352c0-80.9472-25.4464-157.1328-70.0416-224.1024l-604.9792 436.992-4.4544 2.4064a42.1376 42.1376 0 0 1-18.432 4.1984z"
|
||||
fill="#FFFFFF"
|
||||
></path>
|
||||
</svg>
|
||||
<p className="text-white text-base font-medium whitespace-nowrap">
|
||||
微信支付
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<p className="text-secondary text-xs font-medium mt-4 text-center mb-1">
|
||||
确认购买即视为同意
|
||||
|
|
|
@ -10,16 +10,8 @@ import { useRouter } from "next/navigation";
|
|||
export default function Vip() {
|
||||
const router = useRouter();
|
||||
|
||||
const alipayBlock = () => {
|
||||
const base = webviewBaseRequest();
|
||||
if (base?.b_mid === 161) {
|
||||
createOrder("alipay_h5");
|
||||
return;
|
||||
}
|
||||
Toast.show({
|
||||
content: "支付渠道维护升级中,请24小时后再试",
|
||||
});
|
||||
};
|
||||
//是否显示被隐藏的支付方式
|
||||
const [isPaymentHided, setIsPaymentHided] = useState(true);
|
||||
|
||||
//检查用户是否是vip
|
||||
const [isVip, setIsVip] = useState(false);
|
||||
|
@ -310,22 +302,41 @@ export default function Vip() {
|
|||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="basis-1/2 px-2">
|
||||
<div
|
||||
onClick={() => createOrder("wxpay_h5")}
|
||||
className="flex flex-row cursor-pointer gap-1.5 h-11 items-center justify-center bg-primary rounded-full"
|
||||
>
|
||||
<svg viewBox="0 0 1228 1024" width="18" height="18">
|
||||
<path
|
||||
d="M530.8928 703.1296a41.472 41.472 0 0 1-35.7376-19.8144l-2.7136-5.5808L278.272 394.752a18.7392 18.7392 0 0 1-2.048-8.1408 19.968 19.968 0 0 1 20.48-19.3536c4.608 0 8.8576 1.4336 12.288 3.84l234.3936 139.9296a64.4096 64.4096 0 0 0 54.528 5.9392L1116.2624 204.8C1004.9536 80.896 821.76 0 614.4 0 275.0464 0 0 216.576 0 483.6352c0 145.7152 82.7392 276.8896 212.2752 365.5168a38.1952 38.1952 0 0 1 17.2032 31.488 44.4928 44.4928 0 0 1-2.1504 12.3904l-27.6992 97.4848c-1.3312 4.608-3.328 9.3696-3.328 14.1312 0 10.752 9.216 19.3536 20.48 19.3536 4.4032 0 8.0384-1.536 11.776-3.584l134.5536-73.3184c10.1376-5.5296 20.7872-8.96 32.6144-8.96 6.2976 0 12.288 0.9216 18.0736 2.5088 62.72 17.0496 130.4576 26.5728 200.5504 26.5728C953.7024 967.168 1228.8 750.592 1228.8 483.6352c0-80.9472-25.4464-157.1328-70.0416-224.1024l-604.9792 436.992-4.4544 2.4064a42.1376 42.1376 0 0 1-18.432 4.1984z"
|
||||
fill="#FFFFFF"
|
||||
></path>
|
||||
</svg>
|
||||
<p className="text-white text-base font-medium whitespace-nowrap">
|
||||
微信支付
|
||||
</p>
|
||||
{isPaymentHided ? (
|
||||
<div className="basis-1/2 px-2">
|
||||
<div
|
||||
onClick={() => setIsPaymentHided(false)}
|
||||
className="flex flex-row cursor-pointer gap-1.5 h-11 items-center justify-center bg-[#2E2E2E] rounded-full"
|
||||
>
|
||||
<svg viewBox="0 0 1024 1024" width="18" height="18">
|
||||
<path
|
||||
d="M512 65.311495c-246.699682 0-446.688505 199.989847-446.688505 446.688505s199.989847 446.688505 446.688505 446.688505S958.688505 758.699682 958.688505 512 758.698658 65.311495 512 65.311495zM309.953308 567.255465c-30.517037 0-55.255465-24.738427-55.255465-55.255465s24.738427-55.255465 55.255465-55.255465 55.255465 24.738427 55.255465 55.255465S340.470345 567.255465 309.953308 567.255465zM512 567.255465c-30.517037 0-55.255465-24.738427-55.255465-55.255465s24.738427-55.255465 55.255465-55.255465c30.517037 0 55.255465 24.738427 55.255465 55.255465S542.517037 567.255465 512 567.255465zM714.046692 567.255465c-30.517037 0-55.255465-24.738427-55.255465-55.255465s24.738427-55.255465 55.255465-55.255465 55.255465 24.738427 55.255465 55.255465S744.56373 567.255465 714.046692 567.255465z"
|
||||
fill="#FFFFFF"
|
||||
></path>
|
||||
</svg>
|
||||
<p className="text-white text-base font-medium whitespace-nowrap">
|
||||
其他支付
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<div className="basis-1/2 px-2">
|
||||
<div
|
||||
onClick={() => createOrder("wxpay_h5")}
|
||||
className="flex flex-row cursor-pointer gap-1.5 h-11 items-center justify-center bg-primary rounded-full"
|
||||
>
|
||||
<svg viewBox="0 0 1228 1024" width="18" height="18">
|
||||
<path
|
||||
d="M530.8928 703.1296a41.472 41.472 0 0 1-35.7376-19.8144l-2.7136-5.5808L278.272 394.752a18.7392 18.7392 0 0 1-2.048-8.1408 19.968 19.968 0 0 1 20.48-19.3536c4.608 0 8.8576 1.4336 12.288 3.84l234.3936 139.9296a64.4096 64.4096 0 0 0 54.528 5.9392L1116.2624 204.8C1004.9536 80.896 821.76 0 614.4 0 275.0464 0 0 216.576 0 483.6352c0 145.7152 82.7392 276.8896 212.2752 365.5168a38.1952 38.1952 0 0 1 17.2032 31.488 44.4928 44.4928 0 0 1-2.1504 12.3904l-27.6992 97.4848c-1.3312 4.608-3.328 9.3696-3.328 14.1312 0 10.752 9.216 19.3536 20.48 19.3536 4.4032 0 8.0384-1.536 11.776-3.584l134.5536-73.3184c10.1376-5.5296 20.7872-8.96 32.6144-8.96 6.2976 0 12.288 0.9216 18.0736 2.5088 62.72 17.0496 130.4576 26.5728 200.5504 26.5728C953.7024 967.168 1228.8 750.592 1228.8 483.6352c0-80.9472-25.4464-157.1328-70.0416-224.1024l-604.9792 436.992-4.4544 2.4064a42.1376 42.1376 0 0 1-18.432 4.1984z"
|
||||
fill="#FFFFFF"
|
||||
></path>
|
||||
</svg>
|
||||
<p className="text-white text-base font-medium whitespace-nowrap">
|
||||
微信支付
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<p className="text-secondary text-xs font-medium mt-4 text-center mb-1">
|
||||
确认购买即视为同意
|
||||
|
|
|
@ -11,6 +11,9 @@ import { useRouter } from "next/navigation";
|
|||
export default function Pay({ params }) {
|
||||
const router = useRouter();
|
||||
|
||||
//是否显示被隐藏的支付方式
|
||||
const [isPaymentHided, setIsPaymentHided] = useState(true);
|
||||
|
||||
//当前选购的商品数据
|
||||
const [data, setData] = useState({});
|
||||
//超粉商品数据
|
||||
|
@ -328,22 +331,41 @@ export default function Pay({ params }) {
|
|||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="basis-1/2 px-2">
|
||||
<div
|
||||
onClick={() => createOrder("wxpay_h5")}
|
||||
className="flex flex-row cursor-pointer gap-1.5 h-11 items-center justify-center bg-primary rounded-full"
|
||||
>
|
||||
<svg viewBox="0 0 1228 1024" width="18" height="18">
|
||||
<path
|
||||
d="M530.8928 703.1296a41.472 41.472 0 0 1-35.7376-19.8144l-2.7136-5.5808L278.272 394.752a18.7392 18.7392 0 0 1-2.048-8.1408 19.968 19.968 0 0 1 20.48-19.3536c4.608 0 8.8576 1.4336 12.288 3.84l234.3936 139.9296a64.4096 64.4096 0 0 0 54.528 5.9392L1116.2624 204.8C1004.9536 80.896 821.76 0 614.4 0 275.0464 0 0 216.576 0 483.6352c0 145.7152 82.7392 276.8896 212.2752 365.5168a38.1952 38.1952 0 0 1 17.2032 31.488 44.4928 44.4928 0 0 1-2.1504 12.3904l-27.6992 97.4848c-1.3312 4.608-3.328 9.3696-3.328 14.1312 0 10.752 9.216 19.3536 20.48 19.3536 4.4032 0 8.0384-1.536 11.776-3.584l134.5536-73.3184c10.1376-5.5296 20.7872-8.96 32.6144-8.96 6.2976 0 12.288 0.9216 18.0736 2.5088 62.72 17.0496 130.4576 26.5728 200.5504 26.5728C953.7024 967.168 1228.8 750.592 1228.8 483.6352c0-80.9472-25.4464-157.1328-70.0416-224.1024l-604.9792 436.992-4.4544 2.4064a42.1376 42.1376 0 0 1-18.432 4.1984z"
|
||||
fill="#FFFFFF"
|
||||
></path>
|
||||
</svg>
|
||||
<p className="text-white text-base font-medium whitespace-nowrap">
|
||||
微信支付
|
||||
</p>
|
||||
{isPaymentHided ? (
|
||||
<div className="basis-1/2 px-2">
|
||||
<div
|
||||
onClick={() => setIsPaymentHided(false)}
|
||||
className="flex flex-row cursor-pointer gap-1.5 h-11 items-center justify-center bg-[#2E2E2E] rounded-full"
|
||||
>
|
||||
<svg viewBox="0 0 1024 1024" width="18" height="18">
|
||||
<path
|
||||
d="M512 65.311495c-246.699682 0-446.688505 199.989847-446.688505 446.688505s199.989847 446.688505 446.688505 446.688505S958.688505 758.699682 958.688505 512 758.698658 65.311495 512 65.311495zM309.953308 567.255465c-30.517037 0-55.255465-24.738427-55.255465-55.255465s24.738427-55.255465 55.255465-55.255465 55.255465 24.738427 55.255465 55.255465S340.470345 567.255465 309.953308 567.255465zM512 567.255465c-30.517037 0-55.255465-24.738427-55.255465-55.255465s24.738427-55.255465 55.255465-55.255465c30.517037 0 55.255465 24.738427 55.255465 55.255465S542.517037 567.255465 512 567.255465zM714.046692 567.255465c-30.517037 0-55.255465-24.738427-55.255465-55.255465s24.738427-55.255465 55.255465-55.255465 55.255465 24.738427 55.255465 55.255465S744.56373 567.255465 714.046692 567.255465z"
|
||||
fill="#FFFFFF"
|
||||
></path>
|
||||
</svg>
|
||||
<p className="text-white text-base font-medium whitespace-nowrap">
|
||||
其他支付
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<div className="basis-1/2 px-2">
|
||||
<div
|
||||
onClick={() => createOrder("wxpay_h5")}
|
||||
className="flex flex-row cursor-pointer gap-1.5 h-11 items-center justify-center bg-primary rounded-full"
|
||||
>
|
||||
<svg viewBox="0 0 1228 1024" width="18" height="18">
|
||||
<path
|
||||
d="M530.8928 703.1296a41.472 41.472 0 0 1-35.7376-19.8144l-2.7136-5.5808L278.272 394.752a18.7392 18.7392 0 0 1-2.048-8.1408 19.968 19.968 0 0 1 20.48-19.3536c4.608 0 8.8576 1.4336 12.288 3.84l234.3936 139.9296a64.4096 64.4096 0 0 0 54.528 5.9392L1116.2624 204.8C1004.9536 80.896 821.76 0 614.4 0 275.0464 0 0 216.576 0 483.6352c0 145.7152 82.7392 276.8896 212.2752 365.5168a38.1952 38.1952 0 0 1 17.2032 31.488 44.4928 44.4928 0 0 1-2.1504 12.3904l-27.6992 97.4848c-1.3312 4.608-3.328 9.3696-3.328 14.1312 0 10.752 9.216 19.3536 20.48 19.3536 4.4032 0 8.0384-1.536 11.776-3.584l134.5536-73.3184c10.1376-5.5296 20.7872-8.96 32.6144-8.96 6.2976 0 12.288 0.9216 18.0736 2.5088 62.72 17.0496 130.4576 26.5728 200.5504 26.5728C953.7024 967.168 1228.8 750.592 1228.8 483.6352c0-80.9472-25.4464-157.1328-70.0416-224.1024l-604.9792 436.992-4.4544 2.4064a42.1376 42.1376 0 0 1-18.432 4.1984z"
|
||||
fill="#FFFFFF"
|
||||
></path>
|
||||
</svg>
|
||||
<p className="text-white text-base font-medium whitespace-nowrap">
|
||||
微信支付
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<p className="text-secondary text-xs font-medium mt-4 text-center mb-1">
|
||||
确认购买即视为同意
|
||||
|
|
Loading…
Reference in New Issue