From 1b53149d8825bf3fd9ab1afb71c0c3b141f06f7d Mon Sep 17 00:00:00 2001 From: WindowBird <13870814+windows-bird@user.noreply.gitee.com> Date: Sat, 8 Nov 2025 15:58:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=AE=A2=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/api/customer.js | 16 ++++++++++ components/CustomerManagement.vue | 53 +++++++++++++++++++++++++++---- pages/customer/detail/index.vue | 45 +++++++++++++++++++++++--- pages/index/index.vue | 12 +++++++ 4 files changed, 115 insertions(+), 11 deletions(-) diff --git a/common/api/customer.js b/common/api/customer.js index 761629f..bc6a10f 100644 --- a/common/api/customer.js +++ b/common/api/customer.js @@ -280,3 +280,19 @@ export const getWechatList = () => { }); }; +/** + * 删除客户 + * @param {string|string[]} ids 客户ID或ID数组(多个ID用逗号分隔或传入数组) + * @returns {Promise} 返回删除结果 + */ +export const deleteCustomer = (ids) => { + // 如果传入的是数组,转换为逗号分隔的字符串 + const idsParam = Array.isArray(ids) ? ids.join(',') : ids; + + return uni.$uv.http.delete(`bst/customer/${idsParam}`,{}, { + custom: { + auth: true // 启用 token 认证 + } + }); +}; + diff --git a/components/CustomerManagement.vue b/components/CustomerManagement.vue index 85e6ab7..908ee69 100644 --- a/components/CustomerManagement.vue +++ b/components/CustomerManagement.vue @@ -129,10 +129,10 @@ diff --git a/pages/customer/detail/index.vue b/pages/customer/detail/index.vue index 6ee72a1..e38f7fe 100644 --- a/pages/customer/detail/index.vue +++ b/pages/customer/detail/index.vue @@ -125,7 +125,7 @@