diff --git a/src/constants.ts b/src/constants.ts index d447e5f..451000a 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -59,12 +59,16 @@ const Constants = { }, 2: { text: '已下架', - status: 'Error' + status: 'Warning' }, 3: { text: '待审核', status: 'default' }, + 4: { + text: '审核失败', + status: 'Error' + }, }, /** * 商户类别 diff --git a/src/pages/BusinessList/detail.tsx b/src/pages/BusinessList/detail.tsx index 8c07e42..2c2b998 100644 --- a/src/pages/BusinessList/detail.tsx +++ b/src/pages/BusinessList/detail.tsx @@ -1,37 +1,18 @@ import React, { useEffect, useState } from 'react'; -import { Button, Descriptions, Image, Switch, Tag, message } from 'antd'; +import { Button, Image, Input, Tag, message } from 'antd'; import { PageContainer } from '@ant-design/pro-layout'; import { Access, useAccess, useParams } from '@umijs/max'; -import { CheckCircleOutlined, FormOutlined, InfoCircleOutlined } from '@ant-design/icons'; -import { getPbcBusinessByIdUsingPost, updateBusinessRecordLevelUsingGet, updateBusinessRecordStateUsingGet } from '@/services/pop-b2b2c/pbcBusinessController'; -import { ModalForm, ProCard, ProFormSelect } from '@ant-design/pro-components'; - - -const handleUpdateState = async (id: string, state: number) => { - const hide = message.loading('正在保存'); - if (!id) return false; - try { - const msg = await updateBusinessRecordStateUsingGet({ pbcId: id, state: state }); - hide(); - if (msg.retcode) { - message.success(!id ? '新增成功!' : '保存成功!'); - return true; - } - message.error(msg.retmsg); - return false; - } catch (error) { - hide(); - message.error(!id ? '新增失败,请重试!' : '保存失败,请重试!'); - return false; - } -}; +import { CheckCircleOutlined, InfoCircleOutlined, PlusCircleOutlined } from '@ant-design/icons'; +import { getPbcBusinessByIdUsingPost } from '@/services/pop-b2b2c/pbcBusinessController'; +import { ProCard, ProDescriptions, ProFormUploadButton } from '@ant-design/pro-components'; +import Constants from '@/constants'; +import { RcFile } from 'antd/es/upload'; const Detail: React.FC<{}> = () => { const params = useParams(); const access: any = useAccess(); const [info, setInfo] = useState({}); - const [isModalOpen, setIsModalOpen] = useState(false); const getInfo = () => { if (params.id) { @@ -61,7 +42,7 @@ const Detail: React.FC<{}> = () => { ]} > - + 基本信息 {info.pbcBusinessState === 1 ? } color="success"> 已认证 @@ -70,88 +51,109 @@ const Detail: React.FC<{}> = () => { 未认证 } } column={3}> - {info.pbcBusinessName} - {info.pbcBusinessType} - - - { - const success = await handleUpdateState(info.pbcId || '', value ? 1 : 2 ); - if (success) { - getInfo() - } - }} - /> - - - {info.pbcBusinessContact} - {info.pbcBusinessContactMobile} - - {info.pbcBusinessLevel} - - { - setIsModalOpen(true) - }} /> - - - + {info.pbcBusinessName} + {info.pbcBusinessType} + {info.pbcState === 1} + {info.pbcBusinessContact} + {info.pbcBusinessContactMobile} + {info.pbcBusinessLevel} + - - {info.pbcBusinessHead} - {info.pbcBusinessHeadUserNo} - {info.pbcBusinessStartDate} - {info.pbcBusinessBank} - {info.pbcBusinessAccount} - {info.pbcBusinessMainCategory} - - - - - - setIsModalOpen(false), - }} - initialValues={{ - pbcBusinessLevel: info.pbcBusinessLevel - }} - onFinish={async (value: any) => { - console.log(value) - if (params.id) { - await updateBusinessRecordLevelUsingGet({pbcId: params.id, businessLevel: value.pbcBusinessLevel}).then(res => { - if (res.retcode) { - message.success("修改成功") - getInfo() - setIsModalOpen(false) - } else { - message.error(res.retmsg) - } - }) - } - }} - > - { + return + }, + renderFormItem: () => { + return } + title={
点击上传图片
} + max={1} + fieldProps={{ + name: 'file', + accept: 'image/*', + listType: 'picture-card', + headers: { + authorization: localStorage.getItem('token') ?? '', + }, + onPreview: async (file) => { + if (file.uid === '-1') { + window.open(file.url); + } + if (file.response && file.response.retcode) { + window.open(file.response.data); + } + }, + }} + action={process.env.BASE_URL + '/oss/imgUpload'} + />; + }, }, ]} - options={['1级', '2级', '3级', '4级', '5级']} - width="md" - name="pbcBusinessLevel" - /> -
+ bordered + title="工商信息" + > + + ); }; diff --git a/src/pages/MessageList/index.tsx b/src/pages/MessageList/index.tsx index f118be5..16b3f4a 100644 --- a/src/pages/MessageList/index.tsx +++ b/src/pages/MessageList/index.tsx @@ -59,6 +59,13 @@ const TableList: React.FC<{}> = () => { actionRef={actionRef} request={(param: any) => { const queryParam = handlePageQuery(param); + if (queryParam.filters) { + queryParam.filters.push({ + key: 'pbcReplyToId'.replace(/([A-Z])/g, '_$1').toLowerCase(), + value: "", + action: 'isnull', + }) + } return fetchData(queryParam); }} rowKey="pbcId" diff --git a/src/pages/ProductList/index.tsx b/src/pages/ProductList/index.tsx index dd67810..bbc3163 100644 --- a/src/pages/ProductList/index.tsx +++ b/src/pages/ProductList/index.tsx @@ -71,7 +71,7 @@ const TableList: React.FC<{}> = () => { }, { title: '所属商户', - dataIndex: 'pbcBusinessId', + dataIndex: 'pbcBusinessName', search: false }, { diff --git a/src/services/pop-b2b2c/errorController.ts b/src/services/pop-b2b2c/errorController.ts index f29cc7f..5f0967b 100644 --- a/src/services/pop-b2b2c/errorController.ts +++ b/src/services/pop-b2b2c/errorController.ts @@ -2,41 +2,41 @@ /* eslint-disable */ import request from '@/utils/request'; -/** error GET /error */ -export async function errorUsingGet(options?: { [key: string]: any }) { - return request>('/error', { +/** errorHtml GET /error */ +export async function errorHtmlUsingGet(options?: { [key: string]: any }) { + return request('/error', { method: 'GET', ...(options || {}), }); } -/** error PUT /error */ -export async function errorUsingPut(options?: { [key: string]: any }) { - return request>('/error', { +/** errorHtml PUT /error */ +export async function errorHtmlUsingPut(options?: { [key: string]: any }) { + return request('/error', { method: 'PUT', ...(options || {}), }); } -/** error POST /error */ -export async function errorUsingPost(options?: { [key: string]: any }) { - return request>('/error', { +/** errorHtml POST /error */ +export async function errorHtmlUsingPost(options?: { [key: string]: any }) { + return request('/error', { method: 'POST', ...(options || {}), }); } -/** error DELETE /error */ -export async function errorUsingDelete(options?: { [key: string]: any }) { - return request>('/error', { +/** errorHtml DELETE /error */ +export async function errorHtmlUsingDelete(options?: { [key: string]: any }) { + return request('/error', { method: 'DELETE', ...(options || {}), }); } -/** error PATCH /error */ -export async function errorUsingPatch(options?: { [key: string]: any }) { - return request>('/error', { +/** errorHtml PATCH /error */ +export async function errorHtmlUsingPatch(options?: { [key: string]: any }) { + return request('/error', { method: 'PATCH', ...(options || {}), }); diff --git a/src/services/pop-b2b2c/pbcBusinessApprovalController.ts b/src/services/pop-b2b2c/pbcBusinessApprovalController.ts index 36f335e..5051bbe 100644 --- a/src/services/pop-b2b2c/pbcBusinessApprovalController.ts +++ b/src/services/pop-b2b2c/pbcBusinessApprovalController.ts @@ -65,6 +65,14 @@ export async function approvalSignYUsingGet( }); } +/** 获取卖家认证状态 获取卖家认证状态 GET /b2b2c/pbcbusinessapproval/getBusinessConfirmState */ +export async function getBusinessConfirmStateUsingGet(options?: { [key: string]: any }) { + return request('/b2b2c/pbcbusinessapproval/getBusinessConfirmState', { + method: 'GET', + ...(options || {}), + }); +} + /** getPage 分页,按照搜索条件查询出商户认证申请表记录(用后面的分页) POST /b2b2c/pbcbusinessapproval/getpage */ export async function getPageUsingPost( body: API.PbcBusinessPageDTO, diff --git a/src/services/pop-b2b2c/pbcBusinessController.ts b/src/services/pop-b2b2c/pbcBusinessController.ts index 368f0e8..18f309f 100644 --- a/src/services/pop-b2b2c/pbcBusinessController.ts +++ b/src/services/pop-b2b2c/pbcBusinessController.ts @@ -2,6 +2,21 @@ /* eslint-disable */ import request from '@/utils/request'; +/** 后台修改商户信息 后台 POST /b2b2c/pbcbusiness/adminChangeBusinessInfo */ +export async function adminChangeBusinessInfoUsingPost( + body: API.PbcBusiness, + options?: { [key: string]: any }, +) { + return request('/b2b2c/pbcbusiness/adminChangeBusinessInfo', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + /** getPage 分页,按照搜索条件查询出商户表记录(别用这个) POST /b2b2c/pbcbusiness/getpage */ export async function getPageUsingPost1( body: API.PbcBusinessPageDTO, diff --git a/src/services/pop-b2b2c/pbcCategoryController.ts b/src/services/pop-b2b2c/pbcCategoryController.ts index 00c8242..ac97f16 100644 --- a/src/services/pop-b2b2c/pbcCategoryController.ts +++ b/src/services/pop-b2b2c/pbcCategoryController.ts @@ -65,7 +65,7 @@ export async function searchCategoryUsingGet( }); } -/** 前端后台都使用,树形结构获取类目,路径参数是1则前端使用,2后台使用 树形结构获取类目 GET /b2b2c/pbccategory/list/tree/${param0} */ +/** 前端使用,树形结构获取类目,路径参数是1则前端使用 树形结构获取类目 GET /b2b2c/pbccategory/list/tree/${param0} */ export async function listTreeUsingGet( // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) params: API.listTreeUsingGETParams, diff --git a/src/services/pop-b2b2c/pbcOssImgController.ts b/src/services/pop-b2b2c/pbcOssImgController.ts index 659af10..5d3a434 100644 --- a/src/services/pop-b2b2c/pbcOssImgController.ts +++ b/src/services/pop-b2b2c/pbcOssImgController.ts @@ -207,6 +207,33 @@ export async function headFileUploadUsingPatch( }); } +/** 传入身份证图片,获取身份证号码 识别 POST /oss/getIdCardByPic */ +export async function getIdCardByPicUsingPost(body: API.PbcRole, options?: { [key: string]: any }) { + return request('/oss/getIdCardByPic', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** 传入商户的认证图url,获取商户社会统一信用代码 识别 POST /oss/getPbcUnifiedSocialCreditCodeByPic */ +export async function getPbcUnifiedSocialCreditCodeByPicUsingPost( + body: API.PbcRole, + options?: { [key: string]: any }, +) { + return request('/oss/getPbcUnifiedSocialCreditCodeByPic', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + /** headImgUpload GET /oss/imgUpload */ export async function headImgUploadUsingGet( // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) @@ -435,3 +462,249 @@ export async function orcIdCardUsingPost(body: API.PbcRole, options?: { [key: st ...(options || {}), }); } + +/** 评论带图 评论带图 POST /oss/uploadCommentImage */ +export async function uploadCommentImageUsingPost( + // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) + params: API.uploadCommentImageUsingPOSTParams, + body: {}, + file?: File, + options?: { [key: string]: any }, +) { + const formData = new FormData(); + + if (file) { + formData.append('file', file); + } + + Object.keys(body).forEach((ele) => { + const item = (body as any)[ele]; + + if (item !== undefined && item !== null) { + if (typeof item === 'object' && !(item instanceof File)) { + if (item instanceof Array) { + item.forEach((f) => formData.append(ele, f || '')); + } else { + formData.append(ele, JSON.stringify(item)); + } + } else { + formData.append(ele, item); + } + } + }); + + return request('/oss/uploadCommentImage', { + method: 'POST', + params: { + ...params, + }, + data: formData, + requestType: 'form', + ...(options || {}), + }); +} + +/** 用户头像 用户头像 POST /oss/uploadHeadImage */ +export async function uploadHeadImageUsingPost( + // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) + params: API.uploadHeadImageUsingPOSTParams, + body: {}, + file?: File, + options?: { [key: string]: any }, +) { + const formData = new FormData(); + + if (file) { + formData.append('file', file); + } + + Object.keys(body).forEach((ele) => { + const item = (body as any)[ele]; + + if (item !== undefined && item !== null) { + if (typeof item === 'object' && !(item instanceof File)) { + if (item instanceof Array) { + item.forEach((f) => formData.append(ele, f || '')); + } else { + formData.append(ele, JSON.stringify(item)); + } + } else { + formData.append(ele, item); + } + } + }); + + return request('/oss/uploadHeadImage', { + method: 'POST', + params: { + ...params, + }, + data: formData, + requestType: 'form', + ...(options || {}), + }); +} + +/** 商户LOGO、身份证正反面、营业执照 商户LOGO、身份证正反面、营业执照 POST /oss/uploadInfoImage */ +export async function uploadInfoImageUsingPost( + // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) + params: API.uploadInfoImageUsingPOSTParams, + body: {}, + file?: File, + options?: { [key: string]: any }, +) { + const formData = new FormData(); + + if (file) { + formData.append('file', file); + } + + Object.keys(body).forEach((ele) => { + const item = (body as any)[ele]; + + if (item !== undefined && item !== null) { + if (typeof item === 'object' && !(item instanceof File)) { + if (item instanceof Array) { + item.forEach((f) => formData.append(ele, f || '')); + } else { + formData.append(ele, JSON.stringify(item)); + } + } else { + formData.append(ele, item); + } + } + }); + + return request('/oss/uploadInfoImage', { + method: 'POST', + params: { + ...params, + }, + data: formData, + requestType: 'form', + ...(options || {}), + }); +} + +/** 商品主图、商品详细图、商品各颜色图片 商品主图、商品详细图、商品各颜色图片 POST /oss/uploadProductImage */ +export async function uploadProductImageUsingPost( + // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) + params: API.uploadProductImageUsingPOSTParams, + body: {}, + file?: File, + options?: { [key: string]: any }, +) { + const formData = new FormData(); + + if (file) { + formData.append('file', file); + } + + Object.keys(body).forEach((ele) => { + const item = (body as any)[ele]; + + if (item !== undefined && item !== null) { + if (typeof item === 'object' && !(item instanceof File)) { + if (item instanceof Array) { + item.forEach((f) => formData.append(ele, f || '')); + } else { + formData.append(ele, JSON.stringify(item)); + } + } else { + formData.append(ele, item); + } + } + }); + + return request('/oss/uploadProductImage', { + method: 'POST', + params: { + ...params, + }, + data: formData, + requestType: 'form', + ...(options || {}), + }); +} + +/** 按上传图片搜索商品 按上传图片搜索商品 POST /oss/upLoadSearchImage */ +export async function upLoadSearchImageUsingPost( + // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) + params: API.upLoadSearchImageUsingPOSTParams, + body: {}, + file?: File, + options?: { [key: string]: any }, +) { + const formData = new FormData(); + + if (file) { + formData.append('file', file); + } + + Object.keys(body).forEach((ele) => { + const item = (body as any)[ele]; + + if (item !== undefined && item !== null) { + if (typeof item === 'object' && !(item instanceof File)) { + if (item instanceof Array) { + item.forEach((f) => formData.append(ele, f || '')); + } else { + formData.append(ele, JSON.stringify(item)); + } + } else { + formData.append(ele, item); + } + } + }); + + return request('/oss/upLoadSearchImage', { + method: 'POST', + params: { + ...params, + }, + data: formData, + requestType: 'form', + ...(options || {}), + }); +} + +/** 商家用户简介里的图片 商家用户简介里的图片 POST /oss/uploadUserInfoImage */ +export async function uploadUserInfoImageUsingPost( + // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) + params: API.uploadUserInfoImageUsingPOSTParams, + body: {}, + file?: File, + options?: { [key: string]: any }, +) { + const formData = new FormData(); + + if (file) { + formData.append('file', file); + } + + Object.keys(body).forEach((ele) => { + const item = (body as any)[ele]; + + if (item !== undefined && item !== null) { + if (typeof item === 'object' && !(item instanceof File)) { + if (item instanceof Array) { + item.forEach((f) => formData.append(ele, f || '')); + } else { + formData.append(ele, JSON.stringify(item)); + } + } else { + formData.append(ele, item); + } + } + }); + + return request('/oss/uploadUserInfoImage', { + method: 'POST', + params: { + ...params, + }, + data: formData, + requestType: 'form', + ...(options || {}), + }); +} diff --git a/src/services/pop-b2b2c/pbcProductController.ts b/src/services/pop-b2b2c/pbcProductController.ts index 1573d91..373ca87 100644 --- a/src/services/pop-b2b2c/pbcProductController.ts +++ b/src/services/pop-b2b2c/pbcProductController.ts @@ -168,12 +168,12 @@ export async function productDetailForAdminUsingGet( }); } -/** 通过图片搜索商品 通过图片搜索商品 POST /b2b2c/pbcproduct/searchbyimage */ +/** 通过图片搜索商品,前端使用 通过图片搜索商品 POST /b2b2c/pbcproduct/searchbyimage */ export async function searchByImageUsingPost( body: API.PbcImageSearchDTO, options?: { [key: string]: any }, ) { - return request('/b2b2c/pbcproduct/searchbyimage', { + return request('/b2b2c/pbcproduct/searchbyimage', { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/src/services/pop-b2b2c/pbcUserCollectController.ts b/src/services/pop-b2b2c/pbcUserCollectController.ts index 8e24ed6..fe258d8 100644 --- a/src/services/pop-b2b2c/pbcUserCollectController.ts +++ b/src/services/pop-b2b2c/pbcUserCollectController.ts @@ -2,17 +2,17 @@ /* eslint-disable */ import request from '@/utils/request'; -/** 添加收藏 添加收藏 GET /b2b2c/pbcusercollect/addusercollect */ -export async function addUserCollectUsingGet( - // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) - params: API.addUserCollectUsingGETParams, +/** 添加收藏 添加收藏 POST /b2b2c/pbcusercollect/addusercollect */ +export async function addUserCollectUsingPost( + body: API.PbcUserCollectDTO, options?: { [key: string]: any }, ) { return request('/b2b2c/pbcusercollect/addusercollect', { - method: 'GET', - params: { - ...params, + method: 'POST', + headers: { + 'Content-Type': 'application/json', }, + data: body, ...(options || {}), }); } diff --git a/src/services/pop-b2b2c/typings.d.ts b/src/services/pop-b2b2c/typings.d.ts index 7ff3796..5b1de63 100644 --- a/src/services/pop-b2b2c/typings.d.ts +++ b/src/services/pop-b2b2c/typings.d.ts @@ -1,9 +1,4 @@ declare namespace API { - type addUserCollectUsingGETParams = { - /** productId */ - productId: string; - }; - type agreeMemberApplicationUsingGETParams = { /** businessUserId */ businessUserId: string; @@ -964,6 +959,8 @@ declare namespace API { type PbcBusinessIndexDTO = { pbcBusinessCode?: string; pbcId?: string; + /** 来源:微信分享,链接、二维码 */ + pbcSourceType?: string; shareUserId?: string; }; @@ -995,6 +992,7 @@ declare namespace API { }; type PbcBusinessStaticalDTO = { + /** 按天:1,按月:2 */ pbcQueryType?: number; pbcUserId?: string; }; @@ -1024,6 +1022,8 @@ declare namespace API { pbcUpdateByUserName?: string; /** 用户id */ pbcUserId?: string; + /** 商家海报地址, 此处为海报链接 */ + pbc_business_user_post_url?: string; }; type PbcBusinessTeamDTO = { @@ -1237,21 +1237,13 @@ declare namespace API { }; type PbcInteractStaticalVO = { - pbcColectNumber?: number; - pbcViewTotalNumber?: number; + pbcColectNumber?: string; + pbcViewTotalNumber?: string; }; type PbcProduct = { - /** 颜色列表 */ - colorDataList?: PbcProductCommonData[]; - /** 颜色名称,列表时返回给前端,格式如红色/绿色 */ - colorName?: string; - /** 是否可见,针对的是私密商品,如果查询对象是会员且会员无权限查看,值为0,前端应不可点进去查看且图片是默认的,值是1表示可见 */ - isVisible?: number; /** 商户id */ pbcBusinessId?: string; - /** 商户名称 */ - pbcBusinessName?: string; /** 创建时间 */ pbcCreateAt?: string; /** 创建人 */ @@ -1314,8 +1306,6 @@ declare namespace API { pbcUpdateBy?: string; /** 更新人 */ pbcUpdateByUserName?: string; - /** 规格列表,查询返回时,与颜色列表分开 */ - productCommonDataList?: PbcProductCommonData[]; }; type PbcProductCollectCountVO = { @@ -1473,8 +1463,8 @@ declare namespace API { }; type PbcRegisterStaticalVO = { - businessNumber?: number; - vipNumber?: number; + businessNumber?: string; + vipNumber?: string; }; type PbcRole = { @@ -1616,6 +1606,11 @@ declare namespace API { pbcUserId?: string; }; + type PbcUserCollectDTO = { + pbcBusinessId?: string; + pbcProductId?: string; + }; + type PbcUserCollectPageDTO = { /** 当前页 */ current?: number; @@ -1694,14 +1689,14 @@ declare namespace API { }; type PbcUserLoginDTO = { + /** 验证码 */ + code?: string; /** 用户邮箱 */ pbcUserEmail?: string; /** 用户手机号 */ pbcUserMobile?: string; /** 用户密码 */ pbcUserPassword?: string; - /** 验证码 */ - pbcValidCode?: string; }; type PbcUserMessage = { @@ -1727,6 +1722,7 @@ declare namespace API { pbcMessageImages?: string; /** 主题id */ pbcMessageMainId?: string; + pbcProduct?: PbcProduct; /** 商品id */ pbcProductId?: string; /** 回复状态,0表示未被商家回复,1表示已被商家回复 */ @@ -1953,9 +1949,9 @@ declare namespace API { }; type PbcVisitStaticalVO = { - pbcLinkNumber?: number; - pbcScanNumber?: number; - pbcShareNumber?: number; + pbcLinkNumber?: string; + pbcScanNumber?: string; + pbcShareNumber?: string; }; type posterUsingGETParams = { @@ -2065,6 +2061,36 @@ declare namespace API { state: number; }; + type uploadCommentImageUsingPOSTParams = { + /** base64 */ + base64?: string; + }; + + type uploadHeadImageUsingPOSTParams = { + /** base64 */ + base64?: string; + }; + + type uploadInfoImageUsingPOSTParams = { + /** base64 */ + base64?: string; + }; + + type uploadProductImageUsingPOSTParams = { + /** base64 */ + base64?: string; + }; + + type upLoadSearchImageUsingPOSTParams = { + /** base64 */ + base64?: string; + }; + + type uploadUserInfoImageUsingPOSTParams = { + /** base64 */ + base64?: string; + }; + type UserAddDTO = { /** 用户id */ pbcId?: string;