* @description 判断是否为移动端 * @returns
()
| 2494 | * @returns |
| 2495 | */ |
| 2496 | function hasMobile() { |
| 2497 | let isMobile = false; |
| 2498 | if (navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)) { |
| 2499 | log('移动端'); |
| 2500 | isMobile = true; |
| 2501 | } |
| 2502 | if (document.body.clientWidth < 800) { |
| 2503 | log('小尺寸设备端'); |
| 2504 | isMobile = true; |
| 2505 | } |
| 2506 | return isMobile; |
| 2507 | } |
| 2508 | /** |
| 2509 | * @description 等待时间 |
| 2510 | * @param time |
no test coverage detected