diff --git a/src/pages/Dashboard.tsx b/src/pages/Dashboard.tsx index 64eeb2a..0b7a0fb 100644 --- a/src/pages/Dashboard.tsx +++ b/src/pages/Dashboard.tsx @@ -1,10 +1,14 @@ +import { listTreeUsingGet } from '@/services/pop-b2b2c/pbcCategoryController'; import { dashboardUsingPost } from '@/services/pop-b2b2c/pbcUserRecordLogController'; import { Bar, Pie } from '@ant-design/plots'; -import { PageContainer, ProCard } from '@ant-design/pro-components'; -import { Card, Col, Radio, RadioChangeEvent, Row, Spin, Statistic } from 'antd'; -import React, { useEffect, useState } from 'react'; +import dayjs from 'dayjs'; +import { PageContainer, ProCard, ProForm, ProFormDateRangePicker, ProFormGroup, ProFormInstance, ProFormRadio } from '@ant-design/pro-components'; +import { Card, Col, DatePickerProps, Row, Spin, Statistic } from 'antd'; +import React, { useEffect, useRef, useState } from 'react'; const Welcome: React.FC = () => { + + const ref = useRef>(); const [loading, handleLoadChange] = useState(false); const [data1, setData1] = useState([]); const [data2, setData2] = useState([]); @@ -12,15 +16,15 @@ const Welcome: React.FC = () => { const [data4, setData4] = useState([]); const [pbcRegisterStatical, setPbcRegisterStatical] = useState({ vipNumber: 0, - businessNumber: 0, + businessNumber: 0 }); const [pbcScanCodeStatical, setPbcScanCodeStatical] = useState({ pbcScanNumber: 0, - pbcScanUserNumber: 0, + pbcScanUserNumber: 0 }); const [pbcInteractStatical, setPbcInteractStatical] = useState({ pbcColectNumber: 0, - pbcViewTotalNumber: 0, + pbcViewTotalNumber: 0 }); const config: any = { @@ -32,10 +36,10 @@ const Welcome: React.FC = () => { label: { autoRotate: false, formatter: (value: any) => { - return value.length > 10 ? value.substring(0, 10) + '...' : value; + return value.length > 10 ? value.substring(0,10) + '...' : value; }, - }, - }, + } + } }; const pieConfig = { @@ -53,68 +57,72 @@ const Welcome: React.FC = () => { }, }; - const getData = (type: number) => { - if (type) { - handleLoadChange(true); - dashboardUsingPost({ pbcQueryType: type }) - .then((res) => { - handleLoadChange(false); - if (res.retcode && res.data) { - setPbcRegisterStatical(res.data.pbcRegisterStaticalVO); - setPbcScanCodeStatical(res.data.pbcScanCodeStaticalVO); - setPbcInteractStatical(res.data.pbcInteractStaticalVO); - setData1( - (res.data.pbcBusinessViewStaticalVO.pbcBusinessRankList || []).map((e: any) => { - return { - label: e.pbcBusinessName, - value: e.pbcBusinessVisitCount, - }; - }), - ); - const arr = [ - { - type: '分享', - value: res.data.pbcVisitStaticalVO.pbcShareNumber || 0, - }, - { - type: '扫码', - value: res.data.pbcVisitStaticalVO.pbcScanNumber || 0, - }, - { - type: '链接', - value: res.data.pbcVisitStaticalVO.pbcLinkNumber || 0, - }, - ]; - setData2(arr); - setData3( - (res.data.pbcProductViewStaticalVO.pbcProductViewRank || []).map((e: any) => { - return { - label: e.pbcProductName, - value: e.pbcProductVisitCount, - }; - }), - ); - setData4( - (res.data.pbcProductCollectStaticalVO.pbcProductCollectViewRank || []).map( - (e: any) => { - return { - label: e.pbcProductName, - value: e.pbcProductCollectCount, - }; - }, - ), - ); - } - }) - .catch(() => { - handleLoadChange(true); - }); + const getData = () => { + const param: any = ref.current?.getFieldsValue() + if (param) { + if (param.dateRange) { + param.startDate = dayjs(param.dateRange[0]).format('YYYY-MM-DD') + param.endDate = dayjs(param.dateRange[1]).format('YYYY-MM-DD') + ' 23:59:59' + delete param.dateRange + } + handleLoadChange(true) + dashboardUsingPost(param).then(res => { + handleLoadChange(false) + if (res.retcode && res.data) { + setPbcRegisterStatical(res.data.pbcRegisterStaticalVO) + setPbcScanCodeStatical(res.data.pbcScanCodeStaticalVO) + setPbcInteractStatical(res.data.pbcInteractStaticalVO) + setData1((res.data.pbcBusinessViewStaticalVO.pbcBusinessRankList || []).map((e: any) => { + return { + label: e.pbcBusinessName, + value: e.pbcBusinessVisitCount + } + })) + const arr = [ + { + type: '分享', + value: res.data.pbcVisitStaticalVO.pbcShareNumber || 0 + }, + { + type: '扫码', + value: res.data.pbcVisitStaticalVO.pbcScanNumber || 0 + }, + { + type: '链接', + value: res.data.pbcVisitStaticalVO.pbcLinkNumber || 0 + }, + ] + setData2(arr) + setData3((res.data.pbcProductViewStaticalVO.pbcProductViewRank || []).map((e: any) => { + return { + label: e.pbcProductName, + value: e.pbcProductVisitCount + } + })) + setData4((res.data.pbcProductCollectStaticalVO.pbcProductCollectViewRank || []).map((e: any) => { + return { + label: e.pbcProductName, + value: e.pbcProductCollectCount + } + })) + } + }).catch(() => { + handleLoadChange(true) + }) + } + } + + const disabledDate: DatePickerProps['disabledDate'] = (current, { from }) => { + if (from) { + return Math.abs(current.diff(from, 'months')) >= 3; } + + return false; }; useEffect(() => { - getData(1); - }, []); + getData() + }, []) return ( { }} > - { - getData(value); + + }} + onFinish={async (values) => { + console.log(values) + getData() + }} + > + + + + + - - - + + + - - - + + + - - - + + + diff --git a/src/services/pop-b2b2c/errorController.ts b/src/services/pop-b2b2c/errorController.ts index 5f0967b..f29cc7f 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'; -/** errorHtml GET /error */ -export async function errorHtmlUsingGet(options?: { [key: string]: any }) { - return request('/error', { +/** error GET /error */ +export async function errorUsingGet(options?: { [key: string]: any }) { + return request>('/error', { method: 'GET', ...(options || {}), }); } -/** errorHtml PUT /error */ -export async function errorHtmlUsingPut(options?: { [key: string]: any }) { - return request('/error', { +/** error PUT /error */ +export async function errorUsingPut(options?: { [key: string]: any }) { + return request>('/error', { method: 'PUT', ...(options || {}), }); } -/** errorHtml POST /error */ -export async function errorHtmlUsingPost(options?: { [key: string]: any }) { - return request('/error', { +/** error POST /error */ +export async function errorUsingPost(options?: { [key: string]: any }) { + return request>('/error', { method: 'POST', ...(options || {}), }); } -/** errorHtml DELETE /error */ -export async function errorHtmlUsingDelete(options?: { [key: string]: any }) { - return request('/error', { +/** error DELETE /error */ +export async function errorUsingDelete(options?: { [key: string]: any }) { + return request>('/error', { method: 'DELETE', ...(options || {}), }); } -/** errorHtml PATCH /error */ -export async function errorHtmlUsingPatch(options?: { [key: string]: any }) { - return request('/error', { +/** error PATCH /error */ +export async function errorUsingPatch(options?: { [key: string]: any }) { + return request>('/error', { method: 'PATCH', ...(options || {}), }); diff --git a/src/services/pop-b2b2c/pbcBusinessController.ts b/src/services/pop-b2b2c/pbcBusinessController.ts index 1c47f8d..d6c0139 100644 --- a/src/services/pop-b2b2c/pbcBusinessController.ts +++ b/src/services/pop-b2b2c/pbcBusinessController.ts @@ -17,6 +17,21 @@ export async function adminChangeBusinessInfoUsingPost( }); } +/** 前端卖家管理员修改部分商户信息 前端 POST /b2b2c/pbcbusiness/frontChangeBusinessInfo */ +export async function frontChangeBusinessInfoUsingPost( + body: API.PbcBusinessFrontChangeVO, + options?: { [key: string]: any }, +) { + return request('/b2b2c/pbcbusiness/frontChangeBusinessInfo', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + /** 获取商家海报 商家海报 GET /b2b2c/pbcbusiness/getBusinessPoster */ export async function getBusinessPosterUsingGet(options?: { [key: string]: any }) { return request('/b2b2c/pbcbusiness/getBusinessPoster', { diff --git a/src/services/pop-b2b2c/pbcCategoryController.ts b/src/services/pop-b2b2c/pbcCategoryController.ts index cd40017..00f1cfa 100644 --- a/src/services/pop-b2b2c/pbcCategoryController.ts +++ b/src/services/pop-b2b2c/pbcCategoryController.ts @@ -80,18 +80,21 @@ export async function searchCategoryUsingGet( }); } -/** 前端使用,树形结构获取类目,路径参数是1则前端使用 树形结构获取类目 GET /b2b2c/pbccategory/list/tree/${param0} */ +/** 前端使用,树形结构获取类目,路径参数是1则前端使用 树形结构获取类目 GET /b2b2c/pbccategory/list/tree/${param0}/${param2}/${param1} */ export async function listTreeUsingGet( // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) params: API.listTreeUsingGETParams, options?: { [key: string]: any }, ) { - const { type: param0, ...queryParams } = params; - return request(`/b2b2c/pbccategory/list/tree/${param0}`, { - method: 'GET', - params: { ...queryParams }, - ...(options || {}), - }); + const { pbcBusinessId: param0, pbcUserType: param1, type: param2, ...queryParams } = params; + return request( + `/b2b2c/pbccategory/list/tree/${param0}/${param2}/${param1}`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }, + ); } /** 后台保存或者修改类目 保存或者修改类目 POST /b2b2c/pbccategory/saveOrUpdateCategory */ diff --git a/src/services/pop-b2b2c/pbcSmsController.ts b/src/services/pop-b2b2c/pbcSmsController.ts index 50588f1..ede3b06 100644 --- a/src/services/pop-b2b2c/pbcSmsController.ts +++ b/src/services/pop-b2b2c/pbcSmsController.ts @@ -31,3 +31,11 @@ export async function getVerificationCodeUsingGet( ...(options || {}), }); } + +/** 获得手机发送状态 短信 GET /b2b2c/pbcsms/querySmsReport */ +export async function querySmsReportUsingGet(options?: { [key: string]: any }) { + return request('/b2b2c/pbcsms/querySmsReport', { + method: 'GET', + ...(options || {}), + }); +} diff --git a/src/services/pop-b2b2c/pbcUserBusinessController.ts b/src/services/pop-b2b2c/pbcUserBusinessController.ts index 69b5ce2..4a91883 100644 --- a/src/services/pop-b2b2c/pbcUserBusinessController.ts +++ b/src/services/pop-b2b2c/pbcUserBusinessController.ts @@ -17,19 +17,19 @@ export async function agreeMemberApplicationUsingGet( }); } -/** 买家已通过的商户会员列表 列表 GET /b2b2c/pbcuserbusiness/businessrecordlist */ -export async function businessRecordListUsingGet( - // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) - params: API.businessRecordListUsingGETParams, +/** 买家的商户会员列表,可以搜索已通过和未通过的商户 列表 POST /b2b2c/pbcuserbusiness/businessrecordlist */ +export async function businessRecordListUsingPost( + body: API.PbcUserBusinessSearchVO, options?: { [key: string]: any }, ) { return request( '/b2b2c/pbcuserbusiness/businessrecordlist', { - method: 'GET', - params: { - ...params, + method: 'POST', + headers: { + 'Content-Type': 'application/json', }, + data: body, ...(options || {}), }, ); @@ -53,6 +53,21 @@ export async function businessUserRecordPageUsingPost( ); } +/** 买家删除收藏的商户 单个 GET /b2b2c/pbcuserbusiness/buyerDeleteBusinessRecord */ +export async function buyerDeleteBusinessRecordUsingGet( + // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) + params: API.buyerDeleteBusinessRecordUsingGETParams, + options?: { [key: string]: any }, +) { + return request('/b2b2c/pbcuserbusiness/buyerDeleteBusinessRecord', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + /** 切换登录用户的商户 切换 GET /b2b2c/pbcuserbusiness/changeuserdefaultbusiness */ export async function changeUserDefaultBusinessUsingGet( // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) diff --git a/src/services/pop-b2b2c/pbcUserMessageController.ts b/src/services/pop-b2b2c/pbcUserMessageController.ts index cb5a237..af1b49c 100644 --- a/src/services/pop-b2b2c/pbcUserMessageController.ts +++ b/src/services/pop-b2b2c/pbcUserMessageController.ts @@ -35,6 +35,24 @@ export async function frontPbcUserMessagePageUsingPost( ); } +/** frontPbcUserMessagePageNew 分页,按照搜索条件查询出留言记录分页,前端专用 POST /b2b2c/pbcusermesssage/frontPbcUserMessagePageNew */ +export async function frontPbcUserMessagePageNewUsingPost( + body: API.PbcUserMessageVO, + options?: { [key: string]: any }, +) { + return request( + '/b2b2c/pbcusermesssage/frontPbcUserMessagePageNew', + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }, + ); +} + /** 留言详情 使用主题id查询主题的回复详情 GET /b2b2c/pbcusermesssage/getmessagedetail */ export async function getMessageDetailUsingGet( // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) diff --git a/src/services/pop-b2b2c/typings.d.ts b/src/services/pop-b2b2c/typings.d.ts index e55bf2d..adcd55f 100644 --- a/src/services/pop-b2b2c/typings.d.ts +++ b/src/services/pop-b2b2c/typings.d.ts @@ -275,9 +275,9 @@ declare namespace API { pbcId: number; }; - type businessRecordListUsingGETParams = { - /** state */ - state?: number; + type buyerDeleteBusinessRecordUsingGETParams = { + /** pbcId */ + pbcId: number; }; type categoryInfoUsingGETParams = { @@ -552,6 +552,10 @@ declare namespace API { }; type listTreeUsingGETParams = { + /** pbcBusinessId */ + pbcBusinessId: number; + /** pbcUserType */ + pbcUserType: number; /** type */ type: number; }; @@ -842,6 +846,8 @@ declare namespace API { pbcBusinessContact?: string; /** 商户联系人电话 */ pbcBusinessContactMobile?: string; + /** 商户门牌号, 新增字段 */ + pbcBusinessDoorLabel?: string; /** 商户邮箱 */ pbcBusinessEmail?: string; /** 商户负责人 */ @@ -913,6 +919,8 @@ declare namespace API { pbcBusinessContact?: string; /** 商户联系人电话 */ pbcBusinessContactMobile?: string; + /** 商户门牌号, 新增字段 */ + pbcBusinessDoorLabel?: string; /** 商户邮箱 */ pbcBusinessEmail?: string; /** 商户负责人 */ @@ -965,11 +973,45 @@ declare namespace API { pbcUpdateByUserName?: string; }; + type PbcBusinessFrontChangeVO = { + /** 商户对公账户 */ + pbcBusinessAccount?: string; + /** 商户地址 */ + pbcBusinessAddress?: string; + /** 商户区域 */ + pbcBusinessArea?: string; + /** 商户对公账户银行 */ + pbcBusinessBank?: string; + /** 商户城市 */ + pbcBusinessCity?: string; + /** 商户联系人 */ + pbcBusinessContact?: string; + /** 商户手机号 */ + pbcBusinessContactMobile?: string; + /** 商户门牌号,新增字段 */ + pbcBusinessDoorLabel?: string; + /** 商户邮箱 */ + pbcBusinessEmail?: string; + /** 商户图片 */ + pbcBusinessImage?: string; + /** 商户简介 */ + pbcBusinessIntroduction?: string; + /** 商户logo */ + pbcBusinessLogo?: string; + /** 商户主营范围 */ + pbcBusinessMainCategory?: string; + /** 商户省份 */ + pbcBusinessProvince?: string; + /** 主键 */ + pbcId?: number; + }; + type PbcBusinessIndexDTO = { pbcBusinessCode?: string; pbcId?: number; /** 来源:微信分享,链接、二维码 */ pbcSourceType?: string; + /** 分享人的id */ shareUserId?: number; }; @@ -1237,11 +1279,14 @@ declare namespace API { }; type PbcDashBoardDTO = { + endDate?: string; pbcCategoryType?: number; pbcQueryType?: number; + startDate?: string; }; type PbcImageSearchDTO = { + pbcBusinessId?: number; pbcImageUrl?: string; }; @@ -1361,6 +1406,8 @@ declare namespace API { pbcUpdateByUserName?: string; /** 商品id */ productId?: number; + /** 缩略图地址 */ + thumbnailUrl?: string; }; type PbcProductDTO = { @@ -1456,6 +1503,8 @@ declare namespace API { pbcState?: number; /** 热销类型,类型包括new:新品、main:主推、hotSale:热卖,必须 */ pbcSystemTypeHotProduct?: string; + /** 用户类型 */ + pbcUserType?: number; /** 排序方式 asc desc */ sort?: string; /** 排序列,用表字段名称 */ @@ -1621,6 +1670,8 @@ declare namespace API { pbcBusinessLogo?: string; /** 商户名称 */ pbcBusinessName?: string; + /** 商家员工id */ + pbcBusinessUserId?: number; /** 创建时间 */ pbcCreateAt?: string; /** 创建人 */ @@ -1668,6 +1719,13 @@ declare namespace API { pbcUserBusinessList?: PbcUserBusiness_[]; }; + type PbcUserBusinessSearchVO = { + /** 商户名称 */ + keyword?: string; + /** 是否通过会员申请,1是通过,0是未通过 */ + state?: number; + }; + type PbcUserCollect = { /** 创建时间 */ pbcCreateAt?: string; @@ -1723,6 +1781,8 @@ declare namespace API { pbcBusinessId?: number; /** 商户logo */ pbcBusinessLogo?: string; + /** 商户认证状态,false是未认证,true是已认证 */ + pbcBusinessState?: boolean; pbcBusinessTeam?: PbcBusinessTeam_; /** 创建时间 */ pbcCreateAt?: string; @@ -1740,16 +1800,10 @@ declare namespace API { pbcUpdateBy?: number; /** 更新人 */ pbcUpdateByUserName?: string; - /** 企业名称 */ - pbcUserCompanyName?: string; - /** 封面图 */ - pbcUserCoverImage?: string; /** 用户邮箱 */ pbcUserEmail?: string; /** 用户头像 */ pbcUserImage?: string; - /** 简介 */ - pbcUserIntroduction?: string; /** 用户手机号 */ pbcUserMobile?: string; /** 用户姓名 */ @@ -1768,6 +1822,8 @@ declare namespace API { pbcUserSourceType?: string; /** 用户来源绑定的分享源 */ pbcUserSourceUserId?: number; + /** 用户分享源的昵称 */ + pbcUserSourceUserNickName?: string; /** 0表示商户,1表示会员, 2管理员 */ pbcUserType?: number; /** 模糊搜索条件,可以是用户名、手机号 */ @@ -1872,6 +1928,17 @@ declare namespace API { pbcUpdateByUserName?: string; }; + type PbcUserMessageVO = { + /** 当前页 */ + current?: number; + /** 每页条数 */ + pageSize?: number; + /** 回复状态,0表示未被商家回复,1表示已被商家回复 */ + pbcReplyState?: number; + /** 留言标题 */ + pbcTitle?: string; + }; + type PbcUserRegisterDTO = { /** 商户id */ pbcBusinessId?: number; @@ -1896,6 +1963,8 @@ declare namespace API { pbcBusinessId?: number; /** 商户logo */ pbcBusinessLogo?: string; + /** 商户认证状态,false是未认证,true是已认证 */ + pbcBusinessState?: boolean; pbcBusinessTeam?: PbcBusinessTeam_; /** 创建时间 */ pbcCreateAt?: string; @@ -1913,16 +1982,10 @@ declare namespace API { pbcUpdateBy?: number; /** 更新人 */ pbcUpdateByUserName?: string; - /** 企业名称 */ - pbcUserCompanyName?: string; - /** 封面图 */ - pbcUserCoverImage?: string; /** 用户邮箱 */ pbcUserEmail?: string; /** 用户头像 */ pbcUserImage?: string; - /** 简介 */ - pbcUserIntroduction?: string; /** 用户手机号 */ pbcUserMobile?: string; /** 用户姓名 */ @@ -1941,6 +2004,8 @@ declare namespace API { pbcUserSourceType?: string; /** 用户来源绑定的分享源 */ pbcUserSourceUserId?: number; + /** 用户分享源的昵称 */ + pbcUserSourceUserNickName?: string; /** 0表示商户,1表示会员, 2管理员 */ pbcUserType?: number; }; @@ -1952,6 +2017,8 @@ declare namespace API { pbcBusinessId?: number; /** 商户logo */ pbcBusinessLogo?: string; + /** 商户认证状态,false是未认证,true是已认证 */ + pbcBusinessState?: boolean; pbcBusinessTeam?: PbcBusinessTeam_; /** 创建时间 */ pbcCreateAt?: string; @@ -1969,16 +2036,10 @@ declare namespace API { pbcUpdateBy?: number; /** 更新人 */ pbcUpdateByUserName?: string; - /** 企业名称 */ - pbcUserCompanyName?: string; - /** 封面图 */ - pbcUserCoverImage?: string; /** 用户邮箱 */ pbcUserEmail?: string; /** 用户头像 */ pbcUserImage?: string; - /** 简介 */ - pbcUserIntroduction?: string; /** 用户手机号 */ pbcUserMobile?: string; /** 用户姓名 */ @@ -1997,6 +2058,8 @@ declare namespace API { pbcUserSourceType?: string; /** 用户来源绑定的分享源 */ pbcUserSourceUserId?: number; + /** 用户分享源的昵称 */ + pbcUserSourceUserNickName?: string; /** 0表示商户,1表示会员, 2管理员 */ pbcUserType?: number; /** 来源人姓名 */ @@ -2201,14 +2264,8 @@ declare namespace API { type UserDTO = { /** 用户id */ pbcId?: number; - /** 企业名称 */ - pbcUserCompanyName?: string; - /** 封面图 */ - pbcUserCoverImage?: string; /** 用户头像 */ pbcUserImage?: string; - /** 简介 */ - pbcUserIntroduction?: string; /** 用户姓名 */ pbcUserName?: string; /** 用户昵称 */