mirror of
https://github.com/MrXujiang/h5-Dooring.git
synced 2025-12-12 18:22:51 +00:00
🆕 添加环境判断, 修复issue#119
This commit is contained in:
parent
7333032f63
commit
bb2c1b0b42
@ -3,6 +3,7 @@ import { Button } from 'zarm';
|
|||||||
import BaseForm from './BaseForm';
|
import BaseForm from './BaseForm';
|
||||||
import styles from './index.less';
|
import styles from './index.less';
|
||||||
import { IFormConfig } from './schema';
|
import { IFormConfig } from './schema';
|
||||||
|
import { IsPC } from '@/utils/tool';
|
||||||
import logo from '@/assets/form.png';
|
import logo from '@/assets/form.png';
|
||||||
const FormComponent = (props: IFormConfig & { isTpl: boolean }) => {
|
const FormComponent = (props: IFormConfig & { isTpl: boolean }) => {
|
||||||
const {
|
const {
|
||||||
@ -52,7 +53,7 @@ const FormComponent = (props: IFormConfig & { isTpl: boolean }) => {
|
|||||||
backgroundColor: bgColor,
|
backgroundColor: bgColor,
|
||||||
overflow: 'hidden',
|
overflow: 'hidden',
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
pointerEvents: isEditorPage ? 'none' : 'initial',
|
pointerEvents: isEditorPage || IsPC() ? 'none' : 'initial',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{title && (
|
{title && (
|
||||||
|
|||||||
@ -154,3 +154,17 @@ export const _gaw = (w: number) => {
|
|||||||
const vw = window.innerWidth > 800 ? 375 : window.innerWidth;
|
const vw = window.innerWidth > 800 ? 375 : window.innerWidth;
|
||||||
return (vw / 375) * w;
|
return (vw / 375) * w;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 代码运行环境判断
|
||||||
|
export function IsPC() {
|
||||||
|
var userAgentInfo = navigator.userAgent;
|
||||||
|
var Agents = new Array('Android', 'iPhone', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod');
|
||||||
|
var flag = true;
|
||||||
|
for (var v = 0; v < Agents.length; v++) {
|
||||||
|
if (userAgentInfo.indexOf(Agents[v]) > 0) {
|
||||||
|
flag = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user