From 6bc8515f48e8480700afcd0dc472526250e5e922 Mon Sep 17 00:00:00 2001
From: WindowBird <13870814+windows-bird@user.noreply.gitee.com>
Date: Fri, 7 Nov 2025 09:40:39 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E5=88=97=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
App.vue | 2 +-
common/api.js | 100 ++++++
components/CustomerManagement.vue | 579 ++++++++++++++++++++++++++++++
pages/index/index.vue | 46 ++-
4 files changed, 709 insertions(+), 18 deletions(-)
create mode 100644 components/CustomerManagement.vue
diff --git a/App.vue b/App.vue
index f5057a9..0e709ea 100644
--- a/App.vue
+++ b/App.vue
@@ -8,7 +8,7 @@
// 如果还没有 token,则设置一个测试 token
const token = uni.getStorageSync('token')
if (!token) {
- const testToken = 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImUzMDY4YzNjLThiOTMtNGExNy1hNmFlLWY1NDg5ZTJjYmYyOSJ9.k1cspIDAA_Z357hbRC0PY3PPwRLjTlvezrq37rgVVSYL_T11nDjF3IOWw7QZoEK1uZKYKNn_rAhuqKGOoopvWw'
+ const testToken = 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImQ0ODJhYzdlLTBiYzgtNGFhNC1hMDI2LWVkMWU4YWQ3YmJkYiJ9._m4s6mcpjAHtk4u9r6LMMfIQHSCXDPCTfiWVOTyopZfbsxVFiLkY4ovec3M3u2E9KKm_jIH2fLhAduW4rfAZHQ'
uni.setStorageSync('token', testToken)
console.log('已设置测试 token:', testToken)
}
diff --git a/common/api.js b/common/api.js
index 20bda64..2d38078 100644
--- a/common/api.js
+++ b/common/api.js
@@ -117,3 +117,103 @@ export const submitTask = ({ id, submitAttaches, submitRemark }) => {
});
};
+/**
+ * 获取客户列表
+ * @param {Object} params 请求参数(可选)
+ * @param {string[]} params.statusList 客户状态列表:["1"] 正在跟进, ["2"] 待跟进
+ * @param {string} params.excludeld 排除id
+ * @param {string[]} params.ids id列表
+ * @param {string} params.intent 意向
+ * @param {string} params.createDate 创建日期 (yyyy-MM-dd)
+ * @param {string} params.joinUserld 参与人id
+ * @param {string} params.lastFollowDate 上次跟进日期 (yyyy-MM-dd)
+ * @param {string} params.nextFollowDate 下次跟进日期 (yyyy-MM-dd)
+ * @param {string} params.nextFollowDateStart 下次跟进日期开始 (yyyy-MM-dd)
+ * @param {string} params.nextFollowDateEnd 下次跟进日期结束 (yyyy-MM-dd)
+ * @param {string[]} params.createDateRange 创建日期范围 (yyyy-MM-dd)
+ * @param {string[]} params.saleList 销售列表
+ * @returns {Promise} 返回客户列表 { total: number, rows: array }
+ */
+export const getCustomerList = (params = {}) => {
+ const queryParams = [];
+
+ // 处理数组参数
+ if (params.statusList && Array.isArray(params.statusList) && params.statusList.length > 0) {
+ params.statusList.forEach(status => {
+ queryParams.push(`statusList=${encodeURIComponent(status)}`);
+ });
+ }
+
+ if (params.ids && Array.isArray(params.ids) && params.ids.length > 0) {
+ params.ids.forEach(id => {
+ queryParams.push(`ids=${encodeURIComponent(id)}`);
+ });
+ }
+
+ if (params.createDateRange && Array.isArray(params.createDateRange) && params.createDateRange.length > 0) {
+ params.createDateRange.forEach(date => {
+ queryParams.push(`createDateRange=${encodeURIComponent(date)}`);
+ });
+ }
+
+ if (params.saleList && Array.isArray(params.saleList) && params.saleList.length > 0) {
+ params.saleList.forEach(sale => {
+ queryParams.push(`saleList=${encodeURIComponent(sale)}`);
+ });
+ }
+
+ // 处理字符串参数
+ if (params.excludeld) {
+ queryParams.push(`excludeld=${encodeURIComponent(params.excludeld)}`);
+ }
+
+ if (params.intent) {
+ queryParams.push(`intent=${encodeURIComponent(params.intent)}`);
+ }
+
+ if (params.createDate) {
+ queryParams.push(`createDate=${encodeURIComponent(params.createDate)}`);
+ }
+
+ if (params.joinUserld) {
+ queryParams.push(`joinUserld=${encodeURIComponent(params.joinUserld)}`);
+ }
+
+ if (params.lastFollowDate) {
+ queryParams.push(`lastFollowDate=${encodeURIComponent(params.lastFollowDate)}`);
+ }
+
+ if (params.nextFollowDate) {
+ queryParams.push(`nextFollowDate=${encodeURIComponent(params.nextFollowDate)}`);
+ }
+
+ if (params.nextFollowDateStart) {
+ queryParams.push(`nextFollowDateStart=${encodeURIComponent(params.nextFollowDateStart)}`);
+ }
+
+ if (params.nextFollowDateEnd) {
+ queryParams.push(`nextFollowDateEnd=${encodeURIComponent(params.nextFollowDateEnd)}`);
+ }
+
+ const queryString = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
+
+ return uni.$uv.http.get(`bst/customer/list${queryString}`, {
+ custom: {
+ auth: true // 启用 token 认证
+ }
+ });
+};
+
+/**
+ * 获取客户详情
+ * @param {string} id 客户ID
+ * @returns {Promise} 返回客户详情
+ */
+export const getCustomerDetail = (id) => {
+ return uni.$uv.http.get(`customer/${id}`, {
+ custom: {
+ auth: true // 启用 token 认证
+ }
+ });
+};
+
diff --git a/components/CustomerManagement.vue b/components/CustomerManagement.vue
new file mode 100644
index 0000000..983a912
--- /dev/null
+++ b/components/CustomerManagement.vue
@@ -0,0 +1,579 @@
+
+
+
+
+
+
+
+
+ 状态:
+
+ 全部
+ 正在跟进
+ 待跟进
+
+
+
+
+
+
+
+
+
+
+
+
+ 客户星级:
+
+ ★
+
+
+
+
+
+
+ {{ customer.followName || '未分配' }}
+
+
+
+
+
+ ✓
+ 跟进
+
+
+ ☰
+ 任务
+
+
+ ☎
+ 电话
+
+
+ 更多
+ ›
+
+
+
+
+
+
+ 暂无客户数据
+
+
+
+
+ 加载中...
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/index/index.vue b/pages/index/index.vue
index fa2d4e2..c5de374 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -1,31 +1,37 @@
-
-
+
+
-
-
+
+
-
-
+
+
+
+
-
-
+
+
-
-
+
+
+
+
+
+
-
+
@@ -53,6 +59,7 @@ import ScheduleEditor from '@/components/ScheduleEditor.vue';
import ContentDashboard from '@/components/ContentDashboard.vue';
import TodoList from '@/components/TodoList.vue';
import MessageContent from '@/components/MessageContent.vue';
+import CustomerManagement from '@/components/CustomerManagement.vue';
// 顶部tabs选项
const topTabs = [
@@ -179,9 +186,14 @@ onShow(() => {
.content-wrapper {
padding-top: 8rpx;
-
overflow: hidden;
margin-top: var(--status-bar-height, 0);
+
+ /* 客户管理页面不需要顶部 padding */
+ :deep(.customer-management) {
+ margin-top: 0;
+ padding-top: 0;
+ }
}
:deep(.bottom-tabbar) { z-index: 1000 !important; }