Compare commits
No commits in common. "826924db78a47dfb7fc03566747eca82328ca3d5" and "c0f51f8370df7733d1fc7d48b40c94ac7329752d" have entirely different histories.
826924db78
...
c0f51f8370
@ -110,13 +110,6 @@
|
|||||||
"disableScroll": true
|
"disableScroll": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "benefit-entry",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "权益录入",
|
|
||||||
"disableScroll": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "index",
|
"path": "index",
|
||||||
"style": {
|
"style": {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -338,18 +338,6 @@ $primary-color: #0877F1;
|
|||||||
border-top: 10rpx solid transparent;
|
border-top: 10rpx solid transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom-bubble,
|
|
||||||
.benefit-bubble {
|
|
||||||
padding: 0;
|
|
||||||
border-radius: 0;
|
|
||||||
background: transparent;
|
|
||||||
overflow: visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
.benefit-bubble {
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 医生发送的蓝色气泡(用于消息卡片) */
|
/* 医生发送的蓝色气泡(用于消息卡片) */
|
||||||
.doctor-bubble-blue {
|
.doctor-bubble-blue {
|
||||||
background-color: #0877F1;
|
background-color: #0877F1;
|
||||||
|
|||||||
@ -13,11 +13,13 @@
|
|||||||
<view class="input-area">
|
<view class="input-area">
|
||||||
<!-- :hold-keyboard="true" -->
|
<!-- :hold-keyboard="true" -->
|
||||||
<textarea v-if="!showVoiceInput" class="text-input" v-model="inputText" placeholder="我来说两句..."
|
<textarea v-if="!showVoiceInput" class="text-input" v-model="inputText" placeholder="我来说两句..."
|
||||||
@confirm="sendTextMessage" @focus="handleInputFocus" @input="handleInput" :auto-height="true"
|
@confirm="sendTextMessage" @focus="handleInputFocus" @input="handleInput"
|
||||||
:show-confirm-bar="false" :cursor-spacing="40" ref="textareaRef" />
|
:auto-height="true" :show-confirm-bar="false" :cursor-spacing="40"
|
||||||
|
ref="textareaRef"
|
||||||
|
/>
|
||||||
<input v-else class="voice-input-btn" :class="{ recording: isRecording }" @touchstart="startRecord"
|
<input v-else class="voice-input-btn" :class="{ recording: isRecording }" @touchstart="startRecord"
|
||||||
@touchmove="onRecordTouchMove" @touchend="stopRecord" @touchcancel="cancelRecord"
|
@touchmove="onRecordTouchMove" @touchend="stopRecord" @touchcancel="cancelRecord" :placeholder="isRecording ? '松开发送' : '按住说话'" disabled>
|
||||||
:placeholder="isRecording ? '松开发送' : '按住说话'" disabled />
|
</input>
|
||||||
</view>
|
</view>
|
||||||
<button v-if="inputText.trim() && !props.isGenerating" class="send-btn" @click="sendTextMessage">
|
<button v-if="inputText.trim() && !props.isGenerating" class="send-btn" @click="sendTextMessage">
|
||||||
发送
|
发送
|
||||||
@ -85,7 +87,6 @@ const props = defineProps({
|
|||||||
groupId: { type: String, default: "" },
|
groupId: { type: String, default: "" },
|
||||||
userId: { type: String, default: "" },
|
userId: { type: String, default: "" },
|
||||||
teamId: { type: String, default: "" },
|
teamId: { type: String, default: "" },
|
||||||
teamName: { type: String, default: "" },
|
|
||||||
patientId: { type: String, default: "" },
|
patientId: { type: String, default: "" },
|
||||||
corpId: { type: String, default: "" },
|
corpId: { type: String, default: "" },
|
||||||
orderStatus: { type: String, default: "" },
|
orderStatus: { type: String, default: "" },
|
||||||
@ -408,14 +409,6 @@ const goToArticleList = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// 跳转到权益录入页面
|
|
||||||
const goToBenefitEntry = () => {
|
|
||||||
showMorePanel.value = false;
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pages/message/benefit-entry?groupId=${encodeURIComponent(props.groupId)}&patientId=${encodeURIComponent(props.patientId)}&patientName=${encodeURIComponent(props.patientInfo.name || "")}&teamId=${encodeURIComponent(props.teamId)}&teamName=${encodeURIComponent(props.teamName)}&corpId=${encodeURIComponent(props.corpId)}`,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// 跳转到问卷列表页面
|
// 跳转到问卷列表页面
|
||||||
const goToSurveyList = () => {
|
const goToSurveyList = () => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@ -481,11 +474,6 @@ const morePanelButtons = computed(() => {
|
|||||||
icon: "/static/icon/xuanjiaowenzhang.png",
|
icon: "/static/icon/xuanjiaowenzhang.png",
|
||||||
action: goToArticleList,
|
action: goToArticleList,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
text: "权益录入",
|
|
||||||
icon: "/static/icon/quanyi.svg",
|
|
||||||
action: goToBenefitEntry,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
text: "问卷",
|
text: "问卷",
|
||||||
icon: "/static/icon/wenjuan.png",
|
icon: "/static/icon/wenjuan.png",
|
||||||
|
|||||||
@ -37,7 +37,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 自定义消息卡片 -->
|
<!-- 自定义消息卡片 -->
|
||||||
<block v-else-if="message.type === 'TIMCustomElem'">
|
<template v-else-if="message.type === 'TIMCustomElem'">
|
||||||
<!-- 文章消息 -->
|
<!-- 文章消息 -->
|
||||||
<view v-if="customMessageType === 'article'" class="article-card" @click="handleArticleClick(message)">
|
<view v-if="customMessageType === 'article'" class="article-card" @click="handleArticleClick(message)">
|
||||||
<view class="article-content">
|
<view class="article-content">
|
||||||
@ -56,28 +56,6 @@
|
|||||||
<image v-if="surveyData.imgUrl" class="survey-image" :src="surveyData.imgUrl" mode="aspectFill" />
|
<image v-if="surveyData.imgUrl" class="survey-image" :src="surveyData.imgUrl" mode="aspectFill" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 权益消息 -->
|
|
||||||
<view v-else-if="customMessageType === 'benefit'" class="benefit-card">
|
|
||||||
<view class="benefit-title">{{ benefitData.title }}</view>
|
|
||||||
<view class="benefit-content">
|
|
||||||
<view v-for="(item, index) in benefitData.items" :key="`${item.projectId}-${index}`" class="benefit-item">
|
|
||||||
<view class="benefit-project-row">
|
|
||||||
<text v-if="index === 0" class="benefit-label">项目:</text>
|
|
||||||
<text v-else class="benefit-label-placeholder"></text>
|
|
||||||
<text class="benefit-project-name">{{ item.projectName }}</text>
|
|
||||||
<text class="benefit-count">X{{ item.usageCount }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="benefit-valid-row">
|
|
||||||
<text class="benefit-valid-label">有效期:</text>
|
|
||||||
<text class="benefit-valid-value">{{ item.validTimeText || '无限期' }}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="benefit-detail-button" @click.stop="handleBenefitClick">
|
|
||||||
<text class="benefit-detail-text">查看详情</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 其他自定义消息 -->
|
<!-- 其他自定义消息 -->
|
||||||
<!-- <view
|
<!-- <view
|
||||||
v-else
|
v-else
|
||||||
@ -91,7 +69,7 @@
|
|||||||
@viewDetail="$emit('viewDetail', $event)"
|
@viewDetail="$emit('viewDetail', $event)"
|
||||||
/>
|
/>
|
||||||
</view> -->
|
</view> -->
|
||||||
</block>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@ -146,19 +124,6 @@ const surveyData = computed(() => ({
|
|||||||
imgUrl: payloadData.value.imgUrl || "",
|
imgUrl: payloadData.value.imgUrl || "",
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const benefitData = computed(() => ({
|
|
||||||
title: payloadData.value.title || "医生为您录入专属权益",
|
|
||||||
patientId: payloadData.value.patientId || "",
|
|
||||||
items: Array.isArray(payloadData.value.items) ? payloadData.value.items : [],
|
|
||||||
}))
|
|
||||||
|
|
||||||
const handleBenefitClick = () => {
|
|
||||||
if (!benefitData.value.patientId) return;
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pages/case/archive-detail?id=${encodeURIComponent(String(benefitData.value.patientId))}`,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 计算图片样式
|
// 计算图片样式
|
||||||
const getImageStyle = (imageInfo) => {
|
const getImageStyle = (imageInfo) => {
|
||||||
// 如果没有尺寸信息,使用默认样式
|
// 如果没有尺寸信息,使用默认样式
|
||||||
@ -299,95 +264,4 @@ function isWechatChannels(data) {
|
|||||||
width: 480rpx;
|
width: 480rpx;
|
||||||
height: 320rpx;
|
height: 320rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.benefit-card {
|
|
||||||
width: 520rpx;
|
|
||||||
max-width: 100%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
border-radius: 10rpx;
|
|
||||||
padding: 22rpx 18rpx 18rpx;
|
|
||||||
background: linear-gradient(180deg, #0b75f2 0%, #0067df 100%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.benefit-title {
|
|
||||||
color: #fff;
|
|
||||||
font-size: 32rpx;
|
|
||||||
font-weight: 600;
|
|
||||||
line-height: 1.3;
|
|
||||||
margin-bottom: 18rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.benefit-content {
|
|
||||||
border: 4rpx solid rgba(255, 255, 255, 0.28);
|
|
||||||
border-radius: 8rpx;
|
|
||||||
padding: 24rpx 24rpx 28rpx;
|
|
||||||
background: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.benefit-item + .benefit-item {
|
|
||||||
margin-top: 18rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.benefit-project-row {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
min-width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.benefit-label,
|
|
||||||
.benefit-label-placeholder {
|
|
||||||
flex-shrink: 0;
|
|
||||||
width: 104rpx;
|
|
||||||
color: #8b8f96;
|
|
||||||
font-size: 28rpx;
|
|
||||||
line-height: 1.4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.benefit-project-name {
|
|
||||||
flex: 1;
|
|
||||||
min-width: 0;
|
|
||||||
color: #111827;
|
|
||||||
font-size: 30rpx;
|
|
||||||
line-height: 1.4;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.benefit-count {
|
|
||||||
flex-shrink: 0;
|
|
||||||
margin-left: 16rpx;
|
|
||||||
color: #111827;
|
|
||||||
font-size: 30rpx;
|
|
||||||
line-height: 1.4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.benefit-valid-row {
|
|
||||||
display: flex;
|
|
||||||
margin-left: 104rpx;
|
|
||||||
margin-top: 8rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.benefit-valid-label,
|
|
||||||
.benefit-valid-value {
|
|
||||||
color: #8b8f96;
|
|
||||||
font-size: 26rpx;
|
|
||||||
line-height: 1.4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.benefit-detail-button {
|
|
||||||
height: 82rpx;
|
|
||||||
margin-top: 28rpx;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
background: linear-gradient(180deg, #0b75f2 0%, #0067df 100%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.benefit-detail-text {
|
|
||||||
color: #fff;
|
|
||||||
font-size: 32rpx;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
@ -151,7 +151,6 @@
|
|||||||
"
|
"
|
||||||
:userId="openid"
|
:userId="openid"
|
||||||
:teamId="teamId"
|
:teamId="teamId"
|
||||||
:teamName="teamName"
|
|
||||||
:patientId="patientId"
|
:patientId="patientId"
|
||||||
:corpId="corpId"
|
:corpId="corpId"
|
||||||
:patientInfo="patientInfo"
|
:patientInfo="patientInfo"
|
||||||
@ -242,7 +241,7 @@ import {
|
|||||||
const timChatManager = globalTimChatManager;
|
const timChatManager = globalTimChatManager;
|
||||||
|
|
||||||
const PENDING_FOLLOWUP_SEND_STORAGE_KEY = "ykt_followup_pending_send";
|
const PENDING_FOLLOWUP_SEND_STORAGE_KEY = "ykt_followup_pending_send";
|
||||||
const pendingFollowUpSendConsumedToken = ref("");
|
const pendingFollowUpSendConsumed = ref(false);
|
||||||
const initialMessageListLoaded = ref(false);
|
const initialMessageListLoaded = ref(false);
|
||||||
const isCallbacksInitialized = ref(false); // 标记回调是否已初始化
|
const isCallbacksInitialized = ref(false); // 标记回调是否已初始化
|
||||||
|
|
||||||
@ -253,18 +252,17 @@ function normalizeGroupId(v) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function tryConsumePendingFollowUpSend() {
|
async function tryConsumePendingFollowUpSend() {
|
||||||
const raw = uni.getStorageSync(PENDING_FOLLOWUP_SEND_STORAGE_KEY);
|
if (pendingFollowUpSendConsumed.value) return;
|
||||||
const payload = raw && typeof raw === "object" ? raw : null;
|
|
||||||
if (!payload) return;
|
|
||||||
|
|
||||||
const createdAt = Number(payload.createdAt || 0) || 0;
|
|
||||||
const payloadToken = String(createdAt || payload.conversationID || "");
|
|
||||||
if (payloadToken && pendingFollowUpSendConsumedToken.value === payloadToken) return;
|
|
||||||
|
|
||||||
// 等待 IM 就绪与首屏消息加载完成,避免发送的本地消息被列表回调覆盖
|
// 等待 IM 就绪与首屏消息加载完成,避免发送的本地消息被列表回调覆盖
|
||||||
if (!timChatManager?.isLoggedIn) return;
|
if (!timChatManager?.isLoggedIn) return;
|
||||||
if (!initialMessageListLoaded.value) return;
|
if (!initialMessageListLoaded.value) return;
|
||||||
|
|
||||||
|
const raw = uni.getStorageSync(PENDING_FOLLOWUP_SEND_STORAGE_KEY);
|
||||||
|
const payload = raw && typeof raw === "object" ? raw : null;
|
||||||
|
if (!payload) return;
|
||||||
|
|
||||||
|
const createdAt = Number(payload.createdAt || 0) || 0;
|
||||||
// 过期就清理,避免误发送
|
// 过期就清理,避免误发送
|
||||||
if (createdAt && Date.now() - createdAt > 5 * 60 * 1000) {
|
if (createdAt && Date.now() - createdAt > 5 * 60 * 1000) {
|
||||||
uni.removeStorageSync(PENDING_FOLLOWUP_SEND_STORAGE_KEY);
|
uni.removeStorageSync(PENDING_FOLLOWUP_SEND_STORAGE_KEY);
|
||||||
@ -292,7 +290,7 @@ async function tryConsumePendingFollowUpSend() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
pendingFollowUpSendConsumedToken.value = payloadToken;
|
pendingFollowUpSendConsumed.value = true;
|
||||||
// 先清理再发,避免页面重复初始化导致二次发送
|
// 先清理再发,避免页面重复初始化导致二次发送
|
||||||
uni.removeStorageSync(PENDING_FOLLOWUP_SEND_STORAGE_KEY);
|
uni.removeStorageSync(PENDING_FOLLOWUP_SEND_STORAGE_KEY);
|
||||||
|
|
||||||
@ -356,7 +354,6 @@ const patientInfo = ref({
|
|||||||
// 患者ID
|
// 患者ID
|
||||||
const patientId = ref("");
|
const patientId = ref("");
|
||||||
const teamId = ref("");
|
const teamId = ref("");
|
||||||
const teamName = ref("");
|
|
||||||
|
|
||||||
// 计算弹框显示状态 - 只有 pending 状态才显示接受问诊组件
|
// 计算弹框显示状态 - 只有 pending 状态才显示接受问诊组件
|
||||||
const showConsultAccept = computed(() => orderStatus.value === "pending");
|
const showConsultAccept = computed(() => orderStatus.value === "pending");
|
||||||
@ -418,10 +415,9 @@ const fetchGroupOrderStatus = async () => {
|
|||||||
if (result.success && result.data) {
|
if (result.success && result.data) {
|
||||||
orderStatus.value = result.data.orderStatus || "";
|
orderStatus.value = result.data.orderStatus || "";
|
||||||
|
|
||||||
const resolvedTeamName = result.data.team?.name || "";
|
// 更新导航栏标题为团队名称
|
||||||
const navigationTeamName = resolvedTeamName || "群聊";
|
const teamName = result.data.team?.name || "群聊";
|
||||||
teamName.value = resolvedTeamName;
|
updateNavigationTitle(teamName);
|
||||||
updateNavigationTitle(navigationTeamName);
|
|
||||||
|
|
||||||
teamId.value =
|
teamId.value =
|
||||||
result.data.teamId ||
|
result.data.teamId ||
|
||||||
@ -445,7 +441,7 @@ const fetchGroupOrderStatus = async () => {
|
|||||||
|
|
||||||
console.log("获取群组订单状态:", {
|
console.log("获取群组订单状态:", {
|
||||||
orderStatus: orderStatus.value,
|
orderStatus: orderStatus.value,
|
||||||
teamName: teamName.value,
|
teamName: teamName,
|
||||||
patientInfo: patientInfo.value,
|
patientInfo: patientInfo.value,
|
||||||
groupId: groupId.value,
|
groupId: groupId.value,
|
||||||
});
|
});
|
||||||
@ -457,17 +453,6 @@ const fetchGroupOrderStatus = async () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function getCustomMessageType(message) {
|
|
||||||
try {
|
|
||||||
const data = typeof message.payload?.data === "string"
|
|
||||||
? JSON.parse(message.payload.data)
|
|
||||||
: message.payload?.data || {};
|
|
||||||
return data?.type || "";
|
|
||||||
} catch (error) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取消息气泡样式类
|
// 获取消息气泡样式类
|
||||||
function getBubbleClass(message) {
|
function getBubbleClass(message) {
|
||||||
// 图片消息不需要气泡背景
|
// 图片消息不需要气泡背景
|
||||||
@ -475,10 +460,7 @@ function getBubbleClass(message) {
|
|||||||
return "image-bubble";
|
return "image-bubble";
|
||||||
}
|
}
|
||||||
if (message.type === "TIMCustomElem") {
|
if (message.type === "TIMCustomElem") {
|
||||||
if (getCustomMessageType(message) === "benefit") {
|
return message.flow === "out" ? "" : "";
|
||||||
return "benefit-bubble";
|
|
||||||
}
|
|
||||||
return "custom-bubble";
|
|
||||||
}
|
}
|
||||||
return message.flow === "out" ? "user-bubble" : "doctor-bubble";
|
return message.flow === "out" ? "user-bubble" : "doctor-bubble";
|
||||||
}
|
}
|
||||||
@ -973,9 +955,6 @@ onShow(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
startIMMonitoring(30000);
|
startIMMonitoring(30000);
|
||||||
nextTick(() => {
|
|
||||||
tryConsumePendingFollowUpSend();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 监听回访任务发送事件
|
// 监听回访任务发送事件
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.8 KiB |
@ -1,9 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="104" height="104" viewBox="0 0 104 104">
|
|
||||||
<rect width="104" height="104" fill="#ffffff"/>
|
|
||||||
<g fill="none" stroke="#7d8e9e" stroke-width="4.5" stroke-linecap="round" stroke-linejoin="round">
|
|
||||||
<path d="M33 31.5h27.5a3 3 0 0 1 3 3v29a3 3 0 0 1-3 3H33a3 3 0 0 1-3-3v-29a3 3 0 0 1 3-3Z"/>
|
|
||||||
<path d="M39 42h15M39 49h15M39 56h8"/>
|
|
||||||
<circle cx="62.5" cy="63" r="12.5" fill="#ffffff"/>
|
|
||||||
<path d="m62.5 56.8 1.8 3.7 4.1.6-3 2.9.7 4.1-3.6-1.9-3.7 1.9.7-4.1-3-2.9 4.1-.6 1.8-3.7Z" fill="#7d8e9e" stroke="none"/>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 575 B |
@ -17,7 +17,6 @@ const urlsConfig = {
|
|||||||
getTemplateListByTemptype: 'getTemplateListByTemptype',
|
getTemplateListByTemptype: 'getTemplateListByTemptype',
|
||||||
wxAppLogin: 'wxAppLogin',
|
wxAppLogin: 'wxAppLogin',
|
||||||
getDeptList: 'getRealDeptList',
|
getDeptList: 'getRealDeptList',
|
||||||
getTreatmentDeptList: "getDeptList",
|
|
||||||
getHospitalList: 'getRealHospital',
|
getHospitalList: 'getRealHospital',
|
||||||
addCorpMember: 'addCorpMember',
|
addCorpMember: 'addCorpMember',
|
||||||
getCorpMemberData: 'getCorpMemberData',
|
getCorpMemberData: 'getCorpMemberData',
|
||||||
@ -27,7 +26,6 @@ const urlsConfig = {
|
|||||||
submitCertProfile: 'submitCertProfile',
|
submitCertProfile: 'submitCertProfile',
|
||||||
getMemberVerifyStatus: "getMemberVerifyStatus",
|
getMemberVerifyStatus: "getMemberVerifyStatus",
|
||||||
getJoinedTeams: "getJoinedTeams",
|
getJoinedTeams: "getJoinedTeams",
|
||||||
getProjectList: "getProjectList",
|
|
||||||
updateTeamInfo: "updateTeamInfo",
|
updateTeamInfo: "updateTeamInfo",
|
||||||
createOwnTeam: 'createOwnTeam',
|
createOwnTeam: 'createOwnTeam',
|
||||||
removeTeammate: "removeTeammate",
|
removeTeammate: "removeTeammate",
|
||||||
@ -93,7 +91,6 @@ const urlsConfig = {
|
|||||||
unbindMiniAppArchive: 'unbindMiniAppArchive',
|
unbindMiniAppArchive: 'unbindMiniAppArchive',
|
||||||
// 健康档案相关接口
|
// 健康档案相关接口
|
||||||
addMedicalRecord: 'addMedicalRecord',
|
addMedicalRecord: 'addMedicalRecord',
|
||||||
addTreatmentRecord: "addTreatmentRecord",
|
|
||||||
getMedicalRecordById: 'getMedicalRecordById',
|
getMedicalRecordById: 'getMedicalRecordById',
|
||||||
updateMedicalRecord: 'updateMedicalRecord',
|
updateMedicalRecord: 'updateMedicalRecord',
|
||||||
removeMedicalRecord: 'removeMedicalRecord',
|
removeMedicalRecord: 'removeMedicalRecord',
|
||||||
@ -107,6 +104,7 @@ const urlsConfig = {
|
|||||||
im: {
|
im: {
|
||||||
getUserSig: 'getUserSig',
|
getUserSig: 'getUserSig',
|
||||||
sendSystemMessage: "sendSystemMessage",
|
sendSystemMessage: "sendSystemMessage",
|
||||||
|
getChatRecordsByGroupId: "getChatRecordsByGroupId",
|
||||||
sendConsultRejectedMessage: "sendConsultRejectedMessage",
|
sendConsultRejectedMessage: "sendConsultRejectedMessage",
|
||||||
endConsultation: "endConsultation",
|
endConsultation: "endConsultation",
|
||||||
openConsultation: "openConsultation",
|
openConsultation: "openConsultation",
|
||||||
|
|||||||
@ -402,45 +402,6 @@ function buildSurveyMessage(survey, surveyLink) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function sendBenefitMessage(benefit, options = {}) {
|
|
||||||
if (!benefit || !Array.isArray(benefit.items) || !benefit.items.length) {
|
|
||||||
toast('权益信息不完整');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (!globalTimChatManager?.isLoggedIn) {
|
|
||||||
toast('IM系统未就绪,请稍后重试');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const customMessageData = {
|
|
||||||
type: 'benefit',
|
|
||||||
messageType: 'benefit',
|
|
||||||
title: benefit.title || '医生为您录入专属权益',
|
|
||||||
desc: benefit.desc || '点击查看详情',
|
|
||||||
patientId: benefit.patientId || options.customerId || '',
|
|
||||||
patientName: benefit.patientName || options.customerName || '',
|
|
||||||
corpId: benefit.corpId || options.corpId || '',
|
|
||||||
teamId: benefit.teamId || options.teamId || '',
|
|
||||||
items: benefit.items.map((item) => ({
|
|
||||||
projectId: item.projectId || '',
|
|
||||||
projectName: item.projectName || '',
|
|
||||||
usageCount: Number(item.usageCount || 0),
|
|
||||||
validTime: item.validTime || null,
|
|
||||||
validTimeText: item.validTimeText || '无限期',
|
|
||||||
})),
|
|
||||||
};
|
|
||||||
|
|
||||||
const result = await globalTimChatManager.sendCustomMessage(customMessageData);
|
|
||||||
return Boolean(result?.success);
|
|
||||||
} catch (error) {
|
|
||||||
console.error('发送权益消息异常:', error);
|
|
||||||
toast('发送权益消息失败');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理回访任务消息发送
|
* 处理回访任务消息发送
|
||||||
* @param {Object} messages - 消息数组
|
* @param {Object} messages - 消息数组
|
||||||
@ -478,14 +439,6 @@ export async function handleFollowUpMessages(messages, context = {}) {
|
|||||||
customerName: context.customerName,
|
customerName: context.customerName,
|
||||||
corpId: context.corpId
|
corpId: context.corpId
|
||||||
});
|
});
|
||||||
} else if (msg.type === 'benefit') {
|
|
||||||
success = await sendBenefitMessage(msg.content, {
|
|
||||||
userId: context.userId,
|
|
||||||
customerId: context.customerId,
|
|
||||||
customerName: context.customerName,
|
|
||||||
corpId: context.corpId,
|
|
||||||
teamId: context.teamId,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user