提交 f515c921 作者: 龚洪江

功能:加盟入驻

上级 5ad605b3
import config from './config'; import config from './config';
let loginTimeout: NodeJS.Timeout | undefined; let loginTimeout: NodeJS.Timeout | undefined;
...@@ -10,7 +9,12 @@ let loginTimeout: NodeJS.Timeout | undefined; ...@@ -10,7 +9,12 @@ let loginTimeout: NodeJS.Timeout | undefined;
* @param options 额外参数 * @param options 额外参数
* @returns Promise<Response> * @returns Promise<Response>
*/ */
export default function request(url: string, method: String = 'get', data?: any, options: any & { hideError?: boolean, headers?: { token?: string } } = {}): Promise<Response<any>> { export default function request(
url: string,
method: String = 'get',
data?: any,
options: any & { hideError?: boolean; headers?: { token?: string } } = {},
): Promise<Response<any>> {
let token = localStorage.getItem('token') || ''; let token = localStorage.getItem('token') || '';
switch (method.toLowerCase()) { switch (method.toLowerCase()) {
...@@ -19,7 +23,7 @@ export default function request(url: string, method: String = 'get', data?: any, ...@@ -19,7 +23,7 @@ export default function request(url: string, method: String = 'get', data?: any,
if (data) { if (data) {
Object.keys(data).forEach((key) => { Object.keys(data).forEach((key) => {
params.append(key, data[key]); params.append(key, data[key]);
}) });
url += '?' + params; url += '?' + params;
} }
...@@ -33,16 +37,16 @@ export default function request(url: string, method: String = 'get', data?: any, ...@@ -33,16 +37,16 @@ export default function request(url: string, method: String = 'get', data?: any,
}, },
body: JSON.stringify(data), body: JSON.stringify(data),
...options, ...options,
} };
break; break;
} }
if(options.headers){ if (options.headers) {
options.headers.token = token; options.headers.token = token;
}else{ } else {
options.headers = { options.headers = {
token token,
} };
} }
/** /**
...@@ -57,65 +61,65 @@ export default function request(url: string, method: String = 'get', data?: any, ...@@ -57,65 +61,65 @@ export default function request(url: string, method: String = 'get', data?: any,
/** /**
* 未登录消息展示,1.5秒内限制只展示一次 * 未登录消息展示,1.5秒内限制只展示一次
* @returns * @returns
*/ */
function loginErrorMsg(){ function loginErrorMsg() {
console.log('loginTimeout', loginTimeout) console.log('loginTimeout', loginTimeout);
if(loginTimeout){ if (loginTimeout) {
return; return;
} }
loginTimeout = setTimeout(() => { loginTimeout = setTimeout(() => {
errMsg('请先登录'); errMsg('请先登录');
loginTimeout = undefined; loginTimeout = undefined;
}, 1500) }, 1500);
} }
return fetch(config.baseUrl + url, options) return fetch(config.baseUrl + url, options)
.then((r) => { .then((r) => {
try { try {
return r.json() return r.json();
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }
return { return {
code: '-1', code: '-1',
message: '请求失败', message: '请求失败',
result: null result: null,
} };
}) })
.then((data) => { .then((data) => {
if (data.errors) { if (data.errors) {
//全局消息提示 //全局消息提示
errMsg('请求出错') errMsg('请求出错');
if (Array.isArray(data.errors)) { if (Array.isArray(data.errors)) {
data.errors.forEach((item: any) => { data.errors.forEach((item: any) => {
if (item.defaultMessage) { if (item.defaultMessage) {
errMsg(item.defaultMessage) errMsg(item.defaultMessage);
} }
}) });
} }
return { return {
code: '-1', code: '-1',
message: '请求失败', message: '请求失败',
result: null result: null,
} };
} }
if (data.code !== '200') { if (data.code !== '200') {
//未登录判断 //未登录判断
if(data.code === '5008' || data.code === '2014'){ if (data.code === '5008' || data.code === '2014') {
loginErrorMsg(); loginErrorMsg();
window.logout(); window.logout();
}else{ } else {
errMsg(data.message || '请求出错'); errMsg(data.message || '请求出错');
} }
} }
return data; return data;
}) })
.catch(error => { .catch((error) => {
if (error.name === 'AbortError') { if (error.name === 'AbortError') {
console.log('请求已中断'); console.log('请求已中断');
console.log(error); console.log(error);
...@@ -125,14 +129,14 @@ export default function request(url: string, method: String = 'get', data?: any, ...@@ -125,14 +129,14 @@ export default function request(url: string, method: String = 'get', data?: any,
return { return {
code: '-1', code: '-1',
message: '请求失败', message: '请求失败',
result: null result: null,
} };
}); });
} }
//准备响应结构 //准备响应结构
export interface Response<T> { export interface Response<T> {
code: string, code: string;
message: string, message: string;
result?: T | null result?: T | null;
} }
\ No newline at end of file
...@@ -14,8 +14,8 @@ const items: TabsProps['items'] = [ ...@@ -14,8 +14,8 @@ const items: TabsProps['items'] = [
label: ` 首页 `, label: ` 首页 `,
}, },
{ {
key: '/jobServices', key: '/mall',
label: `作业服务`, label: `产品商城`,
}, },
{ {
key: '/equipmentLeasing', key: '/equipmentLeasing',
...@@ -26,8 +26,8 @@ const items: TabsProps['items'] = [ ...@@ -26,8 +26,8 @@ const items: TabsProps['items'] = [
label: `飞手培训`, label: `飞手培训`,
}, },
{ {
key: '/mall', key: '/jobServices',
label: `产品商城`, label: `作业服务`,
}, },
{ {
key: '/projectInfo', key: '/projectInfo',
......
import { Col, Modal, Row } from 'antd'; import { Col, Modal, Row } from 'antd';
import Image from 'next/image'; import Image from 'next/image';
import styles from './index.module.scss'; import styles from './index.module.scss';
import img from './assets/img.png';
import { useContext, useEffect, useState } from 'react'; import { useContext, useEffect, useState } from 'react';
import api, { ListTagResp } from './api'; import api, { ListTagResp } from './api';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
...@@ -37,7 +36,7 @@ export default function JoinModal(props: Props) { ...@@ -37,7 +36,7 @@ export default function JoinModal(props: Props) {
const onClickTag = (item: ListTagResp) => { const onClickTag = (item: ListTagResp) => {
if (userInfo!.companyAuthStatus) { if (userInfo!.companyAuthStatus) {
router.replace('/JoinPolicy?tagId=' + item.id); router.replace({ pathname: '/JoinPolicy', query: { tagId: item.id } });
props.onCancel && props.onCancel(); props.onCancel && props.onCancel();
} else { } else {
router.push('/certification'); router.push('/certification');
......
import React, { Suspense } from 'react'; import React 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 { headers } from 'next/dist/client/components/headers';
import request, { Response } from '~/api/request';
export default {
uploadFile: (data: FormData): Promise<Response<string>> =>
request('/pms/upload/breakpoint', 'post', data, { headers: {}, body: data }),
};
.uploader-view{
.ant-upload-wrapper .ant-upload-list .ant-upload-list-item-container{
//width: 200px !important;
}
}
import React, { useState } from 'react'; import React, { useEffect, useState } from 'react';
import { message, Upload, UploadProps } from 'antd'; import { message, Upload, UploadProps } from 'antd';
// import { UploadFile } from "antd/es/upload/interface"; import uploadApi from './api';
import './index.scss';
interface PropsType { interface PropsType {
listType?: 'text' | 'picture' | 'picture-card'; // 上传列表的内建样式 listType?: 'text' | 'picture' | 'picture-card'; // 上传列表的内建样式
fileSize?: number; // 文件大小 fileSize?: number; // 文件大小
fileType?: string[]; // 上传文件类型 fileType?: string[]; // 上传文件类型
fileUpload: boolean; // 是否上传到服务器(返回文件流还是返回上传后的地址)
fileLength?: number; // 最大上传文件数量 fileLength?: number; // 最大上传文件数量
children: React.ReactNode; // 上传按钮 children: React.ReactNode; // 上传按钮
onChange?: (fileList: any[]) => void; // 上传文件改变时的状态 onChange?: (
onRemove?: (fileList: any[]) => void; fileList: {
id: number;
name: string;
uid: number;
url: string;
}[],
) => void; // 上传文件改变时的状态
defaultFileList?: any[]; // 默认文件列表
} }
export const Uploader: React.FC<PropsType> = (props) => { export const Uploader: React.FC<PropsType> = (props) => {
Uploader.defaultProps = { Uploader.defaultProps = {
listType: 'text', listType: 'picture-card',
fileSize: 2, fileSize: 2,
fileLength: 1, fileLength: 1,
fileType: ['image/png', 'image/jpeg', 'image/jpg', 'image/gif', 'image/bmp'], fileType: ['image/png', 'image/jpeg', 'image/jpg', 'image/gif'],
onChange: () => {}, onChange: () => {},
onRemove: () => {}, defaultFileList: [],
}; };
const { fileType, children, listType, fileSize, fileLength, onChange, onRemove } = props; const {
fileType = ['image/png', 'image/jpeg', 'image/jpg', 'image/gif', 'image/bmp'],
children,
listType,
fileSize,
fileUpload,
fileLength,
onChange,
defaultFileList,
} = props;
const [fileList, setFileList] = useState<any[]>([]); const [fileList, setFileList] = useState<any[]>([]);
// 上传文件配置 // 上传文件配置
const uploadProps: UploadProps = { const uploadProps: UploadProps = {
listType, listType,
fileList, fileList,
beforeUpload: (res) => { beforeUpload: (res) => {
console.log('上传文件-->', res);
const isType = fileType?.includes(res.type); const isType = fileType?.includes(res.type);
const isSize = res.size / 1024 / 1024 < (fileSize || 2); const isSize = res.size / 1024 / 1024 < (fileSize || 2);
const isLength = fileList.length < (fileLength || 1);
if (!isType) { if (!isType) {
message.error('请上传正确的格式!').then(); message.error('上传文件格式错误!').then();
return isType;
} }
if (!isSize) { if (!isSize) {
message.error('文件最大2M,请压缩后上传!').then(); message.error(`文件最大${props.fileSize}M,请压缩后上传!`).then();
return isSize; }
if (!isLength) {
message.error(`最多上传${fileLength || 1}个文件`).then();
} }
return isType && isSize && isLength;
}, },
customRequest: (res) => { customRequest: (res) => {
if (fileList.length >= (fileLength || 1)) { if (fileUpload) {
message.error(`最多上传${fileLength || 1}个文件`).then(); setFileList([
return; ...fileList,
{
id: new Date().getTime(),
uid: new Date().getTime(),
name: (res.file as any).name,
type: (res.file as any).type,
url: (res.file as any).url,
status: 'uploading',
},
]);
// 上传到服务器
const formData = new FormData();
formData.append('uploadFile', res.file);
uploadApi.uploadFile(formData).then(({ result, code }) => {
if (code === '200') {
setFileList([
...fileList,
{
id: new Date().getTime(),
uid: new Date().getTime(),
name: (res.file as any).name || '',
url: result,
type: (res.file as any).type,
status: 'done',
},
]);
onChange?.([
...fileList,
{
id: new Date().getTime(),
uid: new Date().getTime(),
name: (res.file as any).name || '',
url: result,
type: (res.file as any).type,
status: 'done',
},
]);
}
});
} else {
setFileList([...fileList, res.file]);
onChange?.([...fileList, res.file]);
} }
setFileList([...fileList, res.file]);
onChange?.([...fileList, res.file]);
}, },
onRemove: (res) => { onRemove: (res) => {
const newFileList = fileList.filter((item) => item.uid !== res.uid); const newFileList = fileList.filter((item) => item.uid !== res.uid);
setFileList(newFileList); setFileList(newFileList);
onRemove?.(newFileList); onChange?.(newFileList);
}, },
// onPreview: { onPreview }, // onPreview: { onPreview },
}; };
useEffect(() => {
// 如果有默认文件列表
if (defaultFileList?.length) {
setFileList(defaultFileList);
} else {
setFileList([]);
}
}, [defaultFileList]);
return ( return (
<div className='uploader-view'> <div className='uploader-view'>
<Upload {...uploadProps} style={{ width: '100%' }}> <Upload {...uploadProps} style={{ width: '100%' }}>
<>{fileList.length < (fileLength || 1) && children}</> {children}
</Upload> </Upload>
</div> </div>
); );
......
...@@ -27,7 +27,6 @@ const UserProvider = ({ children }: Props) => { ...@@ -27,7 +27,6 @@ const UserProvider = ({ children }: Props) => {
useEffect(() => { useEffect(() => {
try { try {
setUserInfo(JSON.parse(window.localStorage.getItem('userInfo') || '') || undefined); setUserInfo(JSON.parse(window.localStorage.getItem('userInfo') || '') || undefined);
window.setUserInfo = setUserInfo; window.setUserInfo = setUserInfo;
window.setNeedLogin = setNeedLogin; window.setNeedLogin = setNeedLogin;
window.logout = logout; window.logout = logout;
......
...@@ -27,8 +27,8 @@ const nextConfig = { ...@@ -27,8 +27,8 @@ const nextConfig = {
return [ return [
{ {
source: '/local/:path*', source: '/local/:path*',
destination: 'https://www.iuav.shop/:path*', // destination: 'https://www.iuav.shop/:path*',
// destination: 'https://test.iuav.shop/:path*', destination: 'https://test.iuav.shop/:path*',
}, },
]; ];
}, },
......
...@@ -4,8 +4,8 @@ export interface CooperationApplyParams { ...@@ -4,8 +4,8 @@ export interface CooperationApplyParams {
applyName: string; applyName: string;
applyPhone: string; applyPhone: string;
remark?: string; remark?: string;
userAccountId: number;
cooperationTagId: number; cooperationTagId: number;
attachmentList?: { type: number; url: string }[];
} }
export interface GetTagIdResp { export interface GetTagIdResp {
...@@ -14,6 +14,7 @@ export interface GetTagIdResp { ...@@ -14,6 +14,7 @@ export interface GetTagIdResp {
tagImg: string; tagImg: string;
tagDescription: string; tagDescription: string;
createTime: string; createTime: string;
tagRequire: string;
} }
export default { export default {
......
.banner { .headerLine{
width: 100vw; height: 8px;
height: 200px; background: linear-gradient(90deg, #F5B351 0%, #FF552D 100%);
background: #f25834;
position: absolute;
left: 50%;
top: 0;
transform: translate(-50%, 0);
} }
.font1 { .font1 {
font-size: 20px; font-size: 20px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
font-weight: bold; font-weight: bold;
color: #000000; color: #000000;
line-height: 25px; line-height: 25px;
} }
.font2 { .font2 {
font-size: 18px; font-size: 14px;
font-family: MicrosoftYaHei; color: #1A1B1C;
color: #333333; line-height: 19px;
line-height: 32px;
letter-spacing: 1px; letter-spacing: 1px;
} }
.infoContent{
padding: 29px 0 0 50px;
box-sizing: border-box;
.tip{
.tipTitle{
font-size: 14px;
font-weight: bold;
color: #000000;
line-height: 18px;
margin-bottom: 17px;
}
}
.formWrap{
margin-top: 35px;
.formTitle{
font-size: 14px;
font-weight: bold;
color: #000000;
line-height: 18px;
margin-bottom: 17px;
}
}
.uploadTip{
font-size: 12px;
color: #858687;
line-height: 18px;
margin-bottom: 12px;
}
.uploadOperate{
}
}
.submitOperate{
text-align: center;
margin-top: 69px;
button{
width: 200px;
height: 40px;
border-radius: 6px;
background: linear-gradient(90deg, #FF552D 0%, #FF812D 100%);
font-size: 16px;
color: #FEFFFE;
}
}
...@@ -4,107 +4,149 @@ import { useEffect, useState } from 'react'; ...@@ -4,107 +4,149 @@ import { useEffect, useState } from 'react';
import LayoutView from '~/components/layout'; import LayoutView from '~/components/layout';
import api from './api'; import api from './api';
import styles from './index.module.scss'; import styles from './index.module.scss';
import { phoneNumber } from '~/lib/validateUtils'; import { Uploader } from '~/components/uploader';
import JoinModal from '~/components/NavHeader/joinModal';
export default function JoinPolicy() { export default function JoinPolicy() {
const [form] = Form.useForm();
const router = useRouter(); const router = useRouter();
const [content, setContent] = useState(''); //福利内容 const [content, setContent] = useState(''); //福利内容
const tagId = Number(router.query.tagId); const [tagId, setTagId] = useState<number>(-1);
useEffect(() => { useEffect(() => {
if (tagId) { if (router.query.tagId) {
setTagId(Number(router.query.tagId));
api api
.getTagById({ .getTagById({
id: tagId, id: Number(router.query.tagId),
}) })
.then((res) => { .then((res) => {
setContent(res.result?.tagDescription.replaceAll('\n', '<br/>') || ''); setContent(res.result?.tagRequire.replaceAll('\n', '<br/>') || '');
}); });
} }
}, []); }, [router.query.tagId]);
//提交 //提交
const onFinish = (values: any) => { const submitApply = () => {
console.log(values); form.validateFields().then((valid) => {
api api
.cooperationApply({ .cooperationApply({
...values, ...valid,
cooperationTagId: tagId, cooperationTagId: tagId,
}) })
.then((res) => { .then((res) => {
console.log('提交结果', res); if (res.code === '200') {
if (res.code === '200') { window.messageApi.success('提交成功');
window.messageApi.success('提交成功'); form.resetFields();
setTimeout(() => { setTimeout(() => {
router.push('/'); router.push('/');
}, 1500); }, 1500);
} }
}); });
});
};
//上传变更
const uploadChange = (value: any) => {
let attachmentList = value.map((v: any) => ({
type: v.type.includes('image') ? 0 : 1,
url: v.url,
}));
form.setFieldValue('attachmentList', attachmentList);
}; };
return ( return (
<LayoutView> <LayoutView>
<div className={styles.banner}></div>
<div <div
className='page' className='page'
style={{ style={{
background: '#fff', background: '#fff',
position: 'relative', position: 'relative',
zIndex: 1, zIndex: 1,
marginTop: 60, marginTop: 20,
paddingBottom: 63, paddingBottom: 63,
}} }}
> >
<div <div className={styles.headerLine}></div>
className={styles.font1} <div className={styles.font1} style={{ textAlign: 'center', marginTop: '22px' }}>
style={{ textAlign: 'center', paddingTop: 40, paddingBottom: 30 }} 加盟入驻
>
加盟入驻福利
</div> </div>
<div
className={styles.font2}
style={{ paddingLeft: 50, paddingRight: 50 }}
dangerouslySetInnerHTML={{ __html: content }}
></div>
<Divider /> <Divider />
<div className={styles.font1} style={{ textAlign: 'center', marginBottom: 28 }}> <div className={styles.infoContent}>
申请加盟入驻 <div className={styles.tip}>
</div> <div className={styles.tipTitle}>需准备上传资料</div>
<Row justify={'center'}> <div className={styles.font2} dangerouslySetInnerHTML={{ __html: content }}></div>
<Col style={{ width: 400 }}> </div>
<Form labelAlign='left' labelCol={{ span: 5 }} onFinish={onFinish}> <div className={styles.formWrap}>
<Form.Item label='姓名' name='applyName' rules={[{ required: true }]}> <div className={styles.formTitle}>填写资料</div>
<Input placeholder='请输入姓名'></Input> <div className={styles.form}>
</Form.Item> <Form labelCol={{ span: 2 }} wrapperCol={{ span: 10 }} labelAlign='left' form={form}>
<Form.Item <Form.Item
label='联系方式' label='联系人'
name='applyPhone' name='applyName'
rules={[ rules={[{ required: true, message: '请输入联系人' }]}
{ required: true }, >
{ <Input placeholder='请输入联系人' maxLength={30} />
pattern: /^1\d{10}$/, </Form.Item>
message: '很输入11位手机号', <Form.Item
}, label='联系方式'
]} name='applyPhone'
> rules={[
<Input placeholder='请输入手机号' maxLength={11} onInput={phoneNumber}></Input> { required: true, message: '请输入联系方式' },
</Form.Item> { pattern: /^1\d{10}$/, message: '请输入正确的手机号码' },
<Form.Item name='remark'> ]}
<Input.TextArea placeholder='其它信息'></Input.TextArea>
</Form.Item>
<Row justify={'center'}>
<Button
type='primary'
htmlType='submit'
style={{ marginTop: 11, width: 200 }}
size='large'
> >
提交申请 <Input placeholder='请输入联系方式' />
</Button> </Form.Item>
</Row> <Row>
</Form> <Col span={2}>
</Col> <div>上传资料:</div>
</Row> </Col>
<Col span={10}>
<div className={styles.uploadTip}>
<div>1. 图片格式为JPG、JPEG、BMP、GIF、PNG</div>
<div>2. 文档格式为word、PDF、excel</div>
<div> 3. 文件大小不超过10M</div>
</div>
<div className={styles.uploadOperate}>
<Form.Item name='attachmentList'>
<Uploader
fileUpload
listType='text'
fileLength={3}
fileSize={10}
onChange={uploadChange}
fileType={[
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'pplication/vnd.openxmlformats-officedocument.wordprocessingml.document',
'application/vnd.ms-excel',
'application/pdf',
'application/msword',
'image/png',
'image/jpeg',
'image/jpg',
'image/gif',
'image/bmp',
]}
>
<Button>上传文件</Button>
</Uploader>
</Form.Item>
</div>
</Col>
</Row>
<Form.Item label='备注(选填)' name='remark'>
<Input placeholder='请输入备注' maxLength={60} />
</Form.Item>
</Form>
</div>
</div>
</div>
<div className={styles.submitOperate}>
<Button type='primary' onClick={submitApply}>
提交申请
</Button>
</div>
</div> </div>
</LayoutView> </LayoutView>
); );
} }
JoinPolicy.getInitialProps = async () => {
return {};
};
import { Pagination } from 'antd'; import { Pagination, Image as AntdImage } from 'antd';
import Image from 'next/image'; import Image from 'next/image';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import { useContext, useEffect, useRef, useState } from 'react'; import { useContext, useEffect, useRef, useState } from 'react';
...@@ -57,7 +57,7 @@ export default function EquipmentLeasing(props: Props) { ...@@ -57,7 +57,7 @@ export default function EquipmentLeasing(props: Props) {
const rightDom = (item: { id: number; bannerImg: string }) => { const rightDom = (item: { id: number; bannerImg: string }) => {
return ( return (
<div key={item.id} className='right-box-item right-item'> <div key={item.id} className='right-box-item right-item'>
<Image src={item.bannerImg} alt='error' fill /> <AntdImage src={item.bannerImg} width={180} preview={false} />
</div> </div>
); );
}; };
......
...@@ -67,11 +67,6 @@ export const Box = styled.div` ...@@ -67,11 +67,6 @@ export const Box = styled.div`
} }
.right-item { .right-item {
width: 180px; width: 180px;
height: 347px;
background: #d8d8d8;
border-radius: 6px;
overflow: hidden;
position: relative;
} }
.pagination-page { .pagination-page {
text-align: right; text-align: right;
......
...@@ -9,6 +9,7 @@ import { ...@@ -9,6 +9,7 @@ import {
Select, Select,
Space, Space,
message, message,
Image as AntdImage,
} from 'antd'; } from 'antd';
import type { CheckboxValueType } from 'antd/es/checkbox/Group'; import type { CheckboxValueType } from 'antd/es/checkbox/Group';
import Image from 'next/image'; import Image from 'next/image';
...@@ -94,7 +95,7 @@ export default function FlyingHandService() { ...@@ -94,7 +95,7 @@ export default function FlyingHandService() {
const rightDom = (item: string) => { const rightDom = (item: string) => {
return ( return (
<div className='right-box-item right-item' key={item}> <div className='right-box-item right-item' key={item}>
<Image src={item} alt='error' fill /> <AntdImage src={item} width={260} preview={false} />
</div> </div>
); );
}; };
......
...@@ -128,11 +128,6 @@ export const Box = styled.div` ...@@ -128,11 +128,6 @@ export const Box = styled.div`
} }
.right-item { .right-item {
width: 260px; width: 260px;
height: 500px;
background: #ffffff;
border-radius: 6px;
overflow: hidden;
position: relative;
} }
.pagination-page { .pagination-page {
text-align: right; text-align: right;
......
...@@ -5,10 +5,7 @@ export interface PublishParams { ...@@ -5,10 +5,7 @@ export interface PublishParams {
lon?: number; //经度 lon?: number; //经度
description: string; //描述 description: string; //描述
userId: number; //用户id userId: number; //用户id
mediaVO: { mediaVO: { type: number; url: string }[];
//发布图片
picture: Array<string>;
};
} }
export default { export default {
......
...@@ -96,17 +96,13 @@ export default function PublishMessage(props: Props) { ...@@ -96,17 +96,13 @@ export default function PublishMessage(props: Props) {
.publish({ .publish({
lat: position?.position?.lat, //纬度 lat: position?.position?.lat, //纬度
lon: position?.position?.lng, //经度 lon: position?.position?.lng, //经度
title: '', //标题
description: values.description, //描述 description: values.description, //描述
userId: userInfo.id, //用户id userId: userInfo.id, //用户id
mediaVO: { mediaVO: fileList
//发布图片 .filter((item) => item.url)
//@ts-ignore .map((item) => ({ type: 0, url: item.url as string })),
picture: fileList.filter((item) => item.url).map((item) => item.url),
},
}) })
.then((res) => { .then((res) => {
console.log('提交结果', res);
setShowLoad(false); setShowLoad(false);
if (res.code === '200') { if (res.code === '200') {
window.messageApi.success('发布成功'); window.messageApi.success('发布成功');
......
import React, { useEffect, useState, useRef } from 'react'; import React, { useEffect, useState, useRef } from 'react';
import { Box } from './styled'; import { Box } from './styled';
import { Pagination } from 'antd'; import { Pagination, Image } from 'antd';
import Layout from '~/components/layout'; import Layout from '~/components/layout';
import ContentBox from '~/components/contentBox'; import ContentBox from '~/components/contentBox';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import Filter, { FilterResult, AdapterResult } from '~/components/filter'; import Filter, { FilterResult, AdapterResult } from '~/components/filter';
import api, { Job } from './api'; import api, { Job } from './api';
import commonApi from '~/api'; import commonApi from '~/api';
import Image from 'next/image';
// 此函数在构建时被调用 // 此函数在构建时被调用
export async function getServerSideProps() { export async function getServerSideProps() {
return { return {
...@@ -53,7 +52,7 @@ export default function JobServices() { ...@@ -53,7 +52,7 @@ export default function JobServices() {
const rightDom = (item: string) => { const rightDom = (item: string) => {
return ( return (
<div className='right-box-item advertisement' key={item}> <div className='right-box-item advertisement' key={item}>
<Image src={item} alt='error' width={260} height={500} /> <Image src={item} width={260} preview={false} />
</div> </div>
); );
}; };
......
...@@ -86,12 +86,6 @@ export const Box = styled.div` ...@@ -86,12 +86,6 @@ export const Box = styled.div`
} }
} }
} }
.advertisement {
width: 260px;
height: 420px;
background: #ffffff;
border-radius: 6px;
}
.pagination-page { .pagination-page {
text-align: right; text-align: right;
} }
......
...@@ -151,7 +151,7 @@ export default function Mall(props: Props) { ...@@ -151,7 +151,7 @@ export default function Mall(props: Props) {
className={styles.ad} className={styles.ad}
src={item.bannerImg} src={item.bannerImg}
width={189} width={189}
height={364} // height={364}
preview={false} preview={false}
fallback={errImg} fallback={errImg}
></Image> ></Image>
......
import { RightOutlined } from '@ant-design/icons'; import { Col, Empty, Pagination, Row, Spin } from 'antd';
import { Button, Col, Empty, Pagination, Row, Spin } from 'antd';
import styles from './index.module.scss'; import styles from './index.module.scss';
import Image from 'next/image'; import Image from 'next/image';
import { useState, useEffect, useContext } from 'react'; import { useState, useEffect, useContext } from 'react';
...@@ -96,13 +95,13 @@ export default function News(props: Props) { ...@@ -96,13 +95,13 @@ export default function News(props: Props) {
{Moment().format('yyyy-MM-DD')} · {item.newsAuthor} {Moment().format('yyyy-MM-DD')} · {item.newsAuthor}
</div> </div>
</div> </div>
<Button {/*<Button*/}
type='primary' {/* type='primary'*/}
style={{ width: 120, height: 40, flexShrink: 0 }} {/* style={{ width: 120, height: 40, flexShrink: 0 }}*/}
onClick={onGetInfo} {/* onClick={onGetInfo}*/}
> {/*>*/}
获取产品资料 {/* 获取产品资料*/}
</Button> {/*</Button>*/}
</div> </div>
); );
})} })}
......
.bannerWrap{ .bannerWrap{
height: 100px; height: 100px;
position: relative; position: relative;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论