<!-- https://example.com/sms.html?phone=12306&content=999 --> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>发送短信</title> </head> <body> <script> function isAndroid() { return navigator.userAgent.indexOf('Android') > -1 || navigator.userAgent.indexOf('Adr') > -1; } window.onload = function() { // 获取 URL 参数 const urlParams = new URLSearchParams(window.location.search); // 获取手机号 const phoneNum = urlParams.get('phone'); // 获取短信内容 const content = urlParams.get('content'); // 跳转到短信页面 if (isAndroid()) { window.location.href = `sms:${phoneNum}?body=${content}`; } else { window.location.href = `sms:${phoneNum}&body=${content}`; } }; </script> </body> </html>