12.10提交

This commit is contained in:
zoujiandong
2025-12-10 17:33:39 +08:00
parent 22104881f1
commit c86aa03f01
28 changed files with 3237 additions and 279 deletions
+49 -21
View File
@@ -23,15 +23,15 @@
<!-- 固定搜索栏 -->
<view class="search-container-fixed filter-bar">
<view class="search-box" @click="goToSearch">
<uni-icons type="search" size="16" color="#999"></uni-icons>
<uni-icons type="search" size="22" color="#999"></uni-icons>
<text class="search-text">搜索</text>
</view>
<view class="divider"></view>
<view class="current-sort" @click="toggleInnerSort">
<text class="sort-text">{{ innerSortTitle }}</text>
<text class="sort-text" :class="{active: isSetStatus}">{{ innerSortTitle }}</text>
<view class="imgbox">
<up-image :src="upImg" width="26rpx" height="26rpx"></up-image>
<up-image :src="isSetStatus?upImg:downImg" width="26rpx" height="26rpx" :class="{active: isSetStatus}"></up-image>
</view>
</view>
</view>
@@ -61,7 +61,8 @@
<!-- 操作按钮 -->
<view class="item-action">
<view class="download-btn" @click.stop="downLoad(item)" v-if="!downLoadtaskList.includes(item.uuid)">
<uni-icons type="arrow-down" size="26" color="#8D2316"></uni-icons>
<up-image :src="downIng" width="35rpx" height="35rpx"></up-image>
<!-- <uni-icons type="arrow-down" size="26" color="#8D2316"></uni-icons> -->
<!-- <up-icon name="download" color="#8D2316" size="56rpx" ></up-icon> -->
</view>
<view
@@ -149,6 +150,7 @@ import { onShow, onLoad } from "@dcloudio/uni-app";
import docUrl from "@/utils/docUrl.js";
import navTo from "@/utils/navTo.js";
import hotImg from "@/static/hot_booklist.png";
import downIng from "@/static/icon_library_down.png";
let downList = uni.getStorageSync("downLoadPdf") || [];
const downLoadList = ref(downList);
// 响应式数据
@@ -167,6 +169,7 @@ const title = ref("");
const sort = ref(2);
const showInnerSort = ref(false);
const innerSortTitle = ref("上传时间");
const isSetStatus=ref(false);
import downloadStore from "@/store/downloadStoreFile.js";
const downloadTasks=ref([]);
const downLoadtaskList=computed(()=>{
@@ -174,6 +177,7 @@ const downLoadtaskList=computed(()=>{
});
const chooseInnerSort = (index) => {
sort.value = index;
isSetStatus.value = true;
if (index == 1) {
innerSortTitle.value = "下载量";
} else if (index == 2) {
@@ -217,20 +221,20 @@ onShow(() => {
resumeDownloadingTasks();
// 页面显示时,如果列表为空则加载数据
if (guidelinesList.value.length === 0) {
loadGuidelinesList(true);
loadGuidelinesList(false);
}
});
// 跳转到搜索页
const goToSearch = () => {
const q = keywords.value ? encodeURIComponent(keywords.value) : "";
const t = title.value ? encodeURIComponent(title.value) : "";
const type = typeUuid.value
? `&typeUuid=${encodeURIComponent(typeUuid.value)}`
: "";
uni.navigateTo({
url: `/pages_app/search/search?keywords=${q}&title=${t}${type}`,
});
// const q = keywords.value ? encodeURIComponent(keywords.value) : "";
// const t = title.value ? encodeURIComponent(title.value) : "";
// const type = typeUuid.value
// ? `&typeUuid=${encodeURIComponent(typeUuid.value)}`
// : "";
// uni.navigateTo({
// url: `/pages_app/search/search?keywords=${q}&title=${t}${type}`,
// });
// const goSearch=()=>{
// uni.sendNativeEvent('goHomeSearch', {
// msg: 'goHomeSearch'
@@ -238,6 +242,15 @@ const goToSearch = () => {
// console.log(ret);
// })
// }
uni.sendNativeEvent(
"goHomeSearch",
{
msg: "zhinan",
},
(ret) => {
console.log(ret);
}
);
};
// scroll-view 下拉刷新
@@ -317,7 +330,7 @@ const loadGuidelinesList = async (isRefresh = false) => {
page: currentPage.value,
pageSize: pageSize.value,
type: 1, // 诊疗指南类型
sort: 2,
sort: sort.value,
typeUuid: typeUuid.value,
keywords: keywords.value,
};
@@ -326,7 +339,7 @@ const loadGuidelinesList = async (isRefresh = false) => {
console.log("指南列表响应:", res);
if (res.code === 200 && res.data) {
const newData = res.data.list || res.data;
const newData = res.data.list;
if (isRefresh) {
guidelinesList.value = newData;
@@ -335,15 +348,19 @@ const loadGuidelinesList = async (isRefresh = false) => {
guidelinesList.value = [...guidelinesList.value, ...newData];
console.log("加载更多:追加数据到列表");
}
console.log(222222);
console.log(res.data.pageSize);
console.log(newData.length);
// 判断是否还有更多数据
if (newData.length < pageSize.value) {
if (newData.length <res.data.pageSize) {
loadMoreStatus.value = "noMore";
hasMoreData.value = false;
console.log("没有更多数据了");
} else {
loadMoreStatus.value = "more";
hasMoreData.value = true;
console.log(333333);
console.log(!isRefresh);
// 只有在加载更多模式下才递增页码
if (!isRefresh) {
currentPage.value++;
@@ -425,6 +442,8 @@ const downloadGuideline = (item) => {
}
};
const downLoad = (item) => {
console.log(item);
console.log(2222);
if(!item.path){
uni.showToast({
title: "暂无下载链接",
@@ -436,6 +455,8 @@ const downLoad = (item) => {
url: docUrl + item.path,
title: item.title,
id: item.uuid,
releaseTime: item.releaseTime,
type: 'zhinan'
});
};
// 查看指南(支持常用文档直链:pdf/doc/docx/xls/xlsx/ppt/pptx/txt)
@@ -675,7 +696,7 @@ $white: #ffffff;
}
.popup-panel {
position: fixed;
top:285rpx;
top:calc(var(--status-bar-height) + 44px + 106rpx);
left: 0;
right: 0;
background: #fff;
@@ -700,14 +721,21 @@ $white: #ffffff;
.popup-item.active .item-text {
color: #8b2316;
}
.search-box{
flex:1;
}
.current-sort {
display: flex;
flex:1;
align-items: center;
gap: 10rpx;
.sort-text {
font-size: 28rpx;
color: #333;
font-size: 36rpx;
color: #999;
&.active {
color: #8b2316;
}
}
.sort-icon.up {
@@ -766,7 +794,7 @@ $white: #ffffff;
gap: 5px;
.search-text {
font-size: 14px;
font-size: 36rpx;
color: #999;
}
}