/* eslint no-undef: 0 */ /* eslint arrow-parens: 0 */ import { enquireScreen } from "enquire-js"; import React from "react"; import Banner0 from "./Banner0"; // import Content4 from "./Content4"; import Content0 from "./Content0"; import Content1 from "./Content1"; import { Banner00DataSource, // Content40DataSource, Content00DataSource, Content10DataSource, // Pricing11DataSource, // Content30DataSource, // Content120DataSource, Footer10DataSource, Nav00DataSource, Pricing20DataSource, } from "./data.source"; // import Pricing1 from "./Pricing1"; // import Content3 from "./Content3"; // import Content12 from "./Content12"; import Footer1 from "./Footer1"; import "./less/antMotionStyle.less"; import Nav0 from "./Nav0"; import Pricing2 from "./Pricing2"; let isMobile; enquireScreen((b) => { isMobile = b; }); const { location = {} } = typeof window !== "undefined" ? window : {}; export default class Home extends React.Component { constructor(props) { super(props); this.state = { isMobile, show: !location.port, // 如果不是 dva 2.0 请删除 }; } componentDidMount() { // 适配手机屏幕; enquireScreen((b) => { this.setState({ isMobile: !!b }); }); // dva 2.0 样式在组件渲染之后动态加载,导致滚动组件不生效;线上不影响; /* 如果不是 dva 2.0 请删除 start */ if (location.port) { // 样式 build 时间在 200-300ms 之间; setTimeout(() => { this.setState({ show: true, }); }, 500); } /* 如果不是 dva 2.0 请删除 end */ console.log("Setting $crisp segments", ["lead"]); window.$crisp.push(["set", "session:segments", [["lead"]]]); window.$crisp.push([ "set", "session:event", [[["landing-page", {}, "green"]]], ]); } render() { const children = [ , , ...(process.env.NODE_ENV !== "production" ? [ // , , , , // , // , // , ] : []), , ]; return (
{ this.dom = d; }} > {/* 如果不是 dva 2.0 替换成 {children} start */} {this.state.show && children} {/* 如果不是 dva 2.0 替换成 {children} end */}
); } }