diff --git a/api/api.js b/api/api.js index d5a0847..ac10106 100644 --- a/api/api.js +++ b/api/api.js @@ -261,7 +261,27 @@ const api = { return request('/expertAPI/newsTagList', data, 'post', false); }, - + meetingListV2U(data){ + return request('/expertAPI/meetingListV2U', data, 'post', false); + }, + applyList(data){ + return request('/expertAPI/applyList', data, 'post', false); + }, + patientListByGBK(data){ + return request('/expertAPI/patientListByGBK', data, 'post', false); + }, + followUpList(data){ + return request('/expertAPI/followUpList', data, 'post', false); + }, + relationRecordLately(data){ + return request('/expertAPI/relationRecordLately', data, 'post', false); + }, + applyListOperate(data){ + return request('/expertAPI/applyListOperate', data, 'post', false); + }, + groupList(data){ + return request('/expertAPI/groupListU', data, 'post', false); + }, } export default api \ No newline at end of file diff --git a/package.json b/package.json index c7fe411..231ecbb 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "dayjs": "^1.11.18", "js-base64": "^3.7.8", "js-md5": "^0.8.3", + "pinyin": "^4.0.0", "uview-plus": "^3.4.73" } } diff --git a/pages.json b/pages.json index 8c9ec71..ebaa76b 100644 --- a/pages.json +++ b/pages.json @@ -218,6 +218,47 @@ } } }, + { + "path": "patientSetting/patientSetting", + "style": { + "navigationStyle": "custom", + "navigationBarTitleText": "uni-app分页", + "app": { + "bounce": "none" + } + } + }, + { + "path": "patientRemark/patientRemark", + "style": { + "navigationStyle": "custom", + "navigationBarTitleText": "uni-app分页", + "app": { + "bounce": "none" + } + } + }, + { + "path": "groupEdit/groupEdit", + "style": { + "navigationStyle": "custom", + "navigationBarTitleText": "uni-app分页", + "app": { + "bounce": "none" + } + } + }, + { + "path": "selectPatient/selectPatient", + "style": { + "navigationStyle": "custom", + "navigationBarTitleText": "uni-app分页", + "app": { + "bounce": "none" + } + } + }, + { "path": "videoDetail/videoDetail", "style": { diff --git a/pages/live/live.vue b/pages/live/live.vue index 0c12390..3e45f19 100644 --- a/pages/live/live.vue +++ b/pages/live/live.vue @@ -36,8 +36,8 @@ 2025年08月 - - + + {{ item.date }} @@ -47,11 +47,20 @@ {{ item.title }} - + - 预告 + 预告 + 直播中 + 回放 @@ -69,6 +78,15 @@ + + + + + + 暂无会议数据 + 请稍后再试或调整筛选条件 + + @@ -138,10 +156,13 @@ import { ref,nextTick} from 'vue'; import { onShow } from "@dcloudio/uni-app"; import CustomTabbar from '@/components/tabBar/tabBar.vue'; + import api from '@/api/api.js'; import select from "@/static/triangle_normal.png" import selectOn from "@/static/triangle_normal.png" import playImg from "@/static/bofang.png" import timeImg from "@/static/play_long.png" + import docUrl from "@/utils/docUrl" + // 弹窗状态 const isTimePopupShow = ref(false); const isLocationPopupShow = ref(false); @@ -214,32 +235,153 @@ ]); // 会议列表数据 - const meetingList = ref([ - { - date: '13', - tagColor: '#FF4444', - title: '"天山论·见"—疑难危重病患维训练营', - poster: '/static/meeting-poster-1.jpg', - time: '2025.08.13', - location: '线上' - }, - { - date: '13', - tagColor: '#FFA500', - title: '护肝新声大咖谈', - poster: '/static/meeting-poster-2.jpg', - time: '2025.08.13', - location: '线上' - }, - { - date: '15', - tagColor: '#00BCD4', - title: '小罐医生讲HIV和感染|专题二:抗菌药物-抗真菌药物特性解读', - poster: '/static/meeting-poster-3.jpg', - time: '2025.08.15', - location: '线上' + const meetingList = ref([]); + + // 页面显示时获取会议列表数据 + onShow(() => { + getMeetingList(true); + }); + + // 获取会议列表数据的函数 + const getMeetingList = async (isRefresh = false) => { + if (isRefresh) { + currentPage.value = 1; + hasMoreData.value = true; } - ]); + + const params = { + page: currentPage.value, + pageSize: pageSize.value, + month: selectedMonth.value !== 'all' ? selectedMonth.value : '', + province: selectedProvince.value !== 'all' ? selectedProvince.value : '' + }; + + try { + console.log('获取会议列表参数:', params); + const response = await api.meetingListV2U(params); + console.log('会议列表API响应:', response); + + if (response && response.code === 200 && response.data) { + let newItems = []; + let totalCount = 0; + + // 处理不同的数据结构 + if (response.data.list && Array.isArray(response.data.list)) { + newItems = response.data.list; + totalCount = response.data.total || response.data.totalRow || 0; + console.log('使用 res.data.list 结构'); + } else if (response.data && Array.isArray(response.data)) { + newItems = response.data; + totalCount = response.total || response.totalRow || newItems.length; + console.log('使用 res.data 结构'); + } else if (Array.isArray(response)) { + newItems = response; + totalCount = newItems.length; + console.log('使用 res 数组结构'); + } + + console.log('解析后的数据:', { newItems, totalCount }); + console.log('图片字段映射示例:', newItems.slice(0, 2).map(item => ({ + liveimg: item.liveimg || item.live_image || item.live_img, + poster: item.poster || item.cover_image || item.image + }))); + + if (Array.isArray(newItems) && newItems.length > 0) { + // 处理会议数据,添加必要的字段 + const processedItems = newItems.map(item => ({ + id: item.id || item.meeting_id || Math.random().toString(36).substr(2, 9), + date: item.date || item.meeting_date || item.start_time || '13', + tagColor: getTagColor(item.status || item.meeting_status || 'upcoming'), + title: item.title || item.meeting_title || item.name || '会议标题', + liveimg: item.liveimg || item.live_image || item.live_img || '', + poster: item.poster || item.cover_image || item.image || '/static/meeting-poster-1.jpg', + time: formatMeetingTime(item.start_time || item.meeting_time || item.time), + location: item.location || item.address || item.venue || '线上', + status: item.status || item.meeting_status || 'upcoming', + description: item.description || item.content || '', + organizer: item.organizer || item.host || '', + speakers: item.speakers || item.experts || [] + })); + + if (isRefresh) { + meetingList.value = processedItems; + } else { + meetingList.value.push(...processedItems); + } + + // 检查是否还有更多数据 + if (meetingList.value.length >= totalCount) { + hasMoreData.value = false; + } + + console.log('会议列表更新成功,当前总数:', meetingList.value.length); + console.log('图片字段详情:', processedItems.slice(0, 2).map(item => ({ + id: item.id, + liveimg: item.liveimg, + poster: item.poster, + finalImage: item.liveimg || item.poster + }))); + } else { + console.log('API返回的数据为空'); + if (isRefresh) { + meetingList.value = []; + } + } + } else { + console.log('API响应格式不正确:', response); + if (isRefresh) { + meetingList.value = []; + } + } + } catch (error) { + console.error('获取会议列表失败:', error); + if (isRefresh) { + meetingList.value = []; + } + uni.showToast({ + title: '获取会议列表失败', + icon: 'error', + duration: 2000 + }); + } + }; + + // 根据会议状态获取标签颜色 + const getTagColor = (status) => { + const colorMap = { + 'upcoming': '#FF4444', // 预告 + 'live': '#00BCD4', // 直播中 + 'replay': '#9C27B0', // 回放 + 'finished': '#4CAF50', // 已结束 + 'cancelled': '#FF9800' // 已取消 + }; + return colorMap[status] || '#FF4444'; + }; + + // 格式化会议时间 + const formatMeetingTime = (timeStr) => { + if (!timeStr) return '2025.08.13'; + + try { + // 如果是时间戳 + if (typeof timeStr === 'number') { + const date = new Date(timeStr); + return `${date.getFullYear()}.${String(date.getMonth() + 1).padStart(2, '0')}.${String(date.getDate()).padStart(2, '0')}`; + } + + // 如果是字符串,尝试解析 + const date = new Date(timeStr); + if (!isNaN(date.getTime())) { + return `${date.getFullYear()}.${String(date.getMonth() + 1).padStart(2, '0')}.${String(date.getDate()).padStart(2, '0')}`; + } + + // 如果解析失败,返回原字符串 + return timeStr; + } catch (error) { + console.error('时间格式化失败:', error); + return timeStr; + } + }; // 显示时间选择弹窗 const showTimePopup = () => { @@ -255,7 +397,8 @@ const selectMonth = (month) => { selectedMonth.value = month.value; console.log('选择月份:', month.label); - // 这里可以根据选择的月份筛选会议数据 + // 选择月份后重新加载数据 + getMeetingList(true); hideTimePopup(); }; @@ -273,7 +416,8 @@ const selectProvince = (province) => { selectedProvince.value = province.code; console.log('选择省份:', province.name); - // 这里可以根据选择的省份筛选会议数据 + // 选择省份后重新加载数据 + getMeetingList(true); hideLocationPopup(); }; @@ -283,102 +427,64 @@ // 这里可以实现视频播放逻辑 }; + // 图片加载失败处理 + const onImageError = (e) => { + const itemId = e.currentTarget.dataset.itemId; + console.log('图片加载失败,项目ID:', itemId); + + // 找到对应的项目并设置默认图片 + const itemIndex = meetingList.value.findIndex(item => item.id === itemId); + if (itemIndex !== -1) { + // 如果liveimg加载失败,尝试使用poster + if (meetingList.value[itemIndex].liveimg && meetingList.value[itemIndex].liveimg !== meetingList.value[itemIndex].poster) { + console.log('liveimg加载失败,切换到poster'); + meetingList.value[itemIndex].liveimg = meetingList.value[itemIndex].poster; + } else { + // 如果poster也失败,使用默认图片 + console.log('设置默认图片'); + meetingList.value[itemIndex].poster = '/static/meeting-poster-1.jpg'; + } + } + }; + + // 图片加载成功处理 + const onImageLoad = (e) => { + const itemId = e.currentTarget.dataset.itemId; + console.log('图片加载成功,项目ID:', itemId, '图片地址:', e.currentTarget.src); + }; + // 下拉刷新 const onRefresh = () => { isRefreshing.value = true; currentPage.value = 1; hasMoreData.value = true; - // 模拟网络请求 - setTimeout(() => { - // 重置会议列表为初始数据 - meetingList.value = [ - { - date: '13', - tagColor: '#FF4444', - title: '"天山论·见"—疑难危重病患维训练营', - poster: '/static/meeting-poster-1.jpg', - time: '2025.08.13', - location: '线上' - }, - { - date: '13', - tagColor: '#FFA500', - title: '护肝新声大咖谈', - poster: '/static/meeting-poster-2.jpg', - time: '2025.08.13', - location: '线上' - }, - { - date: '15', - tagColor: '#00BCD4', - title: '小罐医生讲HIV和感染|专题二:抗菌药物-抗真菌药物特性解读', - poster: '/static/meeting-poster-3.jpg', - time: '2025.08.15', - location: '线上' - } - ]; - isRefreshing.value = false; - uni.showToast({ - title: '刷新成功', - icon: 'success', - duration: 1500 - }); - }, 1500); + // 调用获取会议列表函数 + getMeetingList(true).finally(() => { + // 延迟关闭刷新状态,给用户更好的体验 + setTimeout(() => { + isRefreshing.value = false; + uni.showToast({ + title: '刷新成功', + icon: 'success', + duration: 1500 + }); + }, 500); + }); }; // 上拉加载更多 const onLoadMore = () => { - console.log('上拉加载'); + console.log('上拉加载更多'); if (isLoadingMore.value || !hasMoreData.value) return; isLoadingMore.value = true; currentPage.value++; - // 模拟网络请求 - setTimeout(() => { - // 模拟新增数据 - const newMeetings = [ - { - date: '16', - tagColor: '#9C27B0', - title: '肝胆外科微创技术研讨会', - poster: '/static/meeting-poster-4.jpg', - time: '2025.08.16', - location: '北京' - }, - { - date: '17', - tagColor: '#FF9800', - title: '胆囊疾病诊疗新进展', - poster: '/static/meeting-poster-5.jpg', - time: '2025.08.17', - location: '上海' - }, - { - date: '18', - tagColor: '#4CAF50', - title: '肝移植术后管理专题讲座', - poster: '/static/meeting-poster-6.jpg', - time: '2025.08.18', - location: '广州' - } - ]; - - meetingList.value.push(...newMeetings); - - // 模拟没有更多数据的情况(第3页后) - if (currentPage.value >= 3) { - hasMoreData.value = false; - } - + // 调用API获取更多数据 + getMeetingList(false).finally(() => { isLoadingMore.value = false; - - // 强制更新页面,确保scroll-view可以正常滚动 - nextTick(() => { - console.log('数据加载完成,列表长度:', meetingList.value.length); - }); - }, 1000); + }); }; @@ -701,7 +807,29 @@ $shadow: 0 2px 8px rgba(0,0,0,0.1); position: absolute; top: 16rpx; right: 16rpx; - border: 4rpx solid #fff; + background-color: #FF4444; + color: $white; + font-size: 24rpx; + padding: 4rpx 16rpx; + border-radius: 20rpx; + } + + .live-tag { + position: absolute; + top: 16rpx; + right: 16rpx; + background-color: #00BCD4; + color: $white; + font-size: 24rpx; + padding: 4rpx 16rpx; + border-radius: 20rpx; + } + + .replay-tag { + position: absolute; + top: 16rpx; + right: 16rpx; + background-color: #9C27B0; color: $white; font-size: 24rpx; padding: 4rpx 16rpx; @@ -730,6 +858,31 @@ $shadow: 0 2px 8px rgba(0,0,0,0.1); } } +// 空状态 +.empty-state { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 100rpx 30rpx; + + .empty-icon { + margin-bottom: 30rpx; + } + + .empty-text { + font-size: 32rpx; + color: $gray; + margin-bottom: 16rpx; + } + + .empty-subtext { + font-size: 26rpx; + color: $gray-text; + text-align: center; + } +} + // 加载更多提示 .load-more { padding: 30rpx; diff --git a/pages_app/groupEdit/groupEdit.vue b/pages_app/groupEdit/groupEdit.vue new file mode 100644 index 0000000..b4fadb3 --- /dev/null +++ b/pages_app/groupEdit/groupEdit.vue @@ -0,0 +1,196 @@ + + + + + diff --git a/pages_app/myPatient/myPatient.vue b/pages_app/myPatient/myPatient.vue index 4ccf8cb..a7ceff9 100644 --- a/pages_app/myPatient/myPatient.vue +++ b/pages_app/myPatient/myPatient.vue @@ -24,20 +24,20 @@ -