提交 0c98981a 作者: 余乾开

Merge branch 'master' into feature/chuck

...@@ -3,6 +3,18 @@ ...@@ -3,6 +3,18 @@
"plugins": [ "plugins": [
[ [
"styled-components",{ "ssr":true } "styled-components",{ "ssr":true }
],
[
"styled-components-px2rem",
{
"rootValue": 1,
"unitPrecision": 5,
"propList": ["*"],
"selectorBlackList": [], //排除html样式
"replace": true,
"mediaQuery": false,
"minPixelValue": 0
}
] ]
] ]
} }
\ No newline at end of file
.content{
min-height: 120px;
line-height: 1;
width: 1200px;
position: relative;
margin: 0 auto;
}
\ No newline at end of file
...@@ -2,9 +2,17 @@ import React, { Suspense } from "react"; ...@@ -2,9 +2,17 @@ import React, { Suspense } from "react";
import { Layout, Space } from "antd"; import { Layout, Space } from "antd";
import NavHeader from "~/components/NavHeader"; import NavHeader from "~/components/NavHeader";
import FooterView from "~/components/footer"; import FooterView from "~/components/footer";
import {useRouter} from 'next/router'
import styles from './index.module.scss';
const { Header, Footer, Content } = Layout; const { Header, Footer, Content } = Layout;
const homeStyle: React.CSSProperties = {
position:'fixed',
width:'100%',
bottom:'0'
}
const headerStyle: React.CSSProperties = { const headerStyle: React.CSSProperties = {
height: "auto", height: "auto",
background: "none", background: "none",
...@@ -24,14 +32,12 @@ const contentStyle: React.CSSProperties = { ...@@ -24,14 +32,12 @@ const contentStyle: React.CSSProperties = {
}; };
const footerStyle: React.CSSProperties = { const footerStyle: React.CSSProperties = {
width:"100%",
color: "", color: "",
backgroundColor: "", backgroundColor: "",
lineHeight: "1", lineHeight: "1",
padding: 0, padding: 0,
position: "fixed", position: "relative",
bottom:0, marginTop: 60,
// marginTop: 60,
}; };
type Props = { type Props = {
...@@ -41,6 +47,7 @@ type Props = { ...@@ -41,6 +47,7 @@ type Props = {
}; };
export default function LayoutView(props: Props) { export default function LayoutView(props: Props) {
const router = useRouter()
return ( return (
<Space direction="vertical" style={{ width: "100%" }} size={[0, 48]}> <Space direction="vertical" style={{ width: "100%" }} size={[0, 48]}>
<Layout <Layout
...@@ -52,9 +59,15 @@ export default function LayoutView(props: Props) { ...@@ -52,9 +59,15 @@ export default function LayoutView(props: Props) {
<Header style={headerStyle}> <Header style={headerStyle}>
<NavHeader /> <NavHeader />
</Header> </Header>
<Content style={contentStyle}>{props.children}</Content> <Content className={styles.content}>{props.children}</Content>
{!props.hideFooter && ( {!props.hideFooter && (
<Footer style={footerStyle}> <Footer
style={
router.pathname.includes("home")
? { ...footerStyle, ...homeStyle }
: footerStyle
}
>
<FooterView></FooterView> <FooterView></FooterView>
</Footer> </Footer>
)} )}
......
...@@ -2,6 +2,7 @@ import React, { useContext, useEffect, useState } from "react"; ...@@ -2,6 +2,7 @@ import React, { useContext, useEffect, useState } from "react";
import { Modal, Image } from "antd"; import { Modal, Image } from "antd";
import api from "~/api"; import api from "~/api";
import { UserContext } from "~/lib/userProvider"; import { UserContext } from "~/lib/userProvider";
import errImg from "~/assets/errImg";
type Props = { type Props = {
open: boolean; open: boolean;
...@@ -27,6 +28,7 @@ export default function LoginModal(props: Props) { ...@@ -27,6 +28,7 @@ export default function LoginModal(props: Props) {
}); });
} */ } */
if (!props.open) { if (!props.open) {
setQrCode("");
return; return;
} }
...@@ -38,6 +40,8 @@ export default function LoginModal(props: Props) { ...@@ -38,6 +40,8 @@ export default function LoginModal(props: Props) {
.then((res) => { .then((res) => {
if (res.code == "200") { if (res.code == "200") {
setQrCode("data:image/png;base64," + res.result || ""); setQrCode("data:image/png;base64," + res.result || "");
} else {
window.messageApi.error("获取登录二维码失败");
} }
}); });
}, [props.open]); }, [props.open]);
...@@ -97,7 +101,12 @@ export default function LoginModal(props: Props) { ...@@ -97,7 +101,12 @@ export default function LoginModal(props: Props) {
欢迎来到云享飞 欢迎来到云享飞
</div> </div>
<div id="login_container" style={{ margin: "auto", display: "table" }}> <div id="login_container" style={{ margin: "auto", display: "table" }}>
<Image src={qrCode} width={150} height={150}></Image> <Image
src={qrCode}
width={150}
height={150}
fallback={errImg}
></Image>
</div> </div>
<div <div
style={{ style={{
......
...@@ -34,12 +34,14 @@ ...@@ -34,12 +34,14 @@
"@hapi/iron": "^7.0.1", "@hapi/iron": "^7.0.1",
"@types/styled-components": "^5.1.26", "@types/styled-components": "^5.1.26",
"babel-plugin-styled-components": "^2.1.1", "babel-plugin-styled-components": "^2.1.1",
"babel-plugin-styled-components-px2rem": "^1.5.5",
"cookie": "^0.5.0", "cookie": "^0.5.0",
"moment": "^2.29.4", "moment": "^2.29.4",
"next-connect": "^1.0.0", "next-connect": "^1.0.0",
"passport": "^0.6.0", "passport": "^0.6.0",
"passport-local": "^1.0.0", "passport-local": "^1.0.0",
"pinyin-pro": "^3.14.0", "pinyin-pro": "^3.14.0",
"postcss-pxtorem": "^6.0.0",
"react-infinite-scroll-component": "^6.1.0", "react-infinite-scroll-component": "^6.1.0",
"styled-components": "^6.0.0-rc.1", "styled-components": "^6.0.0-rc.1",
"swiper": "^9.3.2", "swiper": "^9.3.2",
......
import '../public/antd.min.css'; import "../public/antd.min.css";
import '../styles/index.scss'; import "../styles/index.scss";
import type { AppProps } from 'next/app'; import type { AppProps } from "next/app";
import withTheme from '../theme'; import withTheme from "../theme";
import { message } from 'antd'; import { message } from "antd";
import { useEffect } from 'react'; import { useEffect } from "react";
import Head from "next/head"; import Head from "next/head";
import Script from 'next/script'; import Script from "next/script";
import UserProvider, { UserContext } from "~/lib/userProvider"; import UserProvider, { UserContext } from "~/lib/userProvider";
export default function App({ Component, pageProps }: AppProps) { export default function App({ Component, pageProps }: AppProps) {
...@@ -13,14 +13,18 @@ export default function App({ Component, pageProps }: AppProps) { ...@@ -13,14 +13,18 @@ export default function App({ Component, pageProps }: AppProps) {
useEffect(() => { useEffect(() => {
//全局消息提示 //全局消息提示
window.messageApi = messageApi; window.messageApi = messageApi;
}, []) //@ts-ignore
window.onresize = function(){
window.document.querySelector('html')!.style.fontSize = (window.innerWidth / 1920) + 'PX';
}
}, []);
return withTheme( return withTheme(
<> <>
<Head> <Head>
<meta <meta
name="viewport" name="viewport"
content="width=device-width,initial-scale=1" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"
></meta> ></meta>
</Head> </Head>
<Script src="https://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></Script> <Script src="https://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></Script>
......
...@@ -24,7 +24,7 @@ export default class MyDocument extends Document { ...@@ -24,7 +24,7 @@ export default class MyDocument extends Document {
render() { render() {
return ( return (
<Html lang='en'> <Html lang='en' style={{fontSize: 1}}>
<Head /> <Head />
<body> <body>
<Main /> <Main />
......
...@@ -23,7 +23,10 @@ export default function JobServicesDetail() { ...@@ -23,7 +23,10 @@ export default function JobServicesDetail() {
{ {
key: '1', key: '1',
label: `团队介绍`, label: `团队介绍`,
children: <Image width={1100} height={800} src={detail?.teamPoster ? detail?.teamPoster : ''} alt='error'/>, children: <div>
{/* <Image width={1100} height={800} src={detail?.teamPoster ? detail?.teamPoster : ''} alt='error'/> */}
<img src={detail?.teamPoster ? detail?.teamPoster : ''} alt="error" />
</div>,
}, },
{ {
key: '2', key: '2',
......
...@@ -7,7 +7,7 @@ export default function Style() { ...@@ -7,7 +7,7 @@ export default function Style() {
export const Box = styled.div` export const Box = styled.div`
box-sizing: border-box; box-sizing: border-box;
overflow-y: auto; overflow-y: auto;
height: 900px; height: 800px;
.item{ .item{
height: 180px; height: 180px;
&-user{ &-user{
......
...@@ -104,7 +104,7 @@ export const Box = styled.div` ...@@ -104,7 +104,7 @@ export const Box = styled.div`
} }
} }
.tabs{ .tabs{
padding: 0 60px; padding: 0 24px;
margin-top: 69px; margin-top: 69px;
} }
` `
\ No newline at end of file
...@@ -167,7 +167,6 @@ export default function JobServices() { ...@@ -167,7 +167,6 @@ export default function JobServices() {
total={count} total={count}
onChange={onPageChange} onChange={onPageChange}
hideOnSinglePage={true} hideOnSinglePage={true}
style={{ marginTop: 20 }}
/> />
</div> </div>
), ),
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
.title { .title {
font-size: 14px; font-size: 14px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI; font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
font-weight: bold;
color: #3c3e42; color: #3c3e42;
width: 649px; width: 649px;
@include ellipsis(1); @include ellipsis(1);
......
...@@ -12,15 +12,14 @@ ...@@ -12,15 +12,14 @@
.info { .info {
.title { .title {
font-size: 16px; font-size: 14px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI; font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
font-weight: bold;
color: #3c3e42; color: #3c3e42;
width: 649px; width: 649px;
@include ellipsis(1); @include ellipsis(1);
} }
.desc { .desc {
font-size: 16px; font-size: 14px;
font-family: MicrosoftYaHei; font-family: MicrosoftYaHei;
color: #ff552d; color: #ff552d;
margin-top: 9px; margin-top: 9px;
......
...@@ -22,9 +22,8 @@ export interface Params { ...@@ -22,9 +22,8 @@ export interface Params {
provinceCode?: number; //省编码 provinceCode?: number; //省编码
} }
const items = (params: any) =>
const items = (params:any) => ["项目需求", "招投标项目", "业务案例", "行业新闻"].map( ["项目需求", "招投标项目", "业务案例", "行业新闻"].map((value) => {
(value) => {
let children: JSX.Element | string = <></>; let children: JSX.Element | string = <></>;
switch (value) { switch (value) {
...@@ -49,14 +48,14 @@ const items = (params:any) => ["项目需求", "招投标项目", "业务案例" ...@@ -49,14 +48,14 @@ const items = (params:any) => ["项目需求", "招投标项目", "业务案例"
key: value, key: value,
children: children, children: children,
}; };
} });
);
export default function ProjectInfo() { export default function ProjectInfo() {
const [region, setRegion] = useState<Array<RegionResp>>([]); const [region, setRegion] = useState<Array<RegionResp>>([]);
const [params, setParams] = useState<Params | null>({}); const [params, setParams] = useState<Params | null>({});
useEffect(() => { useEffect(() => {
window!.document!.querySelector('body')!.style.background = '#fff';
commonApi.region().then((res) => { commonApi.region().then((res) => {
let temp = res.result || []; let temp = res.result || [];
let temp1: Array<RegionResp> = []; let temp1: Array<RegionResp> = [];
...@@ -77,15 +76,15 @@ export default function ProjectInfo() { ...@@ -77,15 +76,15 @@ export default function ProjectInfo() {
console.log(value); console.log(value);
let params1: Params = { let params1: Params = {
provinceCode: undefined, provinceCode: undefined,
districtCode: undefined districtCode: undefined,
}; };
list?.forEach(item => { list?.forEach((item) => {
if(item.level == 1){ if (item.level == 1) {
params1.provinceCode = item.id; params1.provinceCode = item.id;
} else if(item.level == 2){ } else if (item.level == 2) {
params1.districtCode = item.id; params1.districtCode = item.id;
} }
}) });
setParams({ setParams({
...params, ...params,
...params1, ...params1,
......
module.exports = {
plugins: {
"postcss-pxtorem": {
rootValue: 1,
unitPrecision: 5,
propList: ["*"],
selectorBlackList: [], //排除html样式
replace: true,
mediaQuery: false,
minPixelValue: 0,
},
},
};
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论