6.9
This commit is contained in:
@@ -9,45 +9,45 @@
|
||||
@query="queryList"
|
||||
>
|
||||
<template #top>
|
||||
<navBarSearch :searchWord="keyWord" :navName="navName"></navBarSearch>
|
||||
<navBarSearch :searchWord="keyWord" :navName="navName" @changeWord="changeWord"></navBarSearch>
|
||||
<view class="filterbox">
|
||||
<!-- <view class="type" @click="swicthType">{{!isArticle?'文章':'视频'}}<up--image :src="switchImg" width="31rpx" height="31rpx"></up--image></view> -->
|
||||
<up-dropdown class="u-dropdown" ref="uDropdownRef">
|
||||
<up-dropdown-item
|
||||
v-model="order.push_date"
|
||||
title="收藏"
|
||||
@change="change"
|
||||
v-model="type1"
|
||||
:title="type1==0?'收藏':'浏览'"
|
||||
@change="changetype1"
|
||||
:options="options"
|
||||
></up-dropdown-item>
|
||||
<up-dropdown-item
|
||||
v-model="order.read_num"
|
||||
title="文章病例库"
|
||||
@change="change"
|
||||
:options="options"
|
||||
<up-dropdown-item
|
||||
v-model="type2"
|
||||
:title="title2"
|
||||
@change="changetype2"
|
||||
:options="options1"
|
||||
></up-dropdown-item>
|
||||
</up-dropdown>
|
||||
|
||||
</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" @click="goDetail()" :key="item.collect_id">
|
||||
<view class="title ellipsis">{{item.data.title}}</view>
|
||||
<view class="tagsbox">
|
||||
<view class="tag" v-for="tag in item.author" :key="tag.author_id">{{ tag.doctor_name }}</view>
|
||||
<view class="tag" v-for="tag in item.data.author" :key="tag.author_id">{{ tag.doctor_name }}</view>
|
||||
</view>
|
||||
<view class="deal">
|
||||
<view class="left">
|
||||
<view class="eyebox">
|
||||
<up-icon name="eye" color="#6B7280" size="28rpx"></up-icon>
|
||||
<view class="num">{{item.read_num }}</view>
|
||||
<view class="num">{{item.data.read_num }}</view>
|
||||
</view>
|
||||
<view class="collect">
|
||||
<up-icon name="heart" color="#6B7280" size="28rpx"></up-icon>
|
||||
<view class="num">{{item.collect_num }}</view>
|
||||
<view class="num">{{item.data.collect_num }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="time">
|
||||
<up-icon name="clock" color="#6B7280" size="28rpx"></up-icon>
|
||||
<view class="num">{{formatdate(item.push_date) }}</view>
|
||||
<view class="num">{{formatdate(item.data.push_date) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -69,14 +69,11 @@ const dataList = ref([]);
|
||||
const total = ref(0);
|
||||
const value = ref("");
|
||||
const keyWord = ref("");
|
||||
const page=ref(1);
|
||||
const isArticle=ref(true);
|
||||
const hospital_id=ref('');
|
||||
const hospital_name=ref('');
|
||||
const doctor_id=ref('');
|
||||
const doctor_name=ref('');
|
||||
const numInfo=reactive({});
|
||||
const navName=ref('肝胆相照临床病例库')
|
||||
const navName=ref('肝胆相照临床病例库');
|
||||
const type1=ref(0);
|
||||
const type2=ref(1);
|
||||
const title2=ref('文章病例库');
|
||||
const options= ref([
|
||||
{
|
||||
label: "收藏",
|
||||
@@ -90,15 +87,15 @@ const options= ref([
|
||||
const options1= ref([
|
||||
{
|
||||
label: "文章病例库",
|
||||
value: 0,
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: "视频病例库",
|
||||
value:1,
|
||||
value:2,
|
||||
},
|
||||
{
|
||||
label: "病例交流",
|
||||
value:2,
|
||||
value:3,
|
||||
},
|
||||
]);
|
||||
|
||||
@@ -111,32 +108,16 @@ 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 change=(e)=>{
|
||||
const changetype1=(e)=>{
|
||||
type1.value=e;
|
||||
paging.value.reload();
|
||||
}
|
||||
const changetype2=(e)=>{
|
||||
type2.value=e;
|
||||
title2.value=options1.value[e-1].label;
|
||||
paging.value.reload();
|
||||
}
|
||||
const formatdate=(date)=>{
|
||||
return dayjs(date).format('YYYY-MM-DD')
|
||||
}
|
||||
@@ -148,53 +129,34 @@ const goDetail=(id)=>{
|
||||
url: `/pages/detail/detail?id=${id}&type=${type}`
|
||||
})
|
||||
}
|
||||
const swicthType=()=>{
|
||||
isArticle.value=!isArticle.value;
|
||||
dataList.value=[];
|
||||
order.read_num='';
|
||||
order.push_date='';
|
||||
paging.value.reload();
|
||||
const changeWord=(val)=>{
|
||||
keyWord.value=val;
|
||||
paging.value.reload();
|
||||
}
|
||||
const searchArticle =(params) => {
|
||||
const searchCollect=(params) => {
|
||||
let searchForm={
|
||||
keyword: keyWord.value,
|
||||
doctor_id:doctor_id.value,
|
||||
hospital_id:hospital_id.value
|
||||
type:type2.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.searchArticle({
|
||||
api.getMyCollect({
|
||||
...searchForm,
|
||||
...params
|
||||
}).then((res)=>{
|
||||
paging.value.complete(res.data.data.data);
|
||||
paging.value.complete(res.data.data.data);
|
||||
total.value=res.data.data.total;
|
||||
}).catch(err=>{
|
||||
paging.value.complete(false);
|
||||
})
|
||||
}
|
||||
|
||||
const searchVideo = async(params) => {
|
||||
const searchRead = async(params) => {
|
||||
let searchForm={
|
||||
keyword: keyWord.value,
|
||||
type:type2.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({
|
||||
|
||||
api.getMyRead({
|
||||
...searchForm,
|
||||
...params
|
||||
}).then((res)=>{
|
||||
paging.value.complete(res.data.data.data);
|
||||
@@ -203,27 +165,14 @@ const searchVideo = async(params) => {
|
||||
paging.value.complete(false);
|
||||
})
|
||||
}
|
||||
const getStaticDoctor=(id)=>{
|
||||
api.getStaticDoctor(id).then((res)=>{
|
||||
let result=res.data.data;
|
||||
Object.assign(numInfo,result);
|
||||
})
|
||||
}
|
||||
const getStaticHospital=(id)=>{
|
||||
api.getStaticHospital(id).then((res)=>{
|
||||
let result=res.data.data;
|
||||
Object.assign(numInfo,result);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const queryList = (pageNo, pageSize) => {
|
||||
console.log(666666);
|
||||
const params = {
|
||||
page: pageNo,
|
||||
page_size: pageSize,
|
||||
};
|
||||
isArticle.value?searchArticle(params):searchVideo(params)
|
||||
type1.value==1?searchRead(params):searchCollect(params)
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user