diff --git a/src/api/shop/shopDealerRecord/index.ts b/src/api/shop/shopDealerRecord/index.ts new file mode 100644 index 0000000..160ac75 --- /dev/null +++ b/src/api/shop/shopDealerRecord/index.ts @@ -0,0 +1,105 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { ShopDealerRecord, ShopDealerRecordParam } from './model'; + +/** + * 分页查询客户跟进情况 + */ +export async function pageShopDealerRecord(params: ShopDealerRecordParam) { + const res = await request.get>>( + '/shop/shop-dealer-record/page', + { + params + } + ); + if (res.code === 0) { + return res.data; + } + return Promise.reject(new Error(res.message)); +} + +/** + * 查询客户跟进情况列表 + */ +export async function listShopDealerRecord(params?: ShopDealerRecordParam) { + const res = await request.get>( + '/shop/shop-dealer-record', + { + params + } + ); + if (res.code === 0 && res.data) { + return res.data; + } + return Promise.reject(new Error(res.message)); +} + +/** + * 添加客户跟进情况 + */ +export async function addShopDealerRecord(data: ShopDealerRecord) { + const res = await request.post>( + '/shop/shop-dealer-record', + data + ); + if (res.code === 0) { + return res.message; + } + return Promise.reject(new Error(res.message)); +} + +/** + * 修改客户跟进情况 + */ +export async function updateShopDealerRecord(data: ShopDealerRecord) { + const res = await request.put>( + '/shop/shop-dealer-record', + data + ); + if (res.code === 0) { + return res.message; + } + return Promise.reject(new Error(res.message)); +} + +/** + * 删除客户跟进情况 + */ +export async function removeShopDealerRecord(id?: number) { + const res = await request.del>( + '/shop/shop-dealer-record/' + id + ); + if (res.code === 0) { + return res.message; + } + return Promise.reject(new Error(res.message)); +} + +/** + * 批量删除客户跟进情况 + */ +export async function removeBatchShopDealerRecord(data: (number | undefined)[]) { + const res = await request.del>( + '/shop/shop-dealer-record/batch', + { + data + } + ); + if (res.code === 0) { + return res.message; + } + return Promise.reject(new Error(res.message)); +} + +/** + * 根据id查询客户跟进情况 + */ +export async function getShopDealerRecord(id: number) { + const res = await request.get>( + '/shop/shop-dealer-record/' + id + ); + if (res.code === 0 && res.data) { + return res.data; + } + return Promise.reject(new Error(res.message)); +} diff --git a/src/api/shop/shopDealerRecord/model/index.ts b/src/api/shop/shopDealerRecord/model/index.ts new file mode 100644 index 0000000..c32e9a7 --- /dev/null +++ b/src/api/shop/shopDealerRecord/model/index.ts @@ -0,0 +1,39 @@ +import type { PageParam } from '@/api'; + +/** + * 客户跟进情况 + */ +export interface ShopDealerRecord { + // ID + id?: number; + // 上级id, 0是顶级 + parentId?: number; + // 客户ID + dealerId?: number; + // 内容 + content?: string; + // 用户ID + userId?: number; + // 排序(数字越小越靠前) + sortNumber?: number; + // 备注 + comments?: string; + // 状态, 0待处理, 1已完成 + status?: number; + // 是否删除, 0否, 1是 + deleted?: number; + // 租户id + tenantId?: number; + // 创建时间 + createTime?: string; + // 修改时间 + updateTime?: string; +} + +/** + * 客户跟进情况搜索条件 + */ +export interface ShopDealerRecordParam extends PageParam { + id?: number; + keywords?: string; +} diff --git a/src/cms/category/components/ArticleList.tsx b/src/cms/category/components/ArticleList.tsx index 3f46857..ffe5d29 100644 --- a/src/cms/category/components/ArticleList.tsx +++ b/src/cms/category/components/ArticleList.tsx @@ -1,15 +1,25 @@ import {Image, Cell} from '@nutui/nutui-react-taro' +import {View, Text} from '@tarojs/components' import Taro from '@tarojs/taro' const ArticleList = (props: any) => { return ( <> -
- {props.data.map((item, index) => { + + {props.data.map((item: any, index: number) => { return ( + {item.title} + {item.comments && ( + + {item.comments} + + )} + + } extra={ } @@ -18,7 +28,7 @@ const ArticleList = (props: any) => { /> ) })} -
+ ) } diff --git a/src/cms/category/index.tsx b/src/cms/category/index.tsx index 7ba9010..abc216f 100644 --- a/src/cms/category/index.tsx +++ b/src/cms/category/index.tsx @@ -53,11 +53,11 @@ function Category() { return { title: `${nav?.categoryName}_九运售电云`, path: `/shop/category/index?id=${categoryId}`, - success: function (res) { - console.log('分享成功', res); + success: function () { + console.log('分享成功'); }, - fail: function (res) { - console.log('分享失败', res); + fail: function () { + console.log('分享失败'); } }; }); diff --git a/src/dealer/customer/index.tsx b/src/dealer/customer/index.tsx index 14ec7dd..4aaaa26 100644 --- a/src/dealer/customer/index.tsx +++ b/src/dealer/customer/index.tsx @@ -15,6 +15,7 @@ import { import FixedButton from "@/components/FixedButton"; import navTo from "@/utils/common"; import {pageShopDealerApply, removeShopDealerApply, updateShopDealerApply} from "@/api/shop/shopDealerApply"; +import {addShopDealerRecord} from "@/api/shop/shopDealerRecord"; // 扩展User类型,添加客户状态和保护天数 interface CustomerUser extends UserType { @@ -73,6 +74,12 @@ const CustomerIndex = () => { // @ts-ignore if (res.confirm && res.content !== undefined) { try { + // 添加跟进记录 + await addShopDealerRecord({ + dealerId: customer.userId, + // @ts-ignore + content: res.content.trim() + }) // 更新跟进情况 await updateShopDealerApply({ ...customer,