Merge remote-tracking branch 'origin/dev-wdb' into dev-hjf

This commit is contained in:
Jafeng 2026-02-02 11:20:57 +08:00
commit ebaaa7b72f
13 changed files with 242 additions and 41 deletions

View File

@ -1,4 +1,5 @@
MP_API_BASE_URL=http://localhost:8080 MP_API_BASE_URL=https://patient.youcan365.com
MP_CACHE_PREFIX=development MP_CACHE_PREFIX=development
MP_WX_APP_ID=wx93af55767423938e MP_WX_APP_ID=wx93af55767423938e
MP_TIM_SDK_APP_ID=1600123876 MP_TIM_SDK_APP_ID=1600123876
MP_CORP_ID=wwe3fb2faa52cf9dfb

View File

@ -1,4 +1,5 @@
MP_API_BASE_URL=http://192.168.60.2:8080 MP_API_BASE_URL=http://localhost:8080
MP_CACHE_PREFIX=development MP_CACHE_PREFIX=development
MP_WX_APP_ID=wx93af55767423938e MP_WX_APP_ID=wx93af55767423938e
MP_TIM_SDK_APP_ID=1600123876 MP_TIM_SDK_APP_ID=1600123876
MP_CORP_ID=wwe3fb2faa52cf9dfb

View File

@ -1,5 +1,5 @@
<template> <template>
<view v-if="showCancel || showConfirm" class="relative px-15 py-12 bg-white text-center" <view v-if="showCancel || showConfirm" class="relative flex px-15 py-12 bg-white text-center"
:class="hidedenShadow ? '' : 'shadow-up'"> :class="hidedenShadow ? '' : 'shadow-up'">
<view v-if="showCancel" class="flex-grow py-10 text-base border-primary rounded text-primary rounded" <view v-if="showCancel" class="flex-grow py-10 text-base border-primary rounded text-primary rounded"
@click="cancel()"> @click="cancel()">

View File

@ -120,6 +120,9 @@
"path": "pages/common/agreement", "path": "pages/common/agreement",
"style": { "style": {
"navigationBarTitleText": "用户协议" "navigationBarTitleText": "用户协议"
"path": "pages/article/article-detail",
"style": {
"navigationBarTitleText": "宣教文章"
} }
} }
], ],

View File

@ -0,0 +1,201 @@
<template>
<view class="article-detail-page">
<view v-if="loading" class="loading-container">
<uni-icons type="spinner-cycle" size="40" color="#999" />
<text class="loading-text">加载中...</text>
</view>
<view v-else-if="error" class="error-container">
<text class="error-text">{{ error }}</text>
<button class="retry-btn" @click="loadArticle">重试</button>
</view>
<scroll-view v-else scroll-y class="article-content">
<view class="article-header">
<text class="article-title">{{ articleData.title }}</text>
<text class="article-date">{{ articleData.date }}</text>
</view>
<view class="article-body">
<view class="rich-text-wrapper">
<rich-text :nodes="articleData.content"></rich-text>
</view>
</view>
</scroll-view>
</view>
</template>
<script setup>
import { onLoad } from "@dcloudio/uni-app";
import api from "@/utils/api.js";
import { ref } from "vue";
const env = __VITE_ENV__;
const corpId = env.MP_CORP_ID;
const loading = ref(true);
const error = ref("");
const articleData = ref({
title: "",
content: "",
date: "",
});
let articleId = "";
// 使
const processRichTextContent = (html) => {
if (!html) return "";
// img
let processedHtml = html.replace(
/<img/gi,
'<img style="max-width:100%;height:auto;display:block;margin:10px 0;"'
);
//
processedHtml = processedHtml.replace(
/style="[^"]*width:\s*\d+px[^"]*"/gi,
(match) => {
return match.replace(/width:\s*\d+px;?/gi, "max-width:100%;");
}
);
//
processedHtml = processedHtml.replace(
/<table/gi,
'<table style="max-width:100%;overflow-x:auto;display:block;"'
);
//
processedHtml = `<div style="width:100%;overflow-x:hidden;word-wrap:break-word;word-break:break-all;">${processedHtml}</div>`;
return processedHtml;
};
//
const loadArticle = async () => {
loading.value = true;
error.value = "";
try {
const res = await api("getArticle", { id: articleId, corpId });
if (res.success && res.data) {
//
let date = "";
if (res.data.createTime) {
const d = new Date(res.data.createTime);
const year = d.getFullYear();
const month = String(d.getMonth() + 1).padStart(2, "0");
const day = String(d.getDate()).padStart(2, "0");
date = `${year}-${month}-${day}`;
}
articleData.value = {
title: res.data.title || "宣教文章",
content: processRichTextContent(res.data.content || ""),
date: date,
};
} else {
error.value = res.message || "加载文章失败";
}
} catch (err) {
console.error("加载文章失败:", err);
error.value = "加载失败,请重试";
} finally {
loading.value = false;
}
};
onLoad((options) => {
if (options.id) {
articleId = options.id;
loadArticle();
} else {
error.value = "文章信息不完整";
loading.value = false;
}
});
</script>
<style scoped lang="scss">
.article-detail-page {
width: 100%;
height: 100vh;
background-color: #fff;
}
.loading-container,
.error-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
padding: 40rpx;
}
.loading-text {
margin-top: 20rpx;
font-size: 28rpx;
color: #999;
}
.error-text {
font-size: 28rpx;
color: #999;
margin-bottom: 30rpx;
text-align: center;
}
.retry-btn {
padding: 16rpx 60rpx;
background-color: #0877f1;
color: #fff;
border: none;
border-radius: 8rpx;
font-size: 28rpx;
}
.article-content {
height: 100vh;
}
.article-header {
padding: 40rpx 30rpx 20rpx;
border-bottom: 1px solid #eee;
}
.article-title {
display: block;
font-size: 36rpx;
font-weight: bold;
color: #333;
line-height: 1.6;
margin-bottom: 20rpx;
}
.article-date {
display: block;
font-size: 24rpx;
color: #999;
}
.article-body {
padding: 0;
}
.rich-text-wrapper {
padding: 30rpx;
width: 100%;
box-sizing: border-box;
overflow: hidden;
}
.rich-text-wrapper ::v-deep rich-text {
width: 100%;
}
.rich-text-wrapper ::v-deep rich-text img {
max-width: 100% !important;
height: auto !important;
display: block;
}
</style>

