登录、我的、仓储页面以及逻辑编写

This commit is contained in:
zx
2026-03-17 10:49:59 +08:00
parent d0755147c0
commit 100ea5a0d1
348 changed files with 43967 additions and 68 deletions

View File

@@ -0,0 +1,22 @@
export function isPC() {
var userAgentInfo = navigator.userAgent || '';
var info = typeof uni !== 'undefined' && uni.getSystemInfoSync ? uni.getSystemInfoSync() : null;
if (info && info.deviceType) {
if (info.deviceType === 'pc') return true;
if (info.deviceType === 'phone' || info.deviceType === 'pad') return false;
}
var isMobileUA = /Android|iPhone|SymbianOS|Windows Phone|iPad|iPod|Mobile|Harmony|HarmonyOS/i.test(userAgentInfo);
if (isMobileUA) return false;
var hasTouch = false;
if (typeof navigator.maxTouchPoints === 'number') {
hasTouch = navigator.maxTouchPoints > 0;
} else if (typeof window !== 'undefined') {
hasTouch = 'ontouchstart' in window;
}
if (hasTouch && typeof window !== 'undefined' && window.matchMedia) {
var finePointer = window.matchMedia('(pointer: fine)').matches;
var canHover = window.matchMedia('(hover: hover)').matches;
return finePointer || canHover;
}
return !hasTouch;
}