From c5d4eba244e3d79d38916eea34b3e9a587020082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=AF=85?= <1335909236@qq.com> Date: Thu, 25 Sep 2025 11:42:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=9C=8D=E6=A8=A1=E5=9D=97=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../customerService/chattingRecords/index.vue | 44 ++++++------- packages/customerService/index/index.vue | 66 +++++++++++-------- packages/user/index/index.vue | 2 + pages/login/login.vue | 3 + pages/user/index.vue | 5 +- 5 files changed, 65 insertions(+), 55 deletions(-) diff --git a/packages/customerService/chattingRecords/index.vue b/packages/customerService/chattingRecords/index.vue index e17b049a..069c0323 100644 --- a/packages/customerService/chattingRecords/index.vue +++ b/packages/customerService/chattingRecords/index.vue @@ -40,11 +40,10 @@ export default { isLoading: false, page_num: 1, page_size: 10, + itemObj: {}, }; }, onLoad() { - // 加载聊天记录列表 - this.loadChattingRecords(); }, onShow() { // 页面显示时重新加载聊天记录 @@ -62,7 +61,7 @@ export default { page_num: this.page_num, page_size: this.page_size, }).then((res) => { - this.recordsList = res.msg_list + this.recordsList = res.msg_list.filter(item => item.client_id_one !== item.client_id_two) }) } catch (error) { console.error('加载聊天记录失败', error); @@ -104,29 +103,24 @@ export default { // 跳转到聊天页面 goToChatPage(record) { - const params = { - mch_id: record.mch_id, - } - - request(apiArr.csGetMchContactList, "POST", params).then((res) => { - if (res.rows && res.rows.length > 0) { - res.rows.map(item => { - item.employee_image = picUrl + item.employee_image; - }) - const itemObj = res.rows.find(item => item.employee_mobile === record.two.account) - - // 跳转到聊天页面 - uni.navigateTo({ - url: '/packages/customerService/index/index?item=' + JSON.stringify(itemObj) - }); - } else { - console.log("没有获取到客服列表数据"); - uni.showToast({ - title: '该客服不存在', - icon: 'none' - }) + console.log("🚀 ~ goToChatPage ~ record:", record) + if (record.client_id_two == uni.getStorageSync('openId')) { + this.itemObj = { + ...record.one, + bind_id: record.id } - }) + } else { + this.itemObj = { + ...record.one, + bind_id: record.id + } + } + console.log("🚀 ~ goToChatPage ~ itemObj:", this.itemObj) + + // 跳转到聊天页面 + uni.navigateTo({ + url: '/packages/customerService/index/index?item=' + JSON.stringify(this.itemObj) + }); } } }; diff --git a/packages/customerService/index/index.vue b/packages/customerService/index/index.vue index 098faf2c..b9418f7c 100644 --- a/packages/customerService/index/index.vue +++ b/packages/customerService/index/index.vue @@ -47,7 +47,7 @@ packages/customerService/index/index