提交 71f14a6b 作者: 龚洪江

修复:项目资讯,联系人二维码

上级 746d55c8
import { Modal, ModalProps } from 'antd';
import { FC, useEffect, useState } from 'react';
import { Box } from './styled';
import api from '~/api';
import { Image } from 'antd';
const WxCodeModal: FC<ModalProps> = ({ open, onCancel }) => {
const [wxCodeImg, setWxCodeImg] = useState<string>('');
const getWXCode = () => {
api.listBannerImg('WX_CODE').then(({ result }) => {
if (result) {
setWxCodeImg(result[0].bannerImg);
}
});
};
useEffect(() => {
getWXCode();
}, []);
return (
<Modal open={open} onCancel={onCancel} width={400} footer={null}>
<Box>
<div className='title'>立即申请合作</div>
<div className='img'>
<Image src={wxCodeImg} width={160} height={160} />
</div>
<div className='meta'>打开微信扫一扫</div>
</Box>
</Modal>
);
};
export default WxCodeModal;
import styled from 'styled-components';
export const Box = styled.div`
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.title {
font-size: 20px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
font-weight: bold;
color: #ff5a33;
line-height: 25px;
}
.img {
margin: 48px 0 40px 0;
}
.meta {
font-size: 14px;
font-family: MicrosoftYaHei;
color: #3e454d;
line-height: 19px;
}
`;
import { Select, Space, message } from 'antd';
import { useRouter } from 'next/router';
import { useContext, useEffect, useState } from 'react';
import React, { useContext, useEffect, useState } from 'react';
import ContentBox from '~/components/contentBox';
import Map from './components/map';
import RotationChart from './components/rotationChart';
......@@ -18,6 +18,7 @@ import api, {
mallApi,
} from './api';
import { bigNumberTransform } from '~/utils/money';
import WxCodeModal from '~/components/wxCodeModal';
interface ColumnsType {
title: string;
......@@ -26,9 +27,8 @@ interface ColumnsType {
export default function WaterfallFlowBody() {
const router = useRouter();
const { userInfo, setNeedLogin } = useContext(UserContext);
const [list, setList] = useState([
const [list] = useState([
'中国人寿',
'中国平安',
'中国人保',
......@@ -100,127 +100,13 @@ export default function WaterfallFlowBody() {
const [rightTopDomList, setRightTopDomList] = useState<JSX.Element>();
const [rightBottomDomList, setRightBottomDomList] = useState<JSX.Element>();
// const { deviceBrand, deviceModel } = equipmentLeasingApi
// const eqApiTypeList = ['brandId', 'categoryId', 'modelId']
// const {
// listAllModel,
// listAllBrand,
// listAllCategory,
// listAllParts,
// listAllQuality,
// } = mallApi
// const mallApiTypeList = [
// 'brandId',
// 'productCategoryId',
// 'partsId',
// 'modelId',
// 'qualityId',
// ]
// const { IndustryFlightSkills, InDronePilotLicense } = flightSkillsApi
// const flightApiTypeList = ['licenseId', 'flightSkillsId']
// const { listAllIndustry, listAllAppType } = jobServicesApi
// const jobApiTypeList = ['industryId', 'appTypeId']
const [wxCodeShow, setWXCodeShow] = useState<boolean>(false);
const onMoreChange = (value: { value: string; label: number }, index: number, option: []) => {
const [item] = option.filter((item: any) => item.name === value.value);
routerPath(index, item);
};
// useEffect(() => {
// ;(async () => {
// let res1 = await Promise.all([deviceBrand(), deviceModel()])
// let res2 = await Promise.all([listAllBrand(), listAllCategory(), listAllParts(), listAllModel(), listAllQuality()])
// let res3 = await Promise.all([IndustryFlightSkills(), InDronePilotLicense()])
// let res4 = await Promise.all([listAllIndustry(), listAllAppType()])
// // let res4 = await Promise.all([deviceCategory(),deviceBrand(),deviceModel()])
// // let res6 = await Promise.all([deviceCategory(),deviceBrand(),deviceModel()])
// const resValuelist1 = res1
// .map((item, index) => {
// if (item.code === '200') {
// return item.result?.map(it => {
// it.type = eqApiTypeList[index]
// return it
// })
// }
// return {}
// })
// .flat()
// const resValuelist2 = res2
// .map((item, index) => {
// if (item.code === '200') {
// return item.result?.map(it => {
// it.type = mallApiTypeList[index]
// return it
// })
// }
// return {}
// })
// .flat()
// const resValuelist3 = res3
// .map((item, index) => {
// if (item.code === '200') {
// return item.result?.map(it => {
// it.type = flightApiTypeList[index]
// it.name = it.name || it.skillsName || it.licenseType
// return it
// })
// }
// return {}
// })
// .flat()
// const resValuelist4 = res4
// .map((item, index) => {
// if (item.code === '200') {
// return item.result?.map(it => {
// it.type = jobApiTypeList[index]
// it.name = it.name || it.appName
// return it
// })
// }
// return {}
// })
// .flat()
// let res7 = await listNewsApi.listNewsPage({ pageNo: 1, pageSize: 5 })
// let res8 = await listNewsApi.listNewTenderInfo({
// pageNo: 1,
// pageSize: 6
// })
// const listValue: any = [resValuelist1, resValuelist2, [], resValuelist3, resValuelist4, []]
// const listOption = JSON.parse(JSON.stringify(list)).map((item: string, index: number) => {
// return { id: index, name: item, value: index }
// })
// const list2Option = JSON.parse(JSON.stringify(list2)).map((item: string, index: number) => {
// return { id: index, name: item, value: index }
// })
// const optionList = [resValuelist1, resValuelist2, listOption, resValuelist3, resValuelist4, list2Option]
// setLeftDomList(
// columns.map((item, index) => {
// if (index < 3) {
// return {
// element: leftDom(item, index, listValue, optionList[index]),
// type: 'left'
// }
// }
// return {
// element: leftDom(item, index, listValue, optionList[index]),
// type: 'right'
// }
// })
// )
// setRightTopDomList(rightDom(res7.result?.list!))
// setRightBottomDomList(rightDom2(res8.result?.list!))
// })()
// }, [])
useEffect(() => {
(async () => {
const res2 = await api.HomeCategories({ type: 2 }); //无人机培训
......@@ -283,31 +169,35 @@ export default function WaterfallFlowBody() {
}
};
const handleTenderApply = async (item: NewsTenderType) => {
if (item.apply) return;
if (userInfo) {
let res = await listNewsApi.tenderApply({
tenderInfoId: item.id,
tenderNewsId: item.tenderNewsId,
userAccountId: userInfo.id,
});
try {
if (res.code === '200') {
message.success('申请成功');
let res8 = await listNewsApi.listNewTenderInfo({
pageNo: 1,
pageSize: 6,
});
setRightBottomDomList(rightDom2(res8.result?.list!));
} else {
message.error(res.message);
}
} catch (e) {
console.log(e);
}
} else {
setNeedLogin(true);
}
const handleTenderApply = () => {
setWXCodeShow(true);
// if (item.apply) return;
// if (userInfo) {
// let res = await listNewsApi.tenderApply({
// tenderInfoId: item.id,
// tenderNewsId: item.tenderNewsId,
// userAccountId: userInfo.id,
// });
// try {
// if (res.code === '200') {
// message.success('申请成功');
// let res8 = await listNewsApi.listNewTenderInfo({
// pageNo: 1,
// pageSize: 6,
// });
// setRightBottomDomList(rightDom2(res8.result?.list!));
// } else {
// message.error(res.message);
// }
// } catch (e) {
// console.log(e);
// }
// } else {
// setNeedLogin(true);
// }
};
const wxCodeModalCancel = () => {
setWXCodeShow(false);
};
const leftDom = (
......@@ -435,16 +325,10 @@ export default function WaterfallFlowBody() {
</div>
<div
className={`item-right ${item.apply ? 'apply' : ''}`}
onClick={() => handleTenderApply(item)}
onClick={handleTenderApply}
>
<div className='left'>{bigNumberTransform(item.tenderPrice * 10000, true)}</div>
{item.apply ? (
<div className='right'>已申请</div>
) : (
<>
<div className='right'>申请合作</div>
</>
)}
</div>
</div>
))}
......@@ -473,6 +357,7 @@ export default function WaterfallFlowBody() {
],
}}
/>
<WxCodeModal open={wxCodeShow} onCancel={wxCodeModalCancel} />
</Box>
);
}
......@@ -16,6 +16,7 @@ export interface Job {
teamName: string;
price: number;
inspComtAmount: number;
companyName: string;
}
export interface ListPageJobInfoResp {
......
......@@ -33,17 +33,12 @@ export default function JobServices() {
<div className='label'>{item.serviceName}</div>
{/* <div className="com">{item.teamName}</div> */}
</div>
<div className='value-right'>
{/* <span className="money">¥{item.price}</span> */}
{/* <span className="unit">/平</span> */}
<span className='money'>获取报价</span>
</div>
</div>
</div>
<div className='item-bottom'>
<div className='bottom-left'>{item.inspComtAmount}条评价</div>
{/* <div className="bottom-right">专业飞手团队,精通巡航业务</div> */}
<div className='com'>{item.teamName}</div>
<div className='bottom-right'>{item.companyName}</div>
{/*<div className='com'>{item.teamName}</div>*/}
</div>
</div>
);
......
......@@ -37,25 +37,6 @@ export const Box = styled.div`
white-space: nowrap;
}
}
&-right {
.money {
width: 89px;
height: 22px;
font-size: 20px;
font-family: Arial-BoldMT, Arial;
color: #ff552d;
line-height: 22px;
font-weight: bold;
}
.unit {
width: 24px;
height: 22px;
font-size: 16px;
font-family: MicrosoftYaHei;
color: #ff552d;
line-height: 22px;
}
}
}
}
&-bottom {
......@@ -77,7 +58,6 @@ export const Box = styled.div`
line-height: 22px;
}
.bottom-right {
width: 216px;
height: 22px;
font-size: 14px;
font-family: MicrosoftYaHei;
......
......@@ -69,8 +69,8 @@ export default function CaseArticle() {
<Col flex='auto'>
<div className={styles.font1}>{data?.caseTitle}</div>
<div className={styles.font2} style={{ marginTop: 18, marginBottom: 41 }}>
{data?.createTime && Moment(data?.createTime).format('YYYY-MM-DD')} ·作者:
{data?.caseAuthor || '不详'}
{data?.createTime && Moment(data?.createTime).format('YYYY-MM-DD')}
{data?.caseAuthor ? ` ·作者:${data?.caseAuthor}` : ''}
</div>
<div
style={{ lineHeight: 1.5 }}
......
......@@ -13,6 +13,7 @@ type Props = {
districtCode: number; //区编码
provinceCode: number; //省编码
};
showWxCodeModalEvent: () => void;
};
export default function Bids(props: Props) {
......@@ -91,27 +92,18 @@ export default function Bids(props: Props) {
<div className={styles.bids} style={{ height: 610 }}>
{list.map((item) => {
return (
<div className={styles.item} key={item.id} onClick={() => toTenderProjectsDetail(item)}>
<div className={styles.info}>
<div className={styles.item} key={item.id}>
<div className={styles.info} onClick={() => toTenderProjectsDetail(item)}>
<div className={styles.title}>{item.tenderTitle}</div>
</div>
{item.apply ? (
<Button type='primary' disabled className={`${styles.btn} ${styles.disabled}`}>
<div className={styles.text1}>
{bigNumberTransform(item.tenderPrice * 10000, true)}
</div>
<div className={styles.text2}>已申请</div>
</Button>
) : (
<Button type='primary' className={styles.btn}>
<div className={styles.text1}>
{bigNumberTransform(item.tenderPrice * 10000, true)}
</div>
<div className={styles.text2} onClick={() => onApply(item)}>
<div className={styles.text2} onClick={() => props.showWxCodeModalEvent()}>
商务合作
</div>
</Button>
)}
</div>
);
})}
......
......@@ -3,6 +3,7 @@ import { useRouter } from 'next/router';
import { useState, useEffect } from 'react';
import api, { Item } from './api';
import styles from './index.module.scss';
import WxCodeModal from '~/components/wxCodeModal';
type Props = {
params?: {
......@@ -11,6 +12,7 @@ type Props = {
districtCode: number; //区编码
provinceCode: number; //省编码
};
showWxCodeModalEvent: () => void;
};
export default function Cases(props: Props) {
......@@ -22,7 +24,6 @@ export default function Cases(props: Props) {
const [count, setCount] = useState(0);
const [abort, setAbort] = useState<AbortController | null>(null);
const [loading, setLoading] = useState(false);
const Router = useRouter();
useEffect(() => {
......@@ -61,6 +62,7 @@ export default function Cases(props: Props) {
};
return (
<>
<Spin spinning={loading} delay={500}>
<div className={styles.casas} style={{ height: 612 }}>
{list.map((item) => {
......@@ -77,7 +79,7 @@ export default function Cases(props: Props) {
<Button
type='primary'
className={styles.btn}
onClick={() => Router.push('/projectInfo/caseArticle/' + item.id)}
onClick={() => props.showWxCodeModalEvent()}
>
联系品牌厂家
</Button>
......@@ -97,5 +99,6 @@ export default function Cases(props: Props) {
style={{ marginTop: 20 }}
/>
</Spin>
</>
);
}
......@@ -32,7 +32,7 @@
.info {
padding-left: 3px;
padding-right: 83px;
flex: 1;
.title {
font-size: 16px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
......@@ -49,6 +49,11 @@
line-height: 22px;
margin-top: 6px;
@include ellipsis(1);
width: 100%;
video{
max-width: 100%;
height: auto;
}
}
.date {
......
import { Col, Empty, Pagination, Row, Spin } from 'antd';
import { Button, Col, Empty, Pagination, Row, Spin } from 'antd';
import styles from './index.module.scss';
import Image from 'next/image';
import { useState, useEffect, useContext } from 'react';
......@@ -13,6 +13,7 @@ type Props = {
districtCode: number; //区编码
provinceCode: number; //省编码
};
showWxCodeModalEvent: () => void;
};
export default function News(props: Props) {
......@@ -103,13 +104,16 @@ export default function News(props: Props) {
{item.createTime} · 作者:{item.newsAuthor}
</div>
</div>
{/*<Button*/}
{/* type='primary'*/}
{/* style={{ width: 120, height: 40, flexShrink: 0 }}*/}
{/* onClick={onGetInfo}*/}
{/*>*/}
{/* 获取产品资料 */}
{/*</Button>*/}
<Button
type='primary'
style={{ width: 120, height: 40, flexShrink: 0 }}
onClick={(e) => {
props.showWxCodeModalEvent();
e.stopPropagation();
}}
>
获取产品资料
</Button>
</div>
);
})}
......
......@@ -7,6 +7,7 @@ import Bids from './components/bids'; //招投标项目
import Cases from './components/cases'; //业务案例
import News from './components/news'; //行业新闻
import commonApi, { RegionResp } from '~/api';
import WxCodeModal from '~/components/wxCodeModal';
export interface Params {
cityCode?: number; //市编码
......@@ -15,7 +16,8 @@ export interface Params {
provinceCode?: number; //省编码
}
const items = (params: any) =>
export default function ProjectInfo() {
const items = (params: any) =>
[/* "项目需求", */ '招标快讯', '业务案例', '行业新闻'].map((value) => {
let children: JSX.Element | string = <></>;
......@@ -25,15 +27,15 @@ const items = (params: any) =>
break;
case '招标快讯':
children = <Bids params={params}></Bids>;
children = <Bids params={params} showWxCodeModalEvent={showWxCodeModalEvent}></Bids>;
break;
case '业务案例':
children = <Cases params={params}></Cases>;
children = <Cases params={params} showWxCodeModalEvent={showWxCodeModalEvent}></Cases>;
break;
case '行业新闻':
children = <News params={params}></News>;
children = <News params={params} showWxCodeModalEvent={showWxCodeModalEvent}></News>;
break;
}
return {
......@@ -43,9 +45,9 @@ const items = (params: any) =>
};
});
export default function ProjectInfo() {
const [region, setRegion] = useState<Array<RegionResp>>([]);
const [params, setParams] = useState<Params | null>({});
const [wxCodeShow, setWXCodeShow] = useState<boolean>(false);
useEffect(() => {
window!.document!.querySelector('body')!.style.background = '#fff';
......@@ -91,6 +93,12 @@ export default function ProjectInfo() {
date: dateString || undefined,
});
};
const showWxCodeModalEvent = () => {
setWXCodeShow(true);
};
const wxCodeModalCancel = () => {
setWXCodeShow(false);
};
return (
<Layout layoutStyle={{ backgroundColor: '#fff' }} hideFooter>
<div style={{ backgroundColor: '#fff', minHeight: 820 }}>
......@@ -127,6 +135,7 @@ export default function ProjectInfo() {
/>
</div>
</div>
<WxCodeModal open={wxCodeShow} onCancel={wxCodeModalCancel} />
</Layout>
);
}
......@@ -70,7 +70,7 @@ export default function CaseArticle() {
<div className={styles.font1}>{data?.newsTitle}</div>
<div className={styles.font2} style={{ marginTop: 18, marginBottom: 41 }}>
{data?.createTime && Moment(data?.createTime).format('YYYY-MM-DD')} ·作者:
{data?.newsAuthor || '不详'}
{data?.newsAuthor ? ` ·作者:${data?.newsAuthor}` : ''}
</div>
<div
style={{ lineHeight: 1.5 }}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论