Merge branch 'dev-wdb' of http://175.27.226.205:3000/huxuejian/ykt-wxapp into dev-wdb
This commit is contained in:
commit
b08830c7ad
@ -50,7 +50,7 @@
|
|||||||
"quickapp" : {},
|
"quickapp" : {},
|
||||||
/* 小程序特有相关 */
|
/* 小程序特有相关 */
|
||||||
"mp-weixin" : {
|
"mp-weixin" : {
|
||||||
"appid" : "wx93af55767423938e",
|
"appid" : "wx1d8337a40c11d66c",
|
||||||
"setting" : {
|
"setting" : {
|
||||||
"urlCheck" : false
|
"urlCheck" : false
|
||||||
},
|
},
|
||||||
|
|||||||
@ -5,12 +5,12 @@
|
|||||||
<view class="mt-12 text-base text-dark">生命全周期健康管理伙伴</view>
|
<view class="mt-12 text-base text-dark">生命全周期健康管理伙伴</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="login-btn-wrap">
|
<view class="login-btn-wrap">
|
||||||
<!-- <button v-if="checked" class="login-btn" type="primary" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
|
<button v-if="checked" class="login-btn" type="primary" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
|
||||||
手机号快捷登录
|
|
||||||
</button> -->
|
|
||||||
<button v-if="checked" class="login-btn" type="primary" @click="getPhoneNumber()">
|
|
||||||
手机号快捷登录
|
手机号快捷登录
|
||||||
</button>
|
</button>
|
||||||
|
<!-- <button v-if="checked" class="login-btn" type="primary" @click="getPhoneNumber()">
|
||||||
|
手机号快捷登录
|
||||||
|
</button> -->
|
||||||
<button v-else class="login-btn" type="primary" @click="remind()">
|
<button v-else class="login-btn" type="primary" @click="remind()">
|
||||||
手机号快捷登录
|
手机号快捷登录
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@ -120,7 +120,7 @@ const corpId = env.MP_CORP_ID;
|
|||||||
// 从页面参数获取群组信息
|
// 从页面参数获取群组信息
|
||||||
const pageParams = ref({
|
const pageParams = ref({
|
||||||
groupId: "",
|
groupId: "",
|
||||||
userId: "",
|
patientId: "",
|
||||||
corpId: "",
|
corpId: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -323,8 +323,19 @@ const sendArticle = async (article) => {
|
|||||||
imgUrl: article.cover || "",
|
imgUrl: article.cover || "",
|
||||||
desc: "点击查看详情",
|
desc: "点击查看详情",
|
||||||
});
|
});
|
||||||
|
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
|
// 记录文章发送记录
|
||||||
|
try {
|
||||||
|
await api("addArticleSendRecord", {
|
||||||
|
articleId: article._id,
|
||||||
|
userId: doctorInfo.userid,
|
||||||
|
customerId: pageParams.value.patientId,
|
||||||
|
corpId: corpId,
|
||||||
|
});
|
||||||
|
} catch (recordError) {
|
||||||
|
console.error("记录文章发送失败:", recordError);
|
||||||
|
}
|
||||||
|
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
} else {
|
} else {
|
||||||
throw new Error(result.message || "发送失败");
|
throw new Error(result.message || "发送失败");
|
||||||
@ -350,8 +361,8 @@ onLoad((options) => {
|
|||||||
if (options.groupId) {
|
if (options.groupId) {
|
||||||
pageParams.value.groupId = options.groupId;
|
pageParams.value.groupId = options.groupId;
|
||||||
}
|
}
|
||||||
if (options.userId) {
|
if (options.patientId) {
|
||||||
pageParams.value.userId = options.userId;
|
pageParams.value.patientId = options.patientId;
|
||||||
}
|
}
|
||||||
if (options.corpId) {
|
if (options.corpId) {
|
||||||
pageParams.value.corpId = options.corpId;
|
pageParams.value.corpId = options.corpId;
|
||||||
|
|||||||
@ -436,10 +436,8 @@ $primary-color: #0877F1;
|
|||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
padding: 0 46rpx;
|
padding: 0 46rpx;
|
||||||
}
|
|
||||||
|
|
||||||
.voice-input-btn {
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 80rpx;
|
line-height: 80rpx;
|
||||||
}
|
}
|
||||||
@ -1003,7 +1001,15 @@ $primary-color: #0877F1;
|
|||||||
.text-input::-moz-placeholder,
|
.text-input::-moz-placeholder,
|
||||||
.text-input:-ms-input-placeholder,
|
.text-input:-ms-input-placeholder,
|
||||||
.text-input::placeholder {
|
.text-input::placeholder {
|
||||||
line-height: 96rpx;
|
line-height: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.voice-input-btn::-webkit-input-placeholder,
|
||||||
|
.voice-input-btn:-moz-placeholder,
|
||||||
|
.voice-input-btn::-moz-placeholder,
|
||||||
|
.voice-input-btn:-ms-input-placeholder,
|
||||||
|
.voice-input-btn::placeholder {
|
||||||
|
line-height: 80rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 时间分割线 */
|
/* 时间分割线 */
|
||||||
|
|||||||
@ -75,6 +75,7 @@ const props = defineProps({
|
|||||||
formatTime: { type: Function, required: true },
|
formatTime: { type: Function, required: true },
|
||||||
groupId: { type: String, default: '' },
|
groupId: { type: String, default: '' },
|
||||||
userId: { type: String, default: '' },
|
userId: { type: String, default: '' },
|
||||||
|
patientId: { type: String, default: '' },
|
||||||
corpId: { type: String, default: '' },
|
corpId: { type: String, default: '' },
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -385,7 +386,7 @@ const goToCommonPhrases = () => {
|
|||||||
// 跳转到宣教文章页面
|
// 跳转到宣教文章页面
|
||||||
const goToArticleList = () => {
|
const goToArticleList = () => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/message/article-list?groupId=${props.groupId}&userId=${props.userId}&corpId=${props.corpId}`
|
url: `/pages/message/article-list?groupId=${props.groupId}&patientId=${props.patientId}&corpId=${props.corpId}`
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,9 @@
|
|||||||
<view class="patient-info-content">
|
<view class="patient-info-content">
|
||||||
<view class="patient-basic-info">
|
<view class="patient-basic-info">
|
||||||
<text class="patient-name">{{ patientInfo.name }}</text>
|
<text class="patient-name">{{ patientInfo.name }}</text>
|
||||||
<text class="patient-detail">{{ patientInfo.sex }} · {{ patientInfo.age }}岁</text>
|
<text class="patient-detail"
|
||||||
|
>{{ patientInfo.sex }} · {{ patientInfo.age }}岁</text
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
<view class="patient-detail-btn" @click="handleViewPatientDetail">
|
<view class="patient-detail-btn" @click="handleViewPatientDetail">
|
||||||
<text class="detail-btn-text">查看档案</text>
|
<text class="detail-btn-text">查看档案</text>
|
||||||
@ -164,6 +166,7 @@
|
|||||||
: ''
|
: ''
|
||||||
"
|
"
|
||||||
:userId="openid"
|
:userId="openid"
|
||||||
|
:patientId="patientId"
|
||||||
:corpId="corpId"
|
:corpId="corpId"
|
||||||
@scrollToBottom="() => scrollToBottom(true)"
|
@scrollToBottom="() => scrollToBottom(true)"
|
||||||
@messageSent="() => scrollToBottom(true)"
|
@messageSent="() => scrollToBottom(true)"
|
||||||
@ -247,6 +250,9 @@ const patientInfo = ref({
|
|||||||
mobile: "",
|
mobile: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 患者ID
|
||||||
|
const patientId = ref("");
|
||||||
|
|
||||||
// 计算弹框显示状态 - 只有 pending 状态才显示接受问诊组件
|
// 计算弹框显示状态 - 只有 pending 状态才显示接受问诊组件
|
||||||
const showConsultAccept = computed(() => orderStatus.value === "pending");
|
const showConsultAccept = computed(() => orderStatus.value === "pending");
|
||||||
|
|
||||||
@ -320,6 +326,10 @@ const fetchGroupOrderStatus = async () => {
|
|||||||
mobile: result.data.patient.mobile || "",
|
mobile: result.data.patient.mobile || "",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
// 更新患者ID
|
||||||
|
if (result.data.patientId) {
|
||||||
|
patientId.value = result.data.patientId.toString();
|
||||||
|
}
|
||||||
|
|
||||||
console.log("获取群组订单状态:", {
|
console.log("获取群组订单状态:", {
|
||||||
orderStatus: orderStatus.value,
|
orderStatus: orderStatus.value,
|
||||||
@ -335,12 +345,6 @@ const fetchGroupOrderStatus = async () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 检查是否有待接诊的系统消息
|
|
||||||
function checkConsultPendingStatus() {
|
|
||||||
// 直接获取最新的订单状态
|
|
||||||
fetchGroupOrderStatus();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取消息气泡样式类
|
// 获取消息气泡样式类
|
||||||
function getBubbleClass(message) {
|
function getBubbleClass(message) {
|
||||||
// 图片消息不需要气泡背景
|
// 图片消息不需要气泡背景
|
||||||
@ -454,11 +458,6 @@ const initTIMCallbacks = async () => {
|
|||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
console.log("✓ 收到新消息后已标记为已读");
|
console.log("✓ 收到新消息后已标记为已读");
|
||||||
// 触发会话列表更新,确保未读数为0
|
|
||||||
timChatManager.triggerCallback("onConversationListUpdated", {
|
|
||||||
conversationID: chatInfo.value.conversationID,
|
|
||||||
unreadCount: 0,
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error("✗ 标记已读失败:", error);
|
console.error("✗ 标记已读失败:", error);
|
||||||
@ -518,9 +517,6 @@ const initTIMCallbacks = async () => {
|
|||||||
isCompleted.value = data.isCompleted || false;
|
isCompleted.value = data.isCompleted || false;
|
||||||
isLoadingMore.value = false;
|
isLoadingMore.value = false;
|
||||||
|
|
||||||
// 检查是否有待接诊的系统消息
|
|
||||||
checkConsultPendingStatus();
|
|
||||||
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
if (data.isRefresh) {
|
if (data.isRefresh) {
|
||||||
console.log("后台刷新完成,保持当前滚动位置");
|
console.log("后台刷新完成,保持当前滚动位置");
|
||||||
@ -615,11 +611,6 @@ const loadMessageList = async () => {
|
|||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
console.log("✓ 会话已标记为已读:", chatInfo.value.conversationID);
|
console.log("✓ 会话已标记为已读:", chatInfo.value.conversationID);
|
||||||
// 触发会话列表更新回调,通知消息列表页面清空未读数
|
|
||||||
timChatManager.triggerCallback("onConversationListUpdated", {
|
|
||||||
conversationID: chatInfo.value.conversationID,
|
|
||||||
unreadCount: 0,
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error("✗ 标记会话已读失败:", error);
|
console.error("✗ 标记会话已读失败:", error);
|
||||||
@ -776,6 +767,9 @@ onShow(() => {
|
|||||||
// 页面隐藏
|
// 页面隐藏
|
||||||
onHide(() => {
|
onHide(() => {
|
||||||
stopIMMonitoring();
|
stopIMMonitoring();
|
||||||
|
// 清空当前会话ID,避免离开页面后收到的消息被错误标记为已读
|
||||||
|
timChatManager.currentConversationID = null;
|
||||||
|
console.log("✓ 页面隐藏,已清空当前会话ID");
|
||||||
});
|
});
|
||||||
|
|
||||||
const sendCommonPhrase = (content) => {
|
const sendCommonPhrase = (content) => {
|
||||||
@ -900,11 +894,17 @@ const handleRejectReasonCancel = () => {
|
|||||||
|
|
||||||
// 处理查看患者详情
|
// 处理查看患者详情
|
||||||
const handleViewPatientDetail = () => {
|
const handleViewPatientDetail = () => {
|
||||||
// TODO: 跳转到患者详情页面
|
if (!patientId.value) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "患者详情功能开发中",
|
title: "患者信息不完整",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/case/archive-detail?id=${patientId.value}`,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
// 处理结束问诊
|
// 处理结束问诊
|
||||||
const handleEndConsult = async () => {
|
const handleEndConsult = async () => {
|
||||||
|
|||||||
@ -84,7 +84,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, watch, computed } from "vue";
|
import { ref, computed } from "vue";
|
||||||
import { onLoad, onShow, onHide } from "@dcloudio/uni-app";
|
import { onLoad, onShow, onHide } from "@dcloudio/uni-app";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
import useAccountStore from "@/store/account.js";
|
import useAccountStore from "@/store/account.js";
|
||||||
@ -108,15 +108,6 @@ const { withInfo } = useInfoCheck();
|
|||||||
// 团队相关状态
|
// 团队相关状态
|
||||||
const currentTeamId = ref(""); // 空字符串表示"全部会话消息"
|
const currentTeamId = ref(""); // 空字符串表示"全部会话消息"
|
||||||
|
|
||||||
// 监听 IM 初始化状态
|
|
||||||
watch(isIMInitialized, (newValue) => {
|
|
||||||
console.log("IM初始化状态变化:", newValue);
|
|
||||||
if (newValue) {
|
|
||||||
// IM 已初始化,加载会话列表
|
|
||||||
loadConversationList();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// 状态
|
// 状态
|
||||||
const conversationList = ref([]);
|
const conversationList = ref([]);
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
@ -522,7 +513,10 @@ onShow(async () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 再设置监听器,后续通过事件更新列表
|
// 加载会话列表
|
||||||
|
await loadConversationList();
|
||||||
|
|
||||||
|
// 设置监听器,后续通过事件更新列表
|
||||||
setupConversationListener();
|
setupConversationListener();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("页面初始化失败:", error);
|
console.error("页面初始化失败:", error);
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="i.qrcode" class="flex justify-center overflow-hidden">
|
<view v-if="i.qrcode" class="flex justify-center overflow-hidden">
|
||||||
<uqrcode ref="qrcodes" :canvas-id="`qrcode-${idx}`" :value="i.qrcode" :options="options">
|
<uqrcode ref="qrcodes" :canvasId="`qrcode-${idx}`" :value="i.qrcode" :options="options">
|
||||||
</uqrcode>
|
</uqrcode>
|
||||||
</view>
|
</view>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
|
|||||||
@ -19,7 +19,7 @@ export default defineStore("accountStore", () => {
|
|||||||
|
|
||||||
// 从缓存中恢复数据
|
// 从缓存中恢复数据
|
||||||
const account = ref(cache.get(CACHE_KEYS.ACCOUNT, null));
|
const account = ref(cache.get(CACHE_KEYS.ACCOUNT, null));
|
||||||
const loading = ref(false);
|
|
||||||
const loginPromise = ref(null);
|
const loginPromise = ref(null);
|
||||||
// IM 相关
|
// IM 相关
|
||||||
const openid = ref(cache.get(CACHE_KEYS.OPENID, ""));
|
const openid = ref(cache.get(CACHE_KEYS.OPENID, ""));
|
||||||
@ -48,7 +48,7 @@ export default defineStore("accountStore", () => {
|
|||||||
});
|
});
|
||||||
if (code) {
|
if (code) {
|
||||||
const res = await api('wxAppLogin', {
|
const res = await api('wxAppLogin', {
|
||||||
appId:appid,
|
appId: appid,
|
||||||
phoneCode,
|
phoneCode,
|
||||||
code,
|
code,
|
||||||
corpId,
|
corpId,
|
||||||
|
|||||||
@ -140,7 +140,7 @@ const urls = Object.keys(urlsConfig).reduce((acc, path) => {
|
|||||||
}, {})
|
}, {})
|
||||||
console.log('urls: ', urls)
|
console.log('urls: ', urls)
|
||||||
|
|
||||||
export default async function api(urlId, data) {
|
export default async function api(urlId, data, loading) {
|
||||||
const config = urls[urlId];
|
const config = urls[urlId];
|
||||||
if (!config) {
|
if (!config) {
|
||||||
throw new Error(`Unknown URL ID: ${urlId}`);
|
throw new Error(`Unknown URL ID: ${urlId}`);
|
||||||
@ -151,7 +151,7 @@ export default async function api(urlId, data) {
|
|||||||
data: {
|
data: {
|
||||||
...data,
|
...data,
|
||||||
type,
|
type,
|
||||||
}
|
},
|
||||||
})
|
}, loading)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -42,7 +42,7 @@ export async function mergeConversationWithGroupDetails(conversationList, option
|
|||||||
groupIds,
|
groupIds,
|
||||||
...options // 支持传入额外的查询参数(corpId, teamId, keyword等)
|
...options // 支持传入额外的查询参数(corpId, teamId, keyword等)
|
||||||
}
|
}
|
||||||
const response = await api('getGroupList', requestData)
|
const response = await api('getGroupList', requestData, false)
|
||||||
// 4. 检查响应
|
// 4. 检查响应
|
||||||
if (!response || !response.success) {
|
if (!response || !response.success) {
|
||||||
console.error('获取群组详细信息失败:', response?.message || '未知错误')
|
console.error('获取群组详细信息失败:', response?.message || '未知错误')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user