From 16391a2eefae10f51a3e44fd49c92158be00aa0c Mon Sep 17 00:00:00 2001 From: wujingling0908 <2.com> Date: Sun, 20 Sep 2026 13:03:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8C=9C=E4=BD=A0=E6=83=B3=E9=97=AE=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- patch.txt | 235 ++++++++++++++++ src/components/chat-new.vue | 183 +++++------- src/components/footer-bar-input.vue | 1 - src/components/hot-question-new.vue | 125 +++++++++ src/main.js | 1 - src/store/app.js | 1 + src/utils/https.js | 3 +- src/utils/index.js | 2 +- src/utils/sensors.js | 28 ++ src/views/chat.vue | 421 ++++++++++++++++++++++++++-- 10 files changed, 869 insertions(+), 131 deletions(-) create mode 100644 patch.txt create mode 100644 src/components/hot-question-new.vue create mode 100644 src/utils/sensors.js diff --git a/patch.txt b/patch.txt new file mode 100644 index 0000000..d25329b --- /dev/null +++ b/patch.txt @@ -0,0 +1,235 @@ +*** Begin Patch +*** Update File: D:\code\taibao\customAgent\src\views\chat.vue +@@ -421,10 +421,14 @@ + } + } +-// 北极星SDK鉴权 +-function initBxSDK() { ++ ++// 北极星SDK鉴权 ++const initBxSDK = () => { + setConfig({ + url: isProd() ? "life-open.cpic.com.cn/fop/ui/poc/shumeng/h5" : "life-open-sit.cpic.com.cn/fop/ui/poc/shumeng/h5", + deb: "false", + }) + } +- // 异步微信鉴权方法 +- function async initWxAuth(versionNo1) { ++ ++// 异步微信鉴权方法 ++const initWxAuth = async (versionNo1) => { + try { +- // 异步获取微信配置参数 +- const res = await this.getWxAuthConfig(versionNo1); ++ // 异步获取微信配置参数 ++ const res = await getWxAuthConfig(versionNo1); + if (!res.success) { +@@ -459,8 +463,9 @@ + } + } + +- // 获取微信鉴权配置参数 +- function async getWxAuthConfig(versionNo1) { ++// 获取微信鉴权配置参数 ++const getWxAuthConfig = async (versionNo1) => { + const v1 = versionNo1 + try { +@@ -471,3 +476,3 @@ + const encryptUrl = Encrypt(key, iv, url) +- const response = await this.("thirdPartyAuth/getGwResultByUrl", { ++ const response = await Post("thirdPartyAuth/getGwResultByUrl", { + url: encryptUrl +@@ -486,48 +491,35 @@ + + // 微信鉴权成功后的回调 +-function onWxAuthSuccess() { ++const onWxAuthSuccess = () => { + console.log('微信鉴权成功'); +- Toast('wx.ready回调') ++ showToast('wx.ready回调') + } +-function disableShare() { +- var that = this; ++ ++const disableShare = () => { + try { + //禁止分享 + if (typeof WeixinJSBridge == "undefined") { + if (document.addEventListener) { + document.addEventListener( + "WeixinJSBridgeReady", +- that.onBridgeReady(), ++ onBridgeReady, + false + ); + } else if (document.attachEvent) { +- document.attachEvent("WeixinJSBridgeReady", that.onBridgeReady()); +- document.attachEvent("onWeixinJSBridgeReady", that.onBridgeReady()); ++ document.attachEvent("WeixinJSBridgeReady", onBridgeReady); ++ document.attachEvent("onWeixinJSBridgeReady", onBridgeReady); + } + } else { +- that.onBridgeReady(); ++ onBridgeReady(); + } + } catch (error) { + console.log("禁止分享hideOptionMenu", error.message); + } + } +-function onBridgeReady() { ++ ++const onBridgeReady = () => { + WeixinJSBridge.call("hideOptionMenu"); + } +-//链接人工客服 +-function transferLabor() { +- var that = this; +- let sendParmas = { +- reqAndResType: "1", //1文本 2图片 3问提评价 +- msgType: "01", //01文本 02图片 +- msgText: "转接寿险人工客服", +- msgSource: this.manualService, //1机器人 2人工 +- cmd: "ZJSXRGFW", +- // qaId: item.qaId, // 2022.03需求记录 +- }; +- +- // let current = event.currentTarget; +- +- //统计转人工 8月28日 +- // this.statisticsTransferLabor(item); +- +- // 如果当前websocket链接已存在 +- if ( +- this.. && +- this...readyState != this...CLOSED +- ) { +- // console.log(res) +- Toast("当前已经在人工会话中"); +- // current.disabled = true; +- return; +- } +- +- //http接口 +- var transferToast = Toast.loading({ +- message: "转接中...", +- duration: 0, +- loadingType: "spinner", +- forbidClick: true, +- }); +- +- this. +- .dispatch("transferCustomer", sendParmas) +- .then((res) => { +- transferToast.clear(); +- // console.log(res) +- // current.disabled = true; +- // //用户行为统计 start +- // this.getUserBehavior(item.qaId, '5', 'ZJSXRGFW'); // 延期 +- // //用户行为统计 end +- +- //我要转人工 +- if (res.cmd === "ZJSXRGFWCONNECTION") { +- //初始化websocket 如果当前还是机器人 +- that.setWebsocket(); //转人工 +- return; +- } +- +- //其他消息 直接展示消息列表中 +- this.set_chatList(res); +- //滚动到底部 +- this.scrollTopBody(); +- }) +- .catch((err) => { +- transferToast.clear(); +- console.log(err); +- }); +-} +-//建立websocket +-function setWebsocket() { +- var that = this; +- try { +- //http接口 +- var socketToast = Toast.loading({ +- message: "连接中...", +- duration: 0, +- loadingType: "spinner", +- forbidClick: true, +- }); +- +- //建立websocket +- this..initWebSocket(() => { +- that. +- .dispatch("setConnectToEasemob") +- .then((res) => { +- socketToast.clear(); +- // if(res.connection){//机器人转人工 +- // that.set_manualService(res.msgSource); +- // } +- +- // //用户行为统计 start +- // that.getUserBehavior(item.qaId, "5", "ZJSXRGFW"); +- // //用户行为统计 end +- }) +- .catch((err) => { +- socketToast.clear(); +- console.log(err); +- }); +- }); +- } catch (err) { +- console.log(err.message); +- } +-} +-function scrollTopBody() { +- setTimeout(() => { +- //滚动到底部 +- try { +- this.mescrollContent.scrollTop = +- this.mescrollContent.scrollHeight || 0; +- } catch (error) { +- console.log(error.message); +- } +- }, 300); +-} +-function loadSdk(){ ++ ++// 加载SDK ++const loadSdk = () => { + const script = document.createElement('script'); +- this.("config/mydConfig", {}) ++ Post("config/mydConfig", {}) + .then((res) => { +@@ -538,3 +530,3 @@ + script.onload = () => { +- this.set_sdkLoaded(true) ++ store.set_sdkLoaded?.(true) + console.log('SDK successed'); +@@ -549,5 +541,6 @@ + }) + } +-//获取高温用户弹窗数据 +-function getHotUserData(){ +- this.("product/tip/select") ++ ++// 获取高温用户弹窗数据 ++const getHotUserData = () => { ++ Get("product/tip/select") + .then((res) => { +@@ -559,3 +552,3 @@ + if (res.data.rhetoricString && res.data.productTipEntityList.length > 0) { +- this.set_hotUserData(hotUserData); ++ store.set_hotUserData?.(hotUserData); + } +@@ -563,7 +556,7 @@ + const now = new Date(); + const clickTime = \-\-\ \:\:\; +- const userId = this.userId; +- const source = this.source; +- const sessionId = this.sessionId; ++ const userId = store.userId; ++ const source = store.source; ++ const sessionId = store.sessionId; + // 调用埋点接口 +- this.("product/record/save", { ++ Post("product/record/save", { + userId: userId, +*** End Patch diff --git a/src/components/chat-new.vue b/src/components/chat-new.vue index 8dbb84b..968d1f4 100644 --- a/src/components/chat-new.vue +++ b/src/components/chat-new.vue @@ -1,17 +1,22 @@ + +