View File

@ -40,6 +40,7 @@ import { toast } from "@/utils/widget";
import groupAvatar from "@/components/group-avatar.vue"; import groupAvatar from "@/components/group-avatar.vue";
const team = ref(null); const team = ref(null);
const checked = ref(false); const checked = ref(false);
const redirectUrl = ref(""); const redirectUrl = ref("");

View File

@ -366,10 +366,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;
} }
@ -933,7 +931,16 @@ $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;
text-align: center;
} }
/* 时间分割线 */ /* 时间分割线 */

View File

@ -237,7 +237,7 @@ const getArticleData = (message) => {
const handleArticleClick = (message) => { const handleArticleClick = (message) => {
const { articleId } = getArticleData(message); const { articleId } = getArticleData(message);
uni.navigateTo({ uni.navigateTo({
url: `/pages/message/article-detail?id=${articleId}`, url: `/pages/article/article-detail?id=${articleId}`,
}); });
}; };

View File

@ -291,12 +291,6 @@ function handleSystemMessageReceived(message) {
} }
} }
//
function checkConsultPendingStatus() {
//
fetchGroupOrderStatus();
}
// //
function getBubbleClass(message) { function getBubbleClass(message) {
// //
@ -393,27 +387,23 @@ const initTIMCallbacks = async () => {
handleSystemMessageReceived(message); handleSystemMessageReceived(message);
} }
//
checkConsultPendingStatus();
// 使 // 使
nextTick(() => { nextTick(() => {
scrollToBottom(true); scrollToBottom(true);
}); });
// 0 // 0
if (timChatManager.tim && timChatManager.isLoggedIn && chatInfo.value.conversationID) { if (
timChatManager.tim &&
timChatManager.isLoggedIn &&
chatInfo.value.conversationID
) {
timChatManager.tim timChatManager.tim
.setMessageRead({ .setMessageRead({
conversationID: chatInfo.value.conversationID, conversationID: chatInfo.value.conversationID,
}) })
.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);
@ -473,9 +463,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("后台刷新完成,保持当前滚动位置");
@ -570,11 +557,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);
@ -731,6 +713,9 @@ onShow(() => {
// //
onHide(() => { onHide(() => {
stopIMMonitoring(); stopIMMonitoring();
// ID
timChatManager.currentConversationID = null;
console.log("✓ 页面隐藏已清空当前会话ID");
}); });
// //

View File

@ -1,5 +1,5 @@
<template> <template>
<view v-if="member" class="flex p-15 bg-whtie shadow-lg"> <view v-if="member" class="flex p-15 bg-white shadow-lg">
<view class="flex-grow w-0 mr-10 leading-normal"> <view class="flex-grow w-0 mr-10 leading-normal">
<view class="flex items-center"> <view class="flex items-center">
<view class="mr-5 flex-shrink-0 text-xl text-dark font-semibold">{{ member.anotherName }}</view> <view class="mr-5 flex-shrink-0 text-xl text-dark font-semibold">{{ member.anotherName }}</view>

View File

@ -8,6 +8,7 @@ const env = __VITE_ENV__;
export default defineStore("accountStore", () => { export default defineStore("accountStore", () => {
const appid = env.MP_WX_APP_ID; const appid = env.MP_WX_APP_ID;
const corpId = env.MP_CORP_ID;
const account = ref(null); const account = ref(null);
const loading = ref(false) const loading = ref(false)
const isIMInitialized = ref(false); const isIMInitialized = ref(false);
@ -25,8 +26,10 @@ export default defineStore("accountStore", () => {
}); });
if (code) { if (code) {
const res = await api('wxAppLogin', { const res = await api('wxAppLogin', {
appId:appid,
phoneCode, phoneCode,
code, code,
corpId
}); });
loading.value = false loading.value = false
if (res.success && res.data && res.data.mobile) { if (res.success && res.data && res.data.mobile) {

View File

@ -46,7 +46,7 @@ export async function mergeConversationWithGroupDetails(conversationList, option
...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) {

View File

@ -1488,8 +1488,7 @@ class TimChatManager {
this.markConversationAsRead(conversationID) this.markConversationAsRead(conversationID)
// 首先从本地接口加载聊天记录
console.log(" 开始从本地接口加载聊天记录groupID:", actualGroupID)
await this.loadMessagesFromLocalAPI(actualGroupID, count) await this.loadMessagesFromLocalAPI(actualGroupID, count)
} }