diff --git a/components/group-avatar.vue b/components/group-avatar.vue index 6d8ab1d..44b83a7 100644 --- a/components/group-avatar.vue +++ b/components/group-avatar.vue @@ -25,7 +25,7 @@ const props = defineProps({ } }) -const list = computed(() => props.avatarList.map(i => i || '/static/default-avatar.png')) +const list = computed(() => props.avatarList.map(i => i || '/static/default-avatar.svg')) const size = computed(() => { const val = Number.isInteger(props.size) && props.size > 0 ? props.size : 144; diff --git a/manifest.json b/manifest.json index 6966ae3..8a40fb3 100644 --- a/manifest.json +++ b/manifest.json @@ -1,28 +1,28 @@ { - "name": "ykt-team-wxapp", - "appid": "__UNI__3EBDA15", - "description": "", - "versionName": "1.0.0", - "versionCode": "100", - "transformPx": false, + "name" : "ykt-team-wxapp", + "appid" : "__UNI__3EBDA15", + "description" : "", + "versionName" : "1.0.0", + "versionCode" : "100", + "transformPx" : false, /* 5+App特有相关 */ - "app-plus": { - "usingComponents": true, - "nvueStyleCompiler": "uni-app", - "compilerVersion": 3, - "splashscreen": { - "alwaysShowBeforeRender": true, - "waiting": true, - "autoclose": true, - "delay": 0 + "app-plus" : { + "usingComponents" : true, + "nvueStyleCompiler" : "uni-app", + "compilerVersion" : 3, + "splashscreen" : { + "alwaysShowBeforeRender" : true, + "waiting" : true, + "autoclose" : true, + "delay" : 0 }, /* 模块配置 */ - "modules": {}, + "modules" : {}, /* 应用发布信息 */ - "distribute": { + "distribute" : { /* android打包配置 */ - "android": { - "permissions": [ + "android" : { + "permissions" : [ "", "", "", @@ -41,32 +41,32 @@ ] }, /* ios打包配置 */ - "ios": {}, + "ios" : {}, /* SDK配置 */ - "sdkConfigs": {} + "sdkConfigs" : {} } }, /* 快应用特有相关 */ - "quickapp": {}, + "quickapp" : {}, /* 小程序特有相关 */ - "mp-weixin": { - "appid": "wx93af55767423938e", - "setting": { - "urlCheck": false + "mp-weixin" : { + "appid" : "wx93af55767423938e", + "setting" : { + "urlCheck" : false }, - "usingComponents": true + "usingComponents" : true }, - "mp-alipay": { - "usingComponents": true + "mp-alipay" : { + "usingComponents" : true }, - "mp-baidu": { - "usingComponents": true + "mp-baidu" : { + "usingComponents" : true }, - "mp-toutiao": { - "usingComponents": true + "mp-toutiao" : { + "usingComponents" : true }, - "uniStatistics": { - "enable": false + "uniStatistics" : { + "enable" : false }, - "vueVersion": "3" -} \ No newline at end of file + "vueVersion" : "3" +} diff --git a/pages.json b/pages.json index 6bd738e..9cfcb68 100644 --- a/pages.json +++ b/pages.json @@ -13,6 +13,12 @@ "navigationBarTitleText": "我的宣教" } }, + { + "path": "pages/article/article-cate-list", + "style": { + "navigationBarTitleText": "健康宣教" + } + }, { "path": "pages/survey/survey-list", "style": { diff --git a/pages/article/article-cate-list.vue b/pages/article/article-cate-list.vue new file mode 100644 index 0000000..97ed96b --- /dev/null +++ b/pages/article/article-cate-list.vue @@ -0,0 +1,410 @@ + + + + + diff --git a/pages/article/article-detail.vue b/pages/article/article-detail.vue index 5d8927f..9ef3aaf 100644 --- a/pages/article/article-detail.vue +++ b/pages/article/article-detail.vue @@ -28,8 +28,11 @@ import { onLoad } from "@dcloudio/uni-app"; import api from "@/utils/api.js"; import { ref } from "vue"; +import { storeToRefs } from "pinia"; +import useAccountStore from "@/store/account.js"; const env = __VITE_ENV__; const corpId = env.MP_CORP_ID; +const { account } = storeToRefs(useAccountStore()); const loading = ref(true); const error = ref(""); const articleData = ref({ @@ -40,6 +43,16 @@ const articleData = ref({ let articleId = ""; +const markArticleRead = async () => { + const unionid = account.value?.unionid; + if (!unionid || !articleId) return; + try { + await api("addArticleReadRecord", { corpId, articleId, unionid }, false); + } catch (err) { + console.warn("markArticleRead failed:", err?.message || err); + } +}; + // 处理富文本内容,使图片自适应 const processRichTextContent = (html) => { if (!html) return ""; @@ -107,6 +120,7 @@ const loadArticle = async () => { onLoad((options) => { if (options.id) { articleId = options.id; + markArticleRead(); loadArticle(); } else { error.value = "文章信息不完整"; diff --git a/pages/article/article-list.vue b/pages/article/article-list.vue index 6cf29d1..ed0c095 100644 --- a/pages/article/article-list.vue +++ b/pages/article/article-list.vue @@ -11,16 +11,25 @@ ? 'bg-orange-100 text-orange-500 border-orange-500' : 'bg-white text-gray-600 border-gray-200' ]" - @click="activeTab = tab.value" + @click="selectTab(tab.value)" > {{ tab.name }} - + + + 加载中... + + + + + + + - {{ item.type }} + 宣教文章 @@ -44,86 +53,168 @@ class="text-sm mr-2" :class="item.status === 'UNREAD' ? 'text-red-500' : 'text-gray-400'" > - {{ item.status === 'UNREAD' ? '未阅读' : '查看' }} + {{ item.status === 'UNREAD' ? '未阅读' : '已阅读' }} - - - 人员: - {{ item.person }} + + 人员: + {{ item.person || '-' }} - - - 团队: - {{ item.team }} + + + 团队: + {{ item.team || '-' }} - 发送时间: {{ item.time }} + 发送时间: {{ item.time || '-' }} + + + + 加载中... + + + + 没有更多了 + diff --git a/pages/home/article-list.vue b/pages/home/article-list.vue index 79e85d7..a7acf0d 100644 --- a/pages/home/article-list.vue +++ b/pages/home/article-list.vue @@ -2,16 +2,25 @@ 健康宣教 - + 更多 + - - + :class="{ 'mb-15': index < articles.length - 1 }" + @click="goToDetail(article)" + > + {{ article.title }} @@ -25,7 +34,7 @@ \ No newline at end of file + diff --git a/pages/home/customer-archive.vue b/pages/home/customer-archive.vue index a35c88c..59e700e 100644 --- a/pages/home/customer-archive.vue +++ b/pages/home/customer-archive.vue @@ -1,53 +1,75 @@ \ No newline at end of file + +.field-label { + flex-shrink: 0; + white-space: nowrap; +} + +.loading-container, +.empty-container { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 100rpx 0; +} + +.loading-text { + margin-top: 20rpx; + font-size: 28rpx; + color: #999; +} + +.loading-more, +.no-more { + display: flex; + align-items: center; + justify-content: center; + padding: 30rpx 0; + font-size: 24rpx; + color: #999; + gap: 10rpx; +} + diff --git a/pages/team/friend.vue b/pages/team/friend.vue index 085a936..c9551da 100644 --- a/pages/team/friend.vue +++ b/pages/team/friend.vue @@ -2,7 +2,7 @@ - + {{ member.anotherName }} diff --git a/pages/team/team-detail.vue b/pages/team/team-detail.vue index eaed240..c780553 100644 --- a/pages/team/team-detail.vue +++ b/pages/team/team-detail.vue @@ -20,7 +20,7 @@ - + {{ i.anotherName }} @@ -45,7 +45,7 @@ - + {{ i.anotherName }} @@ -83,7 +83,7 @@ const { memberJob, memberList: list } = useJob(); const memberList = computed(() => team.value && Array.isArray(team.value.memberList) ? team.value.memberList : []) -const avatarList = computed(() => memberList.value.map(i => i.avatar || '/static/default-avatar.png').filter(Boolean)) +const avatarList = computed(() => memberList.value.map(i => i.avatar || '/static/default-avatar.svg').filter(Boolean)) const teammate = computed(() => { const memberLeaderList = team.value && Array.isArray(team.value.memberLeaderList) ? team.value.memberLeaderList : []; diff --git a/routes/index.js b/routes/index.js index 1bb43db..daaef26 100644 --- a/routes/index.js +++ b/routes/index.js @@ -28,6 +28,10 @@ export default [ path: 'pages/article/article-list', meta: { title: '健康宣教', login: true } }, + { + path: 'pages/article/article-cate-list', + meta: { title: '健康宣教', login: true } + }, { path: 'pages/health/list', meta: { title: '健康信息', login: true } diff --git a/utils/api.js b/utils/api.js index 0a5a5a6..81fffef 100644 --- a/utils/api.js +++ b/utils/api.js @@ -33,7 +33,9 @@ const urlsConfig = { getArticleCateList: 'getArticleCateList', getArticleList: 'getArticleList', getArticle: 'getArticle', - addArticleSendRecord: 'addArticleSendRecord' + addArticleSendRecord: 'addArticleSendRecord', + addArticleReadRecord: 'addArticleReadRecord', + getMiniAppReceivedArticleList: 'getMiniAppReceivedArticleList' }, member: { addCustomer: 'add', @@ -65,6 +67,9 @@ const urlsConfig = { createConsultGroup: "createConsultGroup", cancelConsultApplication: "cancelConsultApplication", getGroupList: "getGroupList" + }, + survery: { + getMiniAppReceivedSurveryList: 'getMiniAppReceivedSurveryList' } } const urls = Object.keys(urlsConfig).reduce((acc, path) => { diff --git a/utils/conversation-merger.js b/utils/conversation-merger.js index 186bf5a..78aa260 100644 --- a/utils/conversation-merger.js +++ b/utils/conversation-merger.js @@ -144,7 +144,7 @@ function mergeConversationData(conversation, groupDetailsMap) { name: formatConversationName(groupDetail), // 更新头像(优先使用已有头像,避免闪动) - avatar: conversation.avatar || groupDetail.patient?.avatar || '/static/default-avatar.png' + avatar: conversation.avatar || groupDetail.patient?.avatar || '/static/default-avatar.svg' } } diff --git a/utils/tim-chat.js b/utils/tim-chat.js index 80131f5..2571c51 100644 --- a/utils/tim-chat.js +++ b/utils/tim-chat.js @@ -2625,7 +2625,7 @@ class TimChatManager { conversationID, groupID, name: patientName ? `${patientName}的问诊` : groupName || '问诊群聊', - avatar: '/static/default-avatar.png', + avatar: '/static/default-avatar.svg', lastMessage, lastMessageTime, unreadCount: conversation.unreadCount || 0, @@ -2638,7 +2638,7 @@ class TimChatManager { conversationID: conversation.conversationID, groupID: conversation.conversationID?.replace('GROUP', '') || '', name: '问诊群聊', - avatar: '/static/default-avatar.png', + avatar: '/static/default-avatar.svg', lastMessage: '暂无消息', lastMessageTime: Date.now(), unreadCount: 0,