From 11141ae436c6a7354ea7677092f540e6563d8cbc Mon Sep 17 00:00:00 2001 From: duanshuwen Date: Sat, 13 Sep 2025 16:09:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9C=AA=E7=99=BB=E5=BD=95=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- .env.production | 2 +- .env.staging | 2 +- hooks/useGoLogin.js | 7 +++ pages/chat/ChatMainList.vue | 20 +++++--- pages/chat/ChatMoreTips.vue | 76 ++++++++++++++--------------- pages/chat/styles/ChatMoreTips.scss | 34 +++++++++++++ pages/drawer/MineSetting.vue | 8 +++ 8 files changed, 103 insertions(+), 48 deletions(-) create mode 100644 pages/chat/styles/ChatMoreTips.scss diff --git a/.env.development b/.env.development index fe4c128..26bf791 100644 --- a/.env.development +++ b/.env.development @@ -7,7 +7,7 @@ VITE_BASE_URL = https://onefeel.brother7.cn/ingress # VITE_BASE_URL = https://biz.nianxx.cn # 测试 -ITE_WSS_URL = wss://onefeel.brother7.cn/ingress/agent/ws/chat +VITE_WSS_URL = wss://onefeel.brother7.cn/ingress/agent/ws/chat # 生产 # VITE_WSS_URL = wss://biz.nianxx.cn/agent/ws/chat diff --git a/.env.production b/.env.production index fd38e4e..5d07a8b 100644 --- a/.env.production +++ b/.env.production @@ -7,7 +7,7 @@ VITE_BASE_URL = https://onefeel.brother7.cn/ingress # VITE_BASE_URL = https://biz.nianxx.cn # 测试 -ITE_WSS_URL = wss://onefeel.brother7.cn/ingress/agent/ws/chat +VITE_WSS_URL = wss://onefeel.brother7.cn/ingress/agent/ws/chat # 生产 # VITE_WSS_URL = wss://biz.nianxx.cn/agent/ws/chat \ No newline at end of file diff --git a/.env.staging b/.env.staging index a711fdb..da39e91 100644 --- a/.env.staging +++ b/.env.staging @@ -7,7 +7,7 @@ VITE_BASE_URL = https://onefeel.brother7.cn/ingress # VITE_BASE_URL = https://biz.nianxx.cn # 测试 -ITE_WSS_URL = wss://onefeel.brother7.cn/ingress/agent/ws/chat +VITE_WSS_URL = wss://onefeel.brother7.cn/ingress/agent/ws/chat # 生产 # VITE_WSS_URL = wss://biz.nianxx.cn/agent/ws/chat \ No newline at end of file diff --git a/hooks/useGoLogin.js b/hooks/useGoLogin.js index d4c32e1..d8e1eae 100644 --- a/hooks/useGoLogin.js +++ b/hooks/useGoLogin.js @@ -5,6 +5,10 @@ export const goLogin = () => uni.reLaunch({ url: "/pages/login/index" }); // 登录逻辑 export const onLogin = (e) => { + const token = uni.getStorageSync("token"); + + if (token) return; + const { code } = e.detail; console.info("onLogin code: ", code); @@ -18,6 +22,9 @@ export const onLogin = (e) => { // 绑定手机号 bindPhone(params); + + // 通知刷新 + uni.$emit("TOKEN_CHANGE"); }); }; diff --git a/pages/chat/ChatMainList.vue b/pages/chat/ChatMainList.vue index 1cb9cff..450f66b 100644 --- a/pages/chat/ChatMainList.vue +++ b/pages/chat/ChatMainList.vue @@ -136,7 +136,7 @@ diff --git a/pages/chat/styles/ChatMoreTips.scss b/pages/chat/styles/ChatMoreTips.scss new file mode 100644 index 0000000..87738ed --- /dev/null +++ b/pages/chat/styles/ChatMoreTips.scss @@ -0,0 +1,34 @@ +.more-tips { + width: 100%; + + &-scroll { + display: flex; + flex-direction: row; + overflow-x: auto; + white-space: nowrap; + -webkit-overflow-scrolling: touch; + padding-bottom: 12px; + box-sizing: border-box; + } + + .more-tips-item { + border-radius: 8px; + margin: 4px; + box-shadow: 0 2px 5px 0px rgba(0, 0, 0, 0.1); + background-color: #ffffff; + padding: 2px 12px; + display: flex; + flex-direction: column; + flex-shrink: 0; + white-space: nowrap; + + .more-tips-item-title { + font-weight: 500; + font-size: 12px; + color: #00a6ff; + line-height: 24px; + text-align: center; + white-space: nowrap; + } + } +} diff --git a/pages/drawer/MineSetting.vue b/pages/drawer/MineSetting.vue index f60100e..f6073c7 100644 --- a/pages/drawer/MineSetting.vue +++ b/pages/drawer/MineSetting.vue @@ -57,6 +57,7 @@ const menuList = ref([ }, // { label: '营业资质&协议', type: 'navigate', url: '/pages/agreement/agreement' }, { label: "联系客服", type: "action", action: "contactService" }, + { label: "订阅消息", type: "action", action: "subscribeMessage" }, ]); // 生命周期钩子 @@ -81,6 +82,13 @@ const handleMenuClick = (item) => { } else if (item.type === "action") { if (item.action === "contactService") { uni.showToast({ title: "联系客服功能待实现", icon: "none" }); + } else if (item.action === "subscribeMessage") { + uni.requestSubscribeMessage({ + tmplIds: ["fMIt1q9GgM3Ep0DJSNgVPm4C3lCpQdz2TediETcv3iM"], + success(res) { + console.log(res); + }, + }); } } };