This commit is contained in:
zoujiandong
2025-06-13 19:09:30 +08:00
parent 518a5d1b47
commit a31fc3c1e6
40 changed files with 4210 additions and 532 deletions
+13 -5
View File
@@ -1,7 +1,7 @@
<template>
<view class="content">
<view class="page">
<web-view src="https:www.baidu.com/" ></web-view>
<web-view :src="src" ></web-view>
</view>
<tabBar :value="1"></tabBar>
</view>
@@ -9,12 +9,20 @@
<script setup>
import { reactive, ref } from 'vue';
import { onShow } from "@dcloudio/uni-app";
import { onShow,onLoad } from "@dcloudio/uni-app";
import tabBar from '@/components/tabBar/tabBar.vue';
const webviewStyles=reactive({
width:"100%",
height:'calc(100vh - 0rpx)'
const src = ref('https://dev-caseplatform.igandan.com/web/home?token=');
onLoad((options)=>{
const { envVersion } = uni.getAccountInfoSync().miniProgram;
let token=''
if (envVersion == "release") {
token=uni.setStorageSync("AUTH_TOKEN_CASEDATA");
} else {
token= uni.setStorageSync("DEV_AUTH_TOKEN_CASEDATA");
};
src.value = 'https://dev-caseplatform.igandan.com/web/home?token='+token;
})
</script>
<style scoped>
+7 -2
View File
@@ -26,7 +26,7 @@
</view>
</view>
<view class="list">
<view class="cell" v-for="item in most_read_articles" :key="item.exchange_id">
<view class="cell" v-for="item in most_read_articles" :key="item.exchange_id" @click="goDetail(item.exchange_id)">
<view class="circle"></view>
<view class="title ellipsis-two-lines">{{ item.exchange_title }}</view>
</view>
@@ -46,6 +46,7 @@
class="cell"
v-for="(item) in new_articles"
:key="item.exchange_id"
@click="goDetail(item.exchange_id)"
>
<view class="title ellipsis-two-lines">{{
item.exchange_title
@@ -181,7 +182,11 @@
Object.assign(numInfo,result);
})
}
const goDetail = (id) => {
uni.navigateTo({
url: `/pages/detail/detail?id=${id}&type=exchange`,
});
};
const videoErrorCallback = (e) => {
uni.showModal({
content: e.target.errMsg,
+32
View File
@@ -0,0 +1,32 @@
<template>
<backNav :navName="'病例收录证书'"></backNav>
<view class="imgbox">
<u--image
:showLoading="true"
:src="src"
width="100%"
mode="widthFix"
></u--image>
</view>
</template>
<script setup>
import { ref } from 'vue';
import { onLoad } from "@dcloudio/uni-app";
import backNav from "@/components/backNav/backNav.vue";
const src = ref('')
onLoad((options) => {
if(options.src){
src.value = options.src;
}else{
src.value= 'https://cn.bing.com//th?id=OHR.SanMiguelAzores_ZH-CN2511982585_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp';
}
});
</script>
<style lang='scss' scoped>
.imgbox{
margin-top: -30rpx;
}
</style>
+51 -101
View File
@@ -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;
+264 -76
View File
@@ -11,7 +11,9 @@
<backNav :navName="'肝胆相照临床病例库'"></backNav>
<view class="box">
<view class="title" v-if="type == 'video'">{{ info.video_title }}</view>
<view class="title" v-else-if="type=='article'">{{ info.article_title }}</view>
<view class="title" v-else-if="type == 'article'">{{
info.article_title
}}</view>
<view class="title" v-else>{{ info.exchange_title }}</view>
<view class="content">
<view class="info" v-for="item in info.author">
@@ -49,25 +51,6 @@
</view>
</view>
<view class="bar"></view>
<view class="detail">
<!-- <view class="votebox">
<view class="name">在线投票</view>
<view class="title">肝胆相照临床病例库肝胆相照临床病例库肝胆</view>
<view class="options">
<view class="option">
<view class="row">
<view class="left">治疗有效性</view>
<view class="num">0%</view>
</view>
<view class="line">
<view class="inner" style="width: 10%"></view>
</view>
</view>
</view>
</view> -->
</view>
<canvas
v-if="showCanvas"
@@ -101,7 +84,7 @@
mode="widthFix"
width="38rpx"
></up--image>
<view class="imgboxshang">
<view class="imgboxshang" @click="openGivePop">
<up--image
:src="shangImg"
mode="widthFix"
@@ -124,9 +107,65 @@
>
</polyv-player>
</view>
<view class="videobox" v-else>
<view class="videobox" v-else-if="type == 'article'">
<view class="content" v-html="info.article_content"></view>
</view>
<view class="videobox" v-else>
<view class="cloumn" v-if="info.exchange_content">
<view class="stitle">病例信息</view>
<u-parse :content="fromatImg(info.exchange_content)"></u-parse>
<!-- <view class="con" v-html="fromatImg(info.exchange_content)"></view> -->
</view>
<view class="cloumn" v-if="info.exchange_summary">
<view class="stitle">结果与讨论</view>
<u-parse :content="fromatImg(info.exchange_summary)"></u-parse>
<!-- <view class="con" v-html="fromatImg(info.exchange_summary)"></view> -->
</view>
<view class="bar"></view>
<view class="detail" v-if="info.case_exchange_vote && info.case_exchange_vote.vote_title">
<view class="votebox" v-if="info.case_exchange_vote.is_have_voted!=1">
<view class="name">在线投票</view>
<view class="title" >{{ info.case_exchange_vote.vote_title }}</view>
<view class="group">
<up-radio-group
v-model="option_id"
placement="column"
>
<view class="row" v-for="item in info.case_exchange_vote.case_exchange_vote_option" :key="item.option_id">
<up-radio
activeColor="#3CC7C0"
:label="item.option_value"
:name="item.option_id"
>
</up-radio>
</view>
</up-radio-group>
<view class="btn" @click="addVote">投票</view>
</view>
</view>
<view class="votebox" v-else>
<view class="name">在线投票</view>
<view class="title">{{ info.case_exchange_vote.vote_title }}</view>
<view class="options">
<view class="option" v-for="item in info.case_exchange_vote.case_exchange_vote_option" :key="item.option_id">
<view class="row">
<view class="left">{{item.option_value }}</view>
<view class="num">{{item.proportion}}%</view>
</view>
<view class="line">
<view class="inner" :style="{width:proportion/100 }"></view>
</view>
</view>
</view>
</view>
</view>
<!-- <view class="detail" v-if="info.case_exchange_vote && info.case_exchange_vote.vote_title">
</view> -->
</view>
<view class="bar"></view>
<view class="comnum">
<view class="imgcon">
@@ -173,7 +212,7 @@
<view class="question">{{ item.content }}</view>
<view class="commentImg" v-if="item.comment_image">
<up-image
:src="(item.comment_image)"
:src="item.comment_image"
radius="16rpx"
width="150rpx"
height="150rpx"
@@ -220,9 +259,9 @@
class="question"
v-html="formatHtml(cell.content)"
></view>
<view class="commentImg" v-if="cell.comment_image">
<view class="commentImg" v-if="cell.comment_image">
<up-image
:src="(cell.comment_image)"
:src="cell.comment_image"
radius="16rpx"
width="150rpx"
height="150rpx"
@@ -264,7 +303,7 @@
:placeholder="placeholder"
></up--textarea>
</view>
<view class="imgbox" v-if="imgList.length>0">
<view class="imgbox" v-if="imgList.length > 0">
<view class="imgunit">
<up--image
:src="imgList[0]"
@@ -282,7 +321,6 @@
<view class="left">
<up-upload
:show-upload-list="false"
@afterRead="afterRead"
name="imgupload"
multiple
@@ -369,15 +407,15 @@
>
</view>
<view class="question">{{ mainCommentObj.content }}</view>
<view class="commentImg" v-if="mainCommentObj.comment_image">
<up-image
:src="mainCommentObj.comment_image"
radius="16rpx"
width="150rpx"
height="150rpx"
@click="previewImg(mainCommentObj.comment_image)"
></up-image>
</view>
<view class="commentImg" v-if="mainCommentObj.comment_image">
<up-image
:src="mainCommentObj.comment_image"
radius="16rpx"
width="150rpx"
height="150rpx"
@click="previewImg(mainCommentObj.comment_image)"
></up-image>
</view>
<view class="date">{{
formatDate(mainCommentObj.created_at)
}}</view>
@@ -416,7 +454,7 @@
>
</view>
<view class="question" v-html="formatHtml(cell.content)"></view>
<view class="commentImg" v-if="cell.comment_image">
<view class="commentImg" v-if="cell.comment_image">
<up-image
:src="cell.comment_image"
radius="16rpx"
@@ -447,17 +485,19 @@
<view class="title">打赏</view>
<view class="count">
积分余额
<text class="num">100</text>积分
<text class="earn">去赚积分</text>
<text class="num">{{ point }}</text>积分
<!-- <text class="earn">去赚积分</text> -->
</view>
<view class="countbox">
<view class="minus">-</view>
<view class="minus" @click="changePoint('minus')">-</view>
<up-input
placeholder="请输入内容"
placeholder="请输入打赏积分"
type="number"
border="surround"
v-model="value"
@input="inputPoint"
v-model="givePointValue"
></up-input>
<view class="add">+</view>
<view class="add" @click="changePoint('add')">+</view>
</view>
<view class="btnbox">
<view class="cancle" @click="showGive = false">取消</view>
@@ -494,6 +534,7 @@ import backNav from "@/components/backNav/backNav.vue";
import commentImg from "@/static/comment_icon.png";
import list from "@/uni_modules/z-paging/components/z-paging/z-paging";
import api from "@/api/api";
import uParse from "@/components/u-parse/u-parse.vue";
import { onLoad } from "@dcloudio/uni-app";
import dayjs from "dayjs";
const paging = ref(null);
@@ -502,6 +543,7 @@ const total = ref(0);
const imgList = ref([]);
const showCanvas = ref(false);
const showCommentDialog = ref(false);
const givePointValue = ref(5);
const canvasWidth = ref(0);
const canvasHeight = ref(0);
const showModal = ref(false);
@@ -522,16 +564,62 @@ const mainCommentObj = reactive({});
const childList = ref([]);
const clickIndex = ref(0);
const is_top = ref(false);
const option_id = ref("");
const point=ref(0)
const confirmGive = () => {
showGive.value = false;
givePoint();
};
const openGivePop=()=>{
showGive.value=true;
getUserPoint();
}
const formatDay = (date) => {
return dayjs(date).format("YYYY-MM-DD");
};
const formatDate = (date) => {
return dayjs(date).format("YYYY-MM-DD HH:mm");
};
const inputPoint=()=>{
if (givePointValue.value < 5) {
givePointValue.value = 5;
uni.showToast({
icon: "none",
title: "每次打赏范围5~100积分",
});
}
if (givePointValue.value > 100) {
givePointValue.value = 100;
uni.showToast({
icon: "none",
title: "每次打赏范围5~100积分",
});
}
};
const changePoint = (type) => {
if (type == 'minus') {
if (givePointValue.value > 5) {
givePointValue.value = givePointValue.value - 5
} else {
uni.showToast({
icon: "none",
title: "每次打赏范围5~100积分",
});
}
} else {
if (givePointValue.value <= 95) {
givePointValue.value = givePointValue.value + 5
} else {
uni.showToast({
icon: "none",
title: "每次打赏范围5~100积分",
});
}
}
}
const openMorePop = (obj, list, index) => {
showMore.value = true;
childList.value = list;
@@ -556,16 +644,54 @@ const getExchangeDetail = (id) => {
Object.assign(info, result);
});
};
const getUserPoint=()=>{
api.getUserPoint().then(res=>{
console.log(res.data.data)
point.value=res.data.data
})
}
const givePoint=()=>{
if(point.value<givePointValue.value){
uni.showToast({
icon:'none',
title:'积分不足'
})
return false
}
let giveType=1;
if(type.value=='article'){
giveType=1
}else if(type.value=='video'){
giveType=2
}else{
giveType=3
}
api.givePoint({
id:id.value,
type:giveType,
point:givePointValue.value,
}).then(res=>{
uni.showToast({
icon:'none',
title:'打赏成功!'
})
showGive.value=false;
})
}
onLoad((options) => {
id.value = options.id;
type.value = options.type;
if (type.value == "article") {
getArticleDetail(options.id);
} else if(type.value == "video") {
} else if (type.value == "video") {
getVideoDetail(options.id);
}else{
} else {
getExchangeDetail(options.id);
}
});
const clearComment = () => {
parent_id.value = null;
@@ -613,11 +739,11 @@ const queryList = (pageNo, pageSize) => {
page_size: pageSize,
};
// type.value == "article" ? getArticleComment(params) : getVideoComment(params);
if(type.value == "article"){
getArticleComment(params)
}else if(type.value == "video"){
if (type.value == "article") {
getArticleComment(params);
} else if (type.value == "video") {
getVideoComment(params);
}else{
} else {
getExchangeComment(params);
}
};
@@ -650,7 +776,7 @@ const getArticleComment = (params) => {
});
};
const getVideoComment = (params) => {
const form = {
const form = {
video_id: id.value,
is_have_sub_comment: 1,
};
@@ -677,7 +803,7 @@ const getVideoComment = (params) => {
});
};
const getExchangeComment = (params) => {
const form = {
const form = {
exchange_id: id.value,
is_have_sub_comment: 1,
};
@@ -1044,7 +1170,7 @@ const chooseImg = () => {
const handleUpload = (file) => {
let File = file.file;
// 打印文件对象
api
.getOss({
@@ -1058,7 +1184,7 @@ const handleUpload = (file) => {
let time = dayjs().format("YYYYMMDDHHmmss");
let random = generateRandomNumber();
let filename = time + random;
let imgType ="."+getImageFormat(File[0].url);
let imgType = "." + getImageFormat(File[0].url);
return new Promise((resolve, reject) => {
uni.uploadFile({
url: host, // 仅为示例,非真实的接口地址
@@ -1074,7 +1200,7 @@ const handleUpload = (file) => {
if (res.statusCode === 204) {
let url = host + "/" + dir + filename + imgType;
console.log(url);
imgList.value=[url]
imgList.value = [url];
}
},
fail: (err) => {
@@ -1082,7 +1208,6 @@ const handleUpload = (file) => {
},
});
});
}
});
};
@@ -1090,20 +1215,20 @@ const generateRandomNumber = () => {
let randomNumber = Math.floor(1000 + Math.random() * 9000);
return randomNumber;
};
const getImageFormat=(imageUrl)=>{
const lastDotIndex = imageUrl.lastIndexOf('.');
if (lastDotIndex !== -1) {
return imageUrl.substring(lastDotIndex + 1);
}
return 'unknown';
};
const getImageFormat = (imageUrl) => {
const lastDotIndex = imageUrl.lastIndexOf(".");
if (lastDotIndex !== -1) {
return imageUrl.substring(lastDotIndex + 1);
}
return "unknown";
};
const afterRead = (file, lists, name) => {
console.log(lists);
console.log(name);
handleUpload(file);
};
const delImg = (index) => {
imgList.value=[];
imgList.value = [];
};
const collectArticle = (id) => {
api.collectArticle(id).then((res) => {
@@ -1164,10 +1289,12 @@ const cancelCollectExchange = (id) => {
const toggleCollect = () => {
if (type.value == "video") {
info.is_collect ? cancelCollectVideo(id.value) : collectVideo(id.value);
} else if(type.value == "article") {
} else if (type.value == "article") {
info.is_collect ? cancelCollectArticle(id.value) : collectArticle(id.value);
}else{
info.is_collect ? cancelCollectExchange(id.value) : collectExchange(id.value);
} else {
info.is_collect
? cancelCollectExchange(id.value)
: collectExchange(id.value);
}
};
const addArticleComment = (id, data) => {
@@ -1221,12 +1348,18 @@ const delVideoComment = (id) => {
paging.value.refresh();
});
};
const fromatImg = (val) => {
return val.replace(/\<img/gi, '<img style="width:100%"');
};
const delExchangeComment = (id) => {
// 调用删除评论的API
api.delExchangeComment(id).then((res) => {
// 显示提示框,提示删除成功
uni.showToast({
icon: "none",
title: "删除成功",
});
// 刷新分页组件
paging.value.refresh();
});
};
@@ -1297,9 +1430,9 @@ const delComment = () => {
const confirmDel = () => {
if (type.value == "article") {
delArticleComment(parent_id.value);
} else if(type.value == "video") {
} else if (type.value == "video") {
delVideoComment(parent_id.value);
}else{
} else {
delExchangeComment(parent_id.value);
}
showModal.value = false;
@@ -1310,11 +1443,11 @@ const toggleTop = () => {
is_top.value
? cancelTopArticleComment(parent_id.value)
: topArticleComment(parent_id.value);
} else if(type.value == "video") {
} else if (type.value == "video") {
is_top.value
? cancelTopVideoComment(parent_id.value)
: topVideoComment(parent_id.value);
}else{
} else {
is_top.value
? cancelTopExchangeComment(parent_id.value)
: topExchangeComment(parent_id.value);
@@ -1334,8 +1467,8 @@ const sendComment = () => {
? "回复" + reply_name.value + "" + content.value
: content.value,
};
if(imgList.value.length>0){
postData.comment_image = imgList.value[0]
if (imgList.value.length > 0) {
postData.comment_image = imgList.value[0];
}
if (parent_id.value !== null) {
postData.parent_id = parent_id.value;
@@ -1345,9 +1478,9 @@ const sendComment = () => {
}
if (type.value == "article") {
addArticleComment(id.value, postData);
} else if(type.value == "video") {
} else if (type.value == "video") {
addVideoComment(id.value, postData);
}else{
} else {
addExchangeComment(id.value, postData);
}
};
@@ -1360,11 +1493,44 @@ const formatHtml = (val) => {
}
return val;
};
const addVote = () => {
if (!option_id.value) {
uni.showToast({
icon: "none",
title: "请选择投票选项!",
});
return false;
}
api
.addVote(id.value, {
option_id: option_id.value,
})
.then((res) => {
uni.showToast({
icon: "none",
title: "投票成功!",
});
getExchangeDetail(id.value);
});
};
</script>
<style lang='scss' scoped>
.videobox{
padding:20rpx 30rpx;
.videobox {
padding: 20rpx 30rpx;
.cloumn{
padding-bottom: 30rpx;
}
:deep(.video) {
display: flex;
justify-content: center;
}
.con {
:deep(.img) {
width: 100%;
}
}
}
.zanboxpop {
display: flex;
@@ -1619,6 +1785,27 @@ const formatHtml = (val) => {
.votebox {
padding: 30rpx;
background: #fff;
.group{
margin-top: 20rpx;
.row{
border-radius: 20rpx;
border: 2rpx solid #B8B8B8;
padding: 16rpx;
background: #fff;
margin-bottom:24rpx;
}
}
.btn {
margin: 50rpx 40rpx 0;
height: 92rpx;
background: #3cc7c0;
border-radius: 46rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 32rpx;
color: #ffffff;
}
.name {
font-size: 36rpx;
color: #000000;
@@ -1637,6 +1824,7 @@ const formatHtml = (val) => {
color: #4b5563;
display: flex;
align-items: center;
margin-bottom: 10rpx;
justify-content: space-between;
}
.line {
+35 -9
View File
@@ -18,7 +18,7 @@
<view class="kubox">
<view class="row">
<up--image
@click="goList('video')"
@click="goVideo"
:src="videoImg"
radius="20rpx"
width="330rpx"
@@ -27,7 +27,7 @@
></up--image>
<up--image
:src="sickImg"
@click="goList('article')"
@click="goSick"
width="330rpx"
radius="20rpx"
height="176rpx"
@@ -68,7 +68,7 @@
</view>
</view>
<view class="listbox">
<view class="cell" v-for="item in new_articles" :key="item.article_id">
<view class="cell" v-for="item in new_articles" :key="item.article_id" @click="goDetail(item.article_id)">
<view class="circle"></view>
<view class="info">
<view class="name">{{item.article_title }}</view>
@@ -89,7 +89,7 @@
</view>
</view>
<view class="listbox">
<view class="cell" v-for="item in most_read_articles" :key="item.article_id">
<view class="cell" v-for="item in most_read_articles" :key="item.article_id" @click="goDetail(item.article_id)">
<view class="circle"></view>
<view class="info">
<view class="name">{{item.article_title }}</view>
@@ -109,7 +109,7 @@
</view>
</view>
<view class="list">
<view class="cell" v-for="item in recommend_hospital" :key="item.hospital_id">{{ item.hospital_name }}</view>
<view class="cell" v-for="item in recommend_hospital" :key="item.hospital_id" @click="goListBy(item.hospital_id,item.hospital_name ,'hospital')">{{ item.hospital_name }}</view>
</view>
</view>
<view class="recbox">
@@ -121,7 +121,7 @@
</view>
</view>
<view class="list">
<view class="cell" v-for="item in recommend_doctor" :key="item.doctor_id">{{ item.doctor_name }}</view>
<view class="cell" v-for="item in recommend_doctor" :key="item.doctor_id" @click="goListBy(item.doctor_id,item.doctor_name ,'doctor')">{{ item.doctor_name }}</view>
</view>
</view>
</view>
@@ -130,7 +130,7 @@
</template>
<script setup>
import { ref, reactive, onMounted } from "vue";
import { ref, reactive, onMounted,getCurrentInstance } from "vue";
import { onLoad} from "@dcloudio/uni-app";
import tabBar from "@/components/tabBar/tabBar.vue";
import navBar from "@/components/navBar/navBar.vue";
@@ -148,6 +148,22 @@ const new_articles = ref([]);
const recommend_doctor=ref([]);
const recommend_hospital=ref([]);
const numInfo=reactive({})
const goDetail = (id) => {
uni.navigateTo({
url: `/pages/detail/detail?id=${id}&type=article`,
});
};
const goListBy=(id,name,type)=>{
let url=''
if(type=='doctor'){
url=`/pages/search/search?doctor_id=${id}&doctor_name=${name}`
}else{
url=`/pages/search/search?hospital_id=${id}&hospital_name=${name}`
}
uni.navigateTo({
url:url,
});
}
const getData = async() => {
const {data}=await api.getHomeData();
@@ -163,7 +179,7 @@ const getData = async() => {
api.getHomeStatics().then((res) => {
let result=res.data.data;
Object.assign(numInfo,result);
console.log(numInfo.value)
})
}
const goList=(type)=>{
@@ -171,6 +187,16 @@ const goList=(type)=>{
url:'/pages/search/search?order='+type
})
};
const goVideo=()=>{
uni.navigateTo({
url:'/pages/videoList/videoList'
})
}
const goSick=()=>{
uni.navigateTo({
url:'/pages/sickList/sickList'
})
}
const searchDoctor=()=>{
uni.navigateTo({
url:'/pages/searchList/searchList?type=doctor&name=医生&id='
@@ -183,8 +209,8 @@ const goHospital=()=>{
}
onLoad(() => {
getStatic();
getData();
});
</script>
<style lang="scss" scoped>
+1
View File
@@ -214,6 +214,7 @@ const getPhoneNumber = (e) => {
api.wxLogin({
phone_code: e.target.code,
wx_code: res,
source:1
})
.then((data) => {
let result=data.data.data;
+1 -1
View File
@@ -125,7 +125,7 @@ onLoad(()=>{
})
const goCert = () => {
uni.navigateTo({
url: "/pages/certList/certList",
url: "/pages/certList/certList?doctor_id="+userInfo.doctor_id,
});
};
const goDoctor=(id,name)=>{
+425 -34
View File
@@ -9,8 +9,8 @@
@query="queryList"
>
<template #top>
<navBarSearch :searchWord="keyWord" :navName="navName"></navBarSearch>
<view class="databox" v-if="hospital_id || doctor_id">
<navBarSearch :searchWord="keyWord" :navName="navName" @changeWord="changeWord"></navBarSearch>
<view class="databox" v-if="hospital_id || doctor_id || (label_iden && !canOpenCase)">
<view class="cell">
<view class="num">{{ numInfo.article_collect_num }}</view>
<view class="name">文章</view>
@@ -24,13 +24,15 @@
<view class="name">阅读量</view>
</view>
</view>
<view class="detail" v-if="total>0 && !(hospital_id || doctor_id)">
<view class="desc" v-if="isArticle">检索到:<text class="red">{{total}}篇文章</text></view>
<view class="desc" v-else>检索到<text class="red">{{total}}个视频</text></view>
<view class="bar"></view>
<view class="detail" v-if="isSearch">
<view class="desc" >检索到<text class="red">{{searchInfo.search_article_num}}篇文章</text></view>
<view class="desc" >检索到<text class="red">{{searchInfo.search_video_num}}个视频</text></view>
<view class="desc" v-if="keyWord">检索词:<text class="red">{{ keyWord }}</text></view>
</view>
<view class="filterbox">
<view class="filterbox" :class="{active:canOpenCase}">
<view class="type" @click="swicthType">{{!isArticle?'文章':'视频'}}<up--image :src="switchImg" width="31rpx" height="31rpx"></up--image></view>
<view class="casesdown" @click="openCase" v-if="canOpenCase">筛选<up--image :src="caseImg" width="31rpx" height="31rpx"></up--image></view>
<up-dropdown class="u-dropdown" ref="uDropdownRef">
<up-dropdown-item
v-model="order.push_date"
@@ -72,6 +74,84 @@
</view>
</z-paging>
</view>
<up-popup
:round="10"
zIndex="9"
:show="showCase"
mode="bottom"
@close="closeCase"
>
<view class="votepop casepop">
<view class="titlebox">
<view class="left" @click="showCase = false">取消</view>
<view class="left continue" @click="continueCase" v-show="level != 3"
>继续选择</view
>
<view class="right" @click="confirmCase">确定</view>
</view>
<view class="casecon">
<view v-show="level == 1" >
<up-radio-group
v-model="caseValue1"
iconPlacement="right"
placement="column"
>
<view
class="column"
v-for="item in labelObj.list1"
:key="item.app_iden"
>
<up-radio
activeColor="#3CC7C0 "
:label="item.label_name"
:name="item.app_iden"
></up-radio>
</view>
</up-radio-group>
</view>
<view v-show="level == 2" >
<up-radio-group
v-model="caseValue2"
iconPlacement="right"
placement="column"
>
<view
class="column"
v-for="item in labelObj.list2"
:key="item.app_iden"
>
<up-radio
activeColor="#3CC7C0 "
:label="item.label_name"
:name="item.app_iden"
></up-radio>
</view>
</up-radio-group>
</view>
<view v-show="level == 3" >
<up-radio-group
v-model="caseValue3"
iconPlacement="right"
placement="column"
>
<view
class="column"
v-for="item in labelObj.list2"
:key="item.app_iden"
>
<up-radio
activeColor="#3CC7C0 "
:label="item.label_name"
:name="item.app_iden"
></up-radio>
</view>
</up-radio-group>
</view>
</view>
</view>
</up-popup>
</template>
<script setup>
@@ -82,19 +162,20 @@ import api from "@/api/api";
import { onLoad } from "@dcloudio/uni-app";
import dayjs from "dayjs";
import switchImg from "@/static/switch.png";
import caseImg from "@/static/caseIcon.png";
const paging = ref(null);
const uDropdownRef=ref(null);
const dataList = ref([]);
const total = ref(0);
const value = ref("");
const keyWord = ref("");
const page=ref(1);
const label_iden = ref("");
const isArticle=ref(true);
const hospital_id=ref('');
const hospital_name=ref('');
const doctor_id=ref('');
const doctor_name=ref('');
const numInfo=reactive({});
const searchInfo=reactive({})
const navName=ref('肝胆相照临床病例库')
const options= ref([
{
@@ -106,12 +187,96 @@ const options= ref([
value: 'desc',
},
]);
const isSearch=ref(false);
const order=reactive({
read_num:'',
push_date:''
})
const showCase = ref(false);
const canOpenCase = ref(false);
const caseValue1 = ref("");
const caseValue2 = ref("");
const caseValue3 = ref("");
const level = ref(1);
const labelObj = reactive({
list1: [],
list2: [],
list3: [],
});
const getCaseLabel = (lev,pid=0) => {
api.getCaseLabel({
pid:pid
}).then((res) => {
if (lev == 1) {
labelObj.list1 = res.data.data;
} else if (lev == 2) {
labelObj.list2 = res.data.data;
} else if (lev == 3) {
labelObj.list3 = res.data.data;
}
level.value = lev;
});
};
const openCase=()=>{
getCaseLabel(1,0)
showCase.value = true;
}
const confirmCase = () => {
if (level.value == 1 && caseValue1.value == "") {
uni.showToast({ title: "请选择疾病", icon: "none" });
return false;
}
if (level.value == 2 && caseValue2.value == "") {
uni.showToast({ title: "请选择疾病", icon: "none" });
return false;
}
if (level.value == 3 && caseValue3.value == "") {
uni.showToast({ title: "请选择疾病", icon: "none" });
return false;
}
showCase.value = false;
if(level.value == 1){
label_iden.value = caseValue1.value
}
if(level.value == 2 ){
label_iden.value = caseValue2.value
}
if(level.value == 3 ){
label_iden.value = caseValue3.value
}
};
const continueCase = () => {
if (level.value == 1 && caseValue1.value == "") {
uni.showToast({ title: "请选择疾病", icon: "none" });
return false;
}
if (level.value == 2 && caseValue2.value == "") {
uni.showToast({ title: "请选择疾病", icon: "none" });
return false;
}
if (level.value == 3 && caseValue3.value == "") {
uni.showToast({ title: "请选择疾病", icon: "none" });
return false;
}
if(level.value == 1 ){
getCaseLabel(2,caseValue1.value);
}else if(level.value == 2 ){
getCaseLabel(3,caseValue2.value);
}
paging.value.reload();
};
const closeCase = () => {
showCase.value = false;
};
const changeWord=(value)=>{
keyWord.value=value;
isSearch.value=true;
paging.value.reload()
}
onLoad((options) => {
if(options.keyWord){
keyWord.value = options.keyWord;
@@ -135,9 +300,16 @@ onLoad((options) => {
hospital_id.value=options.hospital_id;
hospital_name.value=options.hospital_name;
navName.value= hospital_name.value+'临床病例库'
getStaticDoctor(hospital_id.value)
getStaticHospital(hospital_id.value)
}
if(options.case_id){
label_iden.value=options.case_id;
navName.value= options.case_name+'临床病例库'
getStaticSick(label_iden.value)
}else{
canOpenCase.value = true;
}
});
const change=(e)=>{
paging.value.reload();
@@ -163,8 +335,11 @@ const swicthType=()=>{
const searchArticle =(params) => {
let searchForm={
keyword: keyWord.value,
doctor_id:doctor_id.value,
hospital_id:hospital_id.value
hospital_id:hospital_id.value,
doctor_id:doctor_id.value
}
if(isSearch.value){
searchForm.is_need_num=1;
}
if(!order.read_num){
delete order.read_num
@@ -181,6 +356,8 @@ const searchArticle =(params) => {
}).then((res)=>{
paging.value.complete(res.data.data.data);
total.value=res.data.data.total;
searchInfo.search_video_num=res.data.data.search_video_num;
searchInfo.search_article_num=res.data.data.search_article_num;
}).catch(err=>{
paging.value.complete(false);
})
@@ -189,6 +366,11 @@ const searchArticle =(params) => {
const searchVideo = async(params) => {
let searchForm={
keyword: keyWord.value,
hospital_id:hospital_id.value,
doctor_id:doctor_id.value
}
if(isSearch.value){
searchForm.is_need_num=1;
}
if(!order.read_num){
delete order.read_num
@@ -200,10 +382,13 @@ const searchVideo = async(params) => {
searchForm.order=order
}
api.searchVideo({
...searchForm,
...params
}).then((res)=>{
paging.value.complete(res.data.data.data);
total.value=res.data.data.total;
searchInfo.search_video_num=res.data.data.search_video_num;
searchInfo.search_article_num=res.data.data.search_article_num;
}).catch(err=>{
paging.value.complete(false);
})
@@ -224,6 +409,25 @@ const getStaticDoctor=(id)=>{
}
})
}
const getStaticSick=(id)=>{
api.getStaticSick({
label_iden:id
}).then((res)=>{
let result=res.data.data;
if(result){
Object.assign(numInfo,result);
}else{
Object.assign(numInfo,{
article_num: 0,
article_read_num: 0,
video_collect_num: 0,
video_num: 0,
video_read_num: 0,
});
}
})
}
const getStaticHospital=(id)=>{
api.getStaticHospital(id).then((res)=>{
let result=res.data.data;
@@ -253,6 +457,114 @@ const queryList = (pageNo, pageSize) => {
</script>
<style lang="scss" scoped>
.bar {
width: 100%;
background: #f9fafb;
height: 20rpx;
}
.votepop {
.confirm {
margin: 39rpx 30rpx 0;
height: 92rpx;
background: #3cc7c0;
border-radius: 15rpx;
display: flex;
align-items: center;
font-size: 31rpx;
color: #ffffff;
justify-content: center;
}
.del {
margin: 30rpx 30rpx 30rpx;
height: 92rpx;
background: #fff;
border-radius: 15rpx;
font-size: 31rpx;
color: #666666;
display: flex;
align-items: center;
justify-content: center;
}
.tips {
margin-top: 30rpx;
font-size: 27rpx;
color: #9ca3af;
line-height: 38rpx;
padding: 0 30rpx;
}
.add {
margin: 0 30rpx;
display: flex;
align-items: center;
height: 92rpx;
justify-content: center;
background: #f5f5f5;
border-radius: 15rpx;
font-size: 31rpx;
color: #4b5563;
.desc {
margin-left: 10rpx;
}
}
.titlebox {
padding: 0 30rpx;
height: 86rpx;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 2rpx solid #f3f4f6;
.left {
font-size: 31rpx;
color: #4b5563;
}
.right {
font-size: 31rpx;
color: #3cc7c0;
}
}
.votecon {
max-height: calc(100vh - 530rpx);
overflow-y: scroll;
.row {
display: flex;
align-items: center;
.iconbox {
margin-left: 15rpx;
align-items: center;
}
}
.titlebox {
border: none;
margin: 30rpx 0 20rpx;
.title {
font-size: 31rpx;
color: #111827;
}
.desc {
font-size: 27rpx;
color: #9ca3af;
}
}
}
}
.casepop{
display: flex;
flex-direction: column;
max-height: calc(100vh - 400rpx);
.continue{
color: #2878ff !important;
}
}
.casecon {
flex:1;
overflow-y: scroll;
padding-top: 10rpx;
min-height: 350rpx;
.column {
padding: 0 30rpx;
border-bottom: 2rpx solid #e5e7eb;
}
}
.databox {
height: 162rpx;
background: #ffffff;
@@ -278,37 +590,20 @@ 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;
}
:deep(.u-dropdown__menu){
background: #fff;
z-index:1;
margin-left: 180rpx;
margin-left: 160rpx;
}
:deep(.u-dropdown__menu__item__text){
font-size: 14px!important;
}
:deep(.u-dropdown__menu__item){
@@ -320,6 +615,102 @@ const queryList = (pageNo, pageSize) => {
margin-left: 60rpx;
}
display: flex;
height:128rpx;
align-items: center;
position: relative;
.type{
position: absolute;
left:30rpx;
top:24rpx;
color: #606266;
font-size:14px;
display: flex;
justify-content: center;
align-items: center;
background: #F3F4F6;
border-radius: 15rpx;
height: 74rpx;
padding:0 25rpx;
z-index:2;
}
.casesdown{
font-size:14px;
color: #606266;
position: absolute;
left:190rpx;
top:24rpx;
display: flex;
justify-content: center;
align-items: center;
background: #F3F4F6;
border-radius: 15rpx;
height: 74rpx;
padding:0 25rpx;
z-index:2;
}
}
.filterbox.active{
:deep(.u-flex) {
display: flex;
flex-direction:row;
overflow: hidden;
}
:deep(.u-dropdown__menu){
background: #fff;
z-index:1;
margin-left: 330rpx;
}
:deep(.u-dropdown__menu__item__text){
font-size: 14px!important;
}
:deep(.u-dropdown__menu__item){
height:74rpx;
padding:0 20rpx;
background: #F3F4F6;
border-radius: 15rpx;
flex:none;
margin-left: 20rpx;
}
display: flex;
height:128rpx;
align-items: center;
position: relative;
.type{
position: absolute;
left:30rpx;
top:24rpx;
color: #606266;
font-size: 14px;
display: flex;
justify-content: center;
align-items: center;
background: #F3F4F6;
border-radius: 15rpx;
height: 74rpx;
padding:0 25rpx;
z-index:2;
}
.casesdown{
font-size: 14px;
color: #606266;
position: absolute;
left:190rpx;
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 {
.deal {
margin-top: 20rpx;
display: flex;
+4 -273
View File
@@ -70,84 +70,6 @@
</view>
</z-paging>
</view>
<up-popup
:round="10"
zIndex="9"
:show="showCase"
mode="bottom"
@close="closeCase"
>
<view class="votepop casepop">
<view class="titlebox">
<view class="left" @click="showCase = false">取消</view>
<view class="left continue" @click="continueCase" v-show="level != 3"
>继续选择</view
>
<view class="right" @click="confirmCase">确定</view>
</view>
<view class="casecon">
<view v-show="level == 1" >
<up-radio-group
v-model="caseValue1"
iconPlacement="right"
placement="column"
>
<view
class="column"
v-for="item in labelObj.list1"
:key="item.app_iden"
>
<up-radio
activeColor="#3CC7C0 "
:label="item.label_name"
:name="item.app_iden"
></up-radio>
</view>
</up-radio-group>
</view>
<view v-show="level == 2" >
<up-radio-group
v-model="caseValue2"
iconPlacement="right"
placement="column"
>
<view
class="column"
v-for="item in labelObj.list2"
:key="item.app_iden"
>
<up-radio
activeColor="#3CC7C0 "
:label="item.label_name"
:name="item.app_iden"
></up-radio>
</view>
</up-radio-group>
</view>
<view v-show="level == 3" >
<up-radio-group
v-model="caseValue3"
iconPlacement="right"
placement="column"
>
<view
class="column"
v-for="item in labelObj.list2"
:key="item.app_iden"
>
<up-radio
activeColor="#3CC7C0 "
:label="item.label_name"
:name="item.app_iden"
></up-radio>
</view>
</up-radio-group>
</view>
</view>
</view>
</up-popup>
</template>
<script setup>
@@ -168,97 +90,6 @@ const keyWord = ref("");
const isArticle=ref(true)
const type=ref('doctor')
const navName=ref('医生临床病例库');
const showCase = ref(false);
const caseValue1 = ref("");
const caseValue2 = ref("");
const caseValue3 = ref("");
const level = ref(1);
const labelObj = reactive({
list1: [],
list2: [],
list3: [],
});
const getCaseLabel = (lev,pid=0) => {
api.getCaseLabel({
pid:pid
}).then((res) => {
if (lev == 1) {
labelObj.list1 = res.data.data;
} else if (lev == 2) {
labelObj.list2 = res.data.data;
} else if (lev == 3) {
labelObj.list3 = res.data.data;
}
level.value = lev;
});
};
const confirmCase = () => {
if (level.value == 1 && caseValue1.value == "") {
uni.showToast({ title: "请选择疾病", icon: "none" });
return false;
}
if (level.value == 2 && caseValue2.value == "") {
uni.showToast({ title: "请选择疾病", icon: "none" });
return false;
}
if (level.value == 3 && caseValue3.value == "") {
uni.showToast({ title: "请选择疾病", icon: "none" });
return false;
}
showCase.value = false;
if(level.value == 1){
let label = labelObj.list1.find((item) => item.app_iden == caseValue1.value);
console.log(label);
labelList.value.push({
app_iden:label.app_iden,
label_name:label.label_name,
});
}
if(level.value == 2 ){
let label = labelObj.list2.find((item) => item.app_iden == caseValue2.value);
labelList.value.push({
app_iden:label.app_iden,
label_name:label.label_name,
});
}
if(level.value == 3 ){
let label = labelObj.list3.find((item) => item.app_iden == caseValue3.value);
labelList.value.push({
app_iden:label.app_iden,
label_name:label.label_name,
});
}
//去重
labelList.value=labelList.value.filter((item, index) => labelList.value.findIndex(i => i.app_iden === item.app_iden) === index);
caseValue1.value = "";
caseValue2.value = "";
caseValue3.value = "";
};
const continueCase = () => {
if (level.value == 1 && caseValue1.value == "") {
uni.showToast({ title: "请选择疾病", icon: "none" });
return false;
}
if (level.value == 2 && caseValue2.value == "") {
uni.showToast({ title: "请选择疾病", icon: "none" });
return false;
}
if (level.value == 3 && caseValue3.value == "") {
uni.showToast({ title: "请选择疾病", icon: "none" });
return false;
}
if(level.value == 1 ){
getCaseLabel(2,caseValue1.value);
}else if(level.value == 2 ){
getCaseLabel(3,caseValue2.value);
}
};
const closeCase = () => {
showCase.value = false;
};
const options= ref([
{
label: "正序",
@@ -437,110 +268,7 @@ const changeWord=(value)=>{
</script>
<style lang="scss" scoped>
.votepop {
.confirm {
margin: 39rpx 30rpx 0;
height: 92rpx;
background: #3cc7c0;
border-radius: 15rpx;
display: flex;
align-items: center;
font-size: 31rpx;
color: #ffffff;
justify-content: center;
}
.del {
margin: 30rpx 30rpx 30rpx;
height: 92rpx;
background: #fff;
border-radius: 15rpx;
font-size: 31rpx;
color: #666666;
display: flex;
align-items: center;
justify-content: center;
}
.tips {
margin-top: 30rpx;
font-size: 27rpx;
color: #9ca3af;
line-height: 38rpx;
padding: 0 30rpx;
}
.add {
margin: 0 30rpx;
display: flex;
align-items: center;
height: 92rpx;
justify-content: center;
background: #f5f5f5;
border-radius: 15rpx;
font-size: 31rpx;
color: #4b5563;
.desc {
margin-left: 10rpx;
}
}
.titlebox {
padding: 0 30rpx;
height: 86rpx;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 2rpx solid #f3f4f6;
.left {
font-size: 31rpx;
color: #4b5563;
}
.right {
font-size: 31rpx;
color: #3cc7c0;
}
}
.votecon {
max-height: calc(100vh - 530rpx);
overflow-y: scroll;
.row {
display: flex;
align-items: center;
.iconbox {
margin-left: 15rpx;
align-items: center;
}
}
.titlebox {
border: none;
margin: 30rpx 0 20rpx;
.title {
font-size: 31rpx;
color: #111827;
}
.desc {
font-size: 27rpx;
color: #9ca3af;
}
}
}
}
.casepop{
display: flex;
flex-direction: column;
max-height: calc(100vh - 400rpx);
.continue{
color: #2878ff !important;
}
}
.casecon {
flex:1;
overflow-y: scroll;
padding-top: 10rpx;
min-height: 350rpx;
.column {
padding: 0 30rpx;
border-bottom: 2rpx solid #e5e7eb;
}
}
.databox {
height: 162rpx;
background: #ffffff;
@@ -576,6 +304,9 @@ const changeWord=(value)=>{
border-bottom: 2rpx solid rgba(0,0,0,0.08);
align-items: center;
position: relative;
:deep(.u-dropdown__menu__item__text){
font-size: 14px!important;
}
.type{
position: absolute;
left:30rpx;
+455
View File
@@ -0,0 +1,455 @@
<template>
<view class="u-page">
<z-paging
ref="paging"
inside-more
loading-more-no-more-text="咱也是有底线的"
:auto-show-back-to-top="true"
v-model="dataList"
@query="queryList"
>
<template #top>
<navBarSearch :searchWord="keyWord" :navName="navName" :type="'case'" @changeWord="changeWord"></navBarSearch>
<!-- <view class="databox">
<view class="cell">
<view class="num">22</view>
<view class="name">文章</view>
</view>
<view class="cell">
<view class="num">11</view>
<view class="name">视频</view>
</view>
<view class="cell">
<view class="num">44</view>
<view class="name">阅读量</view>
</view>
</view> -->
<!-- <view class="detail" v-if="total>0">
<view class="desc" v-if="isArticle">检索到:<text class="red">{{total}}篇文章</text></view>
<view class="desc" v-else>检索到<text class="red">{{total}}个视频</text></view>
<view class="desc" v-if="keyWord">检索词:<text class="red">{{ keyWord }}</text></view>
</view> -->
<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"
:options="options"
></up-dropdown-item>
<up-dropdown-item
v-model="order.article_num"
title="文章数量"
@change="change"
:options="options"
></up-dropdown-item>
<!-- <up-dropdown-item
v-model="order.article_num"
title="阅读量"
@change="change"
:options="options"
></up-dropdown-item> -->
</up-dropdown>
</view>
</template>
<view class="listbox">
<view class="item" v-for="(item, index) in dataList" :key="index" @click="goDetail(item.label_iden,item.label_name)">
<view class="title ellipsis">{{item.label_name}}</view>
<!-- <view class="tagsbox">
<view class="tag" v-for="tag in item.author" :key="tag.author_id">{{ tag.doctor_name }}</view>
</view> -->
<view class="deal">
<view class="left">
<view class="count">
病例数{{ item.video_num+item.article_num}}<up--image :src="arrowrightImg" width="32rpx" height="32rpx"></up--image></view>
</view>
<view class="time">
<!-- <up-icon name="clock" color="#6B7280" size="28rpx"></up-icon> -->
<view class="num">更新时间{{formatdate(item.last_push_date) }}</view>
</view>
</view>
</view>
</view>
</z-paging>
</view>
</template>
<script setup>
import { ref, reactive} from "vue";
import navBarSearch from "@/components/navBarSearch/navBarSearch.vue";
import list from "@/uni_modules/z-paging/components/z-paging/z-paging";
import api from "@/api/api";
import { onLoad } from "@dcloudio/uni-app";
import dayjs from "dayjs";
import switchImg from "@/static/switch.png";
import arrowrightImg from "@/static/arrowright.png";
const paging = ref(null);
const uDropdownRef=ref(null);
const dataList = ref([]);
const total = ref(0);
const value = ref("");
const keyWord = ref("");
const isArticle=ref(true)
const type=ref('doctor')
const navName=ref('疾病临床病例库');
const options= ref([
{
label: "正序",
value: 'asc',
},
{
label: "倒序",
value: 'desc',
},
]);
const order=reactive({
article_num:'',
push_date:''
})
onLoad((options) => {
if(options.type=='hospital'){
type.value ='hospital';
}
keyWord.value=options.name;
if(options.name){
navName.value=options.name+'临床病例库'
}
if((options.name='医生' || options.name=='医院') && !options.id){
keyWord.value='';
}
if(options.order=='new'){
order.push_date='asc'
};
if(options.order=='read'){
order.article_num='desc'
};
});
const change=(e)=>{
paging.value.reload();
}
const formatdate=(date)=>{
return dayjs(date).format('YYYY-MM-DD')
}
const searchList = async(params) => {
let searchForm={
label_name: keyWord.value,
}
if(!order.article_num){
delete order.article_num
}
if(!order.push_date){
delete order.push_date
}
if(order.article_num || order.push_date){
searchForm.order=order
}
api.getSearchLabel({
...searchForm,
...params
}).then((res)=>{
paging.value.complete(res.data.data.data);
total.value=res.data.data.total;
}).catch(err=>{
paging.value.complete(false);
})
}
const queryList = (pageNo, pageSize) => {
const params = {
page: pageNo,
page_size: pageSize,
};
searchList(params);
};
const goDetail=(id,name)=>{
let url=`/pages/search/search?case_id=${id}&case_name=${name}`
uni.navigateTo({
url:url,
});
}
/**
* 修改关键词并更新界面
*
* @param value 输入的关键词
*/
const changeWord=(value)=>{
console.log(value);
if(value){
navName.value=value+'临床病例库';
keyWord.value=value;
dataList.value=[];
order.article_num='';
order.push_date='';
paging.value.reload();
}
}
</script>
<style lang="scss" scoped>
.votepop {
.confirm {
margin: 39rpx 30rpx 0;
height: 92rpx;
background: #3cc7c0;
border-radius: 15rpx;
display: flex;
align-items: center;
font-size: 31rpx;
color: #ffffff;
justify-content: center;
}
.del {
margin: 30rpx 30rpx 30rpx;
height: 92rpx;
background: #fff;
border-radius: 15rpx;
font-size: 31rpx;
color: #666666;
display: flex;
align-items: center;
justify-content: center;
}
.tips {
margin-top: 30rpx;
font-size: 27rpx;
color: #9ca3af;
line-height: 38rpx;
padding: 0 30rpx;
}
.add {
margin: 0 30rpx;
display: flex;
align-items: center;
height: 92rpx;
justify-content: center;
background: #f5f5f5;
border-radius: 15rpx;
font-size: 31rpx;
color: #4b5563;
.desc {
margin-left: 10rpx;
}
}
.titlebox {
padding: 0 30rpx;
height: 86rpx;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 2rpx solid #f3f4f6;
.left {
font-size: 31rpx;
color: #4b5563;
}
.right {
font-size: 31rpx;
color: #3cc7c0;
}
}
.votecon {
max-height: calc(100vh - 530rpx);
overflow-y: scroll;
.row {
display: flex;
align-items: center;
.iconbox {
margin-left: 15rpx;
align-items: center;
}
}
.titlebox {
border: none;
margin: 30rpx 0 20rpx;
.title {
font-size: 31rpx;
color: #111827;
}
.desc {
font-size: 27rpx;
color: #9ca3af;
}
}
}
}
.casepop{
display: flex;
flex-direction: column;
max-height: calc(100vh - 400rpx);
.continue{
color: #2878ff !important;
}
}
.casecon {
flex:1;
overflow-y: scroll;
padding-top: 10rpx;
min-height: 350rpx;
.column {
padding: 0 30rpx;
border-bottom: 2rpx solid #e5e7eb;
}
}
.databox {
height: 162rpx;
background: #ffffff;
display: flex;
margin-bottom: 20rpx;
// padding: 0 30rpx;
justify-content: space-between;
.cell {
flex: 1;
padding: 35rpx 0;
text-align: center;
.num {
font-size: 38rpx;
color: #3cc7c0;
}
.name {
margin-top: 18rpx;
font-size: 28rpx;
color: #4b5563;
}
}
}
.listbox{
background: #F8F9FA;
overflow: hidden;
}
.filterbox{
display: flex;
height:128rpx;
background:#fff;
border-bottom: 2rpx solid rgba(0,0,0,0.08);
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(.z-paging-content-fixed){
background: #F8F9FA!important;
}
:deep(.u-flex) {
display: flex;
flex-direction:row;
overflow: hidden;
}
:deep(.u-image){
background: none!important;
}
:deep(.u-dropdown__menu){
background: #fff;
z-index:1;
margin-left:30rpx;
}
:deep(.u-dropdown__menu__item){
height:74rpx;
padding:0 20rpx;
background: #F3F4F6;
border-radius: 15rpx;
flex:none;
margin-left: 30rpx;
}
.deal {
margin-top: 20rpx;
display: flex;
color: #6b7280;
background:#fff;
font-size: 24rpx;
justify-content: space-between;
.left {
display: flex;
align-items: center;
font-size: 27rpx;
.count{
display: flex;
align-items: center;
}
}
.collect {
display: flex;
align-items: center;
}
.eyebox {
width: 160rpx;
display: flex;
align-items: center;
}
.time {
display: flex;
align-items: center;
}
.num {
margin-left: 8rpx;
}
}
.item {
margin:30rpx;
background: #fff;
padding:30rpx;
box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.08);
border-radius: 23rpx;
.title {
font-size: 30rpx;
color: #111827;
line-height: 46rpx;
}
}
.tagsbox {
margin-top: 20rpx;
display: flex;
.tag {
padding: 0 10rpx;
margin-right: 16rpx;
height: 46rpx;
line-height: 46rpx;
text-align: center;
background: rgba(60, 199, 192, 0.1);
border-radius: 8rpx;
font-weight: 400;
font-size: 24rpx;
color: #3cc7c0;
}
}
}
.detail {
background: #f9f9f9;
padding: 12rpx 30rpx;
.desc {
font-size: 26rpx;
color: #4b5563;
line-height: 40rpx;
}
.red{
color: #FF0000;
}
}
</style>
+92 -10
View File
@@ -22,6 +22,25 @@
>检索词<text class="red">{{ keyWord }}</text></view
>
</view>
<view class="bar"></view>
<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"
:options="options"
></up-dropdown-item>
<up-dropdown-item
v-model="order.read_num"
title="阅读量"
@change="change"
:options="options"
></up-dropdown-item>
</up-dropdown>
</view>
</template>
<view class="box">
<!-- <view class="bar"></view> -->
@@ -131,7 +150,7 @@
</template>
<script setup>
import { ref } from "vue";
import { ref,reactive} from "vue";
import navBar from "@/components/navBar/navBar.vue";
import tabBar from "@/components/tabBar/tabBar.vue";
import headImg from "@/static/headImg.png";
@@ -146,6 +165,21 @@ const dataList = ref([]);
const total = ref(0);
const keyWord = ref("");
const showNum = ref(false);
const options= ref([
{
label: "正序",
value: 'asc',
},
{
label: "倒序",
value: 'desc',
},
]);
const order=reactive({
read_num:'',
push_date:''
})
const formatdate = (date) => {
return dayjs(date).format("YYYY-MM-DD");
};
@@ -191,15 +225,15 @@ const searchList = async (params) => {
user_id: user_id.value,
is_selected: Number(is_selected.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(!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.searchExchage({
...searchForm,
...params,
@@ -215,6 +249,31 @@ const searchList = async (params) => {
</script>
<style lang='scss' scoped>
.filterbox{
display: flex;
height:128rpx;
align-items: center;
position: relative;
border-bottom: 2rpx solid #f3f4f6;
:deep(.u-dropdown__menu__item__text){
font-size: 14px!important;
}
.type{
color: #606266;
font-size:14px;
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;
}
}
.detail {
background: #f9f9f9;
padding: 12rpx 30rpx;
@@ -231,6 +290,29 @@ const searchList = async (params) => {
display: flex;
flex-direction: column;
height: calc(100vh - 100rpx);
:deep(.u-flex) {
display: flex;
flex-direction:row;
overflow: hidden;
}
:deep(.u-dropdown__menu){
background: #fff;
z-index:1;
margin-left: 0rpx;
}
:deep(.u-dropdown__menu__item){
height:74rpx;
padding:0 20rpx;
background: #F3F4F6;
border-radius: 15rpx;
flex:none;
margin-left: 30rpx;
}
}
.box {
+391
View File
@@ -0,0 +1,391 @@
<template>
<view class="u-page">
<z-paging
ref="paging"
inside-more
loading-more-no-more-text="咱也是有底线的"
:auto-show-back-to-top="true"
v-model="dataList"
@query="queryList"
>
<template #top>
<navBarSearch :searchWord="keyWord" :navName="navName" @changeWord="changeWord" :type="'video'"></navBarSearch>
<view class="databox" >
<view class="cell" v-if="isArticle">
<view class="num">{{ numInfo.article_collect_num }}</view>
<view class="name">文章</view>
</view>
<view class="cell" v-else>
<view class="num">{{ numInfo.video_collect_num }}</view>
<view class="name">视频</view>
</view>
<view class="cell" v-if="isArticle">
<view class="num">{{numInfo.article_read_num }}</view>
<view class="name">阅读量</view>
</view>
<view class="cell" v-else>
<view class="num">{{numInfo.video_read_num}}</view>
<view class="name">阅读量</view>
</view>
</view>
<view class="bar"></view>
<!-- <view class="detail" v-if="isSearch">
<view class="desc" v-if="isArticle">检索到:<text class="red">{{searchInfo.search_article_num}}篇文章</text></view>
<view class="desc" v-else>检索到<text class="red">{{searchInfo.search_video_num}}个视频</text></view>
<view class="desc" v-if="keyWord">检索词:<text class="red">{{ keyWord }}</text></view>
</view> -->
<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"
:options="options"
></up-dropdown-item>
<up-dropdown-item
v-model="order.read_num"
title="阅读量"
@change="change"
:options="options"
></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="tagsbox">
<view class="tag" v-for="tag in item.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>
<view class="collect">
<up-icon name="heart" color="#6B7280" size="28rpx"></up-icon>
<view class="num">{{item.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>
</view>
</view>
</z-paging>
</view>
</template>
<script setup>
import { ref, reactive } from "vue";
import navBarSearch from "@/components/navBarSearch/navBarSearch.vue";
import list from "@/uni_modules/z-paging/components/z-paging/z-paging";
import api from "@/api/api";
import { onLoad } from "@dcloudio/uni-app";
import dayjs from "dayjs";
import switchImg from "@/static/switch.png";
const paging = ref(null);
const uDropdownRef=ref(null);
const dataList = ref([]);
const total = ref(0);
const keyWord = ref("");
const isArticle=ref(false);
const hospital_id=ref('');
const hospital_name=ref('');
const doctor_id=ref('');
const doctor_name=ref('');
const numInfo=reactive({});
const searchInfo=reactive({})
const navName=ref('视频临床病例库')
const options= ref([
{
label: "正序",
value: 'asc',
},
{
label: "倒序",
value: 'desc',
},
]);
const isSearch=ref(false);
const order=reactive({
read_num:'',
push_date:''
})
const changeWord=(value)=>{
keyWord.value=value;
isSearch.value=true;
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;
}
getStatic();
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)=>{
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}`
})
}
const getStatic=()=>{
api.getHomeStatics().then((res) => {
let result=res.data.data;
Object.assign(numInfo,result);
})
}
const searchArticle =(params) => {
let searchForm={
keyword: keyWord.value,
hospital_id:hospital_id.value,
doctor_id:doctor_id.value
}
if(isSearch.value){
searchForm.is_need_num=1;
}
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({
...searchForm,
...params
}).then((res)=>{
paging.value.complete(res.data.data.data);
total.value=res.data.data.total;
searchInfo.search_video_num=res.data.data.search_video_num;
searchInfo.search_article_num=res.data.data.search_article_num;
}).catch(err=>{
paging.value.complete(false);
})
}
const searchVideo = async(params) => {
let searchForm={
keyword: keyWord.value,
hospital_id:hospital_id.value,
doctor_id:doctor_id.value
}
if(isSearch.value){
searchForm.is_need_num=1;
}
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;
searchInfo.search_video_num=res.data.data.search_video_num;
searchInfo.search_article_num=res.data.data.search_article_num;
}).catch(err=>{
paging.value.complete(false);
})
}
const queryList = (pageNo, pageSize) => {
console.log(666666);
const params = {
page: pageNo,
page_size: pageSize,
};
isArticle.value?searchArticle(params):searchVideo(params)
};
</script>
<style lang="scss" scoped>
.bar {
width: 100%;
background: #f9fafb;
height: 20rpx;
}
.databox {
height: 162rpx;
background: #ffffff;
display: flex;
margin-bottom: 20rpx;
// padding: 0 30rpx;
justify-content: space-between;
.cell {
flex: 1;
padding: 35rpx 0;
text-align: center;
.num {
font-size: 38rpx;
color: #3cc7c0;
}
.name {
margin-top: 18rpx;
font-size: 28rpx;
color: #4b5563;
}
}
}
.filterbox{
display: flex;
height:128rpx;
align-items: center;
position: relative;
border-bottom: 2rpx solid #f3f4f6;
:deep(.u-dropdown__menu__item__text){
font-size: 14px!important;
}
.type{
color: #606266;
font-size:14px;
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) {
display: flex;
flex-direction:row;
overflow: hidden;
}
:deep(.u-dropdown__menu){
background: #fff;
z-index:1;
margin-left: 30rpx;
}
:deep(.u-dropdown__menu__item){
height:74rpx;
padding:0 20rpx;
background: #F3F4F6;
border-radius: 15rpx;
flex:none;
margin-left: 30rpx;
}
.deal {
margin-top: 20rpx;
display: flex;
color: #6b7280;
font-size: 24rpx;
justify-content: space-between;
.left {
display: flex;
align-items: center;
}
.collect {
display: flex;
align-items: center;
}
.eyebox {
width: 160rpx;
display: flex;
align-items: center;
}
.time {
display: flex;
align-items: center;
}
.num {
margin-left: 8rpx;
}
}
.item {
border-bottom: 1rpx solid #f3f4f6;
padding: 30rpx;
.title {
font-size: 30rpx;
color: #111827;
line-height: 46rpx;
}
}
.tagsbox {
margin-top: 20rpx;
display: flex;
.tag {
padding: 0 10rpx;
margin-right: 16rpx;
height: 46rpx;
line-height: 46rpx;
text-align: center;
background: rgba(60, 199, 192, 0.1);
border-radius: 8rpx;
font-weight: 400;
font-size: 24rpx;
color: #3cc7c0;
}
}
}
.detail {
background: #f9f9f9;
padding: 12rpx 30rpx;
.desc {
font-size: 26rpx;
color: #4b5563;
line-height: 40rpx;
}
.red{
color: #FF0000;
}
}
</style>