From 6861a44468de82080cf128072d8736bacc1b04d5 Mon Sep 17 00:00:00 2001 From: Junjie <540245094@qq.com> Date: 星期一, 19 八月 2024 11:18:23 +0800 Subject: [PATCH] 网络检测 --- uni_modules/uni-swipe-action/components/uni-swipe-action-item/isPC.js | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/uni_modules/uni-swipe-action/components/uni-swipe-action-item/isPC.js b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/isPC.js new file mode 100644 index 0000000..9a10ece --- /dev/null +++ b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/isPC.js @@ -0,0 +1,12 @@ +export function isPC() { + var userAgentInfo = navigator.userAgent; + var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"]; + var flag = true; + for (let v = 0; v < Agents.length - 1; v++) { + if (userAgentInfo.indexOf(Agents[v]) > 0) { + flag = false; + break; + } + } + return flag; +} \ No newline at end of file -- Gitblit v1.9.1