6.13
This commit is contained in:
+51
-101
@@ -9,7 +9,12 @@
|
||||
@query="queryList"
|
||||
>
|
||||
<template #top>
|
||||
<navBarSearch :searchWord="keyWord" :navName="navName"></navBarSearch>
|
||||
<navBarSearch :searchWord="keyWord" :navName="navName" @changeWord="changeWord"></navBarSearch>
|
||||
<view class="detail" v-if="isSearch">
|
||||
<view class="desc" >检索到:<text class="red">{{numInfo.search_article_num}}篇文章</text></view>
|
||||
<view class="desc">检索到:<text class="red">{{numInfo.search_video_num}}个视频</text></view>
|
||||
<view class="desc" v-if="keyWord">检索词:<text class="red">{{ keyWord }}</text></view>
|
||||
</view>
|
||||
<view class="tabcon">
|
||||
<up-tabs :activeStyle="{
|
||||
color: '#3CC7C0'
|
||||
@@ -19,8 +24,8 @@
|
||||
}" lineColor="#3CC7C0" lineWidth="155rpx" lineHeight="2" :list="tabList" @click="switchTab"></up-tabs>
|
||||
</view>
|
||||
</template>
|
||||
<view class="item" v-for="(item, index) in dataList" :key="index" @click="isArticle?goDetail(item.article_id):goDetail(item.video_id)">
|
||||
<view class="title ellipsis">{{isArticle?item.article_title:item.video_title }}</view>
|
||||
<view class="item" v-for="(item, index) in dataList" :key="index" @click="goDetail(item.cert_image)">
|
||||
<view class="title ellipsis">{{tab==0?item.article_title:item.video_title }}</view>
|
||||
<view class="tagsbox">
|
||||
<view class="tag" v-for="tag in item.author" :key="tag.author_id">{{ tag.doctor_name }}</view>
|
||||
</view>
|
||||
@@ -55,104 +60,57 @@ import dayjs from "dayjs";
|
||||
import switchImg from "@/static/switch.png";
|
||||
import certImg from "@/static/cert.png";
|
||||
const paging = ref(null);
|
||||
const uDropdownRef=ref(null);
|
||||
const isSearch=ref(false);
|
||||
const dataList = ref([]);
|
||||
const total = ref(0);
|
||||
const value = ref("");
|
||||
const keyWord = ref("");
|
||||
const page=ref(1);
|
||||
const isArticle=ref(true);
|
||||
const tab=ref(0);
|
||||
const hospital_id=ref('');
|
||||
const hospital_name=ref('');
|
||||
const doctor_id=ref('');
|
||||
const doctor_name=ref('');
|
||||
const numInfo=reactive({});
|
||||
const navName=ref('肝胆相照临床病例库')
|
||||
const options= ref([
|
||||
{
|
||||
label: "正序",
|
||||
value: 'asc',
|
||||
},
|
||||
{
|
||||
label: "倒序",
|
||||
value: 'desc',
|
||||
},
|
||||
]);
|
||||
|
||||
const formatdate=(date)=>{
|
||||
return dayjs(date).format('YYYY-MM-DD')
|
||||
}
|
||||
const tabList=ref([{
|
||||
|
||||
name: '文章病例库',
|
||||
}, {
|
||||
name: '视频病例库',
|
||||
}])
|
||||
const order=reactive({
|
||||
read_num:'',
|
||||
push_date:''
|
||||
})
|
||||
|
||||
const switchTab=(index)=>{
|
||||
console.log('item', index);
|
||||
tab.value=index.index;
|
||||
paging.value.reload();
|
||||
}
|
||||
onLoad((options) => {
|
||||
if(options.keyWord){
|
||||
keyWord.value = options.keyWord;
|
||||
};
|
||||
if(options.order=='new'){
|
||||
order.push_date='asc'
|
||||
};
|
||||
if(options.order=='read'){
|
||||
order.read_num='desc'
|
||||
};
|
||||
if(options.order=='video'){
|
||||
isArticle.value=false;
|
||||
}
|
||||
if(options.doctor_id){
|
||||
doctor_id.value=options.doctor_id;
|
||||
doctor_name.value=options.doctor_name
|
||||
navName.value= doctor_name.value+'临床病例库'
|
||||
getStaticDoctor(doctor_id.value)
|
||||
}
|
||||
if(options.hospital_id){
|
||||
hospital_id.value=options.hospital_id;
|
||||
hospital_name.value=options.hospital_name;
|
||||
navName.value= hospital_name.value+'临床病例库'
|
||||
getStaticDoctor(hospital_id.value)
|
||||
})
|
||||
const goDetail=(url)=>{
|
||||
|
||||
}
|
||||
});
|
||||
const change=(e)=>{
|
||||
paging.value.reload();
|
||||
}
|
||||
const formatdate=(date)=>{
|
||||
return dayjs(date).format('YYYY-MM-DD')
|
||||
}
|
||||
const goDetail=(id)=>{
|
||||
console.log(11111)
|
||||
console.log(id)
|
||||
let type=isArticle.value?'article':'video'
|
||||
uni.navigateTo({
|
||||
url: `/pages/detail/detail?id=${id}&type=${type}`
|
||||
url: `/pages/certImg/certImg?src=${url}`
|
||||
})
|
||||
}
|
||||
const swicthType=()=>{
|
||||
isArticle.value=!isArticle.value;
|
||||
dataList.value=[];
|
||||
order.read_num='';
|
||||
order.push_date='';
|
||||
paging.value.reload();
|
||||
const changeWord=(val)=>{
|
||||
keyWord.value=val;
|
||||
isSearch.value=true;
|
||||
paging.value.reload();
|
||||
}
|
||||
const searchArticle =(params) => {
|
||||
let searchForm={
|
||||
keyword: keyWord.value,
|
||||
doctor_id:doctor_id.value,
|
||||
hospital_id:hospital_id.value
|
||||
}
|
||||
if(!order.read_num){
|
||||
delete order.read_num
|
||||
}
|
||||
if(!order.push_date){
|
||||
delete order.push_date
|
||||
}
|
||||
if(order.read_num || order.push_date){
|
||||
searchForm.order=order
|
||||
if(isSearch.value){
|
||||
formatdate.is_need_num=1
|
||||
}
|
||||
api.searchArticle({
|
||||
...searchForm,
|
||||
@@ -160,29 +118,27 @@ const searchArticle =(params) => {
|
||||
}).then((res)=>{
|
||||
paging.value.complete(res.data.data.data);
|
||||
total.value=res.data.data.total;
|
||||
numInfo.search_article_num=res.data.data.search_article_num;
|
||||
numInfo.search_video_num=res.data.data.search_video_num;
|
||||
}).catch(err=>{
|
||||
paging.value.complete(false);
|
||||
})
|
||||
}
|
||||
|
||||
const searchVideo = async(params) => {
|
||||
let searchForm={
|
||||
let searchForm={
|
||||
keyword: keyWord.value,
|
||||
doctor_id:doctor_id.value,
|
||||
}
|
||||
if(!order.read_num){
|
||||
delete order.read_num
|
||||
}
|
||||
if(!order.push_date){
|
||||
delete order.push_date
|
||||
}
|
||||
if(order.read_num || order.push_date){
|
||||
searchForm.order=order
|
||||
}
|
||||
|
||||
api.searchVideo({
|
||||
...searchForm,
|
||||
...params
|
||||
}).then((res)=>{
|
||||
paging.value.complete(res.data.data.data);
|
||||
total.value=res.data.data.total;
|
||||
numInfo.search_article_num=res.data.data.search_article_num;
|
||||
numInfo.search_video_num=res.data.data.search_video_num;
|
||||
}).catch(err=>{
|
||||
paging.value.complete(false);
|
||||
})
|
||||
@@ -207,11 +163,23 @@ const queryList = (pageNo, pageSize) => {
|
||||
page: pageNo,
|
||||
page_size: pageSize,
|
||||
};
|
||||
isArticle.value?searchArticle(params):searchVideo(params)
|
||||
tab.value==0?searchArticle(params):searchVideo(params)
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.detail {
|
||||
background: #f9f9f9;
|
||||
padding: 12rpx 30rpx;
|
||||
.desc {
|
||||
font-size: 26rpx;
|
||||
color: #4b5563;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
.red{
|
||||
color: #FF0000;
|
||||
}
|
||||
}
|
||||
.tabcon{
|
||||
margin:0 20rpx;
|
||||
}
|
||||
@@ -239,27 +207,7 @@ const queryList = (pageNo, pageSize) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
.filterbox{
|
||||
display: flex;
|
||||
height:128rpx;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
.type{
|
||||
position: absolute;
|
||||
left:30rpx;
|
||||
top:24rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: #F3F4F6;
|
||||
border-radius: 15rpx;
|
||||
height: 74rpx;
|
||||
padding:0 25rpx;
|
||||
z-index:2;
|
||||
}
|
||||
}
|
||||
.u-page {
|
||||
:deep(.u-flex) {
|
||||
:deep(.u-flex) {
|
||||
display: flex;
|
||||
flex-direction:row;
|
||||
overflow: hidden;
|
||||
@@ -269,7 +217,7 @@ const queryList = (pageNo, pageSize) => {
|
||||
|
||||
background: #fff;
|
||||
z-index:1;
|
||||
margin-left: 180rpx;
|
||||
margin-left: -30rpx;
|
||||
|
||||
}
|
||||
:deep(.u-dropdown__menu__item){
|
||||
@@ -282,6 +230,8 @@ const queryList = (pageNo, pageSize) => {
|
||||
margin-left: 60rpx;
|
||||
|
||||
}
|
||||
.u-page {
|
||||
|
||||
.deal {
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
|
||||
Reference in New Issue
Block a user