This commit is contained in:
zoujiandong 2025-12-03 09:58:56 +08:00
parent 51367c48c9
commit da3659412d
4 changed files with 2314 additions and 2225 deletions

View File

@ -9,16 +9,16 @@
} }
}, },
"pages": [ "pages": [
// { {
// "path": "pages/loading/loading", "path": "pages/loading/loading",
// "style": { "style": {
// "navigationBarTitleText": "", "navigationBarTitleText": "",
// "navigationStyle": "custom", "navigationStyle": "custom",
// "app": { "app": {
// "bounce": "none" "bounce": "none"
// } }
// } }
// }, },
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {

View File

@ -15,11 +15,7 @@
<image class="img-icon" :src="searchImg" mode="aspectFill" /> <image class="img-icon" :src="searchImg" mode="aspectFill" />
</view> </view>
<view class="collect-img" @click="goMeet"> <view class="collect-img" @click="goMeet">
<image <image class="img-icon" :src="meetImg" mode="aspectFill" />
class="img-icon"
:src="meetImg"
mode="aspectFill"
/>
</view> </view>
</view> </view>
</template> </template>
@ -31,12 +27,17 @@
<!-- Fixed Banner Swiper --> <!-- Fixed Banner Swiper -->
<view class="banner-container"> <view class="banner-container">
<view class="swipemask"> <view class="swipemask">
<view class="banner-subtitle" v-if="bannerList.length>0">{{bannerList[currentBannerIndex].name}}</view> <view class="banner-subtitle" v-if="bannerList.length > 0">{{
bannerList[currentBannerIndex].name
}}</view>
<view class="dotbox"> <view class="dotbox">
<view class="circle" :class="{active:currentBannerIndex==index} "v-for="(banner, index) in bannerList" <view
:key="banner.id"></view> class="circle"
:class="{ active: currentBannerIndex == index }"
v-for="(banner, index) in bannerList"
:key="banner.id"
></view>
</view> </view>
</view> </view>
<swiper <swiper
@ -50,7 +51,6 @@
circular circular
@change="onSwiperChange" @change="onSwiperChange"
> >
<swiper-item <swiper-item
v-for="(banner, index) in bannerList" v-for="(banner, index) in bannerList"
:key="banner.id" :key="banner.id"
@ -68,13 +68,20 @@
height="400rpx" height="400rpx"
> >
<template #error> <template #error>
<image :src="lazyVideoImg" class="banner-image" mode="aspectFill"></image> <image
:src="lazyVideoImg"
class="banner-image"
mode="aspectFill"
></image>
</template> </template>
<template #loading> <template #loading>
<image :src="lazyVideoImg" class="banner-image" mode="aspectFill"></image> <image
:src="lazyVideoImg"
class="banner-image"
mode="aspectFill"
></image>
</template> </template>
</up-image> </up-image>
</view> </view>
</swiper-item> </swiper-item>
</swiper> </swiper>
@ -83,32 +90,45 @@
<!-- Fixed Filter Tabs --> <!-- Fixed Filter Tabs -->
<view class="filter-tabs-container"> <view class="filter-tabs-container">
<view class="filter-tabs"> <view class="filter-tabs">
<view <view class="tab-item" @click="showAllVideoPopup = !showAllVideoPopup">
class="tab-item" <up-image
@click="showAllVideoPopup=!showAllVideoPopup" :src="isAllActive ? allOnImg : allImg"
> width="30rpx"
<up-image :src="isAllActive?allOnImg:allImg" width="30rpx" height="30rpx" ></up-image> height="30rpx"
<text class="tab-text" :class="{active:isAllActive}">{{typeName}}</text> ></up-image>
<up-image :src="isAllActive?selectOnImg:selectImg" width="30rpx" height="30rpx" ></up-image> <text class="tab-text" :class="{ active: isAllActive }">{{
typeName
}}</text>
<up-image
:src="isAllActive ? selectOnImg : selectImg"
width="30rpx"
height="30rpx"
></up-image>
</view> </view>
<view class="right"> <view class="right">
<view <view class="tab-item" @click="toggleSort">
class="tab-item" <text class="tab-text active">{{
@click="toggleSort" sort == 2 ? "最新" : "最热"
> }}</text>
<text class="tab-text active">{{sort==2?'最新':'最热'}}</text>
<view class="newbox"> <view class="newbox">
<up-image :src="sort==2?upImg:downImg" width="20rpx" height="26rpx" ></up-image> <up-image
:src="sort == 2 ? upImg : downImg"
width="20rpx"
height="26rpx"
></up-image>
</view> </view>
</view> </view>
<view class="bar"></view> <view class="bar"></view>
<view <view class="tab-item" @click="showFilterPopup">
class="tab-item" <text class="tab-text" :class="{ active: isFilterActive }"
@click="showFilterPopup" >筛选</text
> >
<text class="tab-text " :class="{active:isFilterActive}">筛选</text>
<view class="filterbox"> <view class="filterbox">
<up-image :src="isFilterActive ? filterOn : filter" width="30rpx" height="30rpx" ></up-image> <up-image
:src="isFilterActive ? filterOn : filter"
width="30rpx"
height="30rpx"
></up-image>
</view> </view>
</view> </view>
</view> </view>
@ -125,7 +145,6 @@
@scrolltolower="onLoadMore" @scrolltolower="onLoadMore"
lower-threshold="100" lower-threshold="100"
> >
<!-- Video List --> <!-- Video List -->
<view class="video-list"> <view class="video-list">
<view <view
@ -144,16 +163,22 @@
:lazy-load="true" :lazy-load="true"
width="100%" width="100%"
height="220rpx" height="220rpx"
> >
<template #error> <template #error>
<image :src="lazyImg" class="poster-image" mode="aspectFill"></image> <image
:src="lazyImg"
class="poster-image"
mode="aspectFill"
></image>
</template> </template>
<template #loading> <template #loading>
<image :src="lazyImg" class="poster-image" mode="aspectFill"></image> <image
:src="lazyImg"
class="poster-image"
mode="aspectFill"
></image>
</template> </template>
</up-image> </up-image>
</view> </view>
<view class="video-info"> <view class="video-info">
<view class="video-title">{{ video.title || video.name }}</view> <view class="video-title">{{ video.title || video.name }}</view>
@ -161,10 +186,11 @@
<text class="author">{{ video.public_name }}</text> <text class="author">{{ video.public_name }}</text>
<view class="stats"> <view class="stats">
<uni-icons type="eye" size="14" color="#999"></uni-icons> <uni-icons type="eye" size="14" color="#999"></uni-icons>
<text class="view-count">{{formatNumber(video.readnum)}}</text> <text class="view-count">{{
formatNumber(video.readnum)
}}</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
@ -176,7 +202,7 @@
:content-text="{ :content-text="{
contentdown: '上拉加载更多', contentdown: '上拉加载更多',
contentrefresh: '正在加载...', contentrefresh: '正在加载...',
contentnomore: '没有更多数据了' contentnomore: '没有更多数据了',
}" }"
></uni-load-more> ></uni-load-more>
@ -189,7 +215,6 @@
<view class="btnbox" @click="goPatientVideo"> <view class="btnbox" @click="goPatientVideo">
<up-image :src="videoImg" width="44rpx" height="44rpx"></up-image> <up-image :src="videoImg" width="44rpx" height="44rpx"></up-image>
患教视频 患教视频
</view> </view>
<!-- 筛选弹窗 --> <!-- 筛选弹窗 -->
<view class="filter-popup" v-if="showFilter" @click="hideFilterPopup"> <view class="filter-popup" v-if="showFilter" @click="hideFilterPopup">
@ -215,11 +240,13 @@
</view> </view>
</view> </view>
<!-- 全部视频弹窗 --> <!-- 全部视频弹窗 -->
<view class="all-video-popup" v-if="showAllVideoPopup" @click="closeAllVideoPopup"> <view
class="all-video-popup"
v-if="showAllVideoPopup"
@click="closeAllVideoPopup"
>
<view class="popup-content" @click.stop> <view class="popup-content" @click.stop>
<view class="popup-body"> <view class="popup-body">
<view class="category-sidebar"> <view class="category-sidebar">
<view <view
@ -230,18 +257,18 @@
@click="selectCategory(category.value)" @click="selectCategory(category.value)"
> >
<view class="category-label">{{ category.label }}</view> <view class="category-label">{{ category.label }}</view>
<view class="category-date" v-if="category.value !== '全部' && category.originalDate"> <view
class="category-date"
v-if="category.value !== '全部' && category.originalDate"
>
{{ formatDate(category.originalDate) }} {{ formatDate(category.originalDate) }}
</view> </view>
</view> </view>
</view> </view>
<view class="content-area"> <view class="content-area">
<view class="content-list"> <view class="content-list">
<view <view
class="content-item" class="content-item"
v-for="item in filteredContent" v-for="item in filteredContent"
:key="item.uuid" :key="item.uuid"
:class="{ active: selectYearContent.uuid == item.uuid }" :class="{ active: selectYearContent.uuid == item.uuid }"
@ -261,102 +288,119 @@
</template> </template>
<script setup> <script setup>
import { ref, onMounted, computed,reactive } from 'vue'; import { ref, onMounted, computed, reactive } from "vue";
import { onShow } from "@dcloudio/uni-app"; import { onShow,onBackPress} from "@dcloudio/uni-app";
import api from '@/api/api.js'; import api from "@/api/api.js";
import allImg from "@/static/video_all.png" import allImg from "@/static/video_all.png";
import allOnImg from "@/static/video_select.png" import allOnImg from "@/static/video_select.png";
import selectImg from "@/static/all_video.png" import selectImg from "@/static/all_video.png";
import selectOnImg from "@/static/select_video.png" import selectOnImg from "@/static/select_video.png";
import filter from "@/static/cb_screen_no.png" import filter from "@/static/cb_screen_no.png";
import filterOn from "@/static/cb_screen_yes.png" import filterOn from "@/static/cb_screen_yes.png";
import upImg from "@/static/cb_up.png" import upImg from "@/static/cb_up.png";
import downImg from "@/static/cb_down.png" import downImg from "@/static/cb_down.png";
import videoImg from "@/static/patient_video.png" import videoImg from "@/static/patient_video.png";
import docUrl from '@/utils/docUrl'; import docUrl from "@/utils/docUrl";
import navTo from '@/utils/navTo'; import navTo from "@/utils/navTo";
import searchImg from "@/static/search.png" import searchImg from "@/static/search.png";
import lazyImg from "@/static/default_video.png" import lazyImg from "@/static/default_video.png";
import lazyVideoImg from "@/static/videoPlaceholder.png"; import lazyVideoImg from "@/static/videoPlaceholder.png";
import meetImg from "@/static/videoIcon.png" import meetImg from "@/static/videoIcon.png";
import formatNumber from '@/utils/formatNumber.js'; import formatNumber from "@/utils/formatNumber.js";
import navBar from '@/components/navBar/navBar.vue'; import navBar from "@/components/navBar/navBar.vue";
const isAllActive=ref(false) const isAllActive = ref(false);
// //
const videoList = ref([]); const videoList = ref([]);
const bannerVideo = ref(null); const bannerVideo = ref(null);
const activeTab = ref(1); // "" const activeTab = ref(1); // ""
const loading = ref(false); const loading = ref(false);
const refreshing = ref(false); const refreshing = ref(false);
const loadMoreStatus = ref('more'); // more, loading, noMore const loadMoreStatus = ref("more"); // more, loading, noMore
const currentPage = ref(1); const currentPage = ref(1);
const pageSize = ref(10); const pageSize = ref(10);
const hasMoreData = ref(true); const hasMoreData = ref(true);
const filteredContent=ref([]) const filteredContent = ref([]);
const sort = ref(2); const sort = ref(2);
const keywords=ref(''); const keywords = ref("");
const typeUuid=ref(''); const typeUuid = ref("");
const typeName=ref('全部视频') const typeName = ref("全部视频");
// Banner // Banner
const bannerList = ref([]); const bannerList = ref([]);
const currentBannerIndex = ref(0); const currentBannerIndex = ref(0);
const isFilterActive=ref(false) const isFilterActive = ref(false);
const showFilter = ref(false); const showFilter = ref(false);
const yearList = ref([]); const yearList = ref([]);
const selectYearContent=reactive({}) const selectYearContent = reactive({});
const goSearch=()=>{ onBackPress(() => {
uni.sendNativeEvent('goHomeSearch', { try {
msg: 'goHomeSearch' uni.sendNativeEvent(
},ret => { "goTabbarPage",
{
msg: "home",
},
(ret) => {
console.log(ret); console.log(ret);
})
} }
);
} catch (e) {
console.log(e);
}
plus.runtime.quit();
return true;
});
const goSearch = () => {
uni.sendNativeEvent(
"goHomeSearch",
{
msg: "goHomeSearch",
},
(ret) => {
console.log(ret);
}
);
};
const goMeet = () => { const goMeet = () => {
uni.navigateTo({ uni.navigateTo({
url: '/pages_app/liveReplay/liveReplay?from=video' url: "/pages_app/liveReplay/liveReplay?from=video",
}); });
} };
// //
const filterTags = ref([ 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 },
]); ]);
// //
const showAllVideoPopup = ref(false); const showAllVideoPopup = ref(false);
const selectedCategory = ref('全部'); const selectedCategory = ref("全部");
const categoryList = ref([ const categoryList = ref([{ value: "all", label: "全部" }]);
{ value: 'all', label: '全部' }
]);
// - API // - API
const contentByCategory = ref({ const contentByCategory = ref({
all: [] all: [],
}); });
// API // API
const videoTypesData = ref([]); const videoTypesData = ref([]);
// //
onMounted(() => { onMounted(() => {});
});
const formatName = (name) => { const formatName = (name) => {
let index=name.lastIndexOf('-'); let index = name.lastIndexOf("-");
if (index > -1) { if (index > -1) {
return name.substring(index + 1, name.length); return name.substring(index + 1, name.length);
} }
return name; return name;
} };
onShow(() => { onShow(() => {
// API // API
currentPage.value = 1; currentPage.value = 1;
@ -368,7 +412,7 @@
// "" // ""
setTimeout(() => { setTimeout(() => {
loadCategoryVideos('all'); loadCategoryVideos("all");
}, 500); }, 500);
}); });
@ -376,13 +420,11 @@
const loadBannerData = async () => { const loadBannerData = async () => {
try { try {
const response = await api.videoRoll({}); const response = await api.videoRoll({});
console.log('轮播API原始响应:', response); console.log("轮播API原始响应:", response);
bannerList.value = response.data; bannerList.value = response.data;
} catch (error) { } catch (error) {
console.error('加载轮播数据失败:', error); console.error("加载轮播数据失败:", error);
// 使 // 使
} }
}; };
@ -390,82 +432,84 @@
const loadVideoTags = async () => { const loadVideoTags = async () => {
try { try {
const response = await api.videoTagList({ const response = await api.videoTagList({
type:2 type: 2,
}); });
console.log('标签API原始响应:', response); console.log("标签API原始响应:", response);
if (response.code == 200) { if (response.code == 200) {
filterTags.value = response.data; filterTags.value = response.data;
console.log(22222) console.log(22222);
console.log(filterTags.value) console.log(filterTags.value);
} }
} catch (error) { } catch (error) {
console.error('加载视频标签失败:', error); console.error("加载视频标签失败:", error);
} }
}; };
// //
const loadVideoTypes = async () => { const loadVideoTypes = async () => {
try { try {
const response = await api.expertVideoTypeList({ const response = await api.expertVideoTypeList({});
console.log("类型API原始响应:", response);
});
console.log('类型API原始响应:', response);
if (response.code == 200) { if (response.code == 200) {
yearList.value = response.data; yearList.value = response.data;
let all=[{uuid:'',name:'全部视频'}]; let all = [{ uuid: "", name: "全部视频" }];
filteredContent.value=all.concat((response.data[0]).list); filteredContent.value = all.concat(response.data[0].list);
console.log(33) console.log(33);
let arr=response.data.map(item=>{ let arr = response.data.map((item) => {
return { return {
value: item.name, value: item.name,
label:item.name label: item.name,
};
});
categoryList.value = arr;
} }
}) console.log(2222);
categoryList.value=arr console.log(categoryList.value);
}
console.log(2222)
console.log(categoryList.value)
} catch (error) { } catch (error) {
console.error('加载视频类型失败:', error); console.error("加载视频类型失败:", error);
} }
}; };
// //
const loadCategoryVideos = async (categoryValue) => { const loadCategoryVideos = async (categoryValue) => {
try { try {
console.log('加载分类视频:', categoryValue); console.log("加载分类视频:", categoryValue);
let response; let response;
if (categoryValue === '全部') { if (categoryValue === "全部") {
// //
response = await api.videoByKeyWordsNew({ response = await api.videoByKeyWordsNew({
page: 1, page: 1,
pageSize: 20, pageSize: 20,
keywords: '', keywords: "",
sort: 0, sort: 0,
typeUuid: '', typeUuid: "",
tags: '' tags: "",
}); });
} else { } else {
// //
// //
const typesForDate = videoTypesData.value.filter(type => type.create_date === categoryValue); const typesForDate = videoTypesData.value.filter(
(type) => type.create_date === categoryValue
);
console.log(`日期 ${categoryValue} 对应的视频类型:`, typesForDate); console.log(`日期 ${categoryValue} 对应的视频类型:`, typesForDate);
if (typesForDate.length > 0) { if (typesForDate.length > 0) {
// UUID // UUID
const typeUuids = typesForDate.map(type => type.id || type.uuid || type.value).join(','); const typeUuids = typesForDate
console.log('类型UUID列表:', typeUuids); .map((type) => type.id || type.uuid || type.value)
.join(",");
console.log("类型UUID列表:", typeUuids);
// //
response = await api.videoByKeyWordsNew({ response = await api.videoByKeyWordsNew({
page: 1, page: 1,
pageSize: 20, pageSize: 20,
keywords: '', keywords: "",
sort: 0, sort: 0,
typeUuid: typeUuids, typeUuid: typeUuids,
tags: '' tags: "",
}); });
} else { } else {
console.warn(`未找到日期 ${categoryValue} 对应的视频类型`); console.warn(`未找到日期 ${categoryValue} 对应的视频类型`);
@ -474,7 +518,7 @@
} }
} }
console.log('分类视频API响应:', response); console.log("分类视频API响应:", response);
// //
let videoData = {}; let videoData = {};
@ -488,21 +532,24 @@
videoData = response.data || {}; videoData = response.data || {};
} }
console.log('解析后的分类视频数据:', videoData); console.log("解析后的分类视频数据:", videoData);
if (videoData && videoData.list) { if (videoData && videoData.list) {
const { list } = videoData; const { list } = videoData;
// //
contentByCategory.value[categoryValue] = list.map(video => ({ contentByCategory.value[categoryValue] = list.map((video) => ({
id: video.id || video.uuid, id: video.id || video.uuid,
title: video.title || video.name, title: video.title || video.name,
name: video.name || video.title name: video.name || video.title,
})); }));
console.log(`分类 ${categoryValue} 的内容:`, contentByCategory.value[categoryValue]); console.log(
`分类 ${categoryValue} 的内容:`,
contentByCategory.value[categoryValue]
);
} }
} catch (error) { } catch (error) {
console.error('加载分类视频失败:', error); console.error("加载分类视频失败:", error);
} }
}; };
@ -515,13 +562,13 @@
try { try {
// API // API
//const selectedTags = filterTags.value.filter(tag => tag.selected).map(tag => tag.id).join(','); //const selectedTags = filterTags.value.filter(tag => tag.selected).map(tag => tag.id).join(',');
console.log('请求参数:', { console.log("请求参数:", {
page: currentPage.value, page: currentPage.value,
pageSize: pageSize.value, pageSize: pageSize.value,
keywords: keywords.value, keywords: keywords.value,
sort: sort.value, sort: sort.value,
typeUuid: typeUuid.value, typeUuid: typeUuid.value,
tags: keywords.value tags: keywords.value,
}); });
const response = await api.videoByKeyWordsNew({ const response = await api.videoByKeyWordsNew({
@ -532,7 +579,7 @@
typeUuid: typeUuid.value, typeUuid: typeUuid.value,
}); });
console.log('视频列表API原始响应:', response); console.log("视频列表API原始响应:", response);
// //
let videoData = {}; let videoData = {};
@ -546,11 +593,11 @@
videoData = response.data || {}; videoData = response.data || {};
} }
console.log('解析后的视频数据:', videoData); console.log("解析后的视频数据:", videoData);
if (videoData && videoData.list) { if (videoData && videoData.list) {
const { list, pageNumber, totalPage } = videoData; const { list, pageNumber, totalPage } = videoData;
console.log('视频列表数据:', list); console.log("视频列表数据:", list);
if (isRefresh) { if (isRefresh) {
videoList.value = list || []; videoList.value = list || [];
@ -561,14 +608,12 @@
//const { list, pageNumber,totalPage } = videoData; //const { list, pageNumber,totalPage } = videoData;
hasMoreData.value = totalPage > pageNumber; hasMoreData.value = totalPage > pageNumber;
loadMoreStatus.value = hasMoreData.value ? 'more' : 'noMore'; loadMoreStatus.value = hasMoreData.value ? "more" : "noMore";
} else { } else {
throw new Error(response?.message || '获取数据失败'); throw new Error(response?.message || "获取数据失败");
} }
} catch (error) { } catch (error) {
console.error('加载视频失败:', error); console.error("加载视频失败:", error);
} finally { } finally {
loading.value = false; loading.value = false;
refreshing.value = false; refreshing.value = false;
@ -588,7 +633,7 @@
videoList.value = [...videoList.value, ...mockData.list]; videoList.value = [...videoList.value, ...mockData.list];
} }
hasMoreData.value = mockData.hasMore; hasMoreData.value = mockData.hasMore;
loadMoreStatus.value = hasMoreData.value ? 'more' : 'noMore'; loadMoreStatus.value = hasMoreData.value ? "more" : "noMore";
} finally { } finally {
loading.value = false; loading.value = false;
refreshing.value = false; refreshing.value = false;
@ -607,7 +652,7 @@
const onLoadMore = () => { const onLoadMore = () => {
if (!hasMoreData.value || loading.value) return; if (!hasMoreData.value || loading.value) return;
loadMoreStatus.value = 'loading'; loadMoreStatus.value = "loading";
currentPage.value++; currentPage.value++;
loadVideoData(); loadVideoData();
}; };
@ -626,12 +671,10 @@
const videoId = video.id || video.uuid; const videoId = video.id || video.uuid;
navTo({ navTo({
url: `/pages_app/videoDetail/videoDetail?id=${videoId}` url: `/pages_app/videoDetail/videoDetail?id=${videoId}`,
}); });
}; };
// //
// const goSearch = () => { // const goSearch = () => {
// uni.navigateTo({ // uni.navigateTo({
@ -642,26 +685,26 @@
// //
const goPatientVideo = () => { const goPatientVideo = () => {
navTo({ navTo({
url: '/pages_app/patientVideo/patientVideo' url: "/pages_app/patientVideo/patientVideo",
}); });
}; };
// //
const searchVideos = async (keywords) => { const searchVideos = async (keywords) => {
if (!keywords || keywords.trim() === '') { if (!keywords || keywords.trim() === "") {
loadVideoData(true); loadVideoData(true);
return; return;
} }
try { try {
console.log('搜索关键词:', keywords.trim()); console.log("搜索关键词:", keywords.trim());
const response = await api.videoByKeyWordsNew({ const response = await api.videoByKeyWordsNew({
keywords: keywords.trim(), keywords: keywords.trim(),
page: 1, page: 1,
pageSize: pageSize.value pageSize: pageSize.value,
}); });
console.log('搜索API原始响应:', response); console.log("搜索API原始响应:", response);
// //
let searchData = {}; let searchData = {};
@ -675,26 +718,25 @@
searchData = response.data || {}; searchData = response.data || {};
} }
console.log('解析后的搜索数据:', searchData); console.log("解析后的搜索数据:", searchData);
if (searchData && searchData.list) { if (searchData && searchData.list) {
const { list, totalPage, pageNumber } = searchData; const { list, totalPage, pageNumber } = searchData;
videoList.value = list || []; videoList.value = list || [];
hasMoreData.value = totalPage > pageNumber; hasMoreData.value = totalPage > pageNumber;
console.log('hasMoreData:'+hasMoreData.value) console.log("hasMoreData:" + hasMoreData.value);
loadMoreStatus.value = hasMoreData.value ? 'more' : 'noMore'; loadMoreStatus.value = hasMoreData.value ? "more" : "noMore";
currentPage.value = 1; currentPage.value = 1;
} }
} catch (error) { } catch (error) {
console.error('搜索视频失败:', error); console.error("搜索视频失败:", error);
uni.showToast({ uni.showToast({
title: '搜索失败,请重试', title: "搜索失败,请重试",
icon: 'none' icon: "none",
}); });
} }
}; };
const onSwiperChange = (e) => { const onSwiperChange = (e) => {
currentBannerIndex.value = e.detail.current; currentBannerIndex.value = e.detail.current;
}; };
@ -703,7 +745,7 @@
const videoId = banner.id || banner.uuid; const videoId = banner.id || banner.uuid;
navTo({ navTo({
url: `/pages_app/videoDetail/videoDetail?id=${videoId}` url: `/pages_app/videoDetail/videoDetail?id=${videoId}`,
}); });
}; };
@ -717,15 +759,17 @@
}; };
const selectCategory = async (categoryValue) => { const selectCategory = async (categoryValue) => {
selectedCategory.value = categoryValue; selectedCategory.value = categoryValue;
console.log(yearList.value) console.log(yearList.value);
console.log('选择分类:', categoryValue); console.log("选择分类:", categoryValue);
let all=[{uuid:'',name:'全部视频'}]; let all = [{ uuid: "", name: "全部视频" }];
for (var i = 0; i < yearList.value.length; i++) { for (var i = 0; i < yearList.value.length; i++) {
if (categoryValue == yearList.value[i].name) { if (categoryValue == yearList.value[i].name) {
console.log(yearList.value[i]); console.log(yearList.value[i]);
filteredContent.value=categoryValue=='全部'?all.concat(yearList.value[i].list):yearList.value[i].list; filteredContent.value =
console.log(filteredContent.value) categoryValue == "全部"
? all.concat(yearList.value[i].list)
: yearList.value[i].list;
console.log(filteredContent.value);
break; break;
} }
} }
@ -733,7 +777,7 @@
const selectContent = (content) => { const selectContent = (content) => {
// //
console.log('选中内容:', content); console.log("选中内容:", content);
closeAllVideoPopup(); closeAllVideoPopup();
Object.assign(selectYearContent, content); Object.assign(selectYearContent, content);
typeUuid.value = content.uuid; typeUuid.value = content.uuid;
@ -754,16 +798,16 @@
const toggleTag = (index) => { const toggleTag = (index) => {
filterTags.value[index].selected = !filterTags.value[index].selected; filterTags.value[index].selected = !filterTags.value[index].selected;
isFilterActive.value = filterTags.value.some(tag => tag.selected); isFilterActive.value = filterTags.value.some((tag) => tag.selected);
}; };
const resetFilter = () => { const resetFilter = () => {
// //
filterTags.value.forEach(tag => tag.selected = false); filterTags.value.forEach((tag) => (tag.selected = false));
// //
isFilterActive.value = false; isFilterActive.value = false;
// //
keywords.value = ''; keywords.value = "";
// //
currentPage.value = 1; currentPage.value = 1;
hasMoreData.value = true; hasMoreData.value = true;
@ -771,21 +815,18 @@
}; };
const confirmFilter = () => { const confirmFilter = () => {
let str=''; let str = "";
const selectedTags = filterTags.value.filter(tag => tag.selected); const selectedTags = filterTags.value.filter((tag) => tag.selected);
console.log('选中的筛选标签:', selectedTags); console.log("选中的筛选标签:", selectedTags);
for (var i = 0; i < selectedTags.length; i++) { for (var i = 0; i < selectedTags.length; i++) {
if (str) { if (str) {
str+=","+selectedTags[i].NAME str += "," + selectedTags[i].NAME;
} else { } else {
str=selectedTags[i].NAME str = selectedTags[i].NAME;
} }
} }
keywords.value = str; keywords.value = str;
console.log('keywords:'+keywords.value) console.log("keywords:" + keywords.value);
isFilterActive.value = true; isFilterActive.value = true;
hideFilterPopup(); hideFilterPopup();
// //
@ -805,22 +846,31 @@
const index = startIndex + i; const index = startIndex + i;
mockList.push({ mockList.push({
id: `video_${index}`, id: `video_${index}`,
title: index === 0 ? '《2025年版慢加急性肝衰竭指南》解读' : title:
index % 4 === 1 ? '自身免疫性肝病专栏免疫治疗的双刃剑——1例自…' : index === 0
index % 4 === 2 ? '徐医感染:硬化出血发热路,关关难过关关过' : ? "《2025年版慢加急性肝衰竭指南》解读"
index % 4 === 3 ? '徐医感染:一场呼吸的迷局' : : index % 4 === 1
'南京市第二医院疑难肝病病理读片会暨疑难肝病MDT', ? "自身免疫性肝病专栏免疫治疗的双刃剑——1例自…"
thumbnail: '/static/video-thumb-' + (index % 4 + 1) + '.png', : index % 4 === 2
author: index % 3 === 0 ? '首都医…' : ? "徐医感染:硬化出血发热路,关关难过关关过"
index % 3 === 1 ? '徐州医…' : '南京市…', : index % 4 === 3
? "徐医感染:一场呼吸的迷局"
: "南京市第二医院疑难肝病病理读片会暨疑难肝病MDT",
thumbnail: "/static/video-thumb-" + ((index % 4) + 1) + ".png",
author:
index % 3 === 0
? "首都医…"
: index % 3 === 1
? "徐州医…"
: "南京市…",
viewCount: Math.floor(Math.random() * 2000) + 100, viewCount: Math.floor(Math.random() * 2000) + 100,
duration: '15:30' duration: "15:30",
}); });
} }
resolve({ resolve({
list: mockList, list: mockList,
hasMore: page <2 // 模拟5页数据 hasMore: page < 2, // 5
}); });
}, 1000); }, 1000);
}); });
@ -830,23 +880,22 @@
uni.navigateBack({ uni.navigateBack({
fail() { fail() {
uni.redirectTo({ uni.redirectTo({
url: '/pages/index/index' url: "/pages/index/index",
}); });
} },
}); });
} };
const toggleSort = () => { const toggleSort = () => {
sort.value = sort.value === 1 ? 2 : 1; // 1=, 2= sort.value = sort.value === 1 ? 2 : 1; // 1=, 2=
currentPage.value = 1; currentPage.value = 1;
hasMoreData.value = true; hasMoreData.value = true;
loadVideoData(true); loadVideoData(true);
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
$primary-color: #ff6b6b; $primary-color: #ff6b6b;
$theme-color: #8B2316; $theme-color: #8b2316;
$white: #fff; $white: #fff;
$gray-bg: #f5f5f5; $gray-bg: #f5f5f5;
$gray-light: #eee; $gray-light: #eee;
@ -902,7 +951,8 @@
z-index: 100; z-index: 100;
} }
.header-left, .header-right { .header-left,
.header-right {
display: flex; display: flex;
align-items: center; align-items: center;
} }
@ -910,17 +960,21 @@
.header-title { .header-title {
font-size: 36rpx; font-size: 36rpx;
font-weight: 600; font-weight: 600;
color: #8B4513; color: #8b4513;
} }
/* Scroll View */ /* Scroll View */
.scroll-view { .scroll-view {
position: fixed; position: fixed;
bottom: 0rpx; bottom: 0rpx;
height: calc(100vh - var(--status-bar-height) - 54px - 430rpx); /* 固定高度减去固定的banner和Filter Tabs空间 */ height: calc(
100vh - var(--status-bar-height) - 54px - 430rpx
); /* 固定高度减去固定的banner和Filter Tabs空间 */
background-color: #f5f5f5; background-color: #f5f5f5;
margin-bottom: 200rpx; margin-bottom: 200rpx;
top: calc(var(--status-bar-height) + 54px + 400rpx); /* 为固定的banner和Filter Tabs留出空间 */ top: calc(
var(--status-bar-height) + 54px + 400rpx
); /* 为固定的banner和Filter Tabs留出空间 */
} }
/* Banner Styles */ /* Banner Styles */
@ -981,7 +1035,7 @@
} }
.tab-item.active .tab-text { .tab-item.active .tab-text {
color: #E74C3C; color: #e74c3c;
font-weight: 600; font-weight: 600;
} }
@ -998,8 +1052,7 @@
white-space: nowrap; white-space: nowrap;
} }
.tab-item .tab-text.active { .tab-item .tab-text.active {
color: #8B2316; color: #8b2316;
} }
/* Fixed Banner Container */ /* Fixed Banner Container */
.banner-container { .banner-container {
@ -1033,7 +1086,7 @@
border-radius: 50%; border-radius: 50%;
} }
.circle.active { .circle.active {
background-color: #8B2316; background-color: #8b2316;
} }
} }
} }
@ -1042,7 +1095,9 @@
/* Fixed Filter Tabs Container */ /* Fixed Filter Tabs Container */
.filter-tabs-container { .filter-tabs-container {
position: fixed; position: fixed;
top: calc(var(--status-bar-height) + 44px + 400rpx); /* banner-container top + banner height */ top: calc(
var(--status-bar-height) + 44px + 400rpx
); /* banner-container top + banner height */
left: 0; left: 0;
right: 0; right: 0;
z-index: 40; z-index: 40;
@ -1143,8 +1198,6 @@
height: 100%; height: 100%;
} }
.video-duration { .video-duration {
margin-top: 8rpx; margin-top: 8rpx;
} }
@ -1232,7 +1285,6 @@
z-index: 1000; z-index: 1000;
display: flex; display: flex;
} }
.popup-content { .popup-content {
@ -1242,7 +1294,6 @@
background-color: #fff; background-color: #fff;
overflow: scroll; overflow: scroll;
} }
.popup-header { .popup-header {
@ -1292,8 +1343,7 @@
.category-item.active { .category-item.active {
background-color: #fff; background-color: #fff;
color: #8B2316; color: #8b2316;
} }
.category-label { .category-label {
@ -1330,11 +1380,8 @@
border: 2rpx solid transparent; border: 2rpx solid transparent;
} }
.content-item.active { .content-item.active {
color: #8b2316;
color: #8B2316;
} }
.empty-content { .empty-content {

View File

@ -40,11 +40,13 @@
class="player-wrapper" class="player-wrapper"
:src="videoSrc" :src="videoSrc"
:videoHeight="220" :videoHeight="220"
:videoWidth="videoWidth"
:seekTime="0" :seekTime="0"
@fullscreenchange="onFullscreenChange" @fullscreenchange="onFullscreenChange"
/> />
<!-- 标签切换 --> <!-- 标签切换 -->
<cover-view class="tabs" v-if="from != 'download'" :style="{ opacity: isFullScreen ? 0: 1 }">
<cover-view class="tabs" v-if="from != 'download'" :style="{ opacity:isFullScreen?0:1, width: videoWidth + 'px' }" >
<cover-view <cover-view
class="tab" class="tab"
:class="{ active: activeTab === 'info' }" :class="{ active: activeTab === 'info' }"
@ -958,7 +960,6 @@ $theme-color: #8b2316;
position: relative; position: relative;
top: calc(var(--status-bar-height) + 44px); top: calc(var(--status-bar-height) + 44px);
z-index: 0; z-index: 0;
overflow: hidden; overflow: hidden;
} }
.share-img { .share-img {
@ -1034,7 +1035,7 @@ $theme-color: #8b2316;
} }
.intro { .intro {
// background: #fff; // background: #fff;
padding: 30rpx 28rpx 100rpx; padding: 40rpx 28rpx 100rpx;
// margin-top: calc(var(--status-bar-height) + 44px + 220px + 88rpx); // margin-top: calc(var(--status-bar-height) + 44px + 220px + 88rpx);
// height: calc(100vh - var(--status-bar-height) - 44px - 220px - 88rpx); // height: calc(100vh - var(--status-bar-height) - 44px - 220px - 88rpx);
// overflow-y: scroll; // overflow-y: scroll;
@ -1056,9 +1057,7 @@ $theme-color: #8b2316;
.video-author { .video-author {
font-size: 26rpx; font-size: 26rpx;
color: #666; color: #666;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
} }

View File

@ -13,7 +13,6 @@
<view class="zhinan-page" v-if="tab == 'zhinan'"> <view class="zhinan-page" v-if="tab == 'zhinan'">
<!-- 导航栏 --> <!-- 导航栏 -->
<!-- 固定搜索栏 --> <!-- 固定搜索栏 -->
<view class="search-container-fixed filter-bar"> <view class="search-container-fixed filter-bar">
<view class="search-box" @click="goSearch"> <view class="search-box" @click="goSearch">
@ -24,7 +23,11 @@
<view class="divider"></view> <view class="divider"></view>
<view class="filter-item" @click="showFilterPopup"> <view class="filter-item" @click="showFilterPopup">
<text>筛选</text> <text>筛选</text>
<up-image :src="isFilterActive ? filterOn : filter" width="30rpx" height="30rpx" ></up-image> <up-image
:src="isFilterActive ? filterOn : filter"
width="30rpx"
height="30rpx"
></up-image>
</view> </view>
</view> </view>
@ -37,7 +40,11 @@
@click="enterCategory(item)" @click="enterCategory(item)"
> >
<view class="item-image"> <view class="item-image">
<image :src="docUrl+item.imgs" mode="widthFix" class="category-icon"></image> <image
:src="docUrl + item.imgs"
mode="widthFix"
class="category-icon"
></image>
</view> </view>
<view class="item-content"> <view class="item-content">
<text class="category-title">{{ item.name }}</text> <text class="category-title">{{ item.name }}</text>
@ -50,12 +57,10 @@
<view class="count"> {{ total }}份文献</view> <view class="count"> {{ total }}份文献</view>
<up-image :src="star2" width="85rpx" height="9rpx"></up-image> <up-image :src="star2" width="85rpx" height="9rpx"></up-image>
</view> </view>
</view> </view>
<view class="qikan-page" v-else-if="tab == 'qikan'"> <view class="qikan-page" v-else-if="tab == 'qikan'">
<!-- 导航头部 --> <!-- 导航头部 -->
<!-- 主要内容区域 --> <!-- 主要内容区域 -->
<view class="main-content"> <view class="main-content">
<!-- 标签切换区域 --> <!-- 标签切换区域 -->
@ -68,7 +73,12 @@
> >
<text class="tab-text">代查文献</text> <text class="tab-text">代查文献</text>
<view class="tab-underline"> <view class="tab-underline">
<up-image :src="activeImg" width="48rpx" height="18rpx" v-if="activeTab === 'daichawenxian'"></up-image> <up-image
:src="activeImg"
width="48rpx"
height="18rpx"
v-if="activeTab === 'daichawenxian'"
></up-image>
</view> </view>
</view> </view>
<view <view
@ -78,7 +88,12 @@
> >
<text class="tab-text">英文文献</text> <text class="tab-text">英文文献</text>
<view class="tab-underline"> <view class="tab-underline">
<up-image :src="activeImg" width="48rpx" height="18rpx" v-if="activeTab === 'yingwenwenxian'"></up-image> <up-image
:src="activeImg"
width="48rpx"
height="18rpx"
v-if="activeTab === 'yingwenwenxian'"
></up-image>
</view> </view>
</view> </view>
</view> </view>
@ -168,12 +183,19 @@
</view> </view>
<!-- 删除按钮 --> <!-- 删除按钮 -->
<view class="delbox" v-if="literatureList.length > 1" @click="removeLiterature(index)"> <view
class="delbox"
v-if="literatureList.length > 1"
@click="removeLiterature(index)"
>
<up-image :src="delImg" width="40rpx" height="52rpx"></up-image> <up-image :src="delImg" width="40rpx" height="52rpx"></up-image>
</view> </view>
<!-- 文献分隔线 --> <!-- 文献分隔线 -->
<view class="literature-divider" v-if="index < literatureList.length - 1"></view> <view
class="literature-divider"
v-if="index < literatureList.length - 1"
></view>
</view> </view>
<!-- 添加代查文献按钮 --> <!-- 添加代查文献按钮 -->
<view class="add-literature-section" v-if="literatureList.length < 5"> <view class="add-literature-section" v-if="literatureList.length < 5">
@ -183,17 +205,27 @@
</view> </view>
<view class="limit-tip"> <view class="limit-tip">
<view class="imgbox"> <view class="imgbox">
<up-image :src="countImg" width="186rpx" height="74rpx"></up-image> <up-image
:src="countImg"
width="186rpx"
height="74rpx"
></up-image>
</view> </view>
<view class="count">还可添加{{ 5 - literatureList.length }}</view> <view class="count"
>还可添加{{ 5 - literatureList.length }}</view
>
</view> </view>
</view> </view>
</view> </view>
<!-- 常见问题 --> <!-- 常见问题 -->
<view class="faq-section"> <view class="faq-section">
<up-image :src="questionImg" width="100%" mode="widtFix" height="540rpx"></up-image> <up-image
:src="questionImg"
width="100%"
mode="widtFix"
height="540rpx"
></up-image>
</view> </view>
<view class="tips"> <view class="tips">
<view class="title">注意</view> <view class="title">注意</view>
@ -202,8 +234,12 @@
<view class="row">不支持模糊代查请尽可能详细提供所需文献信息</view> <view class="row">不支持模糊代查请尽可能详细提供所需文献信息</view>
</view> </view>
<view class="btnbox"> <view class="btnbox">
<up-image :src="submitImg" width="100%" height="160rpx" mode="widtFix"></up-image> <up-image
:src="submitImg"
width="100%"
height="160rpx"
mode="widtFix"
></up-image>
</view> </view>
</view> </view>
@ -215,12 +251,8 @@
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<!-- 筛选弹窗 --> <!-- 筛选弹窗 -->
<view class="filter-popup" v-if="showFilter" @click="hideFilterPopup"> <view class="filter-popup" v-if="showFilter" @click="hideFilterPopup">
<view class="filter-content" @click.stop> <view class="filter-content" @click.stop>
@ -247,35 +279,52 @@
</template> </template>
<script setup> <script setup>
import { ref, onMounted } from 'vue'; import { ref, onMounted } from "vue";
import { onShow } from "@dcloudio/uni-app"; import { onShow, onBackPress } from "@dcloudio/uni-app";
import upImg from "@/static/cb_up.png" import upImg from "@/static/cb_up.png";
import downImg from "@/static/cb_up.png" import downImg from "@/static/cb_up.png";
import filter from "@/static/cb_screen_no.png" import filter from "@/static/cb_screen_no.png";
import filterOn from "@/static/cb_screen_yes.png" import filterOn from "@/static/cb_screen_yes.png";
import star1 from "@/static/xingxing1.png" import star1 from "@/static/xingxing1.png";
import star2 from "@/static/xingxing2.png" import star2 from "@/static/xingxing2.png";
import paperImg from "@/static/paper_bg.png" import paperImg from "@/static/paper_bg.png";
import activeImg from "@/static/route.png" import activeImg from "@/static/route.png";
import emailImg from "@/static/email_bg.png" import emailImg from "@/static/email_bg.png";
import countImg from "@/static/sheng_bg.png" import countImg from "@/static/sheng_bg.png";
import questionImg from "@/static/paper_question.png" import questionImg from "@/static/paper_question.png";
import submitImg from "@/static/paper_submit.png" import submitImg from "@/static/paper_submit.png";
import delImg from "@/static/delete_paper.png" import delImg from "@/static/delete_paper.png";
import api from '@/api/api.js' import api from "@/api/api.js";
import docUrl from "@/utils/docUrl.js" import docUrl from "@/utils/docUrl.js";
import navTo from '@/utils/navTo.js'; import navTo from "@/utils/navTo.js";
import navBar from "@/components/navBar/navBar.vue" import navBar from "@/components/navBar/navBar.vue";
const total = ref(0); const total = ref(0);
const tab=ref('zhinan') const tab = ref("zhinan");
// //
const searchText = ref(''); const searchText = ref("");
const guidelineCategories = ref([]); const guidelineCategories = ref([]);
const isFilterActive=ref(false) const isFilterActive = ref(false);
// 使 // 使
const searchLibraryList = ref([]); const searchLibraryList = ref([]);
const filterTags = ref([]); const filterTags = ref([]);
const keywords = ref(''); const keywords = ref("");
onBackPress(() => {
try {
uni.sendNativeEvent(
"goTabbarPage",
{
msg: "home",
},
(ret) => {
console.log(ret);
}
);
} catch (e) {
console.log(e);
}
plus.runtime.quit();
return true;
});
// //
onMounted(() => { onMounted(() => {
loadGuideTypes(); loadGuideTypes();
@ -288,28 +337,32 @@
showFilter.value = true; showFilter.value = true;
}; };
const goSearch = () => { const goSearch = () => {
uni.sendNativeEvent('goHomeSearch', { uni.sendNativeEvent(
msg: 'goHomeSearch' "goHomeSearch",
},ret => { {
msg: "goHomeSearch",
},
(ret) => {
console.log(ret); console.log(ret);
})
} }
);
};
const hideFilterPopup = () => { const hideFilterPopup = () => {
showFilter.value = false; showFilter.value = false;
}; };
const toggleTag = (index) => { const toggleTag = (index) => {
filterTags.value[index].selected = !filterTags.value[index].selected; filterTags.value[index].selected = !filterTags.value[index].selected;
isFilterActive.value = filterTags.value.some(tag => tag.selected); isFilterActive.value = filterTags.value.some((tag) => tag.selected);
}; };
const resetFilter = () => { const resetFilter = () => {
// //
filterTags.value.forEach(tag => tag.selected = false); filterTags.value.forEach((tag) => (tag.selected = false));
// //
isFilterActive.value = false; isFilterActive.value = false;
// //
keywords.value = ''; keywords.value = "";
// //
// currentPage.value = 1; // currentPage.value = 1;
// hasMoreData.value = true; // hasMoreData.value = true;
@ -317,24 +370,22 @@
}; };
const confirmFilter = () => { const confirmFilter = () => {
const selectedTags = filterTags.value.filter(tag => tag.selected); const selectedTags = filterTags.value.filter((tag) => tag.selected);
console.log('选中的筛选标签:', selectedTags); console.log("选中的筛选标签:", selectedTags);
for (var i = 0; i < selectedTags.length; i++) { for (var i = 0; i < selectedTags.length; i++) {
if (keywords.value) { if (keywords.value) {
keywords.value+=","+selectedTags[i].NAME keywords.value += "," + selectedTags[i].NAME;
} else { } else {
keywords.value=selectedTags[i].NAME keywords.value = selectedTags[i].NAME;
} }
navTo({ navTo({
url:'/pages_app/hot/hot?keywords='+encodeURIComponent(keywords.value) url: "/pages_app/hot/hot?keywords=" + encodeURIComponent(keywords.value),
}) });
} }
isFilterActive.value = true; isFilterActive.value = true;
hideFilterPopup(); hideFilterPopup();
// //
}; };
onShow(() => { onShow(() => {
@ -348,11 +399,10 @@
const res = await api.guideType({}); const res = await api.guideType({});
guidelineCategories.value = res.data; guidelineCategories.value = res.data;
for (var i = 0; i < res.data.length; i++) { for (var i = 0; i < res.data.length; i++) {
total.value=total.value+res.data[i].total total.value = total.value + res.data[i].total;
} }
} catch (e) { } catch (e) {
console.error('加载指南分类失败:', e); console.error("加载指南分类失败:", e);
} }
}; };
@ -363,14 +413,13 @@
page: 1, page: 1,
pageSize: 20, pageSize: 20,
type: 1, type: 1,
keywords:'', keywords: "",
}); });
if (res && res.code === 200) { if (res && res.code === 200) {
searchLibraryList.value = res.data searchLibraryList.value = res.data;
} }
} catch (e) { } catch (e) {
console.error('加载指南库失败:', e); console.error("加载指南库失败:", e);
} }
}; };
@ -378,38 +427,38 @@
const loadGuideTags = async () => { const loadGuideTags = async () => {
try { try {
const res = await api.guideTag({ const res = await api.guideTag({
type:3 type: 3,
}); });
console.log('指南标签API响应:', res); console.log("指南标签API响应:", res);
if (res && res.code === 200 && res.data) { if (res && res.code === 200 && res.data) {
// API // API
filterTags.value = res.data.map(tag => ({ filterTags.value = res.data.map((tag) => ({
...tag, ...tag,
selected: false selected: false,
})); }));
console.log('指南标签加载成功:', filterTags.value); console.log("指南标签加载成功:", filterTags.value);
} }
} catch (e) { } catch (e) {
console.error('加载指南标签失败:', e); console.error("加载指南标签失败:", e);
} }
}; };
// //
const enterCategory = (item) => { const enterCategory = (item) => {
navTo({ navTo({
url: `/pages_app/zhinanList/zhinanList?typeUuid=${item.uuid}&title=${item.name}` url: `/pages_app/zhinanList/zhinanList?typeUuid=${item.uuid}&title=${item.name}`,
}); });
}; };
// //
const showFilterDialog = () => { const showFilterDialog = () => {
console.log('显示筛选'); console.log("显示筛选");
// //
}; };
// //
const switchTab = (tabName) => { const switchTab = (tabName) => {
console.log('切换到:', tabName); console.log("切换到:", tabName);
tab.value = tabName; tab.value = tabName;
}; };
@ -418,49 +467,50 @@
uni.navigateBack({ uni.navigateBack({
fail() { fail() {
uni.redirectTo({ uni.redirectTo({
url: '/pages/index/index' url: "/pages/index/index",
}); });
} },
}); });
}; };
// //
const activeTab = ref('daichawenxian'); const activeTab = ref("daichawenxian");
// //
const formData = ref({ const formData = ref({
email: '', email: "",
literatureName: '', literatureName: "",
author: '', author: "",
journalName: '' journalName: "",
}); });
// //
const literatureList = ref([ const literatureList = ref([
{ {
id: 1, id: 1,
literatureName: '', literatureName: "",
author: '', author: "",
journalName: '' journalName: "",
} },
]); ]);
// //
const faqList = ref([ const faqList = ref([
{ {
question: '如何查找文献?', question: "如何查找文献?",
answer: '请提供准确的文献标题、作者和期刊信息,我们将为您查找并发送到指定邮箱。', answer:
expanded: false "请提供准确的文献标题、作者和期刊信息,我们将为您查找并发送到指定邮箱。",
expanded: false,
}, },
{ {
question: '查找需要多长时间?', question: "查找需要多长时间?",
answer: '通常在1-3个工作日内完成文献查找并发送到您的邮箱。', answer: "通常在1-3个工作日内完成文献查找并发送到您的邮箱。",
expanded: false expanded: false,
}, },
{ {
question: '支持哪些文献类型?', question: "支持哪些文献类型?",
answer: '支持国内外期刊论文、会议论文、学位论文等多种文献类型。', answer: "支持国内外期刊论文、会议论文、学位论文等多种文献类型。",
expanded: false expanded: false,
} },
]); ]);
// //
@ -470,14 +520,14 @@
// //
const switchBottomTab = (tab) => { const switchBottomTab = (tab) => {
if (tab === 'zhinan') { if (tab === "zhinan") {
uni.navigateTo({ uni.navigateTo({
url: '/pages_app/zhinan/zhinan' url: "/pages_app/zhinan/zhinan",
}); });
} else if (tab === 'tools') { } else if (tab === "tools") {
uni.showToast({ uni.showToast({
title: '功能开发中', title: "功能开发中",
icon: 'none' icon: "none",
}); });
} }
}; };
@ -486,24 +536,24 @@
const addLiterature = () => { const addLiterature = () => {
if (literatureList.value.length >= 5) { if (literatureList.value.length >= 5) {
uni.showToast({ uni.showToast({
title: '最多只能添加5篇文献', title: "最多只能添加5篇文献",
icon: 'none' icon: "none",
}); });
return; return;
} }
const newLiterature = { const newLiterature = {
id: Date.now(), // 使ID id: Date.now(), // 使ID
literatureName: '', literatureName: "",
author: '', author: "",
journalName: '' journalName: "",
}; };
literatureList.value.push(newLiterature); literatureList.value.push(newLiterature);
uni.showToast({ uni.showToast({
title: '添加成功', title: "添加成功",
icon: 'none' icon: "none",
}); });
}; };
@ -511,8 +561,8 @@
const removeLiterature = (index) => { const removeLiterature = (index) => {
if (literatureList.value.length <= 1) { if (literatureList.value.length <= 1) {
uni.showToast({ uni.showToast({
title: '至少保留一篇文献', title: "至少保留一篇文献",
icon: 'none' icon: "none",
}); });
return; return;
} }
@ -520,8 +570,8 @@
literatureList.value.splice(index, 1); literatureList.value.splice(index, 1);
uni.showToast({ uni.showToast({
title: '删除成功', title: "删除成功",
icon: 'none' icon: "none",
}); });
}; };
@ -533,14 +583,14 @@
<style lang="scss" scoped> <style lang="scss" scoped>
// SCSS Variables // SCSS Variables
$primary-color: #8B2316; $primary-color: #8b2316;
$bg-color: #f5f5f5; $bg-color: #f5f5f5;
$white: #fff; $white: #fff;
$text-primary: #333; $text-primary: #333;
$text-secondary: #666; $text-secondary: #666;
$text-light: #999; $text-light: #999;
$primary-color: #ff6b6b; $primary-color: #ff6b6b;
$theme-color: #8B2316; $theme-color: #8b2316;
$white: #fff; $white: #fff;
$gray-bg: #f5f5f5; $gray-bg: #f5f5f5;
$gray-light: #eee; $gray-light: #eee;
@ -554,7 +604,7 @@ $border-radius: 8px;
$border-radius-small: 6px; $border-radius-small: 6px;
$padding: 15px; $padding: 15px;
$padding-small: 10px; $padding-small: 10px;
$accent-color: #4A90E2; $accent-color: #4a90e2;
.zhinan-page { .zhinan-page {
background-color: $bg-color; background-color: $bg-color;
min-height: 100vh; min-height: 100vh;
@ -621,7 +671,9 @@ $accent-color: #4A90E2;
padding: 30rpx; padding: 30rpx;
margin: 0 30rpx; margin: 0 30rpx;
margin-top: calc(var(--status-bar-height) + 44px + 106rpx); // (80rpx + ) margin-top: calc(
var(--status-bar-height) + 44px + 106rpx
); // (80rpx + )
.guideline-item { .guideline-item {
margin-top: 20rpx; margin-top: 20rpx;
@ -694,7 +746,7 @@ $accent-color: #4A90E2;
gap: 8rpx; gap: 8rpx;
&.active { &.active {
color: #fff; color: #fff;
background-color: #8B2316; background-color: #8b2316;
} }
.tab-icon { .tab-icon {
width: 44rpx; width: 44rpx;
@ -706,7 +758,6 @@ $accent-color: #4A90E2;
color: $text-secondary; color: $text-secondary;
&.active { &.active {
color: #fff; color: #fff;
} }
} }
} }
@ -755,7 +806,6 @@ $accent-color: #4A90E2;
background-color: #a5d9fe; background-color: #a5d9fe;
padding: 0 30rpx; padding: 0 30rpx;
.tab-container { .tab-container {
display: flex; display: flex;
align-items: center; align-items: center;
@ -786,8 +836,6 @@ $accent-color: #4A90E2;
right: 0; right: 0;
transform: translateX(-50%); transform: translateX(-50%);
height: 18rpx; height: 18rpx;
} }
} }
} }
@ -802,7 +850,7 @@ $accent-color: #4A90E2;
// //
.header-banner { .header-banner {
background: linear-gradient(135deg, #87CEEB, #B0E0E6); background: linear-gradient(135deg, #87ceeb, #b0e0e6);
margin: 20rpx 30rpx; margin: 20rpx 30rpx;
border-radius: 20rpx; border-radius: 20rpx;
padding: 40rpx 30rpx; padding: 40rpx 30rpx;
@ -844,14 +892,12 @@ $accent-color: #4A90E2;
// //
.form-section { .form-section {
margin: -156rpx 30rpx 20rpx; margin: -156rpx 30rpx 20rpx;
border-radius: 20rpx; border-radius: 20rpx;
padding: 0rpx 0rpx; padding: 0rpx 0rpx;
.wenxian { .wenxian {
margin-top: 40rpx; margin-top: 40rpx;
overflow: hidden; overflow: hidden;
} }
.from-cell { .from-cell {
@ -889,7 +935,6 @@ $accent-color: #4A90E2;
} }
.form-group { .form-group {
margin-bottom: 40rpx; margin-bottom: 40rpx;
display: flex; display: flex;
@ -915,7 +960,8 @@ $accent-color: #4A90E2;
.input-container { .input-container {
flex: 1; flex: 1;
.form-input,.form-textarea{ .form-input,
.form-textarea {
width: 100%; width: 100%;
height: 80rpx; height: 80rpx;
padding: 0 20rpx; padding: 0 20rpx;
@ -958,7 +1004,6 @@ $accent-color: #4A90E2;
.formbox .form-group:nth-child(1) { .formbox .form-group:nth-child(1) {
margin-bottom: 40rpx; margin-bottom: 40rpx;
} }
} }
// //
@ -1019,7 +1064,6 @@ $accent-color: #4A90E2;
background-color: $white; background-color: $white;
border-radius: 20rpx; border-radius: 20rpx;
padding: 1rpx 1rpx; padding: 1rpx 1rpx;
} }
.tips { .tips {
font-size: 24rpx; font-size: 24rpx;
@ -1127,5 +1171,4 @@ $accent-color: #4A90E2;
} }
} }
} }
</style> </style>