111
This commit is contained in:
parent
b869716006
commit
1ee5968dfe
47
api/api.js
47
api/api.js
@ -3,7 +3,7 @@ const loadingTime = 500;
|
||||
const showLog = false;
|
||||
const api = {
|
||||
wxLogin(data) {
|
||||
return request('/login/wechat_mobile_login', data, 'post', true);
|
||||
return request('/login/wechat/mobile', data, 'post', true);
|
||||
},
|
||||
mobileLogin(data) {
|
||||
return request('/login/mobile_login', data, 'post', true);
|
||||
@ -13,17 +13,48 @@ const api = {
|
||||
},
|
||||
|
||||
getHomeData(data) { //首页数据
|
||||
return request('/index', data, 'get', true);
|
||||
return request('/index/clinical', data, 'get', true);
|
||||
},
|
||||
getClassify(id) { //获取分类详情
|
||||
return request('/class/' + id, {}, 'get', true);
|
||||
getHomeStatics(data) { //首页统计数据
|
||||
return request('/clinical/stats', data, 'get', true);
|
||||
},
|
||||
getClassifyList() { //获取分类详情
|
||||
return request('/class/list', {}, 'get', false);
|
||||
getArticleDetail(id) { //获取详情
|
||||
return request('/clinical/article/'+id,{}, 'get', true);
|
||||
},
|
||||
getQuestionPage(data) { //获取问题列表-分页
|
||||
return request('/question/page', data, 'post', true, 'application/json');
|
||||
getVideoDetail(id) { //获取详情
|
||||
return request('/clinical/video/'+id,{}, 'get', true);
|
||||
},
|
||||
collectArticle(id){
|
||||
return request('/api/clinical/article/collect/'+id, {}, 'post',false);
|
||||
},
|
||||
cancelCollectArticle(id){
|
||||
return request('/api/clinical/article/collect/'+id, {}, 'delete',false);
|
||||
},
|
||||
collectVideo(id){
|
||||
return request('/api/clinical/video/collect/'+id, {}, 'post',false);
|
||||
},
|
||||
cancelCollectVideo(id){
|
||||
return request('/api/clinical/video/collect/'+id,{}, 'delete',false);
|
||||
},
|
||||
searchArticle(data){
|
||||
return request('/clinical/article/search', data, 'post',true,'application/json');
|
||||
},
|
||||
searchVideo(data){
|
||||
return request('/clinical/video/search', data, 'post',true,'application/json');
|
||||
},
|
||||
searchDoctor(data){
|
||||
return request('/clinical/doctor/search', data, 'post',true,'application/json');
|
||||
},
|
||||
searchHospital(data){
|
||||
return request('/clinical/hospital/search', data, 'post',true,'application/json');
|
||||
},
|
||||
getStaticDoctor(id){
|
||||
return request('/clinical/stats/doctor/'+id, data={}, 'post',false);
|
||||
},
|
||||
getStaticHospital(id){
|
||||
return request('/clinical/stats/hospital/'+id, data={}, 'post',false);
|
||||
},
|
||||
|
||||
queryList(data) {
|
||||
const listCount = 24;
|
||||
return _queryList(data, listCount);
|
||||
|
||||
93
components/backNav/backNav.vue
Normal file
93
components/backNav/backNav.vue
Normal file
@ -0,0 +1,93 @@
|
||||
<template>
|
||||
<view class="navbox">
|
||||
<view class="bg"></view>
|
||||
<view class="namebox">
|
||||
<view class="back" @click="goBack">
|
||||
<u-icon name="arrow-left" color="#000" size="24"></u-icon>
|
||||
</view>
|
||||
<!-- <view class="logo">logo</view> -->
|
||||
<view class="name">{{ navName }}</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
const props = defineProps({
|
||||
navName: {
|
||||
type: String,
|
||||
default: "我的",
|
||||
}
|
||||
|
||||
});
|
||||
const goBack = () => {
|
||||
uni.navigateBack({
|
||||
delta: 1,
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.navbox {
|
||||
padding-bottom: 20rpx;
|
||||
background-color: #f9fafb;
|
||||
position: relative;
|
||||
height:200rpx;
|
||||
background: radial-gradient(
|
||||
60% 90% at 4% 2%,
|
||||
#43c9c3 0%,
|
||||
rgba(255, 255, 255, 0) 100%
|
||||
);
|
||||
}
|
||||
.bg {
|
||||
z-index: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
background: radial-gradient(
|
||||
43% 90% at 84% 6%,
|
||||
#ffd6c9 0%,
|
||||
rgba(255, 255, 255, 0) 100%
|
||||
);
|
||||
}
|
||||
.namebox {
|
||||
padding-top: 102rpx;
|
||||
justify-content: center;
|
||||
margin: 0rpx 30rpx 0rpx;
|
||||
position: relative;
|
||||
display: flex;
|
||||
.back{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
}
|
||||
.name {
|
||||
margin-left: 16rpx;
|
||||
font-size: 30rpx;
|
||||
color: #111827;
|
||||
}
|
||||
}
|
||||
.search {
|
||||
margin: 40rpx 30rpx 0rpx;
|
||||
display: flex;
|
||||
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.searchwrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
padding-left: 28rpx;
|
||||
margin-right: 23rpx;
|
||||
height: 80rpx;
|
||||
background: #fbfbfb;
|
||||
box-shadow: 0px 4rpx 10rpx 0px rgba(153, 153, 153, 0.5);
|
||||
border-radius: 40rpx;
|
||||
|
||||
.ipt {
|
||||
margin-left: 15rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -3,7 +3,8 @@
|
||||
<view class="bg"></view>
|
||||
<view class="namebox">
|
||||
<view class="logo">logo</view>
|
||||
<view class="name">肝胆相照临床病例库</view>
|
||||
<view class="name">{{ navName }}</view>
|
||||
|
||||
</view>
|
||||
<view class="search">
|
||||
<view class="searchwrap">
|
||||
@ -15,8 +16,8 @@
|
||||
width="30rpx"
|
||||
height="30rpx"
|
||||
></up--image> -->
|
||||
<input type="text" class="ipt" />
|
||||
<up-icon name="search" size="26" color="#999"></up-icon>
|
||||
<input type="text" class="ipt" v-model="keyWord" :placeholder="placeholder"/>
|
||||
<up-icon name="search" size="26" color="#999" @click="search"></up-icon>
|
||||
</view>
|
||||
<up--image
|
||||
:src="headImg"
|
||||
@ -30,8 +31,49 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch} from "vue";
|
||||
import headImg from "@/static/headImg.png";
|
||||
import ssImg from "@/static/ss.png";
|
||||
const keyWord = ref('');
|
||||
const props=defineProps({
|
||||
searchWord:{
|
||||
type:String,
|
||||
default:''
|
||||
},
|
||||
type:{
|
||||
type:String,
|
||||
default:'',
|
||||
},
|
||||
navName:{
|
||||
type:String,
|
||||
default:'肝胆相照临床病例库',
|
||||
}
|
||||
|
||||
})
|
||||
const placeholder = ref("输入疾病名称、标题、作者搜索");
|
||||
watch(()=>props.type,(newVal)=>{
|
||||
if(newVal==='doctor'){
|
||||
placeholder.value='输入医生姓名'
|
||||
}else if(newVal==='hospital'){
|
||||
placeholder.value='输入医院名称'
|
||||
}
|
||||
|
||||
},{immediate: true })
|
||||
watch(()=>props.searchWord,(newVal)=>{
|
||||
keyWord.value=newVal
|
||||
})
|
||||
const search=()=>{
|
||||
// if (!keyWord.value) {
|
||||
// return uni.showToast({
|
||||
// title: "请输入关键字",
|
||||
// icon:'none'
|
||||
// });
|
||||
// }
|
||||
|
||||
uni.navigateTo({
|
||||
url: `/pages/search/search?keyWord=${keyWord.value}`,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@ -55,10 +55,19 @@
|
||||
"quickapp" : {},
|
||||
/* 小程序特有相关 */
|
||||
"mp-weixin" : {
|
||||
"appid" : "",
|
||||
"appid" : "wx152ad667d5075f27",
|
||||
"setting" : {
|
||||
"urlCheck" : false
|
||||
"urlCheck" : false,
|
||||
"minified" : true,
|
||||
"postcss" : true
|
||||
},
|
||||
// "plugins": {
|
||||
// "polyv-player": {
|
||||
// "version": "1.9.0",
|
||||
// "provider": "wx4a350a258a6f7876"
|
||||
// }
|
||||
// },
|
||||
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-alipay" : {
|
||||
|
||||
@ -10,6 +10,7 @@
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"dayjs": "^1.11.13",
|
||||
"uview-plus": "^3.4.4"
|
||||
}
|
||||
}
|
||||
|
||||
20
pages.json
20
pages.json
@ -12,6 +12,12 @@
|
||||
"pages": [
|
||||
//pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
||||
{
|
||||
"path": "pages/my/my",
|
||||
"style": {
|
||||
"navigationBarTitleText": "uni-app",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},{
|
||||
"path": "pages/index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "uni-app",
|
||||
@ -22,7 +28,11 @@
|
||||
"path": "pages/detail/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "详情",
|
||||
"navigationStyle": "custom"
|
||||
"navigationStyle": "custom",
|
||||
"usingComponents": {
|
||||
//"polyv-player": "plugin://polyv-player/player"
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -32,7 +42,13 @@
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "pages/searchList/searchList",
|
||||
"style": {
|
||||
"navigationBarTitleText": "uni-app",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/login/login",
|
||||
"style": {
|
||||
|
||||
@ -9,23 +9,38 @@
|
||||
>
|
||||
<template #top>
|
||||
<dNav></dNav>
|
||||
<view class="box" >
|
||||
<view class="title">肝胆相照临床病例库肝胆相照临床病例库肝胆相照临床病例库</view>
|
||||
<view class="box">
|
||||
<view class="title" v-if="type == 'video'">{{ info.video_title }}</view>
|
||||
<view class="title" v-else>{{ info.article_title }}</view>
|
||||
<view class="content">
|
||||
<view class="info">
|
||||
<up--image :src="headImg" mode="widthFix" class="headImg" width="46rpx" height="46rpx"
|
||||
radius="50%"></up--image>
|
||||
<view class="name">陈医生 · 北京某三甲医院</view>
|
||||
<up--image
|
||||
:src="headImg"
|
||||
mode="widthFix"
|
||||
class="headImg"
|
||||
width="46rpx"
|
||||
height="46rpx"
|
||||
radius="50%"
|
||||
></up--image>
|
||||
<view class="name"
|
||||
v-if="info.author"
|
||||
>{{ info.author.doctor_name }} ·
|
||||
{{ info.author.hospital_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">1</view>
|
||||
<view class="num">{{ info.read_num }}</view>
|
||||
</view>
|
||||
<view class="collect">
|
||||
<up-icon name="heart" color="#6B7280" size="28rpx"></up-icon>
|
||||
<view class="num">1</view>
|
||||
<up-icon
|
||||
name="heart"
|
||||
:color="info.is_collect ? 'red' : '#6B7280'"
|
||||
size="28rpx"
|
||||
></up-icon>
|
||||
<view class="num">{{ info.collect_num }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="time">
|
||||
@ -35,25 +50,59 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="bar"></view>
|
||||
|
||||
|
||||
<view class="detail">
|
||||
<polyv-player
|
||||
id="{{'playerContext'+info.video_no}}"
|
||||
playerId="{{'playerId'+info.video_no}}}"
|
||||
vid="{{info.video_no}}"
|
||||
autoplay="{{false}}"
|
||||
>
|
||||
</polyv-player>
|
||||
</view>
|
||||
<!-- 评论框 -->
|
||||
<up-popup :zIndex="11" :overlayStyle="{ zIndex: 10 }" :closeOnClickOverlay="false" :show="showCommentDialog" :round="10" closeable mode="bottom" @close="close" @open="open">
|
||||
<up-popup
|
||||
:zIndex="11"
|
||||
:overlayStyle="{ zIndex: 10 }"
|
||||
:closeOnClickOverlay="false"
|
||||
:show="showCommentDialog"
|
||||
:round="10"
|
||||
closeable
|
||||
mode="bottom"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<view class="poptitle"></view>
|
||||
<view class="wraper">
|
||||
<up--textarea height="200" v-model="comment" placeholder="请输入评论内容"></up--textarea>
|
||||
<up--textarea
|
||||
height="200"
|
||||
v-model="comment"
|
||||
placeholder="请输入评论内容"
|
||||
></up--textarea>
|
||||
</view>
|
||||
<view class="imgbox">
|
||||
<view class="imgunit">
|
||||
<up--image :src="shangImg" radius="6" width="150rpx" height="150rpx" @click="previewImg"></up--image>
|
||||
<up--image
|
||||
:src="shangImg"
|
||||
radius="6"
|
||||
width="150rpx"
|
||||
height="150rpx"
|
||||
@click="previewImg"
|
||||
></up--image>
|
||||
<view class="close">
|
||||
<up-icon name="close-circle" color="#666" size="16" ></up-icon>
|
||||
<up-icon name="close-circle" color="#666" size="16"></up-icon>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="sendbox">
|
||||
<view class="left"><up--image :src="uploadImg" mode="widthFix" width="40rpx" height="77rpx" @click="chooseImg"></up--image></view>
|
||||
<view class="left"
|
||||
><up--image
|
||||
:src="uploadImg"
|
||||
mode="widthFix"
|
||||
width="40rpx"
|
||||
height="77rpx"
|
||||
@click="chooseImg"
|
||||
></up--image
|
||||
></view>
|
||||
<view class="btn">发送</view>
|
||||
</view>
|
||||
</up-popup>
|
||||
@ -61,21 +110,41 @@
|
||||
v-if="showCanvas"
|
||||
type="2d"
|
||||
id="watermarkCanvas"
|
||||
style="width:200px;
|
||||
height:200px;position: fixed; top: -9999px;"
|
||||
style="width: 200px; height: 200px; position: fixed; top: -9999px"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
<template #bottom>
|
||||
<view class="bottom">
|
||||
<view class="iptbox">
|
||||
<up--image :src="chatImg" mode="widthFix" width="46rpx" radius="50%"></up--image>
|
||||
<up-input @focus="open" type="text" placeholderClass="placeholderClass" placeholder="对病例发表您的看法" class="ipt" />
|
||||
<up--image
|
||||
:src="chatImg"
|
||||
mode="widthFix"
|
||||
width="46rpx"
|
||||
radius="50%"
|
||||
></up--image>
|
||||
<up-input
|
||||
@focus="open"
|
||||
type="text"
|
||||
placeholderClass="placeholderClass"
|
||||
placeholder="对病例发表您的看法"
|
||||
class="ipt"
|
||||
/>
|
||||
</view>
|
||||
<view class="right">
|
||||
<up--image :src="collectImg" mode="widthFix" width="38rpx"></up--image>
|
||||
<view class="imgboxshang" >
|
||||
<up--image :src="shangImg" mode="widthFix" width="169rpx" height="77rpx"></up--image>
|
||||
<up--image
|
||||
@click="toggleCollect"
|
||||
:src="collectImg"
|
||||
mode="widthFix"
|
||||
width="38rpx"
|
||||
></up--image>
|
||||
<view class="imgboxshang">
|
||||
<up--image
|
||||
:src="shangImg"
|
||||
mode="widthFix"
|
||||
width="169rpx"
|
||||
height="77rpx"
|
||||
></up--image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -83,37 +152,53 @@
|
||||
<view class="desc">
|
||||
<view class="item" v-for="(item, index) in dataList" :key="index">
|
||||
<view class="qq">
|
||||
{{index}}
|
||||
{{ index }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</z-paging>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref
|
||||
} from 'vue'
|
||||
import headImg from "@/static/headImg.png";
|
||||
import collectImg from "@/static/collect.png";
|
||||
import shangImg from "@/static/shang.png";
|
||||
import chatImg from "@/static/chat.png";
|
||||
import uploadImg from "@/static/uploadImg.png";
|
||||
import list from "@/uni_modules/z-paging/components/z-paging/z-paging";
|
||||
import api from "@/api/api";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
const paging = ref(null);
|
||||
const dataList = ref([]);
|
||||
const showCanvas=ref(false)
|
||||
const showCommentDialog = ref(false);
|
||||
const canvasWidth=ref(0);
|
||||
const canvasHeight=ref(0);
|
||||
const comment = ref('');
|
||||
onLoad(() => {});
|
||||
const queryList = (pageNo, pageSize) => {
|
||||
import { reactive, ref } from "vue";
|
||||
import headImg from "@/static/headImg.png";
|
||||
import collectImg from "@/static/collect.png";
|
||||
import shangImg from "@/static/shang.png";
|
||||
import chatImg from "@/static/chat.png";
|
||||
import uploadImg from "@/static/uploadImg.png";
|
||||
import list from "@/uni_modules/z-paging/components/z-paging/z-paging";
|
||||
import api from "@/api/api";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
const paging = ref(null);
|
||||
const dataList = ref([]);
|
||||
const showCanvas = ref(false);
|
||||
const showCommentDialog = ref(false);
|
||||
const canvasWidth = ref(0);
|
||||
const canvasHeight = ref(0);
|
||||
const comment = ref("");
|
||||
const type = ref("");
|
||||
const info = reactive({});
|
||||
const getArticleDetail = (id) => {
|
||||
api.getArticleDetail(id).then((res) => {
|
||||
let result = res.data.data;
|
||||
Object.assign(info, result);
|
||||
});
|
||||
};
|
||||
const getVideoDetail = (id) => {
|
||||
api.getVideoDetail(id).then((res) => {
|
||||
let result = res.data.data;
|
||||
Object.assign(info, result);
|
||||
});
|
||||
};
|
||||
onLoad((options) => {
|
||||
type.value = options.type;
|
||||
if (type.value == "article") {
|
||||
getArticleDetail(options.id);
|
||||
} else {
|
||||
getVideoDetail(options.id);
|
||||
}
|
||||
});
|
||||
const queryList = (pageNo, pageSize) => {
|
||||
const params = {
|
||||
pageNo: pageNo,
|
||||
pageSize: pageSize,
|
||||
@ -134,117 +219,134 @@
|
||||
// 在底层的网络请求抛出异常时,写uni.$emit('z-paging-error-emit');即可
|
||||
paging.value.complete(false);
|
||||
});
|
||||
};
|
||||
const open=()=>{
|
||||
};
|
||||
const open = () => {
|
||||
showCommentDialog.value = true;
|
||||
console.log('open');
|
||||
};
|
||||
const close=()=>{
|
||||
showCommentDialog.value = false
|
||||
console.log('close');
|
||||
};
|
||||
const previewImg=()=>{
|
||||
console.log("open");
|
||||
};
|
||||
const close = () => {
|
||||
showCommentDialog.value = false;
|
||||
console.log("close");
|
||||
};
|
||||
const previewImg = () => {
|
||||
uni.previewImage({
|
||||
current: 'https://example.com/image1.jpg',
|
||||
urls: ['https://example.com/image1.jpg', 'https://example.com/image2.jpg']
|
||||
current: "https://example.com/image1.jpg",
|
||||
urls: ["https://example.com/image1.jpg", "https://example.com/image2.jpg"],
|
||||
});
|
||||
|
||||
};
|
||||
const fillTextToImgWx=(base64)=>{
|
||||
let maskText="@zjd嗯嗯嗯嗯嗯嗯3评论暂时真实的334"
|
||||
};
|
||||
const fillTextToImgWx = (base64) => {
|
||||
let maskText = "@zjd嗯嗯嗯嗯嗯嗯3评论暂时真实的334";
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
wx.createSelectorQuery().select('#watermarkCanvas').fields({
|
||||
wx.createSelectorQuery()
|
||||
.select("#watermarkCanvas")
|
||||
.fields({
|
||||
node: true,
|
||||
size: true
|
||||
}).exec((res) => {
|
||||
size: true,
|
||||
})
|
||||
.exec((res) => {
|
||||
const canvas = res[0].node;
|
||||
const ctx = canvas.getContext('2d');
|
||||
const ctx = canvas.getContext("2d");
|
||||
let textMetrics = ctx.measureText(maskText);
|
||||
console.log(textMetrics)
|
||||
console.log(textMetrics);
|
||||
//水印文字宽度
|
||||
let { width: textWidth, actualBoundingBoxAscent, actualBoundingBoxDescent } = textMetrics;
|
||||
let {
|
||||
width: textWidth,
|
||||
actualBoundingBoxAscent,
|
||||
actualBoundingBoxDescent,
|
||||
} = textMetrics;
|
||||
//水印文字高度
|
||||
let textHeight = actualBoundingBoxAscent ? (actualBoundingBoxAscent + actualBoundingBoxDescent) : (textMetrics.fontBoundingBoxAscent + textMetrics.fontBoundingBoxDescent);
|
||||
let imgHeight,imgWidth;
|
||||
let font='';//fontsize"px Arial";
|
||||
let textHeight = actualBoundingBoxAscent
|
||||
? actualBoundingBoxAscent + actualBoundingBoxDescent
|
||||
: textMetrics.fontBoundingBoxAscent +
|
||||
textMetrics.fontBoundingBoxDescent;
|
||||
let imgHeight, imgWidth;
|
||||
let font = ""; //fontsize"px Arial";
|
||||
|
||||
let fontColor="#fff"
|
||||
let strokeWidth=3;
|
||||
let fontColor = "#fff";
|
||||
let strokeWidth = 3;
|
||||
uni.getImageInfo({
|
||||
src: base64,
|
||||
success: (imageRes) => {
|
||||
// 设置canvas宽高
|
||||
let scale=(imageRes.width/800)*30>12?(imageRes.width/800)*30:12
|
||||
font=scale+"px Arial"
|
||||
console.log(imageRes)
|
||||
canvas.width = imageRes.width
|
||||
let scale =
|
||||
(imageRes.width / 800) * 30 > 12
|
||||
? (imageRes.width / 800) * 30
|
||||
: 12;
|
||||
font = scale + "px Arial";
|
||||
console.log(imageRes);
|
||||
canvas.width = imageRes.width;
|
||||
canvas.height = imageRes.height;
|
||||
imgHeight=imageRes.height;
|
||||
imgWidth=imageRes.width;
|
||||
imgHeight = imageRes.height;
|
||||
imgWidth = imageRes.width;
|
||||
// 创建目标图片对象
|
||||
const image = canvas.createImage();
|
||||
image.src='';
|
||||
image.src = "";
|
||||
image.src = base64;
|
||||
image.onload = () => {
|
||||
|
||||
// 清除画布
|
||||
//ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||
|
||||
// 将图片绘制到canvas上
|
||||
ctx.drawImage(image, 0, 0, canvas.width, canvas.height)
|
||||
let posXmargin =10; //this.data.posXmargin // 自定义离左/右边的距离
|
||||
let posYmargin =10;// this.data.posYmargin // 自定义离上/下边的距离
|
||||
let randomNumber =3;//Math.floor(Math.random() * (3 + 1));
|
||||
console.log('randomNumber:'+randomNumber);
|
||||
ctx.drawImage(image, 0, 0, canvas.width, canvas.height);
|
||||
let posXmargin = 10; //this.data.posXmargin // 自定义离左/右边的距离
|
||||
let posYmargin = 10; // this.data.posYmargin // 自定义离上/下边的距离
|
||||
let randomNumber = 3; //Math.floor(Math.random() * (3 + 1));
|
||||
console.log("randomNumber:" + randomNumber);
|
||||
switch (randomNumber) {
|
||||
case 0: //左上角
|
||||
let lt_x = posXmargin
|
||||
let lt_y = posYmargin + textHeight
|
||||
ctx.font = font
|
||||
ctx.fillStyle = fontColor
|
||||
let lt_x = posXmargin;
|
||||
let lt_y = posYmargin + textHeight;
|
||||
ctx.font = font;
|
||||
ctx.fillStyle = fontColor;
|
||||
ctx.storkStyle = "black";
|
||||
ctx.strokeWidth= strokeWidth
|
||||
ctx.strokeWidth = strokeWidth;
|
||||
ctx.fillStyle = "#fff";
|
||||
ctx.fillText(maskText, lt_x, lt_y)
|
||||
ctx.fillText(maskText, lt_x, lt_y);
|
||||
|
||||
//ctx.restore()
|
||||
//ctx.save()
|
||||
break;
|
||||
case 1: //左下角
|
||||
let lb_x = posXmargin
|
||||
let lb_y = imgHeight- posYmargin
|
||||
ctx.font = font
|
||||
ctx.fillStyle = fontColor
|
||||
let lb_x = posXmargin;
|
||||
let lb_y = imgHeight - posYmargin;
|
||||
ctx.font = font;
|
||||
ctx.fillStyle = fontColor;
|
||||
ctx.strokeStyle = "black";
|
||||
ctx.strokeWidth= strokeWidth
|
||||
ctx.strokeWidth = strokeWidth;
|
||||
ctx.fillStyle = "#fff";
|
||||
ctx.fillText(maskText, lb_x, lb_y)
|
||||
ctx.fillText(maskText, lb_x, lb_y);
|
||||
//ctx.restore()
|
||||
//ctx.save()
|
||||
break;
|
||||
|
||||
case 2: //右上角
|
||||
let rt_x = imgWidth - textWidth*2.9- posXmargin<=0?10:imgWidth - textWidth*2.9- posXmargin
|
||||
let rt_y = posYmargin + textHeight*2
|
||||
ctx.font = font
|
||||
ctx.fillStyle = fontColor
|
||||
ctx.strokeStyle = "black";
|
||||
ctx.strokeWidth= strokeWidth
|
||||
ctx.fillStyle = "#fff";
|
||||
ctx.fillText(maskText, rt_x, rt_y)
|
||||
ctx.restore()
|
||||
ctx.save()
|
||||
break;
|
||||
case 3: //右下角
|
||||
let rb_x = imgWidth - textWidth*2.9- posXmargin<=0?10:imgWidth - textWidth*2.9- posXmargin
|
||||
let rb_y = imgHeight - posYmargin
|
||||
ctx.font = font
|
||||
let rt_x =
|
||||
imgWidth - textWidth * 2.9 - posXmargin <= 0
|
||||
? 10
|
||||
: imgWidth - textWidth * 2.9 - posXmargin;
|
||||
let rt_y = posYmargin + textHeight * 2;
|
||||
ctx.font = font;
|
||||
ctx.fillStyle = fontColor;
|
||||
ctx.strokeStyle = "black";
|
||||
ctx.strokeWidth= strokeWidth
|
||||
ctx.strokeWidth = strokeWidth;
|
||||
ctx.fillStyle = "#fff";
|
||||
ctx.fillText(maskText, rb_x, rb_y)
|
||||
ctx.fillText(maskText, rt_x, rt_y);
|
||||
ctx.restore();
|
||||
ctx.save();
|
||||
break;
|
||||
case 3: //右下角
|
||||
let rb_x =
|
||||
imgWidth - textWidth * 2.9 - posXmargin <= 0
|
||||
? 10
|
||||
: imgWidth - textWidth * 2.9 - posXmargin;
|
||||
let rb_y = imgHeight - posYmargin;
|
||||
ctx.font = font;
|
||||
ctx.fillStyle = fontColor;
|
||||
ctx.strokeStyle = "black";
|
||||
ctx.strokeWidth = strokeWidth;
|
||||
ctx.fillStyle = "#fff";
|
||||
ctx.fillText(maskText, rb_x, rb_y);
|
||||
//ctx.restore()
|
||||
//ctx.save()
|
||||
break;
|
||||
@ -257,28 +359,24 @@
|
||||
canvas: canvas,
|
||||
success: function (res) {
|
||||
// 输出生成的带水印的图片临时路径
|
||||
resolve(res.tempFilePath)
|
||||
resolve(res.tempFilePath);
|
||||
wx.previewImage({ urls: [res.tempFilePath] });
|
||||
showCanvas.value=false;
|
||||
showCanvas.value = false;
|
||||
},
|
||||
fail: function (res) {
|
||||
// reject(res)
|
||||
console.error(res);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
//})
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
const fillTextToImg=(base64)=>{
|
||||
};
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
const fillTextToImg = (base64) => {
|
||||
const img = new Image();
|
||||
img.src = base64;
|
||||
img.setAttribute("crossOrigin", "Anonymous");
|
||||
@ -330,8 +428,8 @@
|
||||
resolve(canvas.toDataURL("image/jpeg"));
|
||||
};
|
||||
});
|
||||
};
|
||||
const base64ToFile=(base64Data, filename)=> {
|
||||
};
|
||||
const base64ToFile = (base64Data, filename) => {
|
||||
var arr = base64Data.split(",");
|
||||
var type = arr[0].match(/:(.*?);/)[1];
|
||||
var fileExt = type.split("/")[1];
|
||||
@ -344,10 +442,9 @@
|
||||
return new File([u8arr], filename, {
|
||||
type: type,
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
const generateUUID=()=> {
|
||||
const generateUUID = () => {
|
||||
let d = new Date().getTime();
|
||||
if (
|
||||
typeof performance !== "undefined" &&
|
||||
@ -364,23 +461,23 @@
|
||||
}
|
||||
);
|
||||
return uuid;
|
||||
};
|
||||
const readImages=async(localIds)=>{
|
||||
console.log(localIds)
|
||||
};
|
||||
const readImages = async (localIds) => {
|
||||
console.log(localIds);
|
||||
let promiseFun = [];
|
||||
for (var i = 0; i < localIds.length; i++) {
|
||||
//let localData = await doreadImage(localIds[i]);
|
||||
|
||||
let img=null;
|
||||
let img = null;
|
||||
/* #ifdef H5 */
|
||||
|
||||
let imgBase64=await getImageBase64(localIds[i]) ;
|
||||
let imgBase64 = await getImageBase64(localIds[i]);
|
||||
img = await fillTextToImg(imgBase64);
|
||||
console.log(img)
|
||||
uni.previewImage({ urls: [img]})
|
||||
console.log(img);
|
||||
uni.previewImage({ urls: [img] });
|
||||
/* #endif */
|
||||
/* #ifdef MP-WEIXIN */
|
||||
let imgpromise = await fillTextToImgWx(localIds[i]);;
|
||||
let imgpromise = await fillTextToImgWx(localIds[i]);
|
||||
|
||||
console.log(22222);
|
||||
//console.log(imgBase64);
|
||||
@ -396,9 +493,9 @@
|
||||
message: "上传成功",
|
||||
});
|
||||
});
|
||||
};
|
||||
// 图片转64代
|
||||
const getImageBase64=(url)=> {
|
||||
};
|
||||
// 图片转64代
|
||||
const getImageBase64 = (url) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", url, true);
|
||||
@ -407,7 +504,6 @@ const getImageBase64=(url)=> {
|
||||
if (this.status == 200) {
|
||||
const fileReader = new FileReader();
|
||||
fileReader.onloadend = function () {
|
||||
|
||||
resolve(fileReader.result); // Base64编码的字符串
|
||||
};
|
||||
fileReader.readAsDataURL(xhr.response); // 将blob转换为base64
|
||||
@ -420,54 +516,89 @@ const getImageBase64=(url)=> {
|
||||
};
|
||||
xhr.send();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const chooseImg=()=>{
|
||||
showCanvas.value=true;
|
||||
const chooseImg = () => {
|
||||
showCanvas.value = true;
|
||||
uni.chooseImage({
|
||||
count: 1, //默认9
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['album','camera '], //从相册选择
|
||||
sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ["album", "camera "], //从相册选择
|
||||
success: function (res) {
|
||||
console.log(333)
|
||||
console.log(333);
|
||||
readImages(res.tempFilePaths);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
};
|
||||
const collectArticle=(id)=>{
|
||||
api.collectArticle(id).then((res)=>{
|
||||
uni.showToast({
|
||||
icon:'none',
|
||||
title:'收藏成功'
|
||||
})
|
||||
})
|
||||
}
|
||||
const cancelCollectArticle=(id)=>{
|
||||
api.cancelCollectArticle(id).then((res)=>{
|
||||
uni.showToast({
|
||||
icon:'none',
|
||||
title:'已取消收藏'
|
||||
})
|
||||
})
|
||||
}
|
||||
const collectVideo=(id)=>{
|
||||
api.collectVideo(id).then((res)=>{
|
||||
uni.showToast({
|
||||
icon:'none',
|
||||
title:'收藏成功'
|
||||
})
|
||||
})
|
||||
}
|
||||
const cancelCollectVideo=(id)=>{
|
||||
api.cancelCollectVideo(id).then((res)=>{
|
||||
uni.showToast({
|
||||
icon:'none',
|
||||
title:'已取消收藏'
|
||||
})
|
||||
})
|
||||
}
|
||||
const toggleCollect=()=>{
|
||||
if(type.value=='video'){
|
||||
info.is_collect?cancelCollectVideo():collectVideo()
|
||||
}else{
|
||||
info.is_collect?cancelCollectArticle():collectArticle()
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
.imgboxshang{
|
||||
.imgboxshang {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.imgbox{
|
||||
margin:0 30rpx 30rpx;
|
||||
.imgunit{
|
||||
width:150rpx;
|
||||
hight:150rpx;
|
||||
}
|
||||
.imgbox {
|
||||
margin: 0 30rpx 30rpx;
|
||||
.imgunit {
|
||||
width: 150rpx;
|
||||
hight: 150rpx;
|
||||
position: relative;
|
||||
.close{
|
||||
.close {
|
||||
position: absolute;
|
||||
top:0rpx;
|
||||
right:0;
|
||||
top: 0rpx;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
.poptitle{
|
||||
}
|
||||
.poptitle {
|
||||
height: 88rpx;
|
||||
border-bottom:1rpx solid #e7e7e7;
|
||||
}
|
||||
.sendbox{
|
||||
border-bottom: 1rpx solid #e7e7e7;
|
||||
}
|
||||
.sendbox {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin:0 30rpx 30rpx;
|
||||
.btn{
|
||||
width:120rpx;
|
||||
margin: 0 30rpx 30rpx;
|
||||
.btn {
|
||||
width: 120rpx;
|
||||
height: 58rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -476,21 +607,20 @@ const getImageBase64=(url)=> {
|
||||
font-weight: 400;
|
||||
font-size: 30rpx;
|
||||
color: #fff;
|
||||
border-radius:12rpx;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
}
|
||||
.wraper{
|
||||
}
|
||||
.wraper {
|
||||
margin: 0rpx 12rpx;
|
||||
}
|
||||
.desc {
|
||||
}
|
||||
.desc {
|
||||
padding-bottom: 80rpx;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.bottom {
|
||||
.bottom {
|
||||
position: fixed;
|
||||
display: flex;
|
||||
width:100%;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 40rpx 30rpx;
|
||||
align-items: center;
|
||||
@ -504,7 +634,7 @@ const getImageBase64=(url)=> {
|
||||
|
||||
:deep(.placeholderClass) {
|
||||
font-size: 30rpx;
|
||||
color: #4B5563;
|
||||
color: #4b5563;
|
||||
}
|
||||
|
||||
.right {
|
||||
@ -521,7 +651,7 @@ const getImageBase64=(url)=> {
|
||||
.iptbox {
|
||||
flex: 1;
|
||||
padding-left: 30rpx;
|
||||
background: #F3F4F6;
|
||||
background: #f3f4f6;
|
||||
border-radius: 38px;
|
||||
height: 77rpx;
|
||||
display: flex;
|
||||
@ -530,18 +660,16 @@ const getImageBase64=(url)=> {
|
||||
.ipt {
|
||||
margin-left: 15rpx;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bar {
|
||||
.bar {
|
||||
width: 100%;
|
||||
background: #f9fafb;
|
||||
height: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.box {
|
||||
.box {
|
||||
background: #fff;
|
||||
/* height: calc(100vh - 220rpx);
|
||||
overflow-y: scroll;
|
||||
@ -575,9 +703,9 @@ const getImageBase64=(url)=> {
|
||||
margin-left: 15rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.deal {
|
||||
.deal {
|
||||
margin-top: 12rpx;
|
||||
padding: 0 30rpx 20rpx;
|
||||
display: flex;
|
||||
@ -609,5 +737,5 @@ const getImageBase64=(url)=> {
|
||||
.num {
|
||||
margin-left: 8rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -3,21 +3,22 @@
|
||||
<view class="page">
|
||||
<view class="databox">
|
||||
<view class="cell">
|
||||
<view class="num">123</view>
|
||||
<view class="num">{{ numInfo.article_collect_num }}</view>
|
||||
<view class="name">文章</view>
|
||||
</view>
|
||||
<view class="cell">
|
||||
<view class="num">123</view>
|
||||
<view class="num">{{ numInfo.video_collect_num }}</view>
|
||||
<view class="name">视频</view>
|
||||
</view>
|
||||
<view class="cell">
|
||||
<view class="num">123</view>
|
||||
<view class="num">{{ numInfo.video_read_num+numInfo.article_read_num }}</view>
|
||||
<view class="name">阅读量</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="kubox">
|
||||
<view class="row">
|
||||
<up--image
|
||||
@click="goList('video')"
|
||||
:src="videoImg"
|
||||
radius="20rpx"
|
||||
width="330rpx"
|
||||
@ -26,7 +27,7 @@
|
||||
></up--image>
|
||||
<up--image
|
||||
:src="sickImg"
|
||||
|
||||
@click="goList('article')"
|
||||
width="330rpx"
|
||||
radius="20rpx"
|
||||
height="176rpx"
|
||||
@ -42,6 +43,7 @@
|
||||
</view>
|
||||
<view class="row" style="margin-top: 30rpx">
|
||||
<up--image
|
||||
@click="goHospital"
|
||||
:src="hospitalImg"
|
||||
radius="20rpx"
|
||||
width="330rpx"
|
||||
@ -50,7 +52,7 @@
|
||||
></up--image>
|
||||
<up--image
|
||||
:src="doctorImg"
|
||||
|
||||
@click="searchDoctor"
|
||||
width="330rpx"
|
||||
radius="20rpx"
|
||||
height="176rpx"
|
||||
@ -60,27 +62,18 @@
|
||||
<view class="newsbox">
|
||||
<view class="titlebox">
|
||||
<view class="title">最新上线</view>
|
||||
<view class="more">
|
||||
<view class="more" @click="goList('new')">
|
||||
<view class="morename">查看更多</view>
|
||||
<u-icon name="arrow-right" size="16" color="#3CC7C0"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="listbox">
|
||||
<view class="cell">
|
||||
<view class="cell" v-for="item in new_articles" :key="item.article_id">
|
||||
<view class="circle"></view>
|
||||
<view class="info">
|
||||
<view class="name">肝胆相照临床病例库肝胆相照临床病例库</view>
|
||||
<view class="name">{{item.article_title }}</view>
|
||||
<view class="tagsbox">
|
||||
<view class="tag">陈煜</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cell">
|
||||
<view class="circle"></view>
|
||||
<view class="info">
|
||||
<view class="name">肝胆相照临床病例库肝胆相照临床病例库</view>
|
||||
<view class="tagsbox">
|
||||
<view class="tag">陈煜</view>
|
||||
<view class="tag" v-for="tag in item.author" :key="tag.author_id">{{ tag.doctor_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -90,27 +83,18 @@
|
||||
<view class="newsbox">
|
||||
<view class="titlebox">
|
||||
<view class="title">最多阅读</view>
|
||||
<view class="more">
|
||||
<view class="more" @click="goList('read')">
|
||||
<view class="morename">查看更多</view>
|
||||
<u-icon name="arrow-right" size="16" color="#3CC7C0"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="listbox">
|
||||
<view class="cell">
|
||||
<view class="cell" v-for="item in most_read_articles" :key="item.article_id">
|
||||
<view class="circle"></view>
|
||||
<view class="info">
|
||||
<view class="name">肝胆相照临床病例库肝胆相照临床病例库</view>
|
||||
<view class="name">{{item.article_title }}</view>
|
||||
<view class="tagsbox">
|
||||
<view class="tag">陈煜</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cell">
|
||||
<view class="circle"></view>
|
||||
<view class="info">
|
||||
<view class="name">肝胆相照临床病例库肝胆相照临床病例库</view>
|
||||
<view class="tagsbox">
|
||||
<view class="tag">陈煜</view>
|
||||
<view class="tag" v-for="tag in item.author" :key="tag.author_id">{{ tag.doctor_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -119,27 +103,25 @@
|
||||
<view class="recbox">
|
||||
<view class="titlebox">
|
||||
<view class="title">医院病例库推荐</view>
|
||||
<view class="more">
|
||||
<view class="more" @click="goHospital">
|
||||
<view class="morename">查看更多</view>
|
||||
<u-icon name="arrow-right" size="16" color="#3CC7C0"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="cell"> 首都医科大学附属北京佑安医院 </view>
|
||||
<view class="cell"> 首都医科大学附属北京佑安医院 </view>
|
||||
<view class="cell" v-for="item in recommend_hospital" :key="item.hospital_id">{{ item.hospital_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="recbox">
|
||||
<view class="titlebox">
|
||||
<view class="title">医生病例库推荐</view>
|
||||
<view class="more">
|
||||
<view class="more" @click="searchDoctor">
|
||||
<view class="morename">查看更多</view>
|
||||
<u-icon name="arrow-right" size="16" color="#3CC7C0"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="cell"> 首都医科大学附属北京佑安医院 </view>
|
||||
<view class="cell"> 首都医科大学附属北京佑安医院 </view>
|
||||
<view class="cell" v-for="item in recommend_doctor" :key="item.doctor_id">{{ item.doctor_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -148,7 +130,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from "vue";
|
||||
import { ref, reactive, onMounted } from "vue";
|
||||
import { onLoad} from "@dcloudio/uni-app";
|
||||
import tabBar from "@/components/tabBar/tabBar.vue";
|
||||
import navBar from "@/components/navBar/navBar.vue";
|
||||
@ -160,30 +142,52 @@ import videoImg from "@/static/video.png";
|
||||
import sickImg from "@/static/sick.png";
|
||||
import hospitalImg from "@/static/hospital.png";
|
||||
import doctorImg from "@/static/doctor.png";
|
||||
import { object } from "uview-plus/libs/function/test";
|
||||
const most_read_articles = ref([]);
|
||||
const new_articles = ref([]);
|
||||
const recommend_doctor=ref([]);
|
||||
const recommend_hospital=ref([]);
|
||||
const numInfo=reactive({})
|
||||
|
||||
onLoad(() => {});
|
||||
const queryList = (pageNo, pageSize) => {
|
||||
const params = {
|
||||
pageNo: pageNo,
|
||||
pageSize: pageSize,
|
||||
type: 1,
|
||||
const getData = async() => {
|
||||
const {data}=await api.getHomeData();
|
||||
console.log(11111);
|
||||
console.log(data);
|
||||
if(data.code==200){
|
||||
most_read_articles.value=data.data.most_read_articles;
|
||||
new_articles.value=data.data.new_articles;
|
||||
recommend_doctor.value=data.data.recommend_doctor;
|
||||
recommend_hospital.value=data.data.recommend_hospital;
|
||||
|
||||
}
|
||||
};
|
||||
// 此处请求仅为演示,请替换为自己项目中的请求
|
||||
api
|
||||
.queryList(params)
|
||||
.then((res) => {
|
||||
// console.log(res)
|
||||
// dataList.value=dataList.value.concat(res.data.list)
|
||||
// 将请求结果通过complete传给z-paging处理,同时也代表请求结束,这一行必须调用
|
||||
paging.value.complete(res.data.list);
|
||||
const getStatic=()=>{
|
||||
api.getHomeStatics().then((res) => {
|
||||
let result=res.data.data;
|
||||
Object.assign(numInfo,result);
|
||||
console.log(numInfo.value)
|
||||
})
|
||||
}
|
||||
const goList=(type)=>{
|
||||
uni.navigateTo({
|
||||
url:'/pages/search/search?order='+type
|
||||
})
|
||||
.catch((res) => {
|
||||
// 如果请求失败写paging.value.complete(false);
|
||||
// 注意,每次都需要在catch中写这句话很麻烦,z-paging提供了方案可以全局统一处理
|
||||
// 在底层的网络请求抛出异常时,写uni.$emit('z-paging-error-emit');即可
|
||||
paging.value.complete(false);
|
||||
});
|
||||
};
|
||||
const searchDoctor=()=>{
|
||||
uni.navigateTo({
|
||||
url:'/pages/searchList/searchList?type=doctor'
|
||||
})
|
||||
}
|
||||
const goHospital=()=>{
|
||||
uni.navigateTo({
|
||||
url:'/pages/searchList/searchList?type=hospital'
|
||||
})
|
||||
}
|
||||
onLoad(() => {
|
||||
getStatic();
|
||||
|
||||
getData();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.tagsbox {
|
||||
@ -207,6 +211,7 @@ const queryList = (pageNo, pageSize) => {
|
||||
}
|
||||
.recbox{
|
||||
padding-bottom: 23rpx;
|
||||
margin-bottom: 16rpx;
|
||||
padding-top: 36rpx;
|
||||
background: #fff;
|
||||
.cell {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="logincontent">
|
||||
<view class="title">登录观看</view>
|
||||
<up-form labelPosition="left" :model="model" ref="form" labelWidth="115rpx">
|
||||
<up-form labelPosition="left" ref="form" labelWidth="115rpx">
|
||||
<up-form-item
|
||||
label="手机号"
|
||||
prop="userInfo.name"
|
||||
@ -148,7 +148,7 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from "vue";
|
||||
import { onShow } from "@dcloudio/uni-app";
|
||||
import { onShow,onLoad } from "@dcloudio/uni-app";
|
||||
import api from "@/api/api";
|
||||
import auth from "@/utils/auth";
|
||||
const code = ref('');
|
||||
@ -170,9 +170,42 @@ const tips = ref("");
|
||||
const seconds = ref(10);
|
||||
const uCodeRef = ref(null);
|
||||
const checked = ref(false);
|
||||
const hasRedirectUrl = ref(false);
|
||||
const radioChange = (e) => {
|
||||
checked.value =!checked.value;
|
||||
};
|
||||
onLoad((options) => {
|
||||
if (options.redirectUrl) {
|
||||
hasRedirectUrl.value = true
|
||||
};
|
||||
})
|
||||
const goPage=()=>{
|
||||
if (hasRedirectUrl.value) {
|
||||
console.log('true')
|
||||
|
||||
let url="";
|
||||
let redirectUrl = uni.getStorageSync('redirectUrl');
|
||||
if(redirectUrl && redirectUrl.indexOf('/login/login')==-1){
|
||||
url = redirectUrl
|
||||
}else{
|
||||
url='pages/index/index'
|
||||
}
|
||||
console.log('url:' + url)
|
||||
|
||||
uni.redirectTo({
|
||||
url: '/' + url,
|
||||
success(){
|
||||
uni.setStorageSync('redirectUrl', '');
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.log('false')
|
||||
uni.redirectTo({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
const getPhoneNumber = (e) => {
|
||||
if (e.detail.errMsg === "getPhoneNumber:ok") {
|
||||
console.log(e.target.code)
|
||||
@ -183,12 +216,21 @@ const getPhoneNumber = (e) => {
|
||||
wx_code: res,
|
||||
})
|
||||
.then((data) => {
|
||||
let result=data.data.data;
|
||||
console.log(data.data)
|
||||
const { envVersion } = uni.getAccountInfoSync().miniProgram;
|
||||
if (envVersion == "release") {
|
||||
uni.setStorageSync("AUTH_TOKEN", data.token);
|
||||
uni.setStorageSync("AUTH_TOKEN_CASEDATA",result.token);
|
||||
} else {
|
||||
uni.setStorageSync("DEV_AUTH_TOKEN", data.token);
|
||||
}
|
||||
uni.setStorageSync("DEV_AUTH_TOKEN_CASEDATA",result.token);
|
||||
};
|
||||
console.log(2222222)
|
||||
goPage()
|
||||
}).catch((err)=>{
|
||||
uni.showToast({
|
||||
title: err,
|
||||
icon: "none",
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -209,12 +251,14 @@ const phoneLogin = () => {
|
||||
wx_code: res,
|
||||
})
|
||||
.then((data) => {
|
||||
let result=data.data.data;
|
||||
const { envVersion } = uni.getAccountInfoSync().miniProgram;
|
||||
if (envVersion == "release") {
|
||||
uni.setStorageSync("AUTH_TOKEN", data.token);
|
||||
uni.setStorageSync("AUTH_TOKEN_CASEDATA", result.token);
|
||||
} else {
|
||||
uni.setStorageSync("DEV_AUTH_TOKEN", data.token);
|
||||
uni.setStorageSync("DEV_AUTH_TOKEN_CASEDATA",result.token);
|
||||
}
|
||||
goPage()
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
104
pages/my/my.vue
Normal file
104
pages/my/my.vue
Normal file
@ -0,0 +1,104 @@
|
||||
<template>
|
||||
<div class="upage">
|
||||
<dNav></dNav>
|
||||
<view class="infobox">
|
||||
<up--image
|
||||
:src="headImg"
|
||||
width="154rpx"
|
||||
height="154rpx"
|
||||
radius="50%"
|
||||
></up--image>
|
||||
<view class="info">
|
||||
<view class="name">
|
||||
张三(主任医师)
|
||||
</view>
|
||||
<view class="hospital">首都医科大学附属北京**医院</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="databox">
|
||||
<view class="cell">
|
||||
<view class="num">11</view>
|
||||
<view class="name">文章</view>
|
||||
</view>
|
||||
<view class="cell">
|
||||
<view class="num">22</view>
|
||||
<view class="name">视频</view>
|
||||
</view>
|
||||
<view class="cell">
|
||||
<view class="num">333</view>
|
||||
<view class="name">阅读量</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="listbox">
|
||||
<view class="title">我的临床病例库</view>
|
||||
<view class="cell">
|
||||
<view class="left">
|
||||
<u-icon name="chat-fill" color="#000" size="28"></u-icon>
|
||||
<view class="title">我的病例库</view>
|
||||
</view>
|
||||
<u-icon name="arrow-right" color="#000" size="28"></u-icon>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import dNav from "@/components/backNav/backNav.vue";
|
||||
import headImg from "@/static/headImg.png";
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
.listbox{
|
||||
.cell{
|
||||
.left{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
.databox {
|
||||
height: 162rpx;
|
||||
background: #ffffff;
|
||||
display: flex;
|
||||
padding: 10rpx 0rpx;
|
||||
justify-content: space-between;
|
||||
border-bottom:2rpx solid rgba($color: #000000, $alpha: 0.1);
|
||||
.cell {
|
||||
flex: 1;
|
||||
padding: 35rpx 0;
|
||||
|
||||
text-align: center;
|
||||
|
||||
.num {
|
||||
font-size: 38rpx;
|
||||
color: #000000;
|
||||
}
|
||||
.name {
|
||||
margin-top: 18rpx;
|
||||
font-size: 28rpx;
|
||||
color: #4B5563;
|
||||
}
|
||||
}
|
||||
}
|
||||
.infobox{
|
||||
margin:0 30rpx;
|
||||
display: flex;
|
||||
.info{
|
||||
margin-left: 20rpx;
|
||||
.name{
|
||||
font-size: 32rpx;
|
||||
color: #000000;
|
||||
line-height: 46rpx;
|
||||
}
|
||||
.hospital{
|
||||
font-size: 28rpx;
|
||||
color: #4B5563;
|
||||
line-height: 38rpx;}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -9,41 +9,64 @@
|
||||
@query="queryList"
|
||||
>
|
||||
<template #top>
|
||||
<navBar></navBar>
|
||||
<view class="detail">
|
||||
<view class="desc">检索到XX篇文章</view>
|
||||
<view class="desc">检索到X个视频</view>
|
||||
<view class="desc">检索词:陈煜</view>
|
||||
<navBar :searchWord="keyWord" :navName="navName"></navBar>
|
||||
<view class="databox" v-if="hospital_id || doctor_id">
|
||||
<view class="cell">
|
||||
<view class="num">{{ numInfo.article_collect_num }}</view>
|
||||
<view class="name">文章</view>
|
||||
</view>
|
||||
<view class="cell">
|
||||
<view class="num">{{ numInfo.video_collect_num }}</view>
|
||||
<view class="name">视频</view>
|
||||
</view>
|
||||
<view class="cell">
|
||||
<view class="num">{{ numInfo.video_read_num+numInfo.article_read_num }}</view>
|
||||
<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="desc" v-if="keyWord">检索词:<text class="red">{{ keyWord }}</text></view>
|
||||
</view>
|
||||
<view class="filterbox">
|
||||
<u-dropdown class="u-dropdown">
|
||||
<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="value"
|
||||
title="温度"
|
||||
v-model="order.push_date"
|
||||
title="发布时间"
|
||||
@change="change"
|
||||
:options="options"
|
||||
></up-dropdown-item>
|
||||
</u-dropdown>
|
||||
<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">
|
||||
<view class="title ellipsis">{{ item.title }}</view>
|
||||
<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">陈煜</view>
|
||||
<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">1</view>
|
||||
<view class="num">{{item.read_num }}</view>
|
||||
</view>
|
||||
<view class="collect">
|
||||
<up-icon name="heart" color="#6B7280" size="28rpx"></up-icon>
|
||||
<view class="num">1</view>
|
||||
<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">1</view>
|
||||
<view class="num">{{formatdate(item.push_date) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -57,50 +80,224 @@ import navBar from "@/components/navBar/navBar.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 value = ref("");
|
||||
const options = 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 options= ref([
|
||||
{
|
||||
label: "去冰",
|
||||
value: 1,
|
||||
label: "正序",
|
||||
value: 'asc',
|
||||
},
|
||||
{
|
||||
label: "加冰",
|
||||
value: 2,
|
||||
label: "倒序",
|
||||
value: 'desc',
|
||||
},
|
||||
]);
|
||||
|
||||
onLoad(() => {});
|
||||
const queryList = (pageNo, pageSize) => {
|
||||
const params = {
|
||||
pageNo: pageNo,
|
||||
pageSize: pageSize,
|
||||
type: 1,
|
||||
const order=reactive({
|
||||
read_num:'',
|
||||
push_date:''
|
||||
})
|
||||
|
||||
onLoad((options) => {
|
||||
if(options.keyWord){
|
||||
keyWord.value = options.keyWord;
|
||||
};
|
||||
// 此处请求仅为演示,请替换为自己项目中的请求
|
||||
api
|
||||
.queryList(params)
|
||||
.then((res) => {
|
||||
// console.log(res)
|
||||
// dataList.value=dataList.value.concat(res.data.list)
|
||||
// 将请求结果通过complete传给z-paging处理,同时也代表请求结束,这一行必须调用
|
||||
paging.value.complete(res.data.list);
|
||||
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)=>{
|
||||
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}`
|
||||
})
|
||||
.catch((res) => {
|
||||
// 如果请求失败写paging.value.complete(false);
|
||||
// 注意,每次都需要在catch中写这句话很麻烦,z-paging提供了方案可以全局统一处理
|
||||
// 在底层的网络请求抛出异常时,写uni.$emit('z-paging-error-emit');即可
|
||||
}
|
||||
const swicthType=()=>{
|
||||
isArticle.value=!isArticle.value;
|
||||
dataList.value=[];
|
||||
order.read_num='';
|
||||
order.push_date='';
|
||||
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
|
||||
}
|
||||
api.searchArticle({
|
||||
...searchForm,
|
||||
...params
|
||||
}).then((res)=>{
|
||||
paging.value.complete(res.data.data.data);
|
||||
total.value=res.data.data.total;
|
||||
}).catch(err=>{
|
||||
paging.value.complete(false);
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
const searchVideo = async(params) => {
|
||||
let searchForm={
|
||||
keyword: keyWord.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({
|
||||
...params
|
||||
}).then((res)=>{
|
||||
paging.value.complete(res.data.data.data);
|
||||
total.value=res.data.data.total;
|
||||
}).catch(err=>{
|
||||
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)
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.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;
|
||||
.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) {
|
||||
display: flex;
|
||||
flex-direction:row;
|
||||
overflow: hidden;
|
||||
|
||||
}
|
||||
:deep(.u-dropdown__menu){
|
||||
|
||||
background: #fff;
|
||||
z-index:1;
|
||||
margin-left: 180rpx;
|
||||
|
||||
}
|
||||
:deep(.u-dropdown__menu__item){
|
||||
|
||||
height:74rpx;
|
||||
padding:0 20rpx;
|
||||
background: #F3F4F6;
|
||||
border-radius: 15rpx;
|
||||
flex:none;
|
||||
margin-left: 60rpx;
|
||||
|
||||
}
|
||||
.deal {
|
||||
@ -164,5 +361,8 @@ const queryList = (pageNo, pageSize) => {
|
||||
color: #4b5563;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
.red{
|
||||
color: #FF0000;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
394
pages/searchList/searchList.vue
Normal file
394
pages/searchList/searchList.vue
Normal file
@ -0,0 +1,394 @@
|
||||
<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>
|
||||
<navBar :searchWord="keyWord" :navName="navName" :type="type"></navBar>
|
||||
<!-- <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.read_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="type=='hospital'?goDetail(item.basic_hospital.hospital_id):goDetail(item.case_clinical_doctor.doctor_id)">
|
||||
<view class="title ellipsis" v-if="type=='hospital'">{{ item.basic_hospital.hospital_name}}</view>
|
||||
<view class="title ellipsis" v-else>{{ item.case_clinical_doctor.doctor_name}}({{ item.case_clinical_doctor.hospital_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 navBar from "@/components/navBar/navBar.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({
|
||||
read_num:'',
|
||||
push_date:''
|
||||
})
|
||||
|
||||
onLoad((options) => {
|
||||
if(options.type=='hospital'){
|
||||
type.value ='hospital';
|
||||
navName.value='医院临床病例库'
|
||||
};
|
||||
if(options.order=='new'){
|
||||
order.push_date='asc'
|
||||
};
|
||||
if(options.order=='read'){
|
||||
order.read_num='desc'
|
||||
};
|
||||
});
|
||||
const change=(e)=>{
|
||||
paging.value.reload();
|
||||
}
|
||||
const formatdate=(date)=>{
|
||||
return dayjs(date).format('YYYY-MM-DD')
|
||||
}
|
||||
const swicthType=()=>{
|
||||
isArticle.value=!isArticle.value;
|
||||
dataList.value=[];
|
||||
order.read_num='';
|
||||
order.push_date='';
|
||||
paging.value.reload();
|
||||
}
|
||||
const searchArticle =(params) => {
|
||||
let searchForm={
|
||||
keyword: keyWord.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({
|
||||
...searchForm,
|
||||
...params
|
||||
}).then((res)=>{
|
||||
paging.value.complete(res.data.data.data);
|
||||
total.value=res.data.data.total;
|
||||
}).catch(err=>{
|
||||
paging.value.complete(false);
|
||||
})
|
||||
}
|
||||
|
||||
const searchVideo = async(params) => {
|
||||
let searchForm={
|
||||
keyword: keyWord.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({
|
||||
...params
|
||||
}).then((res)=>{
|
||||
paging.value.complete(res.data.data.data);
|
||||
total.value=res.data.data.total;
|
||||
}).catch(err=>{
|
||||
paging.value.complete(false);
|
||||
})
|
||||
}
|
||||
|
||||
const searchHospital = async(params) => {
|
||||
let searchForm={
|
||||
keyword: keyWord.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.searchHospital({
|
||||
...params
|
||||
}).then((res)=>{
|
||||
paging.value.complete(res.data.data.data);
|
||||
total.value=res.data.data.total;
|
||||
}).catch(err=>{
|
||||
paging.value.complete(false);
|
||||
})
|
||||
}
|
||||
const searchDoctor = async(params) => {
|
||||
let searchForm={
|
||||
keyword: keyWord.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.searchDoctor({
|
||||
...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,
|
||||
};
|
||||
type.value=='hospital'?searchHospital(params):searchDoctor(params)
|
||||
};
|
||||
const goDetail=(id)=>{
|
||||
uni.navigateTo({
|
||||
url: `/pages/detail/detail?id=${id}&type=${type.value}`,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.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: 60rpx;
|
||||
|
||||
}
|
||||
.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>
|
||||
BIN
static/arrowright.png
Normal file
BIN
static/arrowright.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 394 B |
BIN
static/switch.png
Normal file
BIN
static/switch.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 610 B |
@ -1,7 +1,7 @@
|
||||
let BASE_URL=''
|
||||
if(process.env.NODE_ENV=='production'){
|
||||
BASE_URL='1111111'
|
||||
BASE_URL='https://prod-casedata.igandan.com/api'
|
||||
}else{
|
||||
BASE_URL='22222222'
|
||||
BASE_URL='https://dev-casedata.igandan.com/api'
|
||||
}
|
||||
export default BASE_URL
|
||||
@ -2,9 +2,9 @@ import pageUrl from './pageUrl'
|
||||
function navTo(obj){
|
||||
// let token='';
|
||||
// if(process.env.NODE_ENV === 'development'){
|
||||
// token = uni.getStorageSync('DEV_AUTH_TOKEN_FIGURE');
|
||||
// token = uni.getStorageSync('DEV_AUTH_TOKEN_CASEDATA');
|
||||
// }else{
|
||||
// token = uni.getStorageSync('AUTH_TOKEN_FIGURE');
|
||||
// token = uni.getStorageSync('AUTH_TOKEN_CASEDATA');
|
||||
// }
|
||||
// if(!token){
|
||||
// let page_url=pageUrl();
|
||||
|
||||
@ -21,12 +21,11 @@ export const request = (url, data = {}, method = 'post',loading = false,contentT
|
||||
})
|
||||
|
||||
};
|
||||
uni.setStorageSync('DEV_AUTH_TOKEN_FIGURE','eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiMTgzMzQzMjEwMTI3ODQ1Mzc2MCIsImV4cCI6MTc0MzEzMTY2OCwibmJmIjoxNzQyODcyNDY4LCJpYXQiOjE3NDI4NzI0Njh9.RGsdwvwck8oDNbStbMA18i5VOmy9JbK68hLNILDGUMQ');
|
||||
let token='';
|
||||
if(process.env.NODE_ENV === 'development'){
|
||||
token = uni.getStorageSync('DEV_AUTH_TOKEN_FIGURE');
|
||||
token = uni.getStorageSync('DEV_AUTH_TOKEN_CASEDATA');
|
||||
}else{
|
||||
token = uni.getStorageSync('AUTH_TOKEN_FIGURE');
|
||||
token = uni.getStorageSync('AUTH_TOKEN_CASEDATA');
|
||||
}
|
||||
// if(!token){
|
||||
// let freeList=['/login','/code/phone','/login/wx','/index','/user/check'];
|
||||
@ -68,9 +67,9 @@ export const request = (url, data = {}, method = 'post',loading = false,contentT
|
||||
var Authorization_token = res.header.Authorization;
|
||||
if(Authorization_token){
|
||||
if(process.env.NODE_ENV === 'development'){
|
||||
uni.setStorageSync('DEV_AUTH_TOKEN_FIGURE', Authorization_token);
|
||||
uni.setStorageSync('DEV_AUTH_TOKEN_CASEDATA', Authorization_token);
|
||||
}else{
|
||||
uni.setStorageSync('AUTH_TOKEN_FIGURE', Authorization_token);
|
||||
uni.setStorageSync('AUTH_TOKEN_CASEDATA', Authorization_token);
|
||||
}
|
||||
|
||||
}
|
||||
@ -80,16 +79,8 @@ export const request = (url, data = {}, method = 'post',loading = false,contentT
|
||||
if(res.data.code==200){
|
||||
e(res)
|
||||
}else if(res.data.code==401 || res.data.code==403 || res.data.code==405 || res.data.code==406){
|
||||
var u=navigator.userAgent;
|
||||
let isApp=Boolean(u.match(/Gdxz/ig));
|
||||
if(isApp){
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
}else{
|
||||
let freeList=['/login','/code/phone','/login/wx','/index','/user/check'];
|
||||
let freeList=['/login/wechat/mobile','/code/phone','/login/mobile_login','/index','/user/check'];
|
||||
if(freeList.indexOf(url) == -1){
|
||||
|
||||
let page_url=pageUrl();
|
||||
uni.setStorageSync('redirectUrl',page_url);
|
||||
uni.navigateTo({
|
||||
@ -97,7 +88,7 @@ export const request = (url, data = {}, method = 'post',loading = false,contentT
|
||||
});
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}else if(res.data.code==500){
|
||||
n(res)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user