From 397cf0c88ebdadddcd49627e4a89a69cdf2a55f2 Mon Sep 17 00:00:00 2001 From: zoujiandong <10130823232@qq.com> Date: Fri, 5 Sep 2025 10:19:10 +0800 Subject: [PATCH] =?UTF-8?q?9.5=E4=B8=8A=E5=8D=88=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/api.js | 30 +- pages.json | 57 +- pages/education/education.vue | 74 +- pages/index/index.vue | 7 +- pages/patientClass/patientClass.vue | 370 ++++++---- pages_app/hot/hot.vue | 707 ++++++++++++++++++++ pages_app/patientVideo/patientVideo.vue | 855 ++++++++++++++++++++++++ pages_app/search/search.vue | 32 +- pages_app/searchNews/searchNews.vue | 638 ++++++++++++++++++ pages_app/searchVideo/searchVideo.vue | 306 +++++++++ pages_app/zhinan/zhinan.vue | 9 +- pages_app/zhinanList/zhinanList.vue | 283 +++++++- static/hot_booklist.png | Bin 0 -> 1899 bytes 13 files changed, 3146 insertions(+), 222 deletions(-) create mode 100644 pages_app/hot/hot.vue create mode 100644 pages_app/patientVideo/patientVideo.vue create mode 100644 pages_app/searchNews/searchNews.vue create mode 100644 pages_app/searchVideo/searchVideo.vue create mode 100644 static/hot_booklist.png diff --git a/api/api.js b/api/api.js index 99f56d3..67680f5 100644 --- a/api/api.js +++ b/api/api.js @@ -297,14 +297,6 @@ const api = { return request('/expertAPI/modifyMobile', data, 'post', false); }, - pointTicketlist(data){ - return request('/expertAPI/pointTicketlist', data, 'post', false); - }, - - pointTicketExchange(data){ - return request('/expertAPI/updateStatus', data, 'post', false); - }, - smsSend(data){ return request('/expertAPI/smsSend', data, 'post', false); }, @@ -381,7 +373,27 @@ const api = { cancelRes(data){ return request('/expertAPI/cancelRes', data, 'post', false); }, - + polularScienceArticleListByKeywordsNew(data){ + return request('/expertAPI/polularScienceArticleListByKeywordsNew', data, 'post', false); + }, + patientVideoByKeyWordsNew(data){ + return request('/expertAPI/patientVideoByKeyWordsNew', data, 'post', false); + }, + patientVideoNew(data){ + return request('/expertAPI/patientVideoNew', data, 'post', false); + }, + top10ByType(data){ + return request('/expertAPI/top10ByType', data, 'post', false); + }, + videoBySearchNew(data){ + return request('/expertAPI/videoBySearchNew', data, 'post', false); + }, + patientVideoBySearchNew(data){ + return request('/expertAPI/patientVideoBySearchNew', data, 'post', false); + }, + polularScienceArticleListIndexNew(data){ + return request('/expertAPI/polularScienceArticleListIndexNew', data, 'post', false); + }, } export default api \ No newline at end of file diff --git a/pages.json b/pages.json index 9ff11c9..28736c1 100644 --- a/pages.json +++ b/pages.json @@ -198,10 +198,32 @@ } } }, + { + "path": "searchNews/searchNews", + "style": { + "navigationStyle": "custom", + "navigationBarTitleText": "uni-app分页", + "app": { + "bounce": "none" + } + } + }, + { + "path": "searchVideo/searchVideo", + "style": { + "navigationStyle": "custom", + "navigationBarRightButton":{ "hide": true}, + "navigationBarTitleText": "uni-app分页", + "app": { + "bounce": "none" + } + } + }, { "path": "search/search", "style": { "navigationStyle": "custom", + "navigationBarRightButton":{ "hide": true}, "navigationBarTitleText": "uni-app分页", "app": { "bounce": "none" @@ -285,6 +307,28 @@ } } }, + { + "path": "hot/hot", + "style": { + "navigationStyle": "custom", + "navigationBarRightButton":{ "hide": true}, + "navigationBarTitleText": "uni-app分页", + "app": { + "bounce": "none" + } + } + }, + { + "path": "patientVideo/patientVideo", + "style": { + "navigationStyle": "custom", + "navigationBarRightButton":{ "hide": true}, + "navigationBarTitleText": "uni-app分页", + "app": { + "bounce": "none" + } + } + }, { "path": "selectPatient/selectPatient", "style": { @@ -658,6 +702,7 @@ "path": "zhinanList/zhinanList", "style": { "navigationStyle": "custom", + "navigationBarRightButton":{ "hide": true}, "navigationBarTitleText": "uni-app分页", "app": { "bounce": "none" @@ -792,16 +837,6 @@ { "root": "pages_goods", "pages": [ - { - "path": "coupon/coupon", - "style": { - "navigationStyle": "custom", - "navigationBarTitleText": "积分券", - "app": { - "bounce": "none" - } - } - }, { "path": "pointMall/pointMall", "style": { @@ -893,7 +928,7 @@ "list": [ { "name": "", //模式名称 - "path": "pages/index/index", //启动页面,必选 + "path": "pages_app/videoDetail/videoDetail", //启动页面,必选 "query": "" //启动参数,在页面的onLoad函数里面得到 } ] diff --git a/pages/education/education.vue b/pages/education/education.vue index b78de7a..ac1fd6e 100644 --- a/pages/education/education.vue +++ b/pages/education/education.vue @@ -4,7 +4,7 @@ - + 肝胆精品课 @@ -16,7 +16,7 @@ - + 肝胆视频 @@ -28,7 +28,7 @@ - + 肝胆课件 @@ -40,7 +40,7 @@ - + - + - + - + @@ -102,6 +102,7 @@ import huicuiImg from "@/static/jingdianbingli.png" import xueyuanImg from "@/static/ganbingxueyuan.png" import newerImg from "@/static/xinshoujiaocheng.png" + import navTo from '@/utils/navTo.js'; // 方法 // 方法 const goToCourse = (courseType) => { @@ -109,47 +110,20 @@ // 根据课程类型进行不同的处理 switch(courseType) { - case 'hepatoBiliary': - uni.showToast({ - title: '肝胆精品课功能开发中', - icon: 'none' - }); + case 'course': + navTo({ + url: '/pages_course/index/index' + }) break; - case 'hepatoBiliaryVideo': - uni.showToast({ - title: '肝胆视频功能开发中', - icon: 'none' - }); + case 'video': + navTo({ + url: '/pages_app/video/video' + }) break; - case 'hepatoBiliaryCourseware': - uni.showToast({ - title: '肝胆课件功能开发中', - icon: 'none' - }); - break; - case 'caseDiscussion': - uni.showToast({ - title: '病例讨论功能开发中', - icon: 'none' - }); - break; - case 'caseCollection': - uni.showToast({ - title: '病例荟萃功能开发中', - icon: 'none' - }); - break; - case 'modernHepatology': - uni.showToast({ - title: '现代肝病学院功能开发中', - icon: 'none' - }); - break; - case 'tutorial': - uni.showToast({ - title: '新手教程功能开发中', - icon: 'none' - }); + case 'ppt': + navTo({ + url: '/pages_app/ppt/ppt' + }) break; default: uni.showToast({ diff --git a/pages/index/index.vue b/pages/index/index.vue index 385533c..0992762 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -253,9 +253,13 @@ import sign from "@/static/home_qiandao_icon.png" import signImg from "@/static/sign_in_bng_big.png" import dayjs from 'dayjs' - import docUrl from "@/utils/docUrl.js" const expertDetail=reactive({}) const showSign=ref(false) + const signInfo=reactive({ + news:{ + summary:'' + } + }) // 定义refs const tabbarRef = ref(null); const visible=ref(false) @@ -850,7 +854,6 @@ url: '/pages_course/course/course' }); }; - const signInfo=reactive({}) // 签到点击事件 const onSignClick = async () => { // 如果已经签到,显示提示 diff --git a/pages/patientClass/patientClass.vue b/pages/patientClass/patientClass.vue index c59c520..f96f2ce 100644 --- a/pages/patientClass/patientClass.vue +++ b/pages/patientClass/patientClass.vue @@ -20,17 +20,18 @@ - + 搜索 - - 最新 - + + {{type==1?'最新':'最热'}} + + - + 筛选 @@ -50,7 +51,7 @@ :class="{ active: tag.selected }" @click="toggleTag(index)" > - {{ tag.name }} + {{ tag.DES }} @@ -63,8 +64,16 @@ - - + + {{ article.title }} @@ -77,13 +86,30 @@ {{ article.views }} - + {{ article.likes }} + + + + + 加载中... + + + + + 没有更多数据了 + + + + + + 暂无文章 + @@ -100,128 +126,177 @@ import downImg from "@/static/cb_up.png" import filter from "@/static/cb_screen_no.png" import filterOn from "@/static/cb_screen_yes.png" + import api from "@/api/api.js" + import docUrl from '@/utils/docUrl.js'; + import navTo from '@/utils/navTo.js'; + const type=ref(1) + + // 分页相关状态 + const currentPage = ref(1); + const pageSize = ref(10); + const hasMore = ref(true); + const loading = ref(false); + const refreshing = ref(false); // 响应式数据 const activeTab = ref(0); const showFilter = ref(false); const isFilterActive = ref(false); - - // 筛选标签数据 - const filterTags = ref([ - { name: '甲型肝炎', selected: false }, - { name: '乙型肝炎', selected: false }, - { name: '丙型肝炎', selected: false }, - { name: '药物肝', selected: false }, - { name: '自免肝', selected: false }, - { name: '酒精肝', selected: false }, - { name: '脂肪肝', selected: false }, - { name: '肝纤维化', selected: false }, - { name: '肝硬化', selected: false }, - { name: '肝癌', selected: false }, - { name: '肝囊虫', selected: false }, - { name: '肝移植', selected: false }, - { name: '胆结石', selected: false }, - { name: '胆囊炎', selected: false }, - { name: '其他疾病', selected: false }, - { name: '肝脏检查', selected: false }, - { name: '乙肝五项', selected: false }, - { name: '肝功能', selected: false }, - { name: '报告解读', selected: false }, - { name: '肝炎病毒', selected: false }, - { name: '传播途径', selected: false }, - { name: '症状表现', selected: false }, - { name: '疫苗接种', selected: false }, - { name: '诊断治疗', selected: false }, - { name: '抗病毒', selected: false }, - { name: '干扰素', selected: false }, - { name: '用药', selected: false }, - { name: '耐药', selected: false }, - { name: '保肝降酶', selected: false }, - { name: '毒副反应', selected: false }, - { name: '治愈停药', selected: false }, - { name: '肝炎复发', selected: false }, - { name: '预后预防', selected: false }, - { name: '日常生活', selected: false }, - { name: '饮食营养', selected: false }, - { name: '养肝护肝', selected: false }, - { name: '一图读懂', selected: false }, - { name: '误区辟谣', selected: false }, - { name: '生儿育女', selected: false }, - { name: '医保报销', selected: false }, - { name: '肝胆相照', selected: false }, - { name: '精华好文', selected: false }, - { name: '肝病故事', selected: false }, - { name: '名医科普', selected: false }, - { name: '肝病现状', selected: false }, - { name: '中医中药', selected: false } - ]); - - // 模拟文章数据 - const articleList = ref([ - { - id: 1, - image: '/static/liver_knowledge.png', - title: '甩掉"乙肝大国"的帽子后,中国第一大肝病变成了它,正在侵...', - date: '今日', - isToday: true, - views: 185, - likes: 0 - }, - { - id: 2, - image: '/static/doctor_liver.png', - title: '从你我做起,让肝炎止步', - date: '08-01', - isToday: false, - views: 315, - likes: 0 - }, - { - id: 3, - image: '/static/liver_health.png', - title: '这6个指标正常,说明你肝脏健康', - date: '07-25', - isToday: false, - views: 1033, - likes: 0 - }, - { - id: 4, - image: '/static/diet_liver.png', - title: '无需节食!吃饭一个改变,脂肪肝好转了!4个月肝脏脂肪减...', - date: '07-18', - isToday: false, - views: 1829, - likes: 1 - }, - { - id: 5, - image: '/static/cooking_spices.png', - title: '这种家家都有的调料,吃太多会增加肝癌风险?很多人已超标!', - date: '07-11', - isToday: false, - views: 2992, - likes: 0 - }, - { - id: 6, - image: '/static/liver_protection.png', - title: '肝炎拖成肝硬化,下一步就是肝癌,养肝护肝,记住这3点', - date: '07-04', - isToday: false, - views: 1993, - likes: 1 + const toggleSort = () => { + type.value = type.value === 1 ? 2 : 1; + // 重置分页状态 + currentPage.value = 1; + hasMore.value = true; + polularScienceArticleListByKeywordsNew(true); + }; + const loadGuideTags = async () => { + try { + const res = await api.guideTag({ + type:4 + }); + if(res && res.code === 200 && res.data) { + // 将API返回的标签数据转换为筛选标签格式 + filterTags.value = res.data.map(tag => ({ + ...tag, + selected: false + })); + console.log('指南标签加载成功:', filterTags.value); + } + } catch (e) { + console.error('加载指南标签失败:', e); + } + }; + const polularScienceArticleListByKeywordsNew = async (isRefresh = false) => { + if (loading.value) return; + + loading.value = true; + + try { + const page = isRefresh ? 1 : currentPage.value; + const res = await api.polularScienceArticleListByKeywordsNew({ + keywords: keywords.value, + page: page, + type: type.value + }); + + if (res && res.code === 200 && res.data) { + const newData = res.data.list || []; + + if (isRefresh) { + // 下拉刷新:替换数据 + articleList.value = newData.map(item => formatArticleData(item)); + currentPage.value = 1; + } else { + // 上拉加载:追加数据 + const formattedData = newData.map(item => formatArticleData(item)); + articleList.value = [...articleList.value, ...formattedData]; + } + + // 判断是否还有更多数据 + hasMore.value = newData.length >= pageSize.value; + + if (!isRefresh) { + currentPage.value++; + } + + console.log('文章数据加载成功:', articleList.value); + } + } catch (error) { + console.error('获取文章列表失败:', error); + uni.showToast({ + title: '获取数据失败', + icon: 'error', + duration: 2000 + }); + } finally { + loading.value = false; + refreshing.value = false; } - ]); + }; + + // 格式化文章数据 + const formatArticleData = (item) => { + // 安全检查,确保item存在且有所需属性 + if (!item) return null; + + const submitDate = item.submitDate ? new Date(item.submitDate) : new Date(); + const today = new Date(); + const isToday = submitDate.toDateString() === today.toDateString(); + + return { + uuid: item.uuid || '', + title: item.topic || '无标题', + summary: item.summary || '', + image: item.imgPath ? docUrl + item.imgPath : '/static/liver_knowledge.png', + date: isToday ? '今日' : formatDate(submitDate), + isToday: isToday, + views: item.readnum || 0, + likes: item.agreenum || 0, + tags: item.tags || '', + path: item.path || '', + submitDate: item.submitDate || '' + }; + }; + + // 格式化日期 + const formatDate = (date) => { + const month = String(date.getMonth() + 1).padStart(2, '0'); + const day = String(date.getDate()).padStart(2, '0'); + return `${month}-${day}`; + }; + // 筛选标签数据 + const filterTags = ref([]); + + // 文章列表数据 + const articleList = ref([]); // 方法 const switchTab = (index) => { - activeTab.value = index; + + if(index==1){ + navTo({ + url: '/pages_app/patientVideo/patientVideo' + }) + }else if(index==2){ + let url=encodeURIComponent('https://wx.igandan.com/wxPatient/index.htm#/problem?link=share&fromtype=doctor') + navTo({ + url: '/pages_app/webview/webview?url='+url + }) + } }; const goToDetail = (article) => { console.log('查看文章详情:', article); // 跳转到详情页 + if (article.path) { + uni.navigateTo({ + url: `/pages_app/webview/webview?url=${encodeURIComponent(docUrl+article.path)}&title=${encodeURIComponent(article.title)}` + }); + } + }; + + // 跳转到搜索页面 + const goToSearch = () => { + uni.navigateTo({ + url: '/pages_app/search/search' + }); + }; + + // 下拉刷新 + const onRefresh = async () => { + refreshing.value = true; + await polularScienceArticleListByKeywordsNew(true); + uni.showToast({ + title: '刷新成功', + icon: 'success', + duration: 1500 + }); + }; + + // 上拉加载更多 + const onLoadMore = async () => { + if (!hasMore.value || loading.value) return; + await polularScienceArticleListByKeywordsNew(false); }; const goToPage = (page) => { @@ -253,7 +328,7 @@ }); isFilterActive.value = false; }; - + const keywords=ref(''); const confirmFilter = () => { // 检查是否有选中的标签 const hasSelected = filterTags.value.some(tag => tag.selected); @@ -261,16 +336,24 @@ // 执行筛选逻辑 if (hasSelected) { - const selectedTags = filterTags.value.filter(tag => tag.selected).map(tag => tag.name); + const selectedTags = filterTags.value.filter(tag => tag.selected).map(tag => tag.DES); console.log('选中的标签:', selectedTags); - // 这里可以添加实际的筛选逻辑 + keywords.value = selectedTags.join(','); + } else { + keywords.value = ''; } + // 重置分页状态 + currentPage.value = 1; + hasMore.value = true; + showFilter.value = false; + polularScienceArticleListByKeywordsNew(true); }; onShow(() => { - console.log('患教学堂页面显示'); + polularScienceArticleListByKeywordsNew(true); + loadGuideTags(); }); @@ -372,8 +455,13 @@ $padding-small: 10px; gap: 3px; font-size: 14px; color: #999; + transition: all 0.3s ease; } } +.filter-item.active{ + color: $theme-color; +} + // 文章列表 .article-list { @@ -449,6 +537,46 @@ $padding-small: 10px; } } } + + // 加载状态样式 + .load-more { + display: flex; + align-items: center; + justify-content: center; + padding: 30rpx; + color: #999; + + .load-text { + margin-left: 10rpx; + font-size: 28rpx; + } + } + + .no-more { + display: flex; + align-items: center; + justify-content: center; + padding: 30rpx; + + .no-more-text { + font-size: 28rpx; + color: #999; + } + } + + .empty-state { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 100rpx 30rpx; + + .empty-text { + margin-top: 20rpx; + font-size: 28rpx; + color: #999; + } + } } // 底部导航栏 diff --git a/pages_app/hot/hot.vue b/pages_app/hot/hot.vue new file mode 100644 index 0000000..f4e71e9 --- /dev/null +++ b/pages_app/hot/hot.vue @@ -0,0 +1,707 @@ + + + + + diff --git a/pages_app/patientVideo/patientVideo.vue b/pages_app/patientVideo/patientVideo.vue new file mode 100644 index 0000000..b450297 --- /dev/null +++ b/pages_app/patientVideo/patientVideo.vue @@ -0,0 +1,855 @@ + + + + + diff --git a/pages_app/search/search.vue b/pages_app/search/search.vue index 2dd3c30..16ca1e7 100644 --- a/pages_app/search/search.vue +++ b/pages_app/search/search.vue @@ -38,7 +38,7 @@ class="category-item" v-for="(item, index) in categoryList" :key="index" - @click="onCategoryClick(index)" + @click="onCategoryClick(Index,item.type)" > @@ -97,7 +97,7 @@ { name: '指南', icon:zhinan, activeIcon:zhinanOn,type: 'zhinan' }, { name: '精品课', icon:course,activeIcon:courseOn, type: 'course' }, { name: '肝胆课件', icon:ppt,activeIcon:pptOn, type: 'ppt' }, - { name: '患者', icon:patient, patientIcon:videoOn,type: 'patient' }, + { name: '患者', icon:patient, patientIcon:patientOn,type: 'patient' }, { name: '名院', icon:doctor,activeIcon:doctorOn, type: 'doctor' }, { name: '名科', icon:department,activeIcon:departmentOn, type: 'department' }, { name: '名医', icon:doctor, activeIcon:doctorOn,type: 'doctor' }, @@ -134,8 +134,33 @@ }; // 点击分类 - const onCategoryClick = (index) => { + const onCategoryClick = (index,type) => { tab.value=index; + if(type=='video'){ + uni.navigateTo({ + url: `/pages_app/searchVideo/searchVideo?keywords=${searchKeyword.value}` + }) + }else if(type=='videoPatient'){ + uni.navigateTo({ + url: `/pages_app/searchVideo/searchVideo?keywords=${searchKeyword.value}&from=hjsp` + }) + }else if(type=='news'){ + uni.navigateTo({ + url: `/pages_app/searchNews/searchNews?keywords=${searchKeyword.value}` + }) + }else if(type=='kepu'){ + uni.navigateTo({ + url: `/pages_app/searchNews/searchNews?keywords=${searchKeyword.value}&from=kp` + }) + }else if(type=='zhinan'){ + uni.navigateTo({ + url: `/pages_app/hot/hot?name=${searchKeyword.value}` + }) + }else if(type=='course'){ + uni.navigateTo({ + url: `/pages_app/searchNews/searchNews?keywords=${searchKeyword.value}&from=kp` + }) + } // 这里可以根据分类进行搜索 }; @@ -313,6 +338,7 @@ font-size: 26rpx; color: #333; text-align: center; + white-space: nowrap; } } } diff --git a/pages_app/searchNews/searchNews.vue b/pages_app/searchNews/searchNews.vue new file mode 100644 index 0000000..a1d27f3 --- /dev/null +++ b/pages_app/searchNews/searchNews.vue @@ -0,0 +1,638 @@ + + + + + diff --git a/pages_app/searchVideo/searchVideo.vue b/pages_app/searchVideo/searchVideo.vue new file mode 100644 index 0000000..60441d9 --- /dev/null +++ b/pages_app/searchVideo/searchVideo.vue @@ -0,0 +1,306 @@ + + + + + + diff --git a/pages_app/zhinan/zhinan.vue b/pages_app/zhinan/zhinan.vue index 2d8fbfd..f6c5ce0 100644 --- a/pages_app/zhinan/zhinan.vue +++ b/pages_app/zhinan/zhinan.vue @@ -263,7 +263,7 @@ import delImg from "@/static/delete_paper.png" import api from '@/api/api.js' import docUrl from "@/utils/docUrl.js" -import navTo from '../../utils/navTo'; + import navTo from '@/utils/navTo.js'; const total=ref(0); const tab=ref('zhinan') // 响应式数据 @@ -319,7 +319,7 @@ import navTo from '../../utils/navTo'; } navTo({ - url:'/pages_app/zhinanList/zhinanList?keywords='+encodeURIComponent(keywords.value) + url:'/pages_app/hot/hot?keywords='+encodeURIComponent(keywords.value) }) } @@ -388,9 +388,8 @@ import navTo from '../../utils/navTo'; // 进入指南分类 const enterCategory = (item) => { - console.log('进入分类:', item.category); - uni.navigateTo({ - url: `/pages/guidelineList/guidelineList?category=${item.category}&title=${item.title}` + navTo({ + url: `/pages_app/zhinanList/zhinanList?typeUuid=${item.uuid}&title=${item.name}` }); }; diff --git a/pages_app/zhinanList/zhinanList.vue b/pages_app/zhinanList/zhinanList.vue index 35cf292..d5d50a7 100644 --- a/pages_app/zhinanList/zhinanList.vue +++ b/pages_app/zhinanList/zhinanList.vue @@ -2,8 +2,8 @@ - + + + + + 搜索 + + + + + {{ innerSortTitle }} + + + + + @@ -43,19 +58,18 @@ - 查看 - + --> @@ -83,13 +97,32 @@ + + + + 下载量 + + + + + 上传时间 + + + + + 标题 + + +