PayM.ts 716 B

12345678910111213141516171819202122232425262728293031323334
  1. import DeviceM from "./DeviceM";
  2. import TgM from "./TgM";
  3. export default class PayM {
  4. share(shareLink: string) {
  5. throw new Error("Method not implemented.");
  6. }
  7. private static _ins: PayM;
  8. public static get ins(): PayM {
  9. return (PayM._ins ??= new PayM());
  10. }
  11. public async jumpToPay(url: string) {
  12. console.log("jumpToPay...url:", url);
  13. if (url) {
  14. url = url.trim();
  15. if (await TgM.ins.isTG()) {
  16. TgM.ins.openTelegramLink(url);
  17. // TGOpenLink(url);
  18. } else {
  19. console.log("web jump:", url);
  20. if (DeviceM.ins.isMobile()) {
  21. window.location.href = url;
  22. } else {
  23. window.open(url, "_blank");
  24. }
  25. }
  26. }
  27. }
  28. }