From 6e8dc30c59d56a08aeb8a4b3cfa6e4f00fe66b8b Mon Sep 17 00:00:00 2001 From: WindowBird <13870814+windows-bird@user.noreply.gitee.com> Date: Sat, 8 Nov 2025 10:39:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E6=B7=BB=E5=8A=A0=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=8B=86=E5=88=86-=E7=BC=96=E8=BE=91=E5=AE=A2?= =?UTF-8?q?=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 2 +- common/api/customer.js | 31 + .../customer-form/CustomerBasicInfo.vue | 203 +++ .../customer-form/CustomerFormNavbar.vue | 54 + .../customer-form/CustomerOtherInfo.vue | 196 +++ components/customer-form/CustomerPickers.vue | 489 +++++++ composables/useCustomerForm.js | 263 ++++ pages.json | 7 + pages/customer/add/index.vue | 1270 ++--------------- pages/customer/detail/index.vue | 32 +- pages/customer/edit/index.vue | 406 ++++++ 11 files changed, 1827 insertions(+), 1126 deletions(-) create mode 100644 components/customer-form/CustomerBasicInfo.vue create mode 100644 components/customer-form/CustomerFormNavbar.vue create mode 100644 components/customer-form/CustomerOtherInfo.vue create mode 100644 components/customer-form/CustomerPickers.vue create mode 100644 composables/useCustomerForm.js create mode 100644 pages/customer/edit/index.vue diff --git a/App.vue b/App.vue index 19f2151..1c56512 100644 --- a/App.vue +++ b/App.vue @@ -8,7 +8,7 @@ // 如果还没有 token,则设置一个测试 token const token = uni.getStorageSync('token') if (!token) { - const testToken = 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjJiNWZkNDAyLTFiYWQtNDI5YS04ZDFkLTllZGE0Y2VkOWIxMyJ9.2UEvAG6OtJ0WZoJxjPjGzGhdgxAclzEqqPl_K94kbcCVs9YplENwZe2AcdsLkdLsc7EnDbRif-xuhWlTKF78WQ' + const testToken = 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImI4MDUzOGE0LThjNTQtNGZlMy04NmMwLThhYzhlZmMwMTg1ZCJ9.xalBJnQcnxHsHUVFn46XXamKBPA2RdDtvVvhRQwc7j-lARywOjKMfSqjUiSe8DbWMKt1iBZIz0Z0JDYX7IGb_g' uni.setStorageSync('token', testToken) console.log('已设置测试 token:', testToken) } diff --git a/common/api/customer.js b/common/api/customer.js index fe5f598..73256db 100644 --- a/common/api/customer.js +++ b/common/api/customer.js @@ -166,6 +166,37 @@ export const createCustomer = (data) => { }); }; +/** + * 更新客户 + * @param {Object} data 客户数据(必须包含id) + * @param {string} data.id 客户ID + * @param {string} data.type 类型 + * @param {string} data.name 客户名 + * @param {string} data.mobile 手机号 + * @param {string} data.wechat 微信号 + * @param {string} data.source 来源 + * @param {string} data.intents 意向的设备,逗号分离 + * @param {string} data.status 状态(1潜在2意向3成交4失效) + * @param {string} data.intentLevel 意向强度 + * @param {string} data.customerStatus 客户状态 + * @param {string} data.customerIntentLevel 客户意向强度 + * @param {string} data.nextFollowTime 下次跟进时间 + * @param {string} data.followId 跟进人id + * @param {string} data.remark 备注 + * @param {string} data.concern 顾虑点 + * @param {string} data.pain 痛点 + * @param {string} data.attention 关注点 + * @param {string} data.demand 需求点 + * @returns {Promise} 返回更新结果 + */ +export const updateCustomer = (data) => { + return uni.$uv.http.put(`bst/customer`, data, { + custom: { + auth: true + } + }); +}; + /** * 获取客户意向字典数据 * @returns {Promise} 返回字典数据数组,包含 dictLabel 和 dictValue diff --git a/components/customer-form/CustomerBasicInfo.vue b/components/customer-form/CustomerBasicInfo.vue new file mode 100644 index 0000000..700ceb7 --- /dev/null +++ b/components/customer-form/CustomerBasicInfo.vue @@ -0,0 +1,203 @@ + + + + + + diff --git a/components/customer-form/CustomerFormNavbar.vue b/components/customer-form/CustomerFormNavbar.vue new file mode 100644 index 0000000..ff11cf2 --- /dev/null +++ b/components/customer-form/CustomerFormNavbar.vue @@ -0,0 +1,54 @@ + + + + + + diff --git a/components/customer-form/CustomerOtherInfo.vue b/components/customer-form/CustomerOtherInfo.vue new file mode 100644 index 0000000..7af45b1 --- /dev/null +++ b/components/customer-form/CustomerOtherInfo.vue @@ -0,0 +1,196 @@ +