no message

This commit is contained in:
wangdongbo 2026-01-23 16:09:34 +08:00
parent f99650a3b7
commit 8ddeb572d4
11 changed files with 635 additions and 470 deletions

358
App.vue
View File

@ -1,365 +1,369 @@
<script> <script>
import useAccountStore from "@/store/account.js"; import useAccountStore from "@/store/account.js";
import { globalTimChatManager } from "@/utils/tim-chat.js"; import {
globalTimChatManager
} from "@/utils/tim-chat.js";
export default { export default {
onLaunch: function () { onLaunch: function() {
// pinia store getActivePinia // pinia store getActivePinia
const { login } = useAccountStore(); const {
login
} = useAccountStore();
login(); login();
console.log("App Launch: "); console.log("App Launch: ");
}, },
onShow: function () { onShow: function() {
console.log("App Show"); console.log("App Show");
}, },
onHide: function () { onHide: function() {
console.log("App Hide"); console.log("App Hide");
// 退退IM try {
// try { if (globalTimChatManager && globalTimChatManager.tim) {
// if (globalTimChatManager && globalTimChatManager.tim) { console.log('小程序退出开始退出腾讯IM');
// console.log('退退IM'); globalTimChatManager.destroy();
// globalTimChatManager.destroy(); console.log('腾讯IM退出成功');
// console.log('IM退'); }
// } } catch (error) {
// } catch (error) { console.error('退出腾讯IM失败:', error);
// console.error('退IM:', error); }
// }
}, },
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
$primary-color: #0074ff; $primary-color: #0074ff;
page { page {
height: 100%; height: 100%;
background: #f5f5f5; background: #f5f5f5;
} }
.shadow-up { .shadow-up {
box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px,
rgba(0, 0, 0, 0.1) 0px -10px 15px -3px, rgba(0, 0, 0, 0.1) 0px -4px 6px -4px; rgba(0, 0, 0, 0.1) 0px -10px 15px -3px, rgba(0, 0, 0, 0.1) 0px -4px 6px -4px;
} }
.shadow-lg { .shadow-lg {
box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
} }
.relative { .relative {
position: relative; position: relative;
} }
.inline-block { .inline-block {
display: inline-block; display: inline-block;
} }
.flex { .flex {
display: flex; display: flex;
} }
.flex-col { .flex-col {
flex-direction: column; flex-direction: column;
} }
.flex-wrap { .flex-wrap {
flex-wrap: wrap; flex-wrap: wrap;
} }
.flex-grow { .flex-grow {
flex-grow: 1; flex-grow: 1;
} }
.flex-shrink-0 { .flex-shrink-0 {
flex-shrink: 0; flex-shrink: 0;
} }
.items-center { .items-center {
align-items: center; align-items: center;
} }
.justify-center { .justify-center {
justify-content: center; justify-content: center;
} }
.justify-between { .justify-between {
justify-content: space-between; justify-content: space-between;
} }
.justify-around { .justify-around {
justify-content: space-around; justify-content: space-around;
} }
.justify-end { .justify-end {
justify-content: flex-end; justify-content: flex-end;
} }
.bg-gray { .bg-gray {
background: #f5f5f5; background: #f5f5f5;
} }
.bg-primary { .bg-primary {
background: $primary-color; background: $primary-color;
} }
.bg-success { .bg-success {
background: green; background: green;
} }
.bg-white { .bg-white {
background: #fff; background: #fff;
} }
.bg-warning { .bg-warning {
background: orange; background: orange;
} }
.bg-danger { .bg-danger {
background: rgb(248 113 113); background: rgb(248 113 113);
} }
.py-5 { .py-5 {
padding-top: 10rpx; padding-top: 10rpx;
padding-bottom: 10rpx; padding-bottom: 10rpx;
} }
.p-15 { .p-15 {
padding: 30rpx; padding: 30rpx;
} }
.p-10 { .p-10 {
padding: 20rpx; padding: 20rpx;
} }
.px-5 { .px-5 {
padding-left: 10rpx; padding-left: 10rpx;
padding-right: 10rpx; padding-right: 10rpx;
} }
.px-10 { .px-10 {
padding-left: 20rpx; padding-left: 20rpx;
padding-right: 20rpx; padding-right: 20rpx;
} }
.px-12 { .px-12 {
padding-left: 24rpx; padding-left: 24rpx;
padding-right: 24rpx; padding-right: 24rpx;
} }
.px-15 { .px-15 {
padding-left: 30rpx; padding-left: 30rpx;
padding-right: 30rpx; padding-right: 30rpx;
} }
.pt-5 { .pt-5 {
padding-top: 10rpx; padding-top: 10rpx;
} }
.pt-15 {
.pt-15 {
padding-top: 30rpx; padding-top: 30rpx;
} }
.break-all { .break-all {
word-break: break-all; word-break: break-all;
} }
.pb-5 { .pb-5 {
padding-bottom: 10rpx; padding-bottom: 10rpx;
} }
.pb-10 { .pb-10 {
padding-bottom: 20rpx; padding-bottom: 20rpx;
} }
.py-10 { .py-10 {
padding-top: 20rpx; padding-top: 20rpx;
padding-bottom: 20rpx; padding-bottom: 20rpx;
} }
.py-12 { .py-12 {
padding-top: 24rpx; padding-top: 24rpx;
padding-bottom: 24rpx; padding-bottom: 24rpx;
} }
.py-15 { .py-15 {
padding-top: 30rpx; padding-top: 30rpx;
padding-bottom: 30rpx; padding-bottom: 30rpx;
} }
.mr-5 { .mr-5 {
margin-right: 10rpx; margin-right: 10rpx;
} }
.mr-10 { .mr-10 {
margin-right: 20rpx; margin-right: 20rpx;
} }
.ml-15 { .ml-15 {
margin-left: 30rpx; margin-left: 30rpx;
} }
.mb-5 { .mb-5 {
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
.mb-10 { .mb-10 {
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.mt-10 { .mt-10 {
margin-top: 20rpx; margin-top: 20rpx;
} }
.mt-15 { .mt-15 {
margin-top: 30rpx; margin-top: 30rpx;
} }
.mt-12 { .mt-12 {
margin-top: 24rpx; margin-top: 24rpx;
} }
.mx-10 { .mx-10 {
margin-left: 20rpx; margin-left: 20rpx;
margin-right: 20rpx; margin-right: 20rpx;
} }
.mx-auto { .mx-auto {
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }
.rounded { .rounded {
border-radius: 16rpx; border-radius: 16rpx;
} }
.rounded-sm { .rounded-sm {
border-radius: 8rpx; border-radius: 8rpx;
} }
.rounded-full { .rounded-full {
border-radius: 999px; border-radius: 999px;
} }
.text-center { .text-center {
text-align: center; text-align: center;
} }
.text-right { .text-right {
text-align: right; text-align: right;
} }
.text-gray { .text-gray {
color: #999; color: #999;
} }
.text-black { .text-black {
color: #000; color: #000;
} }
.text-dark { .text-dark {
color: #333; color: #333;
} }
.text-danger { .text-danger {
color: #f56c6c; color: #f56c6c;
} }
.text-primary { .text-primary {
color: $primary-color; color: $primary-color;
} }
.text-success { .text-success {
color: #67c23a; color: #67c23a;
} }
.text-white { .text-white {
color: #fff; color: #fff;
} }
.text-warning { .text-warning {
color: #f56c6c; color: #f56c6c;
} }
.text-sm { .text-sm {
font-size: 24rpx; font-size: 24rpx;
} }
.text-base { .text-base {
font-size: 28rpx; font-size: 28rpx;
} }
.text-lg { .text-lg {
font-size: 32rpx; font-size: 32rpx;
} }
.text-xl { .text-xl {
font-size: 36rpx; font-size: 36rpx;
} }
.leading-normal { .leading-normal {
line-height: 1.5; line-height: 1.5;
} }
.border { .border {
border: 1px solid #eee; border: 1px solid #eee;
} }
.border-dashed { .border-dashed {
border: 1px dashed #eee; border: 1px dashed #eee;
} }
.border-b { .border-b {
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
} }
.border-auto { .border-auto {
border: 1px solid; border: 1px solid;
} }
.border-dashed-auto { .border-dashed-auto {
border: 1px dashed; border: 1px dashed;
} }
.border-primary { .border-primary {
border: 1px solid $primary-color; border: 1px solid $primary-color;
} }
.font-semibold { .font-semibold {
font-weight: bold; font-weight: bold;
} }
.truncate { .truncate {
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.w-0 { .w-0 {
width: 0; width: 0;
} }
.w-full { .w-full {
width: 100%; width: 100%;
} }
.overflow-hidden { .overflow-hidden {
overflow: hidden; overflow: hidden;
} }
.border-box { .border-box {
box-sizing: border-box; box-sizing: border-box;
} }
.line-clamp-2 { .line-clamp-2 {
display: -webkit-box; display: -webkit-box;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
overflow: hidden; overflow: hidden;
} }
.h-full { .h-full {
height: 100%; height: 100%;
} }
.safe-bottom-padding { .safe-bottom-padding {
height: env(safe-area-inset-bottom); height: env(safe-area-inset-bottom);
} }
</style> </style>

View File

@ -13,6 +13,12 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{
"path": "pages/message/common-phrases",
"style": {
"navigationBarTitleText": "常用语"
}
},
{ {
"path": "pages/case/case", "path": "pages/case/case",
"style": { "style": {

View File

@ -1,24 +1,49 @@
<template> <template>
<view class="common-phrases-page"> <view class="common-phrases-page">
<view class="header"> <!-- 自定义导航栏 -->
<view class="title">快捷回复</view> <view class="custom-navbar" :style="{ paddingTop: statusBarHeight + 'px' }">
<view class="edit-btn" @click="toggleEditMode">{{ isEditMode ? '完成' : '编辑' }}</view> <view class="navbar-content">
<view class="navbar-center">
<text class="navbar-title">快捷回复</text>
</view>
<view class="navbar-right" @click="toggleEditMode">
<text class="edit-text">{{ isEditMode ? '完成' : '编辑' }}</text>
</view>
</view>
</view> </view>
<view class="category-tabs"> <view class="content-wrapper">
<!-- 左侧分类列表 -->
<view class="category-sidebar">
<scroll-view class="category-list" scroll-y>
<view <view
v-for="category in categories" v-for="category in categories"
:key="category.id" :key="category.id"
class="category-tab" class="category-item"
:class="{ active: currentCategory === category.id }" :class="{ active: currentCategory === category.id }"
@click="switchCategory(category.id)" @click="switchCategory(category.id)"
@longpress="handleCategoryLongPress(category)"
> >
{{ category.name }} <view class="category-name">{{ category.name }}</view>
<view v-if="currentCategory === category.id" class="active-indicator"></view>
<view v-if="isEditMode && category.deletable" class="delete-badge" @click.stop="deleteCategory(category)">
<text class="delete-icon">×</text>
</view> </view>
<view class="add-category-btn" @click="showAddCategoryDialog"> </view>
<view class="add-category-item" @click="showAddCategoryDialog">
<text class="plus-icon">+</text> <text class="plus-icon">+</text>
加分类 <text>加分类</text>
</view> </view>
</scroll-view>
</view>
<!-- 右侧常用语列表 -->
<view class="phrases-container">
<view class="add-phrase-header" @click="showAddPhraseDialog">
<text class="add-icon">+</text>
<text class="add-text">添加快捷回复</text>
</view> </view>
<scroll-view class="phrases-list" scroll-y> <scroll-view class="phrases-list" scroll-y>
@ -30,32 +55,41 @@
> >
<view class="phrase-content">{{ phrase.content }}</view> <view class="phrase-content">{{ phrase.content }}</view>
<view v-if="isEditMode" class="phrase-actions"> <view v-if="isEditMode" class="phrase-actions">
<view class="action-btn edit" @click.stop="editPhrase(phrase)">编辑</view> <view class="action-btn edit" @click.stop="editPhrase(phrase)">
<view class="action-btn delete" @click.stop="deletePhrase(phrase)">删除</view> <text>编辑</text>
</view>
<view class="action-btn delete" @click.stop="deletePhrase(phrase)">
<text>删除</text>
</view>
</view> </view>
</view> </view>
<view v-if="currentPhrases.length === 0" class="empty-state"> <view v-if="currentPhrases.length === 0" class="empty-state">
<image src="/static/empty.svg" class="empty-icon" mode="aspectFit"></image> <image src="/static/empty.svg" class="empty-icon" mode="aspectFit"></image>
<text class="empty-text">暂无常用语</text> <text class="empty-text">暂无常用语</text>
<text class="empty-hint">点击上方按钮添加常用语</text>
</view> </view>
</scroll-view> </scroll-view>
</view>
<view class="add-phrase-btn" @click="showAddPhraseDialog">
<text class="plus-icon-white">+</text>
添加快捷回复
</view> </view>
<!-- 添加/编辑常用语弹窗 --> <!-- 添加/编辑常用语弹窗 -->
<view v-if="showPhrasePopup" class="popup-mask" @click="closePopup"> <view v-if="showPhrasePopup" class="popup-mask" @click="closePopup">
<view class="popup-content" @click.stop> <view class="popup-content" @click.stop>
<view class="popup-title">{{ editingPhrase ? '编辑' : '添加快捷回复' }}</view> <view class="popup-header">
<text class="popup-title">{{ editingPhrase ? '编辑快捷回复' : '添加快捷回复' }}</text>
<view class="popup-close" @click="closePopup">
<text class="close-icon">×</text>
</view>
</view>
<textarea <textarea
v-model="phraseForm.content" v-model="phraseForm.content"
class="phrase-textarea" class="phrase-textarea"
placeholder="在此处输入文字" placeholder="在此处输入文字"
maxlength="500" maxlength="500"
:auto-height="true"
></textarea> ></textarea>
<view class="char-count">{{ phraseForm.content.length }}/500</view>
<view class="popup-actions"> <view class="popup-actions">
<button class="cancel-btn" @click="closePopup">取消</button> <button class="cancel-btn" @click="closePopup">取消</button>
<button class="confirm-btn" @click="savePhrase">{{ editingPhrase ? '保存' : '确认添加' }}</button> <button class="confirm-btn" @click="savePhrase">{{ editingPhrase ? '保存' : '确认添加' }}</button>
@ -66,11 +100,16 @@
<!-- 添加分类弹窗 --> <!-- 添加分类弹窗 -->
<view v-if="showCategoryPopup" class="popup-mask" @click="closeCategoryPopup"> <view v-if="showCategoryPopup" class="popup-mask" @click="closeCategoryPopup">
<view class="popup-content category-popup" @click.stop> <view class="popup-content category-popup" @click.stop>
<view class="popup-title">新建分类名</view> <view class="popup-header">
<text class="popup-title">新建分类</text>
<view class="popup-close" @click="closeCategoryPopup">
<text class="close-icon">×</text>
</view>
</view>
<input <input
v-model="categoryForm.name" v-model="categoryForm.name"
class="category-input" class="category-input"
placeholder="请在此填写分类名最多6个字" placeholder="请输入分类名最多6个字"
maxlength="6" maxlength="6"
/> />
<view class="popup-actions"> <view class="popup-actions">
@ -86,14 +125,17 @@
import { ref, computed, onMounted } from 'vue'; import { ref, computed, onMounted } from 'vue';
import api from '@/utils/api'; import api from '@/utils/api';
//
const statusBarHeight = ref(0);
// //
const isEditMode = ref(false); const isEditMode = ref(false);
// //
const categories = ref([ const categories = ref([
{ id: 'visit', name: '文字随访' }, { id: 'visit', name: '文字随访', deletable: false },
{ id: 'voice', name: '语音随访' }, { id: 'voice', name: '语音随访', deletable: false },
{ id: 'common', name: '常用回复' }, { id: 'common', name: '常用回复', deletable: false },
]); ]);
const currentCategory = ref('common'); const currentCategory = ref('common');
@ -121,6 +163,11 @@ const categoryForm = ref({
const editingPhrase = ref(null); const editingPhrase = ref(null);
//
const goBack = () => {
uni.navigateBack();
};
// //
const toggleEditMode = () => { const toggleEditMode = () => {
isEditMode.value = !isEditMode.value; isEditMode.value = !isEditMode.value;
@ -365,6 +412,12 @@ onMounted(() => {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
// 使
$primary-color: #0877F1;
$primary-light: #e8f3ff;
$primary-gradient-start: #1b5cc8;
$primary-gradient-end: #0877f1;
.common-phrases-page { .common-phrases-page {
height: 100vh; height: 100vh;
display: flex; display: flex;
@ -388,62 +441,117 @@ onMounted(() => {
.edit-btn { .edit-btn {
font-size: 28rpx; font-size: 28rpx;
color: #ff6b35; color: $primary-color;
} }
} }
.category-tabs { .content-wrapper {
flex: 1;
display: flex; display: flex;
align-items: center; overflow: hidden;
padding: 24rpx 32rpx; }
background-color: #fff;
overflow-x: auto;
white-space: nowrap;
.category-tab { //
padding: 12rpx 24rpx; .category-sidebar {
margin-right: 16rpx; width: 200rpx;
background-color: #f8f8f8;
border-right: 1px solid #e5e5e5;
.category-list {
height: 100%;
}
.category-item {
position: relative;
padding: 32rpx 24rpx;
text-align: center;
background-color: #f8f8f8;
border-bottom: 1px solid #e5e5e5;
.category-name {
font-size: 28rpx; font-size: 28rpx;
color: #666; color: #666;
background-color: #f5f5f5; }
border-radius: 8rpx;
flex-shrink: 0;
&.active { &.active {
color: #ff6b35; background-color: #fff;
background-color: #fff5f2;
border: 1px solid #ff6b35; .category-name {
color: $primary-color;
font-weight: 600;
}
.active-indicator {
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 6rpx;
height: 40rpx;
background-color: $primary-color;
border-radius: 0 4rpx 4rpx 0;
}
} }
} }
.add-category-btn { .add-category-item {
display: flex; display: flex;
flex-direction: column;
align-items: center; align-items: center;
padding: 12rpx 24rpx; justify-content: center;
font-size: 28rpx; padding: 32rpx 24rpx;
color: #ff6b35; font-size: 24rpx;
background-color: #fff5f2; color: $primary-color;
border-radius: 8rpx; background-color: #f8f8f8;
flex-shrink: 0;
.plus-icon { .plus-icon {
font-size: 32rpx; font-size: 32rpx;
margin-right: 4rpx;
font-weight: 600; font-weight: 600;
margin-bottom: 8rpx;
} }
} }
} }
//
.phrases-container {
flex: 1;
display: flex;
flex-direction: column;
background-color: #fff;
}
.add-phrase-header {
display: flex;
align-items: center;
justify-content: center;
padding: 24rpx;
background: linear-gradient(270deg, $primary-gradient-start 2.26%, $primary-gradient-end 94.33%);
border-bottom: 1px solid rgba(8, 119, 241, 0.1);
.add-icon {
font-size: 32rpx;
color: #fff;
font-weight: 600;
margin-right: 8rpx;
}
.add-text {
font-size: 28rpx;
color: #fff;
font-weight: 500;
}
}
.phrases-list { .phrases-list {
flex: 1; flex: 1;
padding: 24rpx 32rpx; padding: 24rpx;
overflow-y: auto;
.phrase-item { .phrase-item {
padding: 24rpx; padding: 24rpx;
margin-bottom: 16rpx; margin-bottom: 16rpx;
background-color: #fff; background-color: #f8f8f8;
border-radius: 12rpx; border-radius: 12rpx;
border-left: 4rpx solid $primary-color;
.phrase-content { .phrase-content {
font-size: 28rpx; font-size: 28rpx;
@ -456,7 +564,7 @@ onMounted(() => {
justify-content: flex-end; justify-content: flex-end;
margin-top: 16rpx; margin-top: 16rpx;
padding-top: 16rpx; padding-top: 16rpx;
border-top: 1px solid #f5f5f5; border-top: 1px solid #e5e5e5;
.action-btn { .action-btn {
padding: 8rpx 24rpx; padding: 8rpx 24rpx;
@ -465,8 +573,8 @@ onMounted(() => {
border-radius: 8rpx; border-radius: 8rpx;
&.edit { &.edit {
color: #007aff; color: $primary-color;
background-color: #e6f2ff; background-color: $primary-light;
} }
&.delete { &.delete {
@ -497,24 +605,6 @@ onMounted(() => {
} }
} }
.add-phrase-btn {
display: flex;
align-items: center;
justify-content: center;
margin: 24rpx 32rpx;
padding: 24rpx;
font-size: 28rpx;
color: #fff;
background-color: #ff6b35;
border-radius: 12rpx;
.plus-icon-white {
font-size: 36rpx;
margin-right: 8rpx;
font-weight: 600;
}
}
.popup-mask { .popup-mask {
position: fixed; position: fixed;
top: 0; top: 0;
@ -582,7 +672,8 @@ onMounted(() => {
&.confirm-btn { &.confirm-btn {
color: #fff; color: #fff;
background-color: #ff6b35; background: linear-gradient(270deg, $primary-gradient-start 2.26%, $primary-gradient-end 94.33%);
box-shadow: 0 2rpx 8rpx rgba(8, 119, 241, 0.2);
} }
} }
} }

View File

@ -150,6 +150,23 @@ const sendTextMessage = async () => {
inputText.value = ""; inputText.value = "";
}; };
//
const sendTextMessageFromPhrase = async (content) => {
if (!content.trim()) return;
await sendMessage("text", content);
//
nextTick(() => {
emit("scrollToBottom");
});
};
//
defineExpose({
sendTextMessageFromPhrase
});
// //
const sendImageMessage = async (imageFile) => { const sendImageMessage = async (imageFile) => {
console.log("chat-input sendImageMessage 被调用,参数:", imageFile); console.log("chat-input sendImageMessage 被调用,参数:", imageFile);
@ -337,14 +354,40 @@ const sendSurveyMessage = async () => {
await sendCustomMessage(surveyMessage); await sendCustomMessage(surveyMessage);
}; };
// //
const goToCommonPhrases = () => {
uni.navigateTo({
url: '/pages/message/common-phrases'
});
};
const morePanelButtons = [ const morePanelButtons = [
{ text: "照片", icon: "/static/home/photo.png", action: showImagePicker }, { text: "照片", icon: "/static/icon/zhaopian.png", action: showImagePicker },
{ text: "拍摄", icon: "/static/home/video.png", action: takePhoto }, {
// { text: '', icon: '/static/home/avatar.svg', action: sendSymptomMessage }, text: "回访任务",
// { text: '', icon: '/static/home/avatar.svg', action: sendPrescriptionMessage }, icon: "/static/icon/zhaopian.png",
// { text: '', icon: '/static/home/avatar.svg', action: sendRefillMessage }, action: showImagePicker,
// { text: '', icon: '/static/home/avatar.svg', action: sendSurveyMessage } },
{
text: "常用语",
icon: "/static/icon/changyongyu.png",
action: goToCommonPhrases,
},
{
text: "宣教",
icon: "/static/icon/xuanjiaowenzhang.png",
action: showImagePicker,
},
{
text: "问卷",
icon: "/static/icon/zhaopian.png",
action: showImagePicker,
},
{
text: "结束问诊",
icon: "/static/icon/jieshuzixun.png",
action: showImagePicker,
},
]; ];
function handleInputFocus() { function handleInputFocus() {

View File

@ -111,6 +111,7 @@
<!-- 聊天输入组件 --> <!-- 聊天输入组件 -->
<ChatInput <ChatInput
v-if="!isEvaluationPopupOpen" v-if="!isEvaluationPopupOpen"
ref="chatInputRef"
:timChatManager="timChatManager" :timChatManager="timChatManager"
:formatTime="formatTime" :formatTime="formatTime"
@scrollToBottom="() => scrollToBottom(true)" @scrollToBottom="() => scrollToBottom(true)"
@ -153,6 +154,9 @@ const timChatManager = globalTimChatManager;
const { account, openid, isIMInitialized } = storeToRefs(useAccountStore()); const { account, openid, isIMInitialized } = storeToRefs(useAccountStore());
const { initIMAfterLogin } = useAccountStore(); const { initIMAfterLogin } = useAccountStore();
//
const chatInputRef = ref(null);
const groupId = ref(""); const groupId = ref("");
const { const {
chatMember, chatMember,
@ -590,6 +594,18 @@ onHide(() => {
stopIMMonitoring(); stopIMMonitoring();
}); });
//
const sendCommonPhrase = (content) => {
if (chatInputRef.value) {
chatInputRef.value.sendTextMessageFromPhrase(content);
}
};
//
defineExpose({
sendCommonPhrase
});
// //
onUnmounted(() => { onUnmounted(() => {
clearMessageCache(); clearMessageCache();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -15,7 +15,12 @@ const urlsConfig = {
}, },
knowledgeBase: { knowledgeBase: {
getArticleByIds: 'getArticleByIds' getArticleByIds: 'getArticleByIds',
getCommonPhrases: 'getCommonPhrases',
saveCommonPhrase: 'saveCommonPhrase',
deleteCommonPhrase: 'deleteCommonPhrase',
getCommonPhraseCategories: 'getCommonPhraseCategories',
saveCommonPhraseCategory: 'saveCommonPhraseCategory'
}, },
member: { member: {
addCustomer: 'add', addCustomer: 'add',