Compare commits
11 Commits
54194ea63a
...
037edd7855
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
037edd7855 | ||
| 99152578df | |||
| 47303b3a36 | |||
| c1a0090279 | |||
| e6f508ca00 | |||
| e6ee42c3d1 | |||
| bf9471cfa9 | |||
| 19a70f1134 | |||
| c452ea29e9 | |||
| bb7d294ef6 | |||
| 12d7d093e9 |
@ -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;
|
||||
|
||||
@ -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" : [
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||
@ -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"
|
||||
}
|
||||
"vueVersion" : "3"
|
||||
}
|
||||
|
||||
@ -13,6 +13,12 @@
|
||||
"navigationBarTitleText": "我的宣教"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/article/article-cate-list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "健康宣教"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/survey/survey-list",
|
||||
"style": {
|
||||
|
||||
410
pages/article/article-cate-list.vue
Normal file
410
pages/article/article-cate-list.vue
Normal file
@ -0,0 +1,410 @@
|
||||
<template>
|
||||
<view class="bg-gray-100 min-h-screen">
|
||||
<!-- Category Tabs -->
|
||||
<scroll-view
|
||||
scroll-x
|
||||
class="bg-white whitespace-nowrap px-15 py-10 sticky top-0 z-10 w-full"
|
||||
:show-scrollbar="false"
|
||||
>
|
||||
<view
|
||||
v-for="(tab, index) in tabs"
|
||||
:key="index"
|
||||
class="inline-block px-15 py-5 mr-10 text-sm rounded-full border transition-colors"
|
||||
:class="[
|
||||
activeCateId === tab.value
|
||||
? 'bg-orange-100 text-orange-500 border-orange-500'
|
||||
: 'bg-white text-gray-600 border-gray-200',
|
||||
]"
|
||||
@click="selectCate(tab.value)"
|
||||
>
|
||||
{{ tab.name }}
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- List -->
|
||||
<view v-if="loading && list.length === 0" class="loading-container">
|
||||
<uni-icons type="spinner-cycle" size="30" color="#999" />
|
||||
<text class="loading-text">加载中...</text>
|
||||
</view>
|
||||
|
||||
<view v-else-if="!loading && list.length === 0" class="empty-container">
|
||||
<empty-data text="暂无文章" />
|
||||
</view>
|
||||
|
||||
<view v-else class="p-15">
|
||||
<view
|
||||
v-for="(item, index) in list"
|
||||
:key="item._id"
|
||||
class="article-card flex"
|
||||
:class="{ 'mb-15': index < list.length - 1 }"
|
||||
@click="goToDetail(item)"
|
||||
>
|
||||
<image
|
||||
class="flex-shrink-0 cover"
|
||||
:src="item.cover || '/static/home/health-education.png'"
|
||||
mode="aspectFill"
|
||||
/>
|
||||
<view class="w-0 flex-grow">
|
||||
<view class="article-title truncate mb-10">
|
||||
{{ item.title || "宣教文章" }}
|
||||
</view>
|
||||
<view v-if="item.summary" class="article-summary line-clamp-2">
|
||||
{{ item.summary }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="loading && list.length > 0" class="loading-more">
|
||||
<uni-icons type="spinner-cycle" size="20" color="#999" />
|
||||
<text>加载中...</text>
|
||||
</view>
|
||||
|
||||
<view v-if="!loading && list.length >= total" class="no-more">
|
||||
没有更多了
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
import { onLoad, onReachBottom } from "@dcloudio/uni-app";
|
||||
import dayjs from "dayjs";
|
||||
import api from "@/utils/api.js";
|
||||
import EmptyData from "@/components/empty-data.vue";
|
||||
|
||||
const env = __VITE_ENV__;
|
||||
const defaultCorpId = env.MP_CORP_ID;
|
||||
|
||||
const corpId = ref("");
|
||||
const tabs = ref([{ name: "全部", value: "" }]);
|
||||
const activeCateId = ref("");
|
||||
|
||||
const list = ref([]);
|
||||
const total = ref(0);
|
||||
const page = ref(1);
|
||||
const pageSize = 20;
|
||||
const loading = ref(false);
|
||||
|
||||
const loadCates = async () => {
|
||||
if (!corpId.value) return;
|
||||
try {
|
||||
const res = await api("getArticleCateList", { corpId: corpId.value });
|
||||
const cates = res && Array.isArray(res.list) ? res.list : [];
|
||||
tabs.value = [
|
||||
{ name: "全部", value: "" },
|
||||
...cates.map((i) => ({ name: i.label || i.name || "未命名", value: i._id })),
|
||||
];
|
||||
} catch (err) {
|
||||
console.error("loadCates failed:", err);
|
||||
}
|
||||
};
|
||||
|
||||
const loadList = async (reset = false) => {
|
||||
if (!corpId.value || loading.value) return;
|
||||
if (reset) {
|
||||
page.value = 1;
|
||||
list.value = [];
|
||||
total.value = 0;
|
||||
}
|
||||
loading.value = true;
|
||||
try {
|
||||
const params = {
|
||||
corpId: corpId.value,
|
||||
page: page.value,
|
||||
pageSize,
|
||||
enable: true,
|
||||
};
|
||||
if (activeCateId.value) params.cateIds = [activeCateId.value];
|
||||
const res = await api("getArticleList", params);
|
||||
const rows = res && Array.isArray(res.list) ? res.list : [];
|
||||
total.value = Number(res?.total) || 0;
|
||||
const mapped = rows.map((r) => ({
|
||||
...r,
|
||||
time: r?.createTime ? dayjs(r.createTime).format("YYYY-MM-DD") : "",
|
||||
}));
|
||||
if (page.value === 1) list.value = mapped;
|
||||
else list.value = [...list.value, ...mapped];
|
||||
} catch (err) {
|
||||
console.error("loadList failed:", err);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const selectCate = async (cateId) => {
|
||||
if (activeCateId.value === cateId) return;
|
||||
activeCateId.value = cateId;
|
||||
await loadList(true);
|
||||
};
|
||||
|
||||
function goToDetail(item) {
|
||||
if (!item?._id) return;
|
||||
uni.navigateTo({ url: `/pages/article/article-detail?id=${item._id}` });
|
||||
}
|
||||
|
||||
onLoad(async (options) => {
|
||||
corpId.value = options?.corpId || defaultCorpId || "";
|
||||
await loadCates();
|
||||
await loadList(true);
|
||||
});
|
||||
|
||||
onReachBottom(() => {
|
||||
if (loading.value) return;
|
||||
if (list.value.length >= total.value) return;
|
||||
page.value += 1;
|
||||
loadList(false);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.min-h-screen {
|
||||
min-height: 100vh;
|
||||
}
|
||||
.bg-gray-100 {
|
||||
background-color: #f7f8fa;
|
||||
}
|
||||
.bg-white {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.p-15 {
|
||||
padding: 30rpx;
|
||||
}
|
||||
.px-15 {
|
||||
padding-left: 30rpx;
|
||||
padding-right: 30rpx;
|
||||
}
|
||||
.py-10 {
|
||||
padding-top: 20rpx;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
.py-5 {
|
||||
padding-top: 10rpx;
|
||||
padding-bottom: 10rpx;
|
||||
}
|
||||
.px-5 {
|
||||
padding-left: 10rpx;
|
||||
padding-right: 10rpx;
|
||||
}
|
||||
|
||||
.mr-10 {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.mr-5 {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.ml-2 {
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
.mr-2 {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.mb-15 {
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.mb-10 {
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.mt-1 {
|
||||
margin-top: 6rpx;
|
||||
}
|
||||
|
||||
.flex {
|
||||
display: flex;
|
||||
}
|
||||
.items-start {
|
||||
align-items: flex-start;
|
||||
}
|
||||
.items-center {
|
||||
align-items: center;
|
||||
}
|
||||
.justify-between {
|
||||
justify-content: space-between;
|
||||
}
|
||||
.flex-1 {
|
||||
flex: 1;
|
||||
}
|
||||
.flex-grow {
|
||||
flex-grow: 1;
|
||||
}
|
||||
.flex-shrink-0 {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.w-0 {
|
||||
width: 0;
|
||||
}
|
||||
.relative {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.border {
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
}
|
||||
.rounded-full {
|
||||
border-radius: 9999px;
|
||||
}
|
||||
.rounded {
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
.rounded-lg {
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.shadow-sm {
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.text-xs {
|
||||
font-size: 22rpx;
|
||||
}
|
||||
.text-sm {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.text-base {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
.font-bold {
|
||||
font-weight: 600;
|
||||
}
|
||||
.leading-normal {
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.text-orange-500 {
|
||||
color: #f29e38;
|
||||
}
|
||||
.bg-orange-100 {
|
||||
background-color: #fff8eb;
|
||||
}
|
||||
.border-orange-500 {
|
||||
border-color: #f29e38;
|
||||
}
|
||||
|
||||
.text-gray-600 {
|
||||
color: #333333;
|
||||
}
|
||||
.text-gray-400 {
|
||||
color: #999999;
|
||||
}
|
||||
.text-gray-800 {
|
||||
color: #1a1a1a;
|
||||
}
|
||||
.border-gray-200 {
|
||||
border-color: #e5e5e5;
|
||||
}
|
||||
|
||||
.text-green-600 {
|
||||
color: #4b8d5f;
|
||||
}
|
||||
.border-green-600 {
|
||||
border-color: #4b8d5f;
|
||||
}
|
||||
|
||||
.sticky {
|
||||
position: sticky;
|
||||
}
|
||||
.top-0 {
|
||||
top: 0;
|
||||
}
|
||||
.z-10 {
|
||||
z-index: 10;
|
||||
}
|
||||
.w-full {
|
||||
width: 100%;
|
||||
}
|
||||
.whitespace-nowrap {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.inline-block {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.tag-box {
|
||||
border-radius: 4rpx;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.truncate {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.article-card {
|
||||
background: white;
|
||||
border-radius: 16rpx;
|
||||
box-shadow: 0 8rpx 10rpx 0 rgba(60, 169, 145, 0.06);
|
||||
transition: all 0.3s;
|
||||
min-height: 188rpx;
|
||||
padding: 20rpx;
|
||||
align-items: flex-start;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.article-card:active {
|
||||
transform: translateY(-2rpx);
|
||||
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.cover {
|
||||
width: 272rpx;
|
||||
height: 151rpx;
|
||||
border-radius: 12rpx;
|
||||
margin-right: 20rpx;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.article-title {
|
||||
color: #333333;
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
.article-summary {
|
||||
max-width: 402rpx;
|
||||
color: #666666;
|
||||
text-align: justify;
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
.line-clamp-2 {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
overflow: hidden;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
</style>
|
||||
@ -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 = "文章信息不完整";
|
||||
|
||||
@ -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 }}
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- Article List -->
|
||||
<view class="p-15">
|
||||
<view v-if="loading && articles.length === 0" class="loading-container">
|
||||
<uni-icons type="spinner-cycle" size="30" color="#999" />
|
||||
<text class="loading-text">加载中...</text>
|
||||
</view>
|
||||
|
||||
<view v-else-if="!loading && articles.length === 0" class="empty-container">
|
||||
<empty-data text="暂无文章" />
|
||||
</view>
|
||||
|
||||
<view v-else class="p-15">
|
||||
<view
|
||||
v-for="item in filteredArticles"
|
||||
v-for="item in articles"
|
||||
:key="item._id"
|
||||
class="bg-white rounded-lg p-15 mb-15 shadow-sm"
|
||||
@click="goToDetail(item)"
|
||||
@ -30,7 +39,7 @@
|
||||
<view class="flex items-start flex-1 mr-10 relative">
|
||||
<!-- Tag -->
|
||||
<view class="text-xs text-green-600 border border-green-600 px-5 rounded mr-5 flex-shrink-0 mt-1 tag-box">
|
||||
{{ item.type }}
|
||||
宣教文章
|
||||
</view>
|
||||
<!-- Title -->
|
||||
<view class="text-base font-bold text-gray-800 leading-normal line-clamp-2">
|
||||
@ -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' ? '未阅读' : '已阅读' }}
|
||||
</text>
|
||||
<uni-icons type="right" size="14" :color="item.status === 'UNREAD' ? '#ef4444' : '#9ca3af'"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- Content -->
|
||||
<!-- Person -->
|
||||
<view class="text-sm text-gray-600 mb-5 flex items-center">
|
||||
<text class="text-gray-400 mr-2">人员:</text>
|
||||
<text>{{ item.person }}</text>
|
||||
<view class="text-sm text-gray-600 mb-5 flex items-start">
|
||||
<text class="text-gray-400 mr-2 field-label">人员:</text>
|
||||
<text>{{ item.person || '-' }}</text>
|
||||
</view>
|
||||
<!-- Team -->
|
||||
<view class="text-sm text-gray-600 mb-10 pb-10 border-b border-gray-100 flex items-center">
|
||||
<text class="text-gray-400 mr-2">团队:</text>
|
||||
<text>{{ item.team }}</text>
|
||||
|
||||
<view class="text-sm text-gray-600 mb-10 pb-10 border-b border-gray-100 flex items-start">
|
||||
<text class="text-gray-400 mr-2 field-label">团队:</text>
|
||||
<text>{{ item.team || '-' }}</text>
|
||||
</view>
|
||||
|
||||
<!-- Footer -->
|
||||
<view class="text-sm text-gray-400">
|
||||
发送时间: {{ item.time }}
|
||||
发送时间: {{ item.time || '-' }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="loading && articles.length > 0" class="loading-more">
|
||||
<uni-icons type="spinner-cycle" size="20" color="#999" />
|
||||
<text>加载中...</text>
|
||||
</view>
|
||||
|
||||
<view v-if="!loading && articles.length >= total" class="no-more">
|
||||
没有更多了
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { ref } from "vue";
|
||||
import { onShow, onReachBottom } from "@dcloudio/uni-app";
|
||||
import { storeToRefs } from "pinia";
|
||||
import dayjs from "dayjs";
|
||||
import api from "@/utils/api.js";
|
||||
import useAccountStore from "@/store/account.js";
|
||||
import EmptyData from "@/components/empty-data.vue";
|
||||
|
||||
// Mock Data
|
||||
const tabs = [
|
||||
{ name: '全部', value: 'ALL' },
|
||||
{ name: '李珊珊 女 37岁', value: '1' },
|
||||
{ name: '罗小小 女 17岁', value: '2' },
|
||||
];
|
||||
const env = __VITE_ENV__;
|
||||
const corpId = env.MP_CORP_ID;
|
||||
const { account, openid } = storeToRefs(useAccountStore());
|
||||
|
||||
const activeTab = ref('ALL');
|
||||
const tabs = ref([{ name: "全部", value: "" }]);
|
||||
const activeTab = ref("");
|
||||
|
||||
const articles = ref([
|
||||
{
|
||||
_id: 1,
|
||||
type: '宣教文章',
|
||||
title: '妊糖管理期注意事项!',
|
||||
status: 'UNREAD',
|
||||
person: '李珊珊 女 36岁',
|
||||
team: '妊糖管理服务团队',
|
||||
time: '2026-01-09 15:23',
|
||||
ownerId: '1'
|
||||
},
|
||||
{
|
||||
_id: 2,
|
||||
type: '宣教文章',
|
||||
title: '妊糖管理期注意事项!妊糖管理期注意事项!妊糖管理期注意事项......',
|
||||
status: 'READ',
|
||||
person: '李珊珊 女 36岁',
|
||||
team: '妊糖管理服务团队',
|
||||
time: '2026-01-09 15:23',
|
||||
ownerId: '1'
|
||||
},
|
||||
{
|
||||
_id: 3,
|
||||
type: '宣教文章',
|
||||
title: '妊糖管理期注意事项!',
|
||||
status: 'READ',
|
||||
person: '罗小小 女 16岁',
|
||||
team: '妊糖管理服务团队',
|
||||
time: '2026-01-09 15:23',
|
||||
ownerId: '2'
|
||||
const articles = ref([]);
|
||||
const total = ref(0);
|
||||
const page = ref(1);
|
||||
const pageSize = 20;
|
||||
const loading = ref(false);
|
||||
const inited = ref(false);
|
||||
|
||||
const selectTab = async (customerId) => {
|
||||
if (activeTab.value === customerId) return;
|
||||
activeTab.value = customerId;
|
||||
await loadArticleList(true);
|
||||
};
|
||||
|
||||
const loadCustomers = async () => {
|
||||
const miniAppId = openid.value || uni.getStorageSync("openid");
|
||||
if (!miniAppId) return;
|
||||
try {
|
||||
const res = await api("getMiniAppCustomers", { miniAppId, corpId });
|
||||
if (res && res.success) {
|
||||
const list = Array.isArray(res.data) ? res.data : [];
|
||||
tabs.value = [
|
||||
{ name: "全部", value: "" },
|
||||
...list.map((c) => ({ name: c.name || "未命名", value: c._id })),
|
||||
];
|
||||
} else {
|
||||
uni.showToast({ title: res?.message || "获取档案失败", icon: "none" });
|
||||
}
|
||||
} catch (err) {
|
||||
console.error("loadCustomers failed:", err);
|
||||
uni.showToast({ title: "获取档案失败", icon: "none" });
|
||||
}
|
||||
]);
|
||||
};
|
||||
|
||||
const filteredArticles = computed(() => {
|
||||
if (activeTab.value === 'ALL') return articles.value;
|
||||
return articles.value.filter(item => item.ownerId === activeTab.value);
|
||||
});
|
||||
const mapRowToView = (row) => {
|
||||
const sendTime = row?.sendTime ? dayjs(row.sendTime).format("YYYY-MM-DD HH:mm") : "";
|
||||
return {
|
||||
_id: row?._id,
|
||||
articleId: row?.articleId,
|
||||
title: row?.articleInfo?.title || "宣教文章",
|
||||
status: row?.status || "UNREAD",
|
||||
person: row?.customer?.name || "",
|
||||
team: row?.team?.name || "-",
|
||||
time: sendTime,
|
||||
};
|
||||
};
|
||||
|
||||
const loadArticleList = async (reset = false) => {
|
||||
if (loading.value) return;
|
||||
const unionid = account.value?.unionid;
|
||||
const miniAppId = openid.value || uni.getStorageSync("openid");
|
||||
if (!unionid && !miniAppId) {
|
||||
uni.showToast({ title: "未获取到用户信息,请重新登录", icon: "none" });
|
||||
return;
|
||||
}
|
||||
|
||||
if (reset) {
|
||||
page.value = 1;
|
||||
articles.value = [];
|
||||
total.value = 0;
|
||||
}
|
||||
|
||||
loading.value = true;
|
||||
try {
|
||||
const params = {
|
||||
corpId,
|
||||
unionid,
|
||||
miniAppId,
|
||||
page: page.value,
|
||||
pageSize,
|
||||
};
|
||||
if (activeTab.value) params.customerId = activeTab.value;
|
||||
|
||||
const res = await api("getMiniAppReceivedArticleList", params);
|
||||
if (res && res.success) {
|
||||
const list = Array.isArray(res.list) ? res.list : [];
|
||||
total.value = Number(res.total) || 0;
|
||||
const mapped = list.map(mapRowToView);
|
||||
if (page.value === 1) articles.value = mapped;
|
||||
else articles.value = [...articles.value, ...mapped];
|
||||
} else {
|
||||
uni.showToast({ title: res?.message || "获取文章失败", icon: "none" });
|
||||
}
|
||||
} catch (err) {
|
||||
console.error("loadArticleList failed:", err);
|
||||
uni.showToast({ title: "加载失败,请重试", icon: "none" });
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
function goToDetail(item) {
|
||||
console.log('Navigate to detail', item);
|
||||
if (!item?.articleId) return;
|
||||
uni.navigateTo({ url: `/pages/article/article-detail?id=${item.articleId}` });
|
||||
}
|
||||
|
||||
onShow(async () => {
|
||||
if (!inited.value) {
|
||||
await loadCustomers();
|
||||
await loadArticleList(true);
|
||||
inited.value = true;
|
||||
return;
|
||||
}
|
||||
await loadArticleList(true);
|
||||
});
|
||||
|
||||
onReachBottom(() => {
|
||||
if (loading.value) return;
|
||||
if (articles.value.length >= total.value) return;
|
||||
page.value += 1;
|
||||
loadArticleList(false);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@ -206,4 +297,35 @@ function goToDetail(item) {
|
||||
line-clamp: 2;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -2,16 +2,25 @@
|
||||
<view v-if="articles.length" class="article-container">
|
||||
<view class="flex items-center justify-between">
|
||||
<view class="module-title">健康宣教</view>
|
||||
<view class="flex items-center" @click="toList()">
|
||||
<view v-if="total > 3" class="flex items-center" @click="toMorePage()">
|
||||
<view class="mr-5 text-base text-gray">更多</view>
|
||||
<image class="arrow-icon" src="/static/home/arrow-right-gray.png" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="mt-10">
|
||||
<view v-for="(article, index) in articles" :key="article._id"
|
||||
<view
|
||||
v-for="(article, index) in articles"
|
||||
:key="article._id"
|
||||
class="article-card flex"
|
||||
:class="{'mb-15': index < articles.length - 1}">
|
||||
<image class="flex-shrink-0 cover" :src="article.cover || '/static/home/health-education.png'" mode="aspectFill" />
|
||||
:class="{ 'mb-15': index < articles.length - 1 }"
|
||||
@click="goToDetail(article)"
|
||||
>
|
||||
<image
|
||||
class="flex-shrink-0 cover"
|
||||
:src="article.cover || '/static/home/health-education.png'"
|
||||
mode="aspectFill"
|
||||
/>
|
||||
<view class="w-0 flex-grow">
|
||||
<view class="article-title truncate mb-10">
|
||||
{{ article.title }}
|
||||
@ -25,7 +34,7 @@
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { ref, watch } from "vue";
|
||||
import api from '@/utils/api';
|
||||
|
||||
const props = defineProps({
|
||||
@ -34,40 +43,75 @@ const props = defineProps({
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const articles = ref([])
|
||||
|
||||
const qrcode = computed(() => {
|
||||
const qrcodes = props.team && Array.isArray(props.team.qrcodes) ? props.team.qrcodes : [];
|
||||
return qrcodes[0] || {}
|
||||
})
|
||||
const articleIds = computed(() => {
|
||||
const articles = qrcode.value && Array.isArray(qrcode.value.articles) ? qrcode.value.articles : [];
|
||||
const ids = articles.map(item => item._id).filter(i => typeof i === 'string' && i.trim());
|
||||
return qrcode.value.enableAnnounce === 'YES' ? ids : [];
|
||||
})
|
||||
const articles = ref([]);
|
||||
const total = ref(0);
|
||||
const page = ref(1);
|
||||
const pageSize = ref(3);
|
||||
const loading = ref(false);
|
||||
|
||||
function toList() {
|
||||
uni.navigateTo({ url: `/pages/article/article-list?corpId=${props.team.corpId}&ids=${articleIds.value.join()}` })
|
||||
function goToDetail(article) {
|
||||
if (!article?._id) return;
|
||||
uni.navigateTo({ url: `/pages/article/article-detail?id=${article._id}` });
|
||||
}
|
||||
|
||||
async function getArticles() {
|
||||
const res = await api('getArticleByIds', { corpId: props.team.corpId, ids: articleIds.value.join() });
|
||||
articles.value = res && Array.isArray(res.list) ? res.list : [];
|
||||
}
|
||||
|
||||
watch(articleIds, n => {
|
||||
if (n.length) {
|
||||
getArticles()
|
||||
} else {
|
||||
articles.value = []
|
||||
const loadArticles = async (reset = false) => {
|
||||
const corpId = props.team?.corpId || "";
|
||||
if (!corpId || loading.value) return;
|
||||
if (reset) {
|
||||
page.value = 1;
|
||||
articles.value = [];
|
||||
total.value = 0;
|
||||
}
|
||||
}, { immediate: true })
|
||||
loading.value = true;
|
||||
try {
|
||||
const params = {
|
||||
corpId,
|
||||
page: page.value,
|
||||
pageSize: pageSize.value,
|
||||
enable: true,
|
||||
};
|
||||
const res = await api("getArticleList", params, false);
|
||||
const list = res && Array.isArray(res.list) ? res.list : [];
|
||||
total.value = Number(res?.total) || 0;
|
||||
if (page.value === 1) articles.value = list;
|
||||
else articles.value = [...articles.value, ...list];
|
||||
} catch (err) {
|
||||
console.error("loadArticles failed:", err);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
function toMorePage() {
|
||||
const corpId = props.team?.corpId || "";
|
||||
if (!corpId) return;
|
||||
uni.navigateTo({ url: `/pages/article/article-cate-list?corpId=${corpId}` });
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.team?.corpId,
|
||||
async (corpId) => {
|
||||
if (!corpId) {
|
||||
articles.value = [];
|
||||
total.value = 0;
|
||||
page.value = 1;
|
||||
pageSize.value = 3;
|
||||
return;
|
||||
}
|
||||
pageSize.value = 3;
|
||||
await loadArticles(true);
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
<style scoped>
|
||||
.article-container {
|
||||
margin: 0 30rpx;
|
||||
margin-top: 24rpx;
|
||||
padding-bottom: 40rpx;
|
||||
width: calc(100% - 60rpx);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.arrow-icon {
|
||||
@ -91,6 +135,8 @@ watch(articleIds, n => {
|
||||
min-height: 188rpx;
|
||||
padding: 20rpx;
|
||||
align-items: flex-start;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.article-card:active {
|
||||
@ -134,4 +180,4 @@ watch(articleIds, n => {
|
||||
overflow: hidden;
|
||||
line-height: 1.5;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@ -1,53 +1,75 @@
|
||||
<template>
|
||||
<view class="archive-container">
|
||||
<view class="mb-10 flex items-center justify-between">
|
||||
<view class="module-title flex-shrink-0 truncate">
|
||||
成员档案
|
||||
</view>
|
||||
<view class="flex items-center px-10 leading-normal rounded-sm" @click="toManagePage()">
|
||||
<image class="manage-icon mr-5" src="/static/home/archive-manage.png" mode="aspectFit"></image>
|
||||
<view style="font-size: 28rpx; color: #065BD6;">档案管理</view>
|
||||
<view class="module-title flex-shrink-0 truncate"> 成员档案 </view>
|
||||
<view
|
||||
class="flex items-center px-10 leading-normal rounded-sm"
|
||||
@click="toManagePage()"
|
||||
>
|
||||
<image
|
||||
class="manage-icon mr-5"
|
||||
src="/static/home/archive-manage.png"
|
||||
mode="aspectFit"
|
||||
></image>
|
||||
<view style="font-size: 28rpx; color: #065bd6">档案管理</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="customers.length === 0" class="flex items-center justify-center h-80 border-dashed text-dark rounded">
|
||||
<view
|
||||
v-if="customers.length === 0"
|
||||
class="flex items-center justify-center h-80 border-dashed text-dark rounded"
|
||||
>
|
||||
<uni-icons type="plusempty" size="16" color="#999"></uni-icons>
|
||||
<view class="text-base text-dark">新建档案</view>
|
||||
</view>
|
||||
<scroll-view scroll-x="true">
|
||||
<view class="flex flex-nowrap pb-5 ">
|
||||
<view v-for="i in customers" :key="i._id" class="customer-card flex-shrink-0 mr-15 relative"
|
||||
:class="current && i._id === current._id ? 'current-customer' : ''" @click="toggle(i)">
|
||||
<view class="flex flex-nowrap pb-5">
|
||||
<view
|
||||
v-for="i in customers"
|
||||
:key="i._id"
|
||||
class="customer-card flex-shrink-0 mr-15 relative"
|
||||
:class="current && i._id === current._id ? 'current-customer' : ''"
|
||||
@click="toggle(i)"
|
||||
>
|
||||
<!-- 关系标签 -->
|
||||
<view v-if="i.relationship" class="relationship-tag"
|
||||
:class="i.relationship === '本人' ? 'tag-blue' : 'tag-green'">
|
||||
<view
|
||||
v-if="i.relationship"
|
||||
class="relationship-tag"
|
||||
:class="i.relationship === '本人' ? 'tag-blue' : 'tag-green'"
|
||||
>
|
||||
{{ i.relationship }}
|
||||
</view>
|
||||
<view class="flex flex-col items-center">
|
||||
<view class="customer-name text-lg leading-normal font-semibold whitespace-nowrap mb-8"
|
||||
:class="current && i._id === current._id ? 'text-primary' : 'text-dark'">
|
||||
<view
|
||||
class="customer-name text-lg leading-normal font-semibold whitespace-nowrap"
|
||||
:class="
|
||||
current && i._id === current._id ? 'text-primary' : 'text-dark'
|
||||
"
|
||||
>
|
||||
{{ i.name }}
|
||||
</view>
|
||||
<view class="flex items-center mb-5">
|
||||
<image v-if="i.sex" class="sex-icon mr-5"
|
||||
:src="i.sex === '男' ? '/static/home/male.svg' : '/static/home/female.svg'" />
|
||||
<view class="customer-age text-base leading-normal text-gray">
|
||||
{{ i.age > 0 ? i.age + '岁' : '' }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 选中状态底部条和三角 -->
|
||||
<view v-if="current && i._id === current._id" class="active-indicator">
|
||||
<view
|
||||
v-if="current && i._id === current._id"
|
||||
class="active-indicator"
|
||||
>
|
||||
<view class="active-bar"></view>
|
||||
<view class="active-triangle"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view v-if="canAuth" class="px-10 py-5 mt-5 flex items-center bg-danger rounded-sm">
|
||||
<view
|
||||
v-if="canAuth"
|
||||
class="px-10 py-5 mt-5 flex items-center bg-danger rounded-sm"
|
||||
>
|
||||
<view class="mr-5 w-0 flex-grow text-base text-white">
|
||||
点击右侧授权按钮, 我们将更精准的为您服务
|
||||
</view>
|
||||
<view class="px-12 py-5 text-base rounded-sm text-dark bg-white" @click="auth()">
|
||||
<view
|
||||
class="px-12 py-5 text-base rounded-sm text-dark bg-white"
|
||||
@click="auth()"
|
||||
>
|
||||
授权
|
||||
</view>
|
||||
</view>
|
||||
@ -57,18 +79,32 @@
|
||||
<view class="info-content">
|
||||
<view class="flex items-center justify-between mb-8">
|
||||
<view class="info-title">个人基本信息</view>
|
||||
<image class="arrow-icon-small" src="/static/home/arrow-right-blue.png" mode="aspectFit"></image>
|
||||
<image
|
||||
class="arrow-icon-small"
|
||||
src="/static/home/arrow-right-blue.png"
|
||||
mode="aspectFit"
|
||||
></image>
|
||||
</view>
|
||||
<view v-if="baseInfoError" class="text-sm text-danger">请完善您的个人信息</view>
|
||||
<view v-if="baseInfoError" class="text-sm text-danger"
|
||||
>请完善您的个人信息</view
|
||||
>
|
||||
<view v-else class="info-subtitle">完善个人信息</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="hasHealthTemp" class="ml-10 info-card-new flex-grow" @click="toHealthList()">
|
||||
<view
|
||||
v-if="hasHealthTemp"
|
||||
class="ml-10 info-card-new flex-grow"
|
||||
@click="toHealthList()"
|
||||
>
|
||||
<view class="info-bg info-bg-health"></view>
|
||||
<view class="info-content">
|
||||
<view class="flex items-center justify-between mb-8">
|
||||
<view class="info-title">健康信息</view>
|
||||
<image class="arrow-icon-small" src="/static/home/arrow-right-blue.png" mode="aspectFit"></image>
|
||||
<image
|
||||
class="arrow-icon-small"
|
||||
src="/static/home/arrow-right-blue.png"
|
||||
mode="aspectFit"
|
||||
></image>
|
||||
</view>
|
||||
<view class="info-subtitle">上传健康档案</view>
|
||||
</view>
|
||||
@ -77,28 +113,28 @@
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import { computed, onMounted, ref, watch } from 'vue';
|
||||
import { storeToRefs } from 'pinia'
|
||||
import useAccount from '@/store/account';
|
||||
import api from '@/utils/api';
|
||||
import { toast, confirm } from '@/utils/widget';
|
||||
import { computed, onMounted, ref, watch } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
import useAccount from "@/store/account";
|
||||
import api from "@/utils/api";
|
||||
import { toast, confirm } from "@/utils/widget";
|
||||
|
||||
const props = defineProps({
|
||||
corpId: {
|
||||
type: String,
|
||||
default: ''
|
||||
default: "",
|
||||
},
|
||||
customers: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
default: () => [],
|
||||
},
|
||||
team: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
default: () => ({}),
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:customers']);
|
||||
const emit = defineEmits(["update:customers"]);
|
||||
|
||||
const { account } = storeToRefs(useAccount());
|
||||
const current = ref(null);
|
||||
@ -106,41 +142,61 @@ const customers = ref([]);
|
||||
|
||||
const canAuth = computed(() => {
|
||||
if (current.value && props.team && props.team.teamId) {
|
||||
const teamIds = Array.isArray(current.value.teamId) ? current.value.teamId : [];
|
||||
const teamIds = Array.isArray(current.value.teamId)
|
||||
? current.value.teamId
|
||||
: [];
|
||||
return !teamIds.includes(props.team.teamId);
|
||||
}
|
||||
return false
|
||||
})
|
||||
return false;
|
||||
});
|
||||
const qrcode = computed(() => {
|
||||
const qrcodes = props.team && Array.isArray(props.team.qrcodes) ? props.team.qrcodes : [];
|
||||
return qrcodes[0] || ''
|
||||
})
|
||||
const qrcodes =
|
||||
props.team && Array.isArray(props.team.qrcodes) ? props.team.qrcodes : [];
|
||||
return qrcodes[0] || "";
|
||||
});
|
||||
|
||||
const hasHealthTemp = computed(() => qrcode.value && Array.isArray(qrcode.value.healthTempList) && qrcode.value.healthTempList.length > 0)
|
||||
const baseInfo = computed(() => qrcode.value && qrcode.value.teamFileds && Array.isArray(qrcode.value.teamFileds.baseInfo) ? qrcode.value.teamFileds.baseInfo : [])
|
||||
const hasHealthTemp = computed(
|
||||
() =>
|
||||
qrcode.value &&
|
||||
Array.isArray(qrcode.value.healthTempList) &&
|
||||
qrcode.value.healthTempList.length > 0
|
||||
);
|
||||
const baseInfo = computed(() =>
|
||||
qrcode.value &&
|
||||
qrcode.value.teamFileds &&
|
||||
Array.isArray(qrcode.value.teamFileds.baseInfo)
|
||||
? qrcode.value.teamFileds.baseInfo
|
||||
: []
|
||||
);
|
||||
const baseInfoError = computed(() => {
|
||||
const requiredTitles = baseInfo.value.filter(i => i.required).map(i => i.title);
|
||||
return current.value && requiredTitles.some(i => !current.value[i]);
|
||||
})
|
||||
const requiredTitles = baseInfo.value
|
||||
.filter((i) => i.required)
|
||||
.map((i) => i.title);
|
||||
return current.value && requiredTitles.some((i) => !current.value[i]);
|
||||
});
|
||||
|
||||
function fillBaseInfo() {
|
||||
if (canAuth.value) {
|
||||
toast('请先授权本服务团队')
|
||||
toast("请先授权本服务团队");
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: `/pages/archive/edit-archive?teamId=${props.team.teamId}&corpId=${props.corpId}&id=${current.value._id}`
|
||||
})
|
||||
url: `/pages/archive/edit-archive?teamId=${props.team.teamId}&corpId=${props.corpId}&id=${current.value._id}`,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function toHealthList() {
|
||||
if (canAuth.value) {
|
||||
toast('请先授权本服务团队')
|
||||
toast("请先授权本服务团队");
|
||||
} else {
|
||||
const name = `${current.value.name} ${current.value.relationship ? `(${current.value.relationship})` : ''}`
|
||||
const name = `${current.value.name} ${
|
||||
current.value.relationship ? `(${current.value.relationship})` : ""
|
||||
}`;
|
||||
uni.navigateTo({
|
||||
url: `/pages/health/list?teamId=${props.team.teamId}&corpId=${props.corpId}&id=${current.value._id}&name=${encodeURIComponent(name)}`
|
||||
})
|
||||
url: `/pages/health/list?teamId=${props.team.teamId}&corpId=${
|
||||
props.corpId
|
||||
}&id=${current.value._id}&name=${encodeURIComponent(name)}`,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -149,54 +205,67 @@ function toggle(i) {
|
||||
}
|
||||
|
||||
function toManagePage() {
|
||||
uni.navigateTo({ url: `/pages/archive/archive-manage?corpId=${props.corpId}&teamId=${props.team.teamId}` })
|
||||
uni.navigateTo({
|
||||
url: `/pages/archive/archive-manage?corpId=${props.corpId}&teamId=${props.team.teamId}`,
|
||||
});
|
||||
}
|
||||
|
||||
async function auth() {
|
||||
await confirm(`是否授权${props.team.name}提供服务`);
|
||||
const res = await api('authCustomerToTeam', { corpId: props.corpId, teamId: props.team.teamId, id: current.value._id });
|
||||
const res = await api("authCustomerToTeam", {
|
||||
corpId: props.corpId,
|
||||
teamId: props.team.teamId,
|
||||
id: current.value._id,
|
||||
});
|
||||
if (res && res.success) {
|
||||
await toast('授权成功');
|
||||
getCustomers()
|
||||
await toast("授权成功");
|
||||
getCustomers();
|
||||
} else {
|
||||
toast(res?.message || '授权失败');
|
||||
toast(res?.message || "授权失败");
|
||||
}
|
||||
}
|
||||
|
||||
async function getCustomers() {
|
||||
const res = await api('getMiniAppCustomers', { miniAppId: account.value.openid, corpId: props.corpId });
|
||||
const res = await api("getMiniAppCustomers", {
|
||||
miniAppId: account.value.openid,
|
||||
corpId: props.corpId,
|
||||
});
|
||||
if (res && res.success) {
|
||||
customers.value = res && Array.isArray(res.data) ? res.data : [];
|
||||
const customer = customers.value.find(i => current.value && i._id === current.value._id);
|
||||
const customer = customers.value.find(
|
||||
(i) => current.value && i._id === current.value._id
|
||||
);
|
||||
current.value = customer || customers.value[0] || null;
|
||||
// 向父组件传递 customers 数据
|
||||
emit('update:customers', customers.value);
|
||||
emit("update:customers", customers.value);
|
||||
} else {
|
||||
toast(res.message || '获取档案失败');
|
||||
toast(res.message || "获取档案失败");
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
uni.$on('reloadTeamCustomers', getCustomers)
|
||||
})
|
||||
|
||||
watch(() => props.corpId, n => {
|
||||
if (n) {
|
||||
getCustomers()
|
||||
} else {
|
||||
customers.value = [];
|
||||
}
|
||||
}, { immediate: true });
|
||||
uni.$on("reloadTeamCustomers", getCustomers);
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.corpId,
|
||||
(n) => {
|
||||
if (n) {
|
||||
getCustomers();
|
||||
} else {
|
||||
customers.value = [];
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
<style scoped>
|
||||
.archive-container {
|
||||
padding: 24rpx 30rpx;
|
||||
margin: 0 30rpx;
|
||||
background: linear-gradient(181deg, #C2DCFF 1.01%, #FFFFFF 43.31%);
|
||||
background: linear-gradient(181deg, #c2dcff 1.01%, #ffffff 43.31%);
|
||||
border-radius: 16rpx;
|
||||
box-shadow:
|
||||
inset 0 2rpx 0 0 rgba(255, 255, 255, 0.82),
|
||||
box-shadow: inset 0 2rpx 0 0 rgba(255, 255, 255, 0.82),
|
||||
0 8rpx 10rpx 0 rgba(60, 169, 145, 0.06);
|
||||
}
|
||||
|
||||
@ -214,24 +283,20 @@ watch(() => props.corpId, n => {
|
||||
|
||||
.customer-card {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
height: 110rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: linear-gradient(180deg, #FFFFFF 0%, #E6EFFB 100%);
|
||||
background: linear-gradient(180deg, #ffffff 0%, #e6effb 100%);
|
||||
border-radius: 12rpx;
|
||||
border: 2rpx solid #AECAF2;
|
||||
border: 2rpx solid #aecaf2;
|
||||
transition: all 0.2s;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.current-customer {
|
||||
background: #FFFFFF;
|
||||
border: 2rpx solid #065BD6;
|
||||
}
|
||||
|
||||
.customer-name {
|
||||
margin-top: 12rpx;
|
||||
background: #ffffff;
|
||||
border: 2rpx solid #065bd6;
|
||||
}
|
||||
|
||||
.relationship-tag {
|
||||
@ -248,7 +313,7 @@ watch(() => props.corpId, n => {
|
||||
}
|
||||
|
||||
.relationship-tag::after {
|
||||
content: '';
|
||||
content: "";
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: -8rpx;
|
||||
@ -258,19 +323,19 @@ watch(() => props.corpId, n => {
|
||||
}
|
||||
|
||||
.tag-blue {
|
||||
background: #065BD6;
|
||||
background: #065bd6;
|
||||
}
|
||||
|
||||
.tag-blue::after {
|
||||
border-top: 8rpx solid #003F96;
|
||||
border-top: 8rpx solid #003f96;
|
||||
}
|
||||
|
||||
.tag-green {
|
||||
background: #1DBF98;
|
||||
background: #1dbf98;
|
||||
}
|
||||
|
||||
.tag-green::after {
|
||||
border-top: 8rpx solid #0F8C6D;
|
||||
border-top: 8rpx solid #0f8c6d;
|
||||
}
|
||||
|
||||
.active-indicator {
|
||||
@ -298,14 +363,10 @@ watch(() => props.corpId, n => {
|
||||
transform: translateX(-50%) rotate(45deg);
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
background: #065BD6;
|
||||
background: #065bd6;
|
||||
margin-top: -8rpx;
|
||||
}
|
||||
|
||||
.customer-age {
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.mr-15 {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
@ -318,16 +379,11 @@ watch(() => props.corpId, n => {
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.sex-icon {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
|
||||
.info-card-new {
|
||||
position: relative;
|
||||
padding: 24rpx;
|
||||
border-radius: 16rpx;
|
||||
background: linear-gradient(115deg, #F4F9FF 14.74%, #DBEAFF 66.11%);
|
||||
background: linear-gradient(115deg, #f4f9ff 14.74%, #dbeaff 66.11%);
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.06);
|
||||
overflow: hidden;
|
||||
width: 310rpx;
|
||||
@ -354,22 +410,21 @@ watch(() => props.corpId, n => {
|
||||
}
|
||||
|
||||
.info-bg-base {
|
||||
background-image: url('/static/home/basic-info-bg.svg');
|
||||
background-image: url("/static/home/basic-info-bg.svg");
|
||||
}
|
||||
|
||||
.info-bg-health {
|
||||
background-image: url('/static/home/health-info-bg.svg');
|
||||
background-image: url("/static/home/health-info-bg.svg");
|
||||
}
|
||||
|
||||
|
||||
.info-title {
|
||||
color: #213E80;
|
||||
color: #213e80;
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.info-subtitle {
|
||||
color: #78808F;
|
||||
color: #78808f;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
<view v-for="i in teamates" :key="i.userid"
|
||||
class="member-card flex flex-shrink-0 min-w-120 mr-15 p-15"
|
||||
@click="toHomePage(i)">
|
||||
<image class="flex-shrink-0 avatar mr-10" :src="i.avatar || '/static/default-avatar.png'" />
|
||||
<image class="flex-shrink-0 avatar mr-10" :src="i.avatar || '/static/default-avatar.svg'" />
|
||||
<view class="flex-grow flex flex-col justify-between">
|
||||
<view>
|
||||
<view class="member-name leading-normal h-24 text-base font-semibold text-dark whitespace-nowrap">
|
||||
|
||||
@ -9,7 +9,7 @@ import useTeamStore from '@/store/team.js'
|
||||
export default function useGroupAvatars() {
|
||||
const groupAvatarMap = ref({}) // { groupID: [avatarUrl1, avatarUrl2, ...] }
|
||||
const teamStore = useTeamStore()
|
||||
const patientDefaultAvatar = '/static/default-avatar.png'
|
||||
const patientDefaultAvatar = '/static/default-avatar.svg'
|
||||
|
||||
/**
|
||||
* 获取单个群聊的头像列表
|
||||
|
||||
@ -45,8 +45,8 @@ export default function useGroupChat(groupID) {
|
||||
const member = chatMember.value[userId]
|
||||
if (!member) {
|
||||
// 如果找不到成员信息,根据是否为团队成员返回默认头像
|
||||
// 团队成员和患者都使用 default-avatar.png
|
||||
return '/static/default-avatar.png'
|
||||
// 团队成员和患者都使用 default-avatar.svg
|
||||
return '/static/default-avatar.svg'
|
||||
}
|
||||
|
||||
// 如果有头像且不为空字符串,返回头像
|
||||
@ -55,7 +55,7 @@ export default function useGroupChat(groupID) {
|
||||
}
|
||||
|
||||
// 否则使用默认头像
|
||||
return '/static/default-avatar.png'
|
||||
return '/static/default-avatar.svg'
|
||||
}
|
||||
|
||||
// 获取群聊信息和成员头像
|
||||
|
||||
@ -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 }}
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- Survey List -->
|
||||
<view class="p-15">
|
||||
<view v-if="loading && surveys.length === 0" class="loading-container">
|
||||
<uni-icons type="spinner-cycle" size="30" color="#999" />
|
||||
<text class="loading-text">加载中...</text>
|
||||
</view>
|
||||
|
||||
<view v-else-if="!loading && surveys.length === 0" class="empty-container">
|
||||
<empty-data text="暂无问卷" />
|
||||
</view>
|
||||
|
||||
<view v-else class="p-15">
|
||||
<view
|
||||
v-for="item in filteredSurveys"
|
||||
v-for="item in surveys"
|
||||
:key="item._id"
|
||||
class="bg-white rounded-lg p-15 mb-15 shadow-sm"
|
||||
@click="goToDetail(item)"
|
||||
@ -30,7 +39,7 @@
|
||||
<view class="flex items-start flex-1 mr-10 relative">
|
||||
<!-- Tag -->
|
||||
<view class="text-xs text-green-600 border border-green-600 px-5 rounded mr-5 flex-shrink-0 mt-1 tag-box">
|
||||
{{ item.type }}
|
||||
问卷调查
|
||||
</view>
|
||||
<!-- Title -->
|
||||
<view class="text-base font-bold text-gray-800 leading-normal line-clamp-2">
|
||||
@ -38,93 +47,166 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- Status -->
|
||||
<!-- Status (暂不展示未填写/已填写) -->
|
||||
<view class="flex items-center flex-shrink-0 ml-2">
|
||||
<text
|
||||
class="text-sm mr-2"
|
||||
:class="item.status === 'UNFILLED' ? 'text-red-500' : 'text-gray-400'"
|
||||
>
|
||||
{{ item.status === 'UNFILLED' ? '未填写' : '查看' }}
|
||||
</text>
|
||||
<uni-icons type="right" size="14" :color="item.status === 'UNFILLED' ? '#ef4444' : '#9ca3af'"></uni-icons>
|
||||
<text class="text-sm mr-2 text-gray-400">查看</text>
|
||||
<uni-icons type="right" size="14" color="#9ca3af"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- Content -->
|
||||
<!-- Person -->
|
||||
<view class="text-sm text-gray-600 mb-5 flex items-center">
|
||||
<text class="text-gray-400 mr-2">人员:</text>
|
||||
<text>{{ item.person }}</text>
|
||||
<view class="text-sm text-gray-600 mb-5 flex items-start">
|
||||
<text class="text-gray-400 mr-2 field-label">人员:</text>
|
||||
<text>{{ item.person || '-' }}</text>
|
||||
</view>
|
||||
<!-- Team -->
|
||||
<view class="text-sm text-gray-600 mb-10 pb-10 border-b border-gray-100 flex items-center">
|
||||
<text class="text-gray-400 mr-2">团队:</text>
|
||||
<text>{{ item.team }}</text>
|
||||
|
||||
<view class="text-sm text-gray-600 mb-10 pb-10 border-b border-gray-100 flex items-start">
|
||||
<text class="text-gray-400 mr-2 field-label">团队:</text>
|
||||
<text>{{ item.team || '-' }}</text>
|
||||
</view>
|
||||
|
||||
<!-- Footer -->
|
||||
<view class="text-sm text-gray-400">
|
||||
发送时间: {{ item.time }}
|
||||
发送时间: {{ item.time || '-' }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="loading && surveys.length > 0" class="loading-more">
|
||||
<uni-icons type="spinner-cycle" size="20" color="#999" />
|
||||
<text>加载中...</text>
|
||||
</view>
|
||||
|
||||
<view v-if="!loading && surveys.length >= total" class="no-more">
|
||||
没有更多了
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { ref } from "vue";
|
||||
import { onShow, onReachBottom } from "@dcloudio/uni-app";
|
||||
import { storeToRefs } from "pinia";
|
||||
import dayjs from "dayjs";
|
||||
import api from "@/utils/api.js";
|
||||
import useAccountStore from "@/store/account.js";
|
||||
import EmptyData from "@/components/empty-data.vue";
|
||||
|
||||
// Mock Data
|
||||
const tabs = [
|
||||
{ name: '全部', value: 'ALL' },
|
||||
{ name: '李珊珊 女 37岁', value: '1' },
|
||||
{ name: '罗小小 女 17岁', value: '2' },
|
||||
];
|
||||
const env = __VITE_ENV__;
|
||||
const corpId = env.MP_CORP_ID;
|
||||
const { openid } = storeToRefs(useAccountStore());
|
||||
|
||||
const activeTab = ref('ALL');
|
||||
const tabs = ref([{ name: "全部", value: "" }]);
|
||||
const activeTab = ref("");
|
||||
|
||||
const surveys = ref([
|
||||
{
|
||||
_id: 1,
|
||||
type: '问卷调查',
|
||||
title: '门诊满意度调查问卷',
|
||||
status: 'UNFILLED',
|
||||
person: '李珊珊 女 36岁',
|
||||
team: '妊糖管理服务团队',
|
||||
time: '2026-01-09 15:23',
|
||||
ownerId: '1'
|
||||
},
|
||||
{
|
||||
_id: 2,
|
||||
type: '问卷调查',
|
||||
title: 'xxxx术后1周随访调查问卷',
|
||||
status: 'FILLED',
|
||||
person: '李珊珊 女 36岁',
|
||||
team: '妊糖管理服务团队',
|
||||
time: '2026-01-09 15:23',
|
||||
ownerId: '1'
|
||||
},
|
||||
{
|
||||
_id: 3,
|
||||
type: '问卷调查',
|
||||
title: 'xxxxx术后2周随访调查问卷',
|
||||
status: 'FILLED',
|
||||
person: '罗小小 女 16岁',
|
||||
team: '妊糖管理服务团队',
|
||||
time: '2026-01-09 15:23',
|
||||
ownerId: '2'
|
||||
const surveys = ref([]);
|
||||
const total = ref(0);
|
||||
const page = ref(1);
|
||||
const pageSize = 20;
|
||||
const loading = ref(false);
|
||||
const inited = ref(false);
|
||||
|
||||
const selectTab = async (memberId) => {
|
||||
if (activeTab.value === memberId) return;
|
||||
activeTab.value = memberId;
|
||||
await loadSurveyList(true);
|
||||
};
|
||||
|
||||
const loadCustomers = async () => {
|
||||
const miniAppId = openid.value || uni.getStorageSync("openid");
|
||||
if (!miniAppId) return;
|
||||
try {
|
||||
const res = await api("getMiniAppCustomers", { miniAppId, corpId });
|
||||
if (res && res.success) {
|
||||
const list = Array.isArray(res.data) ? res.data : [];
|
||||
tabs.value = [
|
||||
{ name: "全部", value: "" },
|
||||
...list.map((c) => ({ name: c.name || "未命名", value: c._id })),
|
||||
];
|
||||
} else {
|
||||
uni.showToast({ title: res?.message || "获取档案失败", icon: "none" });
|
||||
}
|
||||
} catch (err) {
|
||||
console.error("loadCustomers failed:", err);
|
||||
uni.showToast({ title: "获取档案失败", icon: "none" });
|
||||
}
|
||||
]);
|
||||
};
|
||||
|
||||
const filteredSurveys = computed(() => {
|
||||
if (activeTab.value === 'ALL') return surveys.value;
|
||||
return surveys.value.filter(item => item.ownerId === activeTab.value);
|
||||
const mapRowToView = (row) => {
|
||||
const sendTime = row?.createTime ? dayjs(row.createTime).format("YYYY-MM-DD HH:mm") : "";
|
||||
return {
|
||||
_id: row?._id,
|
||||
surveryId: row?.surveryId,
|
||||
title: row?.name || "问卷调查",
|
||||
person: row?.customer?.name || "",
|
||||
team: row?.team?.name || "-",
|
||||
time: sendTime,
|
||||
status: row?.status || "",
|
||||
};
|
||||
};
|
||||
|
||||
const loadSurveyList = async (reset = false) => {
|
||||
if (loading.value) return;
|
||||
const miniAppId = openid.value || uni.getStorageSync("openid");
|
||||
if (!miniAppId) {
|
||||
uni.showToast({ title: "未获取到用户信息,请重新登录", icon: "none" });
|
||||
return;
|
||||
}
|
||||
|
||||
if (reset) {
|
||||
page.value = 1;
|
||||
surveys.value = [];
|
||||
total.value = 0;
|
||||
}
|
||||
|
||||
loading.value = true;
|
||||
try {
|
||||
const params = {
|
||||
corpId,
|
||||
miniAppId,
|
||||
page: page.value,
|
||||
pageSize,
|
||||
};
|
||||
if (activeTab.value) params.memberId = activeTab.value;
|
||||
|
||||
const res = await api("getMiniAppReceivedSurveryList", params);
|
||||
if (res && res.success) {
|
||||
const list = Array.isArray(res.list) ? res.list : [];
|
||||
total.value = Number(res.total) || 0;
|
||||
const mapped = list.map(mapRowToView);
|
||||
if (page.value === 1) surveys.value = mapped;
|
||||
else surveys.value = [...surveys.value, ...mapped];
|
||||
} else {
|
||||
uni.showToast({ title: res?.message || "获取问卷失败", icon: "none" });
|
||||
}
|
||||
} catch (err) {
|
||||
console.error("loadSurveyList failed:", err);
|
||||
uni.showToast({ title: "加载失败,请重试", icon: "none" });
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
function goToDetail() {
|
||||
uni.showToast({ title: "详情暂未接入", icon: "none" });
|
||||
}
|
||||
|
||||
onShow(async () => {
|
||||
if (!inited.value) {
|
||||
await loadCustomers();
|
||||
await loadSurveyList(true);
|
||||
inited.value = true;
|
||||
return;
|
||||
}
|
||||
await loadSurveyList(true);
|
||||
});
|
||||
|
||||
function goToDetail(item) {
|
||||
console.log('Navigate to detail', item);
|
||||
// Add actual navigation logic here later
|
||||
}
|
||||
onReachBottom(() => {
|
||||
if (loading.value) return;
|
||||
if (surveys.value.length >= total.value) return;
|
||||
page.value += 1;
|
||||
loadSurveyList(false);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@ -207,4 +289,35 @@ function goToDetail(item) {
|
||||
line-clamp: 2;
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
|
||||
.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;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<view v-if="member" class="flex flex-col h-full items-center justify-center">
|
||||
<view class="business-card">
|
||||
<view class="flex">
|
||||
<image class="mr-10 avatar" :src="member.avatar || '/static/default-avatar.png'"></image>
|
||||
<image class="mr-10 avatar" :src="member.avatar || '/static/default-avatar.svg'"></image>
|
||||
<view class="w-0 flex-grow leading-normal">
|
||||
<view class="flex items-center">
|
||||
<view class="mr-5 text-lg font-semibold text-dark">{{ member.anotherName }}</view>
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
</view>
|
||||
<view v-for="i in teammate.leaders" :key="i._id" class="mt-12 flex p-10 border-primary rounded-sm"
|
||||
@click="toHomePage(i.userid)">
|
||||
<image class="flex-shrink-0 mr-10 avatar" :src="i.avatar || '/static/default-avatar.png'"></image>
|
||||
<image class="flex-shrink-0 mr-10 avatar" :src="i.avatar || '/static/default-avatar.svg'"></image>
|
||||
<view class="w-0 flex-grow leading-normal">
|
||||
<view class="flex items-center justify-between">
|
||||
<view class="flex-shrink-0 mr-5 view-lg text-dark font-semibold">{{ i.anotherName }}</view>
|
||||
@ -45,7 +45,7 @@
|
||||
</view>
|
||||
<view v-for="i in teammate.members" :key="i._id" class="mt-12 flex p-10 border-primary rounded-sm"
|
||||
@click="toHomePage(i.userid)">
|
||||
<image class="flex-shrink-0 mr-10 avatar" :src="i.avatar || '/static/default-avatar.png'"></image>
|
||||
<image class="flex-shrink-0 mr-10 avatar" :src="i.avatar || '/static/default-avatar.svg'"></image>
|
||||
<view class="w-0 flex-grow leading-normal">
|
||||
<view class="flex items-center justify-between">
|
||||
<view class="flex-shrink-0 mr-5 view-lg text-dark font-semibold">{{ i.anotherName }}</view>
|
||||
@ -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 : [];
|
||||
|
||||
@ -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 }
|
||||
|
||||
@ -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) => {
|
||||
|
||||
@ -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'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user