This commit is contained in:
zoujiandong
2025-08-03 16:29:54 +08:00
parent 43abd1f3d6
commit 6e320c3944
74 changed files with 1954 additions and 974 deletions
+15 -7
View File
@@ -26,7 +26,7 @@
</view>
</view>
<view class="list">
<view class="cell" v-for="item in most_read_articles.slice(0,3)" :key="item.exchange_id" @click="goDetail(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-one-lines">{{ item.exchange_title }}</view>
</view>
@@ -73,7 +73,7 @@
>
<view
class="imgcell"
v-for="unit in item.exchange_content_image"
v-for="unit in item.exchange_content_image.splice(0,3)"
:key="unit"
>
<up--image
@@ -97,7 +97,7 @@
>
<video
:key="index"
v-for="(videoCell, index) in item.exchange_content_video"
v-for="(videoCell, index) in item.exchange_content_video.slice(0,1)"
class="myVideo"
:src="videoCell"
@@ -106,10 +106,11 @@
></video>
</view>
</view>
<view class="tagbox" @click="goDetail(item.exchange_id)" v-if="item.label && item.label.length > 0">
<view class="tagbox" @click="goDetail(item.exchange_id)" v-if="item.exchange_label">
<view
class="tag"
v-for="cell in item.label"
v-for="cell in item.exchange_label"
:key="cell.exchange_label_id"
>{{ cell.label_name }}</view
>
@@ -204,7 +205,10 @@ const goDetail = (id) => {
const searchList = async () => {
let searchForm = {
page: 1,
page_size: 10
page_size: 10,
order:{
push_date:'desc'
}
};
api.searchExchage({
@@ -227,7 +231,10 @@ const htmlToText=(html)=>{
const goodList=()=>{
api.searchExchageGood({
is_selected:1,
limit:5
order:{
push_date:'desc'
},
limit:3
}).then(res=>{
most_read_articles.value=res.data.data
})
@@ -237,6 +244,7 @@ const hotList=()=>{
is_selected:0,
limit:5,
page:1,
page_size:5
}).then(res=>{
})
+2 -1
View File
@@ -27,6 +27,7 @@ onLoad((options) => {
<style lang='scss' scoped>
.imgbox{
margin-top: -30rpx;
margin: -30rpx 30rpx 0;
overflow-y: scroll;
}
</style>
+192 -121
View File
@@ -5,6 +5,7 @@
loading-more-no-more-text="咱也是有底线的"
:auto-show-back-to-top="false"
v-model="dataList"
refresher-out-rate="0.8"
:empty-view-super-style="{'paddingBottom':'140rpx'}"
:refresher-title-style="{'paddingBottom':'60rpx','paddingTop':'10rpx'}"
:refresher-img-style="{'paddingBottom':'60rpx','paddingTop':'10rpx'}"
@@ -24,15 +25,19 @@
radius="50%"
></up--image>
<view class="iptcon" @click="open">
<up-input
@click="open"
disabled
:focus="false"
type="text"
placeholderClass="placeholderClass"
placeholder="对病例发表您的看法"
class="ipt"
/>
<view class="maskipt" @click="open"></view>
<up-input
@click="open"
disabled
:focus="false"
type="text"
placeholderClass="placeholderClass"
placeholder="对病例发表您的看法"
class="ipt"
/>
</view>
</view>
<view class="right">
@@ -60,10 +65,10 @@
}}</view>
<view class="title" v-else>{{ info.exchange_title }}</view>
<view class="content" >
<view class="info" v-for="item in info.author" v-if="type == 'video' || type == 'article'">
<view class="info" v-for="item in info.author" :key ="item" v-if="type == 'video' || type == 'article'">
<up--image
:src="headImg"
mode="widthFix"
:src="item.avatar?item.avatar:headImg"
class="headImg"
width="46rpx"
height="46rpx"
@@ -75,8 +80,8 @@
</view>
<view class="info" v-else>
<up--image
:src="headImg"
mode="widthFix"
:src="info.avatar?info.avatar:headImg"
class="headImg"
width="46rpx"
height="46rpx"
@@ -145,7 +150,7 @@
<view class="videobox" v-else>
<view class="cloumn" v-if="info.exchange_content">
<view class="stitle">病例信息</view>
<up-parse :content="fromatImg(info.exchange_content)"></up-parse>
<up-parse :content="fromatImg(info.exchange_content)" style="overflow-y: hidden;"></up-parse>
<!-- <view class="con" v-html="fromatImg(info.exchange_content)"></view> -->
</view>
<view class="cloumn" v-if="info.exchange_summary">
@@ -154,17 +159,17 @@
<!-- <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="detail" v-if="info.exchange_vote && info.exchange_vote.vote_title">
<view class="votebox" v-if="info.exchange_vote.is_have_voted!=1">
<view class="name">在线投票</view>
<view class="title" >{{ info.case_exchange_vote.vote_title }}</view>
<view class="title" >{{ info.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">
<view class="row" v-for="item in info.exchange_vote.case_exchange_vote_option" :key="item.option_id">
<up-radio
activeColor="#3CC7C0"
:label="item.option_value"
@@ -178,9 +183,9 @@
</view>
<view class="votebox" v-else>
<view class="name">在线投票</view>
<view class="title">{{ info.case_exchange_vote.vote_title }}</view>
<view class="title">{{ info.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="option" v-for="item in info.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>
@@ -218,7 +223,7 @@
:key="item.comment_id"
>
<up--image
:src="headImg"
:src="item.avatar?item.avatar:headImg"
class="headImg"
width="86rpx"
height="86rpx"
@@ -230,7 +235,7 @@
<view class="namebox">
<view class="name"> {{ item.user_name }}</view>
<up--image
v-if="user_id==item.user_id"
v-if="doctor_id==item.doctor_id"
:src="selfImg"
class="selfImg"
width="69rpx"
@@ -247,7 +252,7 @@
item.user_name,
item.is_top,
2,
item.user_id
item.doctor_id
)
"
>...</view
@@ -275,7 +280,7 @@
style="padding-left: 0;padding-right:0"
>
<up--image
:src="headImg"
:src="cell.avatar?cell.avatar:headImg"
class="headImg"
width="86rpx"
height="86rpx"
@@ -286,7 +291,7 @@
<view class="namebox">
<view class="name"> {{ cell.user_name }}</view>
<up--image
v-if="user_id==cell.user_id"
v-if="doctor_id==cell.doctor_id"
:src="selfImg"
class="selfImg"
width="69rpx"
@@ -303,7 +308,7 @@
cell.user_name,
cell.is_top,
3,
cell.user_id
cell.doctor_id
)
"
>...</view
@@ -330,7 +335,7 @@
class="expand"
@click="openMorePop(item, item.sub_comment, index)"
v-if="item.sub_comment.length > 3"
>展开更多回复</view
>展开更多回复<view class="iconbox"><up-icon name="arrow-down" color="#3cc7c0" size="38rpx"></up-icon></view></view
>
</view>
</view>
@@ -412,11 +417,11 @@
@open="openDeal"
>
<view class="dealbox">
<view class="dealcell" @click="toggleTop" v-if="level == 2 && is_author">{{
<view class="dealcell" @click="toggleTop" v-if="level == 2 && isArticleAuthor">{{
is_top ? "取消置顶" : "置顶"
}}</view>
<view class="dealcell" @click="openCommentDialog">回复</view>
<view class="dealcell" v-if="is_author || user_id==comment_userId" @click="delComment">删除</view>
<view class="dealcell" v-if="isArticleAuthor || doctor_id==comment_doctorId" @click="delComment">删除</view>
<view class="bar"></view>
<view class="dealcell" @click="closeDealPop">取消</view>
</view>
@@ -443,7 +448,7 @@
<view class="unit commentcon">
<view class="item">
<up--image
:src="headImg"
:src="mainCommentObj.avatar?mainCommentObj.avatar:headImg"
class="headImg"
width="86rpx"
height="86rpx"
@@ -455,7 +460,7 @@
<view class="namebox">
<view class="name"> {{ mainCommentObj.user_name}}</view>
<up--image
v-if="user_id==mainCommentObj.user_id"
v-if="doctor_id==mainCommentObj.doctor_id"
:src="selfImg"
class="selfImg"
width="69rpx"
@@ -472,7 +477,7 @@
mainCommentObj.user_name,
mainCommentObj.is_top,
2,
mainCommentObj.user_id
mainCommentObj.doctor_id
)
"
>...</view
@@ -501,7 +506,7 @@
:key="cell.comment_id"
>
<up--image
:src="headImg"
:src="cell.avatar?cell.avatar:headImg"
class="headImg"
width="86rpx"
height="86rpx"
@@ -512,7 +517,7 @@
<view class="namebox">
<view class="name">{{ cell.user_name}}</view>
<up--image
v-if="user_id==cell.user_id"
v-if="doctor_id==cell.doctor_id"
:src="selfImg"
class="selfImg"
width="69rpx"
@@ -529,7 +534,7 @@
cell.user_name,
cell.is_top,
3,
cell.user_id
cell.doctor_id
)
"
>...</view
@@ -616,18 +621,21 @@ import commentImg from "@/static/comment_icon.png";
import selfImg from "@/static/benren.png";
import list from "@/uni_modules/z-paging/components/z-paging/z-paging";
import api from "@/api/api";
import throttle from "@/utils/throttle"
import { onLoad } from "@dcloudio/uni-app";
import dayjs from "dayjs";
// #ifdef H5
import baoliVideo from "@/components/baoliVideo/baoliVideo.vue";
import { linkFlag } from "../../uni_modules/sv-editor/components/common/utils";
// #endif
const isArticleAuthor=ref(false)
const isH5=ref(process.env.UNI_PLATFORM =="h5");
const user_id=ref('');
const doctor_id=ref('');
const paging = ref(null);
const dataList = ref([]);
const total = ref(0);
const imgList = ref([]);
const showCanvas = ref(false);
const showCanvas = ref(true);
const showCommentDialog = ref(false);
const givePointValue = ref(5);
const canvasWidth = ref(0);
@@ -652,7 +660,7 @@ const clickIndex = ref(0);
const is_top = ref(false);
const option_id = ref("");
const point=ref(0)
const comment_userId=ref('');
const comment_doctorId=ref('');
const commentTextarea=ref(null)
const confirmGive = () => {
@@ -718,18 +726,33 @@ const getArticleDetail = (id) => {
api.getArticleDetail(id).then((res) => {
let result = res.data.data;
Object.assign(info, result);
for (let i= 0; i< info.author.length; i++) {
if(info.author[i].doctor_id==doctor_id.value){
isArticleAuthor.value=true;
}
}
});
};
const getVideoDetail = (id) => {
api.getVideoDetail(id).then((res) => {
let result = res.data.data;
Object.assign(info, result);
for (let i= 0; i< info.author.length; i++) {
if(info.author[i].doctor_id==doctor_id.value){
isArticleAuthor.value=true;
}
}
});
};
const getExchangeDetail = (id) => {
api.getExchangeDetail(id).then((res) => {
let result = res.data.data;
Object.assign(info, result);
if(info.doctor_id==doctor_id.value){
isArticleAuthor.value=true;
}
});
};
const getUserPoint=()=>{
@@ -769,14 +792,47 @@ const givePoint=()=>{
showGive.value=false;
})
}
const getQueryParam=(param,link)=>{
const url = link;
// 构造正则表达式,匹配 ? 或 & 后面跟随的参数名称和其值
const regex = new RegExp('[?&]' + param + '=([^&#]*)', 'i');
const result = regex.exec(url);
return result ? decodeURIComponent(result[1]) : null;
};
onLoad((options) => {
id.value = options.id;
type.value = options.type;
readRecord()
if(options.scene){
var decodedURL = decodeURIComponent(options.scene);
let idStr=getQueryParam('id',decodedURL);
let typeStr=getQueryParam('type',decodedURL);
if(idStr){
id.value=idStr;
}
if(typeStr){
if(typeStr==1){
type.value='article';
}else if(typeStr==2){
type.value='video';
}
}
}else{
id.value = options.id;
type.value = options.type;
}
console.log('id:'+id.value)
console.log('type:'+type.value)
readRecord()
let userInfo=uni.getStorageSync('userInfo');
if(userInfo.user_id){
user_id.value=userInfo.user_id;
if(userInfo.doctor_id){
doctor_id.value=userInfo.doctor_id;
}
});
@@ -785,6 +841,7 @@ const clearComment = () => {
imgList.value = [];
content.value = "";
root_id.value = null;
placeholder.value="请输入评论内容"
//is_author.value = false;
reply_name.value = "";
level.value = 1;
@@ -806,7 +863,7 @@ const showReplyPop = () => {
};
const alertDeal = (parentId, rootId, name, top, commentLevel,userId) => {
parent_id.value = parentId;
comment_userId.value=userId;
comment_doctorId.value=userId;
root_id.value = rootId;
//is_author.value = isAuthor == 1 ? true : false;
reply_name.value = name;
@@ -927,7 +984,7 @@ const open = () => {
};
const close = () => {
showCommentDialog.value = false;
console.log("close");
clearComment();
};
const openDeal = () => {
@@ -953,8 +1010,7 @@ const previewImg = (url) => {
};
const fillTextToImgWx = (base64) => {
let maskText = "@zjd嗯嗯嗯嗯嗯嗯3评论暂时真实的334";
let maskText = "@肝胆相照临床病例库";
return new Promise((resolve, reject) => {
wx.createSelectorQuery()
.select("#watermarkCanvas")
@@ -982,15 +1038,15 @@ const fillTextToImgWx = (base64) => {
let font = ""; //fontsize"px Arial";
let fontColor = "#fff";
let strokeWidth = 3;
let strokeWidth =5;
uni.getImageInfo({
src: base64,
success: (imageRes) => {
// 设置canvas宽高
let scale =
(imageRes.width / 800) * 30 > 12
? (imageRes.width / 800) * 30
: 12;
let scale =28;
// (imageRes.width / 800) * 30 > 12
// ? (imageRes.width / 800) * 30
// : 12;
font = scale + "px Arial";
console.log(imageRes);
canvas.width = imageRes.width;
@@ -1046,7 +1102,7 @@ const fillTextToImgWx = (base64) => {
let rt_y = posYmargin + textHeight * 2;
ctx.font = font;
ctx.fillStyle = fontColor;
ctx.strokeStyle = "black";
ctx.strokeStyle = "#000";
ctx.strokeWidth = strokeWidth;
ctx.fillStyle = "#fff";
ctx.fillText(maskText, rt_x, rt_y);
@@ -1055,15 +1111,18 @@ const fillTextToImgWx = (base64) => {
break;
case 3: //右下角
let rb_x =
imgWidth - textWidth * 2.9 - posXmargin <= 0
imgWidth - 276 - posXmargin <= 0
? 10
: imgWidth - textWidth * 2.9 - posXmargin;
: imgWidth - 276- posXmargin;
console.log(rb_x)
let rb_y = imgHeight - posYmargin;
ctx.font = font;
ctx.fillStyle = fontColor;
ctx.strokeStyle = "black";
ctx.strokeWidth = strokeWidth;
ctx.fillStyle = "#fff";
console.log('rb_x')
console.log(rb_x)
ctx.fillText(maskText, rb_x, rb_y);
//ctx.restore()
//ctx.save()
@@ -1078,8 +1137,8 @@ const fillTextToImgWx = (base64) => {
success: function (res) {
// 输出生成的带水印的图片临时路径
resolve(res.tempFilePath);
wx.previewImage({ urls: [res.tempFilePath] });
showCanvas.value = false;
//wx.previewImage({ urls: [res.tempFilePath] });
},
fail: function (res) {
// reject(res)
@@ -1112,9 +1171,9 @@ const fillTextToImg = (base64) => {
ctx.strokeStyle = "#000";
ctx.fillStyle = "#fff";
const uploadTime = new Date();
const name = "@zjd";
const name = "@肝胆相照临床病例库";
const spaceH = remFontSize * 0.1;
let randomNumber = Math.floor(Math.random() * (3 + 1));
let randomNumber = 3//Math.floor(Math.random() * (3 + 1));
let position = [
{
top: remFontSize,
@@ -1187,28 +1246,24 @@ const readImages = async (localIds) => {
//let localData = await doreadImage(localIds[i]);
let img = null;
/* #ifdef H5 */
let imgBase64 = await getImageBase64(localIds[i]);
// #ifdef H5
let imgBase64 = await getImageBase64(localIds[i].url);
img = await fillTextToImg(imgBase64);
console.log(img);
uni.previewImage({ urls: [img] });
/* #endif */
/* #ifdef MP-WEIXIN */
let imgpromise = await fillTextToImgWx(localIds[i]);
console.log(22222);
//console.log(imgBase64);
/* #endif */
// #endif
// #ifdef MP-WEIXIN
img = await fillTextToImgWx(localIds[i].url);
// #endif
promiseFun.push(getOss(img))
//let imgFile = base64ToFile(img, new Date().getTime() + ".jpg");
// console.log(imgFile)
//promiseFun.push(uploadImg(imgFile));
}
Promise.all(promiseFun).then((res) => {
uni.showToast({
duration: 1000,
message: "上传成功",
title: "上传成功",
icon:"none"
});
});
};
@@ -1259,49 +1314,52 @@ const chooseImg = () => {
},
});
};
const getOss=(temurl)=>{
api
.getOss({
scene: 1,
})
.then((rep) => {
let result = rep.data;
if (result.code == 200) {
let { access_id, dir, policy, signature, host } = result.data;
let time = dayjs().format("YYYYMMDDHHmmss");
let random = generateRandomNumber();
let filename = time + random;
let imgType = "." + getImageFormat(temurl);
return new Promise((resolve, reject) => {
uni.uploadFile({
url: host, // 仅为示例,非真实的接口地址
filePath:temurl,
name: "file",
formData: {
OSSAccessKeyId: access_id,
policy,
key: dir + time + random + imgType,
signature,
},
success(res) {
if (res.statusCode === 204) {
let url = host + "/" + dir + filename + imgType;
console.log(url);
imgList.value = [url];
}
},
fail: (err) => {
console.log(err);
},
});
});
}
});
}
const handleUpload = (file) => {
let File = file.file;
console.log(111);
console.log(File);
readImages(File)
// 打印文件对象
api
.getOss({
scene: 1,
})
.then((rep) => {
let result = rep.data;
if (result.code == 200) {
let { access_id, dir, policy, signature, host } = result.data;
let time = dayjs().format("YYYYMMDDHHmmss");
let random = generateRandomNumber();
let filename = time + random;
let imgType = "." + getImageFormat(File[0].url);
return new Promise((resolve, reject) => {
uni.uploadFile({
url: host, // 仅为示例,非真实的接口地址
filePath: File[0].url,
name: "file",
formData: {
OSSAccessKeyId: access_id,
policy,
key: dir + time + random + imgType,
signature,
},
success(res) {
if (res.statusCode === 204) {
let url = host + "/" + dir + filename + imgType;
console.log(url);
imgList.value = [url];
}
},
fail: (err) => {
console.log(err);
},
});
});
}
});
};
const generateRandomNumber = () => {
let randomNumber = Math.floor(1000 + Math.random() * 9000);
@@ -1315,8 +1373,8 @@ const getImageFormat = (imageUrl) => {
return "unknown";
};
const afterRead = (file, lists, name) => {
console.log(lists);
console.log(name);
// console.log(lists);
// console.log(name);
handleUpload(file);
};
const delImg = (index) => {
@@ -1557,7 +1615,7 @@ const toggleTop = () => {
: topExchangeComment(parent_id.value);
}
};
const sendComment = () => {
const sendComment = throttle(() => {
if (!content.value) {
uni.showToast({
icon: "none",
@@ -1587,7 +1645,7 @@ const sendComment = () => {
} else {
addExchangeComment(id.value, postData);
}
};
});
const formatHtml = (val) => {
if (/^回复.+/.test(val)) {
return val.replace(
@@ -2097,7 +2155,15 @@ const readRecord= async()=>{
display: flex;
overflow: hidden;
align-items: center;
.iptcon{
position: relative;
.maskipt{
position: absolute;
width:100%;
height:100%;
z-index:1
}
}
.ipt {
margin-left: 15rpx;
}
@@ -2180,5 +2246,10 @@ const readRecord= async()=>{
margin-left: 8rpx;
}
}
.iconbox{
margin-top: 5rpx;
}
:deep(._root){
overflow-x: hidden!important;
}
</style>
+2 -2
View File
@@ -109,7 +109,7 @@
</view>
</view>
<view class="list">
<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 class="cell ellipsis-one-lines" 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" @click="goListBy(item.doctor_id,item.doctor_name ,'doctor')">{{ item.doctor_name }}</view>
<view class="cell ellipsis-one-lines" v-for="item in recommend_doctor" :key="item.doctor_id" @click="goListBy(item.doctor_id,item.doctor_name ,'doctor')">{{ item.doctor_name }}({{item.hospital_name}})</view>
</view>
</view>
</view>
+7 -7
View File
@@ -1,6 +1,6 @@
<template>
<view class="logincontent">
<view class="title">登录观看</view>
<view class="title">欢迎登录</view>
<up-form labelPosition="left" ref="form" labelWidth="115rpx">
<up-form-item
label="手机号"
@@ -136,16 +136,16 @@
<view class="row">
<view class="tip">操作说明</view>
</view>
<view class="line">
<!-- <view class="line">
<view class="qq">1</view>
肝胆相照注册账号与微信绑定肝胆相照相关直播视频无忧随心看
</view>
<view class="line">
</view> -->
<!-- <view class="line">
<view class="qq">2</view>
仅需操作一次后续通过微信观看直播视频无需额外操作立即进入
</view>
</view> -->
<view class="line">
<view class="qq">3</view>
<!-- <view class="qq">3</view> -->
若您还未注册肝胆相照专家版App, 请直接点击注册进行注册操作
</view>
<view class="desc">
@@ -410,7 +410,7 @@ const start = () => {
padding: 0 30rpx;
}
.row {
margin-top: 30rpx;
margin-top: 40rpx;
display: flex;
justify-content: space-between;
padding: 0 30rpx;
+265 -183
View File
@@ -1,7 +1,10 @@
<template>
<up-toast ref="uToast"></up-toast>
<div class="upage">
<pEditor v-if="showEditor" :editorCotent="editorCotent" :editorType="editorType" @closeEditor="closeEditor" @changeEditor="changeEditor"></pEditor>
<pEditor ref="pEditorRef" v-if="showEditor" :editorCotent="editorType=='info'?form.exchange_content:form.exchange_summary" :editorType="editorType" @closeEditor="closeEditor" @changeEditor="changeEditor"></pEditor>
<view class="navbox">
<view class="bg"></view>
<view class="namebox">
@@ -9,11 +12,11 @@
<u-icon name="arrow-left" color="#000" size="24"></u-icon>
</view>
<!-- <view class="logo">logo</view> -->
<view class="name">发病例交流帖</view>
<view class="name">{{exchange_id?"编辑病例交流帖":"发病例交流帖"}}</view>
</view>
</view>
<!-- <backNav :navName="'发病例交流帖'"></backNav> -->
<scroll-view class="form" id="form" scroll-y="true" style="padding-bottom:150rpx">
<scroll-view class="form" :scroll-top="scrollTop" @scroll="scroll" ref="scrollView" id="form" scroll-y="true" style="padding-bottom:150rpx">
<view class="textbox">
<up--textarea
autoHeight
@@ -57,7 +60,7 @@
@statuschange="statuschange"
></editor> -->
</view>
<view class="textcon" style="border: none">
<view class="textcon" style="border: none;position: relative;z-index:1;" >
<view class="row">
<view class="left">
总结与讨论 <text class="tip">(可不填)</text>
@@ -148,7 +151,7 @@
</view> -->
<view class="bottombtn">
<view class="left">
<view class="draft" @click="openDraftList">草稿箱</view>
<view class="draft" @click="openDraftList" v-if="!exchange_id">草稿箱</view>
<view class="vote" :class="{active:form.case_exchange_vote.vote_title}" @click="alertVote">
投票
<up--image
@@ -324,7 +327,7 @@
</view>
<view class="row" v-else-if="item.exchange_vote">
<view class="smalltitle">投票</view>
<view class="con ellipsis-two-lines">{{
<view class="con ellipsis-two-lines" v-if=" item.exchange_vote">{{
item.exchange_vote.vote_title
}}</view>
</view>
@@ -393,7 +396,7 @@
<view class="zanwraper">
<view class="title">提示</view>
<view class="content" v-if="delType == 'delDraft'">
是否删除该草稿
草稿删除后无法回复确认删除该草稿
</view>
<view class="content" v-else-if="delType == 'saveDraft'">
是否保存该草稿
@@ -405,16 +408,29 @@
</view>
</view>
</up-overlay>
<up-overlay :show="showQuit" mask-click-able zIndex="99">
<view class="zanboxpop">
<view class="zanwraper">
<view class="title">提示</view>
<view class="content">
是否取消编辑
</view>
<view class="btnbox">
<view class="cancle" @click="cancelQuit">取消</view>
<view class="ok" @click="confirmQuit">确定</view>
</view>
</view>
</view>
</up-overlay>
<up-overlay :show="isConfirmPublish" mask-click-able zIndex="99">
<view class="zanboxpop">
<view class="zanwraper">
<view class="title">提示</view>
<view class="content" v-if="exchange_id">
<view class="content" >
是否确认发布
</view>
<view class="content" v-else>
是否确认修改
</view>
<view class="btnbox">
<view class="cancle" @click="cancelConfirmPublish">取消</view>
<view class="ok" @click="confirmConfirmPublish">确定</view>
@@ -478,6 +494,7 @@
class="column"
v-for="item in labelObj.list1"
:key="item.app_iden"
v-show="item.label_name!='热门话题'"
>
<up-radio
activeColor="#3CC7C0 "
@@ -530,12 +547,13 @@
</up-radio-group>
</view>
</scroll-view>
</view>
</up-popup>
</template>
<script setup>
import { reactive, ref } from "vue";
import { nextTick, reactive, ref } from "vue";
import backNav from "@/components/backNav/backNav";
import photoImg from "@/static/photo.png";
import addImg from "@/static/add.png";
@@ -550,7 +568,7 @@ import { onLoad,onReady } from "@dcloudio/uni-app";
import throttle from "@/utils/throttle"
import svEditor from "@/uni_modules/sv-editor/components/sv-editor/sv-editor.vue";
import pEditor from "@/components/pEditor/pEditor"
import videoface from "@/static/videoface.jpg";
const uToast=ref(null);
//import SvEditorToolbar from "@/uni_modules/sv-editor/components/sv-editor/sv-editor-toolbar.vue";
import {
@@ -561,6 +579,7 @@ import {
const isLock = ref(false);
const isFlag = ref(false);
const delId = ref("");
const scrollView=ref(null)
const showModal = ref(false);
const delType = ref("delDraft"); //delDraft saveDraft
const isPublish = ref(false);
@@ -573,7 +592,9 @@ const form = reactive({
exchange_title: "",
exchange_content: "",
exchange_summary: "",
case_exchange_vote: {},
case_exchange_vote: {
vote_title: ""
},
case_exchange_label: [],
});
const voteData = reactive({
@@ -585,6 +606,8 @@ const voteData = reactive({
},
],
});
const videoface=ref('https://caseplatform.oss-cn-beijing.aliyuncs.com/prod/static/shipinfengmian.jpg')
const showQuit=ref(false)
const value = ref("");
const isConfirmPublish=ref(false)
const showVote = ref(false);
@@ -598,13 +621,13 @@ const editorCtxResult = ref(null);
const isFocusInfo = ref(false);
const isFocusResult = ref(false);
const labelList = ref([]);
const infoHeight=ref(100);
const pEditorRef=ref(null);
const infoHeight=ref(300);
let inithtmlString =
"<p>【患者信息】:</p><br/><p>【主诉】:</p><br/><p>【现病史及既往史】:</p><br/><p>【检查】:</p><br/><p>【临床诊断】:</p><br/><p>【治疗经过及结果】:</p><br/><br/>";
const infoHtml=ref(inithtmlString);
const resultHtml=ref('');
const resultHeight=ref(100);
const resultHeight=ref(300);
const showInfoOpacity=ref(true)
const level = ref(1);
const freshKey=ref(0);
@@ -627,6 +650,24 @@ const labelObj = reactive({
list2: [],
list3: []
});
const cancelQuit=()=>{
showQuit.value=false;
}
const confirmQuit=()=>{
showQuit.value=false;
goBack();
}
const oldScrollTop=ref(0)
const scrollTop=ref(0)
const scroll=(e)=>{
oldScrollTop.value=e.detail.scrollTop
}
const toTop=()=>{
scrollTop.value=oldScrollTop.value
nextTick(()=>{
scrollTop.value=0
})
}
const goBack = () => {
uni.navigateBack({
delta: 1,
@@ -636,56 +677,70 @@ const editorCotent=ref('')
const closeEditor=()=>{
showEditor.value=false;
};
const changeEditor=(data)=>{
console.log('content');
console.log(data.content);
showEditor.value=false;
if(data.type=="info"){
infoHtml.value=data.content
form.exchange_content=data.content;
//infoHtml.value=data.content;
infoHeight.value=600;
editorCtx.value.initHtml(data.content,async (videoUrl) => {
let res='';
// #ifdef APP || H5
// res = await this.editorCtx.createVideoThumbnail(videoUrl)
// #endif
let res =""
console.log(videoface.value)
res = await editorCtx.value.createCoverThumbnail(videoface.value)
const fox = videoface
res = await editorCtx.value.createCoverThumbnail(fox)
showEditor.value=false;
return res
})
setTimeout(()=>{
const query = wx.createSelectorQuery();
query.select('#infoContent').boundingClientRect(function(rect){
console.log(rect.height);
infoHeight.value=rect.height+10
// 输出元素的高度
}).exec();
},0)
},async()=>{
})
setTimeout(async()=>{
let info_str=await editorCtx.value.getLastContent();
infoHtml.value=info_str.html;
// console.log("获取变动");
// console.log( editorCtx.value.exportHtml(info_str.html));
setTimeout(()=>{
const query = wx.createSelectorQuery();
query.select('#infoContent').boundingClientRect(function(rect){
console.log(rect.height);
infoHeight.value=rect.height+10;
// 输出元素的高度
}).exec();
},1000)
},1000)
}else{
resultHtml.value=data.content
form.exchange_summary=data.content;
//resultHtml.value=data.content;
editorCtxResult.value.initHtml(data.content,async (videoUrl) => {
let res='';
// #ifdef APP || H5
// res = await this.editorCtx.createVideoThumbnail(videoUrl)
// #endif
const fox = videoface
res = await editorCtx.value.createCoverThumbnail(fox)
showEditor.value=false;
res = await editorCtxResult.value.createCoverThumbnail(videoface.value)
return res
},async()=>{
})
setTimeout(()=>{
const query = wx.createSelectorQuery();
query.select('#resultContent').boundingClientRect(function(rect){
console.log(rect.height);
resultHeight.value=rect.height+10
// 输出元素的高度
}).exec();
},0)
setTimeout(async()=>{
let info_str=await editorCtxResult.value.getLastContent();
resultHtml.value=info_str.html;
setTimeout(()=>{
const query = wx.createSelectorQuery();
query.select('#resultContent').boundingClientRect(function(rect){
console.log(rect.height);
resultHeight.value=rect.height+10;
toTop()
// 输出元素的高度
}).exec();
},1000)
},1000)
}
// setTimeout(()=>{
// showEditor.value=false;
// },1000)
};
const openDraftList=()=>{
getDraftList();
@@ -755,30 +810,31 @@ const saveVote = () => {
});
return false;
}
if (voteData.case_exchange_vote_option.length == 0) {
if(voteData.case_exchange_vote_option.length <2) {
uni.showToast({
title: "请添加投票选项",
title: "请至少设置2个选项",
icon: "none",
});
return false;
}
// for (let i = 0; i < voteData.case_exchange_vote_option.length; i++) {
// if (voteData.case_exchange_vote_option[i].option_value == "") {
// uni.showToast({
// title: "投票选项不能为空",
// icon: "none",
// });
// return false;
// }
// if (voteData.case_exchange_vote_option[i].option_value.length > 16) {
// uni.showToast({
// title: "第" + (i + 1) + "个投票选项超过16个字符",
// icon: "none",
// });
// return false;
// }
// }
for (let i = 0; i < voteData.case_exchange_vote_option.length; i++) {
if (voteData.case_exchange_vote_option[i].option_value == "") {
uni.showToast({
title: "投票选项不能为空",
icon: "none",
});
return false;
}
if (voteData.case_exchange_vote_option[i].option_value.length > 16) {
uni.showToast({
title: "第" + (i + 1) + "个投票选项超过16个字符",
icon: "none",
});
return false;
}
}
// if (voteData.case_exchange_vote_option.length < 2) {
// uni.showToast({
// title: "至少添加两个选项",
@@ -816,26 +872,24 @@ const ready = (e) => {
let html =
"<p>【患者信息】:</p><br/><p>【主诉】:</p><br/><p>【现病史及既往史】:</p><br/><p>【检查】:</p><br/><p>【临床诊断】:</p><br/><p>【治疗经过及结果】:</p><br/><br/>";
editorCtx.value.initHtml(html);
//editorCtx.value.initHtml(html);
// setTimeout(()=>{
uni.hideKeyboard();
uni.pageScrollTo({
scrollTop:0,
selector:"#form"
// })
})
toTop()
};
const readyResult = (e) => {
editorCtxResult.value = e;
setTimeout(()=>{
toTop()
setTimeout(()=>{
if(exchange_id.value){
getExchangeDetail(exchange_id.value);
}
uni.hideLoading();
//uni.hideLoading();
})
//editorCtxResult.value.initHtml("")
};
const clearMuBan = () => {
@@ -847,10 +901,17 @@ const clearMuBan = () => {
const focusInfo = async() => {
isFocusInfo.value = true;
const res= await editorCtx.value.getLastContent();
editorCotent.value=res.html
editorCotent.value=editorCtx.value.exportHtml(res.html);
console.log("focus")
console.log('editorCotent.value')
console.log(editorCotent.value)
showEditor.value=true;
editorType.value="info"
// uni.onKeyboardHeightChange(res => {
// console.log(res.height);
// bottomHeight.value=res.height*2;
@@ -873,7 +934,7 @@ const blurInfo = () => {
const focusResult = async() => {
isFocusResult.value = true;
const res= await editorCtxResult.value.getLastContent();
editorCotent.value=res.html
editorCotent.value=editorCtxResult.value.exportHtml(res.html)
editorType.value="result";
showEditor.value=true;
// uni.onKeyboardHeightChange(res => {
@@ -933,7 +994,7 @@ const saveDraft = async () => {
if (isLock.value) return false;
isLock.value = true;
const res = await editorCtx.value.getLastContent();
form.exchange_content = res.html;
form.exchange_content = res.html;
const resResult = await editorCtxResult.value.getLastContent();
form.exchange_summary = resResult.html;
@@ -942,10 +1003,12 @@ const saveDraft = async () => {
}
api.saveDraft(form).then((res) => {
isLock.value = false;
goBack()
uni.showToast({
title: "保存成功",
icon: "none",
});
getDraftList();
});
};
@@ -959,37 +1022,26 @@ const getExchangeDetail = (id) => {
exchange_summary,
exchange_vote,
} = res.data.data;
editorCtx.value.initHtml(exchange_content,async (videoUrl) => {
let res
// #ifdef APP || H5
// res = await this.editorCtx.createVideoThumbnail(videoUrl)
// #endif
const fox = videoface
res = await editorCtx.value.createCoverThumbnail(fox)
return res
});
form.exchange_content = exchange_content;
//form.exchange_content = exchange_content;
changeEditor({
type:"info",
content:exchange_content
})
//infoHtml.value=exchange_content;
form.exchange_title = exchange_title;
form.case_exchange_label = exchange_label? exchange_label:[];
labelList.value = exchange_label?exchange_label:[];
form.exchange_summary = exchange_summary;
form.case_exchange_vote = exchange_vote;
editorCtxResult.value.initHtml(exchange_summary,async (videoUrl) => {
let res
// #ifdef APP || H5
// res = await this.editorCtx.createVideoThumbnail(videoUrl)
// #endif
const fox = videoface
res = await editorCtxResult.value.createCoverThumbnail(fox)
return res
});
Object.assign(voteData, exchange_vote);
//form.exchange_summary = exchange_summary;
//resultHtml.value=exchange_summary;
form.case_exchange_vote = exchange_vote?exchange_vote:{};
changeEditor({
type:"result",
content:exchange_summary
})
Object.assign(voteData, exchange_vote);
});
};
const editDraft = (index) => {
@@ -1001,16 +1053,32 @@ const editDraft = (index) => {
exchange_summary,
exchange_vote,
} = draft;
editorCtx.value.initHtml(exchange_content);
form.exchange_content = exchange_content;
if(exchange_content){
let html= editorCtx.value.exportHtml(exchange_content.replace('undefined',''));
//form.exchange_content=html;
changeEditor({
type:"info",
content: html
})
}
if(exchange_content){
let html= editorCtxResult.value.exportHtml(exchange_summary.replace('undefined',''));
changeEditor({
type:"result",
content:html
})
}
form.exchange_title = exchange_title;
form.case_exchange_label = exchange_label;
labelList.value = exchange_label;
form.case_exchange_label = exchange_label? exchange_label:[];
labelList.value = exchange_label?exchange_label:[];
form.exchange_summary = exchange_summary;
form.case_exchange_vote = exchange_vote;
editorCtxResult.value.initHtml(exchange_summary);
Object.assign(voteData, exchange_vote);
showDraft.value = false;
form.case_exchange_vote = exchange_vote?exchange_vote:{};
Object.assign(voteData, exchange_vote);
showDraft.value = false;
};
const willDelDraft = (id) => {
delId.value = id;
@@ -1049,39 +1117,45 @@ const delDraft = (id) => {
};
const alertSave = async () => {
if(isPublish.value || exchange_id.value){
goBack()
}else{
const res = await editorCtx.value.getLastContent();
const initInfo =
"<p>【患者信息】:</p><br/><p>【主诉】:</p><br/><p>【现病史及既往史】:</p><br/><p>【检查】:</p><br/><p>【临床诊断】:</p><br/><p>【治疗经过及结果】:</p>";
//let html = editorCtx.value.exportHtml(res.html);
//const initInfo= "<p>【患者信息】:</p><br/><p>【主诉】:</p><br/><p>【现病史及既往史】:</p><br/><p>【检查】:</p><br/><p>【临床诊断】:</p><br/><p>【治疗经过及结果】:</p><br/><br/>";
const resContent = await editorCtxResult.value.getLastContent();
//let reshtml = editorCtxResult.value.exportHtml(resContent.html);
if (
form.exchange_title ||
res.html!=initInfo ||
resContent.text ||
(form.case_exchange_vote &&
form.case_exchange_vote.vote_title &&
form.case_exchange_label &&
form.case_exchange_label.length > 0)
) {
delType.value = "saveDraft";
showModal.value = true;
} else {
goBack();
}
}
if(exchange_id.value){
showQuit.value=true;
}else{
if(isPublish.value){
goBack()
}else{
const res = await editorCtx.value.getLastContent();
const initInfo =
"<p>【患者信息】:</p><br/><p>【主诉】:</p><br/><p>【现病史及既往史】:</p><br/><p>【检查】:</p><br/><p>【临床诊断】:</p><br/><p>【治疗经过及结果】:</p>";
//let html = editorCtx.value.exportHtml(res.html);
//const initInfo= "<p>【患者信息】:</p><br/><p>【主诉】:</p><br/><p>【现病史及既往史】:</p><br/><p>【检查】:</p><br/><p>【临床诊断】:</p><br/><p>【治疗经过及结果】:</p><br/><br/>";
const resContent = await editorCtxResult.value.getLastContent();
//let reshtml = editorCtxResult.value.exportHtml(resContent.html);
if (
form.exchange_title ||
res.html!=initInfo ||
resContent.text ||
(form.case_exchange_vote &&
form.case_exchange_vote.vote_title &&
form.case_exchange_label &&
form.case_exchange_label.length > 0)
) {
delType.value = "saveDraft";
showModal.value = true;
} else {
goBack();
}
}
}
};
const cconfirmConfirmPublish=()=>{
confirmConfirmPublish.value=false;
const confirmConfirmPublish=()=>{
isConfirmPublish.value=false;
publish();
}
const publish =throttle(async () => {
console.log(3333);
const initInfo =
"<p>【患者信息】:</p><br/><p>【主诉】:</p><br/><p>【现病史及既往史】:</p><br/><p>【检查】:</p><br/><p>【临床诊断】:</p><br/><p>【治疗经过及结果】:</p>";
if (form.exchange_title == "") {
@@ -1098,9 +1172,19 @@ const publish =throttle(async () => {
});
return false;
}
const res = await editorCtx.value.getLastContent();
let html = editorCtx.value.exportHtml(res.html);
if (html == initInfo) {
if(form.exchange_content==""){
uni.showToast({
title: "请编辑病例信息",
icon: "none",
});
return false;
}
// const res = await editorCtx.value.getLastContent();
// let html = editorCtx.value.exportHtml(res.html);
// console.log('htmlinfo')
// console.log(html)
if (form.exchange_content == initInfo) {
uni.showToast({
title: "请编辑病例信息",
icon: "none",
@@ -1119,10 +1203,15 @@ const publish =throttle(async () => {
form.case_exchange_label = labelList.value;
if(isLock.value) return false;
isFlag.value = true;
form.exchange_content = html;
const resContent = await editorCtxResult.value.getLastContent();
let reshtml = editorCtxResult.value.exportHtml(resContent.html);
form.exchange_summary = reshtml=="<p><br></p>"?'':reshtml;
//form.exchange_content = html;
// const resContent = await editorCtxResult.value.getLastContent();
// let reshtml = editorCtxResult.value.exportHtml(resContent.html);
// console.log('reshtml')
// console.log(reshtml)
if(form.exchange_summary=="<p><br></p>"){
form.exchange_summary==''
}
//form.exchange_summary = reshtml=="<p><br></p>"?'':reshtml;
if(exchange_id.value){
api.updateExchange(exchange_id.value,form).then((res) => {
uni.showToast({
@@ -1281,10 +1370,7 @@ const HandleAddVideo = async (file) => {
if (res.statusCode === 204) {
let url = host + "/" + dir + filename + imgType;
console.log(editorCtx);
let imgUrl =videoface;
const fileThumbnail = await editorCtx.createCoverThumbnail(
imgUrl
);
const fileThumbnail = await editorCtx.createCoverThumbnail(videoface.value);
resolve([
{
videoUrl: url,
@@ -1303,7 +1389,7 @@ const HandleAddVideo = async (file) => {
});
});
if (videos) {
uni.hideLoading();
//uni.hideLoading();
uni.showToast({ title: "添加视频成功", icon: "success" });
} else {
uni.showToast({ title: "添加视频失败", icon: "error" });
@@ -1501,27 +1587,16 @@ onReady(()=>{
type: "loading",
title: "正在加载",
message: "正在加载",
duration:1000
duration:1500
})
})
onLoad((optoions) => {
onLoad((options) => {
if(optoions.exchange_id){
exchange_id.value=optoions.exchange_id;
console.log(1111)
console.log(exchange_id.value)
if(options.exchange_id){
exchange_id.value=options.exchange_id;
}
//getDraftList();
});
// const previewImg = () => {
// uni.previewImage({
// current: "https://example.com/image1.jpg",
// urls: ["https://example.com/image1.jpg", "https://example.com/image2.jpg"],
// });
// };
</script>
<style lang='scss' scoped>
@@ -1785,9 +1860,10 @@ onLoad((optoions) => {
}
}
#editor {
position:relative;
position:relative;
z-index:2;
padding: 0 10rpx;
min-height:600rpx;
min-height:600rpx;
.editorcon{
position: absolute;
top:0;
@@ -1797,12 +1873,17 @@ position:relative;
opacity:1
}
.editorcon.active{
opacity:0
opacity:0;
}
.infoContent{
position: relative;
z-index:2;
background: #fff;
margin:0 32rpx;
word-break: break-all;
word-wrap: break-word;
word-break: break-all;
/* position: relative;
z-index:2; */
}
@@ -1824,7 +1905,7 @@ min-height: 600rpx;
top:0;
width:100%;
bottom:0;
z-index:1;
z-index:-1;
opacity:1
}
.editorcon.active{
@@ -1832,7 +1913,8 @@ min-height: 600rpx;
}
.resultContent{
margin:0 32rpx;
word-break: break-all;
word-wrap: break-word;
word-break: break-all;
}
.mask{
opacity: 0;
@@ -2159,9 +2241,9 @@ min-height: 600rpx;
display: flex;
align-items: center;
justify-content: center;
margin-right: 25rpx;
}
.vote {
margin-left: 25rpx;
width: 162rpx;
height: 86rpx;
background: rgba(0, 0, 0, 0);
+2 -2
View File
@@ -63,7 +63,7 @@
<script setup>
import { ref, reactive } from "vue";
import { onLoad } from "@dcloudio/uni-app";
const src = ref("https://wx.igandan.com/hcp/toRegister?fromType=wx");
const src = ref("https://dev-wx.igandan.com/hcp/toRegister?fromType=wx");
const model = reactive({
name: "",
});
@@ -141,7 +141,7 @@ onLoad(() => {
const { envVersion } = uni.getAccountInfoSync().miniProgram;
console.log(envVersion)
if (envVersion == "release") {
src.value = "https://wx.igandan.com/hcp/toRegister";
src.value = "https://wx.igandan.com/hcp/toRegister?fromType=weChat";
} else {
src.value = "https://dev-wx.igandan.com/hcp/toRegister?fromType=weChat";
}
+1
View File
@@ -152,6 +152,7 @@
class="column"
v-for="item in labelObj.list1"
:key="item.app_iden"
v-show="item.label_name!='热门话题'"
>
<up-radio
activeColor="#3CC7C0 "
+10 -5
View File
@@ -11,7 +11,7 @@
<template #top>
<navBarSearch
:searchWord="keyWord"
:navName="'肝胆相照病例交流园地'"
:navName="navName"
@changeWord="changeWord"
></navBarSearch>
<!-- <view class="bar"></view> -->
@@ -95,8 +95,9 @@
>
<view
:key="unit"
class="imgcell"
v-for="unit in item.exchange_content_image"
v-for="unit in item.exchange_content_image.splice(0,3)"
>
<up--image
:src="unit"
@@ -119,7 +120,7 @@
>
<video
:key="index"
v-for="(videoCell, index) in item.exchange_content_video"
v-for="(videoCell, index) in item.exchange_content_video.slice(0,1)"
class="myVideo"
:src="videoCell"
@error="videoErrorCallback"
@@ -127,10 +128,10 @@
></video>
</view>
</view>
<view class="tagbox" @click="goDetail(item.exchange_id)" v-if="item.label && item.label.length > 0">
<view class="tagbox" @click="goDetail(item.exchange_id)" v-if="item.exchange_label">
<view
class="tag"
v-for="cell in item.label"
v-for="cell in item.exchange_label"
:key="cell.exchange_label_id"
>{{ cell.label_name }}</view
>
@@ -223,6 +224,7 @@
class="column"
v-for="item in labelObj.list1"
:key="item.app_iden"
v-show="item.label_name!='热门话题'"
>
<up-radio
activeColor="#3CC7C0 "
@@ -325,6 +327,7 @@ const user_id = ref("");
const showModal=ref(false);
const showDeal=ref(false);
const is_selected = ref(0);
const navName=ref('肝胆相照病例交流园地')
const isMine=ref(false)
const paging = ref(null);
const dataList = ref([]);
@@ -561,6 +564,7 @@ onLoad((options) => {
}
if(options.is_selected){
is_selected.value = options.is_selected;
navName.value="肝胆相照精选病例交流"
}
if(options.type=="mine"){
isMine.value=true;
@@ -568,6 +572,7 @@ onLoad((options) => {
if(options.from=="talkHome"){
showNum.value=true;
}
// if(options)「」
getCaseLabel(1,0)
});
onShow(()=>{