This commit is contained in:
liuyuan
2025-07-23 09:26:01 +08:00
parent 6fa247d0fa
commit 7ee25342cc
28 changed files with 8158 additions and 77 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,387 @@
<template>
<view class="content">
<z-nav-bar title="新增医案" bgColor="#5188e5" fontColor="#fff" >
</z-nav-bar>
<view class="containerBg1">
<uni-section title="基本用法" type="line" >
<view class="example">
<!-- 基础用法不包含校验规则 -->
<uni-forms ref="baseForm" :modelValue="baseFormData">
<uni-forms-item label="医案分类" required :label-width="80">
<view style="line-height: 36px;" @click="showDrawer" :style="baseFormData.labelId?'color:#5188e5;font-weight: 700;':'color:#888'">{{ baseFormData.labelId?baseFormData.labelTitle:'请选择医案分类' }}</view>
</uni-forms-item>
<uni-forms-item label="医案标题" required :label-width="80">
<textarea v-model="baseFormData.title" maxlength="-1"
auto-height
placeholder="请输入医案标题"
placeholder-class="custom-placeholder" />
</uni-forms-item>
</uni-forms>
</view>
</uni-section>
</view>
<tree-list ref="treeList" v-if="treeListVisible" @clickCourseInfo="clickCourseInfo"></tree-list>
<z-navigation></z-navigation>
</view>
</template>
<script>
import $http from "@/config/requestConfig.js";
import treeList from './tag.vue'
export default {
components: {
treeList,
},
data() {
return {
form:{},
baseFormData:{},
tabsList: [],
currentCateIndex: 0,
list: [],
null_text: '',
current: 1,
limit: 10,
courseName: '',
taihumedId: null,
timer: null,
showText: false,
noMore: false,
show: null,
count: 0,
scrollTop: 0, //滚动位置
isRefreshing: false, //刷新状态
treeListVisible: false, //刷新状态
}
},
onPullDownRefresh() {
this.isRefreshing = true;
console.log("下拉刷新");
setTimeout(() => {
this.current = 1;
this.list = [];
this.noMore = false;
this.getListData(this.tabsList[this.currentCateIndex].id);
uni.stopPullDownRefresh();
this.isRefreshing = false;
console.log("下拉刷新已停止");
}, 800);
},
onLoad() {
uni.hideTabBar();
this.getTabData();
},
onShow() {
},
methods: {
clickCourseInfo(val){
console.log(val)
this.baseFormData.labelId=val.id
this.baseFormData.labelTitle=val.title
this.$forceUpdate();
},
showDrawer(){
this.treeListVisible = true
this.$nextTick( ()=> {
this.$refs['treeList'].getData()
})
},
createFolder(){
uni.navigateTo({
url: `/pages/medicalRecords/add?navTitle='创建医案'&title='创建医案'`
});
},
//判断显示‘上/中/下’
formatContent(content) {
const keywords = ["上部", "中部", "下部"];
let result = [];
// 判断是否包含关键字
keywords.forEach((keyword) => {
if (content.includes(keyword)) {
result.push(keyword.substring(0, 1));
}
});
return result.join("");
},
//获取tab数据
getTabData() {
// this.$http.request({
// url: 'taihumed/course/getCourseTaihumedList',
// method: "POST",
// data: {},
// header: {
// "Content-Type": "application/json",
// },
// })
// .then(res=> {
// if (res.list&&res.list.length>0) {
this.tabsList = [
{id:0,title:'草稿箱'},
{id:1,title:'待审核'},
{id:3,title:'已完成'},
{id:2,title:'审核失败'},
];
this.taihumedId = this.tabsList[0].id;
this.getListData(this.taihumedId);
// }
// });
},
//获取列表数据
getListData(taihumedId, type) {
if(type){
this.current = 1;
this.list = [];
this.noMore = false;
}
if(this.noMore){
return false;
};
uni.showLoading({
title: '加载中'
})
this.$http.request({
url: 'common/medicalRecords/medicalRecordsList',
method: "POST",
data: {
state: taihumedId,
},
header: {
"Content-Type": "application/json",
},
})
.then(res=> {
uni.hideLoading();
this.list=[...res.medicalRecordsList]
// this.count = res.pageRes.total; //总数
// let length = res.pageRes.records.length;
// if (res.pageRes.records&&length>0) {
// this.show = true;
// //如果返回的数据少于每页数量,表示没有更多数据
// if(this.count==length || length < this.limit ||this.count/this.current==this.limit){
// this.noMore = true;
// }
// this.list = [...this.list, ...res.pageRes.records];
// this.current += 1; //更新页码
// //显示提示语
// this.showText = true;
// if(this.current==2||type){
// this.scrollTop = 0
// this.$nextTick(() => {
// this.scrollTop = 0.1; // 确保触发滚动
// })
// }
// }else{
// this.show = false;
// this.null_text = '暂无数据';
// }
});
},
//加载更多
loadMore(){
this.getListData(this.taihumedId);
},
//切换tab状态
ordersTabCLi(data, index) {
this.currentCateIndex = index;
this.courseName = '';
this.taihumedId = data.id;
//重置
this.list = [];
this.noMore = false;
this.show = false;
this.count = 0;
this.current = 1;
this.getListData(this.taihumedId);
},
//详情
goToDetail(item){
if (this.isRefreshing) return;
uni.navigateTo({
url: `/pages/curriculum/index?navTitle=${item.title}&title=${item.title}&id=${item.id}`
});
},
},
}
</script>
<style lang="scss" scoped>
@import '@/static/mixin.scss';
.content{
height: 100%;
overflow: auto;
background-color: #fff;
}
.doctors_list{
margin: 0 30rpx 20rpx;
}
.doctors_item{
border: 1rpx solid $themeColor;
border-radius: 15rpx;
margin-bottom: 20rpx;
padding: 25rpx 25rpx 60rpx;
display: flex;
align-items: center;
position: relative;
}
.item_image{
display: block;
width: 200rpx;
height: 200rpx;
flex-shrink: 0;
background: #f3f3f3;
}
.item_right{
width: calc(100% - 200rpx);
margin-left: 30rpx;
padding-bottom: 20rpx;
}
.item_top{
display: flex;
align-items: center;
line-height: 40rpx;
}
.item_name{
font-size: 32rpx;
color: #333;
font-weight: bold;
}
.item_title{
font-size: 32rpx;
color: #333;
}
.item_con{
font-size: 30rpx;
font-weight: bold;
color: #333;
margin-top: 10rpx;
line-height: 40rpx;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.null_text{
display: block;
text-align: center;
font-size: 30rpx;
color: #999;
padding-top: 300rpx;
}
.doctors_module{
width: 100%;
position: fixed;
z-index: 99;
left: 0;
}
.cateList{
background: #f3f3f3;
}
.flex{
display: flex;
align-items: center;
width: 100%;
}
.name_search{
background-color: #fff;
padding: 20rpx 30rpx;
display: flex;
align-items: center;
/deep/.is-input-border{
background-color: #f3f3f3;
border-radius: 50rpx;
height: 60rpx;
line-height: 30rpx;
padding: 15rpx;
font-size: 28rpx;
color: #666;
}
/deep/.uni-easyinput__content-input{
}
.name-placeholder{
font-size: 28rpx;
text-align: center;
color: #666;
}
button{
background-color: $themeBgColor;
font-size: 26rpx;
line-height: 36rpx;
border-radius: 15rpx;
color: #fff;
padding: 5rpx 20rpx;
margin-left: 15rpx;
}
}
.show-more,.no-more{
display: inline-block;
width: 100%;
font-size: 24rpx;
padding-top: 5rpx;
color: #ccc;
text-align: center;
}
.list_item_study{
line-height: 48rpx;
background: $themeBgColor;
color: #fff;
border-radius: 40rpx;
font-size: 24rpx;
padding: 0 20rpx;
}
.list_item_bt{
display: flex;
align-items: center;
position: absolute;
right: 20rpx;
bottom: 20rpx;
}
.list_item_price{
font-size: 30rpx;
font-weight: 500;
margin-right: 30rpx;
color: red;
line-height: 54rpx;
}.top_right{
display: flex;
align-items: center;
margin-right: 30rpx;
text{
font-size: 28rpx;
color: #fff;
padding-left: 2rpx;
}
}
.containerBg1{
padding: 40rpx;
}
</style>

1459
pages/medicalRecords/add.vue Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,404 @@
<template>
<view class="content">
<z-nav-bar title="我的医案" bgColor="#5188e5" fontColor="#fff" >
<template v-slot:right>
<view class="top_right" @tap="createFolder">
<uni-icons type="folder-add" size="17" color="#fff"></uni-icons>
<text>创建医案</text>
</view>
</template>
</z-nav-bar>
<view class="doctors_module" :style="`top: ${42 + statusBarHeight}px;`">
<view class="cateList flexbox">
<common-sticky itemStyle="width:25%; height: 38px;font-size:24rpx;" :list="tabsList" label="title"
:currentCateIndex="currentCateIndex" @handleselectCate="ordersTabCLi"></common-sticky>
</view>
<!-- <view class="name_search">
<uni-easyinput
v-model="courseName"
prefixIcon="search"
placeholder="按医案标题搜索"
placeholderClass="name-placeholder"
class="center-input"
/>
<button @click="getListData(taihumedId, true)">查询</button>
</view> -->
</view>
<scroll-view scroll-y="true"
:scroll-top="scrollTop"
@scrolltolower="loadMore"
style="height: calc(100vh - 300rpx); margin-top: 185rpx; padding-bottom: 140rpx;"
v-if="show==true">
<view class="doctors_list" id="top">
<view class="doctors_item" v-for="(item,index) in list" :key="index" @click="goToDetail(item)">
<view class="flex">
<view class="flex">
<image v-if="item.squareImage" :src="item.squareImage" class="item_image" mode="aspectFit"></image>
<image v-else src="../../static/logo_zi.png" class="item_image" mode="aspectFit"></image>
<view class="item_right" v-if="currentCateIndex!=2">
<view class="item_top">
<text class="item_name" v-if="item.taihuTalent&&item.taihuTalent.length>0">{{item.taihuTalent[0].name}}</text>
</view>
<text class="item_con">{{item.title}}</text>
</view>
<view class="item_right" v-else>
<view class="item_top">
<text class="item_name">{{item.title}}</text>
</view>
<text class="item_con">{{ item.taihuTalent.map(talent => talent.name).join(' ') }}</text>
</view>
</view>
</view>
<view class="list_item_bt">
<view class="list_item_price" v-if="item.courseCatalogueEntityList.length==1">
<text v-if="item.courseCatalogueEntityList[0].halfFee==0">免费</text>
<text v-else>¥{{item.courseCatalogueEntityList[0].halfFee}}/{{item.courseCatalogueEntityList[0].fee}}</text>
</view>
<view class="list_item_price" v-if="item.courseCatalogueEntityList.length>1">
<text v-for="(v,i) in item.courseCatalogueEntityList" :key="i">
{{formatContent(v.title)}}<text v-if="i !== item.courseCatalogueEntityList.length - 1">/</text>
</text>
<text v-if="item.courseCatalogueEntityList[0].halfFee==0" style="padding-left: 20rpx;">免费</text>
<text v-else style="margin-left: 20rpx;">{{item.courseCatalogueEntityList[0].halfFee}}/{{item.courseCatalogueEntityList[0].fee}}</text>
</view>
<text class="list_item_study">了解课程</text>
</view>
</view>
</view>
<text v-show="showText&&count>list.length" class="show-more">加载更多</text>
<text v-show="noMore" class="no-more">没有更多了</text>
</scroll-view>
<text class="null_text" v-else>{{null_text}}</text>
<z-navigation></z-navigation>
</view>
</template>
<script>
import $http from "@/config/requestConfig.js";
export default {
data() {
return {
tabsList: [],
currentCateIndex: 0,
list: [],
null_text: '',
current: 1,
limit: 10,
courseName: '',
taihumedId: null,
timer: null,
showText: false,
noMore: false,
show: null,
count: 0,
scrollTop: 0, //滚动位置
isRefreshing: false, //刷新状态
}
},
onPullDownRefresh() {
this.isRefreshing = true;
console.log("下拉刷新");
setTimeout(() => {
this.current = 1;
this.list = [];
this.noMore = false;
this.getListData(this.tabsList[this.currentCateIndex].id);
uni.stopPullDownRefresh();
this.isRefreshing = false;
console.log("下拉刷新已停止");
}, 800);
},
onLoad() {
uni.hideTabBar();
this.getTabData();
},
onShow() {
},
methods: {
createFolder(){
uni.navigateTo({
url: `/pages/medicalRecords/add?navTitle='创建医案'&title='创建医案'`
});
},
//判断显示‘上/中/下’
formatContent(content) {
const keywords = ["上部", "中部", "下部"];
let result = [];
// 判断是否包含关键字
keywords.forEach((keyword) => {
if (content.includes(keyword)) {
result.push(keyword.substring(0, 1));
}
});
return result.join("");
},
//获取tab数据
getTabData() {
// this.$http.request({
// url: 'taihumed/course/getCourseTaihumedList',
// method: "POST",
// data: {},
// header: {
// "Content-Type": "application/json",
// },
// })
// .then(res=> {
// if (res.list&&res.list.length>0) {
this.tabsList = [
{id:0,title:'草稿箱'},
{id:1,title:'待审核'},
{id:3,title:'已完成'},
{id:2,title:'审核失败'},
];
this.taihumedId = this.tabsList[0].id;
this.getListData(this.taihumedId);
// }
// });
},
//获取列表数据
getListData(taihumedId, type) {
if(type){
this.current = 1;
this.list = [];
this.noMore = false;
}
if(this.noMore){
return false;
};
uni.showLoading({
title: '加载中'
})
this.$http.request({
url: 'common/medicalRecords/medicalRecordsList',
method: "POST",
data: {
state: taihumedId,
},
header: {
"Content-Type": "application/json",
},
})
.then(res=> {
uni.hideLoading();
this.list=[...res.medicalRecordsList]
// this.count = res.pageRes.total; //总数
// let length = res.pageRes.records.length;
// if (res.pageRes.records&&length>0) {
// this.show = true;
// //如果返回的数据少于每页数量,表示没有更多数据
// if(this.count==length || length < this.limit ||this.count/this.current==this.limit){
// this.noMore = true;
// }
// this.list = [...this.list, ...res.pageRes.records];
// this.current += 1; //更新页码
// //显示提示语
// this.showText = true;
// if(this.current==2||type){
// this.scrollTop = 0
// this.$nextTick(() => {
// this.scrollTop = 0.1; // 确保触发滚动
// })
// }
// }else{
// this.show = false;
// this.null_text = '暂无数据';
// }
});
},
//加载更多
loadMore(){
this.getListData(this.taihumedId);
},
//切换tab状态
ordersTabCLi(data, index) {
this.currentCateIndex = index;
this.courseName = '';
this.taihumedId = data.id;
//重置
this.list = [];
this.noMore = false;
this.show = false;
this.count = 0;
this.current = 1;
this.getListData(this.taihumedId);
},
//详情
goToDetail(item){
if (this.isRefreshing) return;
uni.navigateTo({
url: `/pages/curriculum/index?navTitle=${item.title}&title=${item.title}&id=${item.id}`
});
},
},
}
</script>
<style lang="scss" scoped>
@import '@/static/mixin.scss';
.content{
height: 100%;
overflow: auto;
background-color: #fff;
}
.doctors_list{
margin: 0 30rpx 20rpx;
}
.doctors_item{
border: 1rpx solid $themeColor;
border-radius: 15rpx;
margin-bottom: 20rpx;
padding: 25rpx 25rpx 60rpx;
display: flex;
align-items: center;
position: relative;
}
.item_image{
display: block;
width: 200rpx;
height: 200rpx;
flex-shrink: 0;
background: #f3f3f3;
}
.item_right{
width: calc(100% - 200rpx);
margin-left: 30rpx;
padding-bottom: 20rpx;
}
.item_top{
display: flex;
align-items: center;
line-height: 40rpx;
}
.item_name{
font-size: 32rpx;
color: #333;
font-weight: bold;
}
.item_title{
font-size: 32rpx;
color: #333;
}
.item_con{
font-size: 30rpx;
font-weight: bold;
color: #333;
margin-top: 10rpx;
line-height: 40rpx;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.null_text{
display: block;
text-align: center;
font-size: 30rpx;
color: #999;
padding-top: 300rpx;
}
.doctors_module{
width: 100%;
position: fixed;
z-index: 99;
left: 0;
}
.cateList{
background: #f3f3f3;
}
.flex{
display: flex;
align-items: center;
width: 100%;
}
.name_search{
background-color: #fff;
padding: 20rpx 30rpx;
display: flex;
align-items: center;
/deep/.is-input-border{
background-color: #f3f3f3;
border-radius: 50rpx;
height: 60rpx;
line-height: 30rpx;
padding: 15rpx;
font-size: 28rpx;
color: #666;
}
/deep/.uni-easyinput__content-input{
}
.name-placeholder{
font-size: 28rpx;
text-align: center;
color: #666;
}
button{
background-color: $themeBgColor;
font-size: 26rpx;
line-height: 36rpx;
border-radius: 15rpx;
color: #fff;
padding: 5rpx 20rpx;
margin-left: 15rpx;
}
}
.show-more,.no-more{
display: inline-block;
width: 100%;
font-size: 24rpx;
padding-top: 5rpx;
color: #ccc;
text-align: center;
}
.list_item_study{
line-height: 48rpx;
background: $themeBgColor;
color: #fff;
border-radius: 40rpx;
font-size: 24rpx;
padding: 0 20rpx;
}
.list_item_bt{
display: flex;
align-items: center;
position: absolute;
right: 20rpx;
bottom: 20rpx;
}
.list_item_price{
font-size: 30rpx;
font-weight: 500;
margin-right: 30rpx;
color: red;
line-height: 54rpx;
}.top_right{
display: flex;
align-items: center;
margin-right: 30rpx;
text{
font-size: 28rpx;
color: #fff;
padding-left: 2rpx;
}
}
</style>

View File

@@ -0,0 +1,214 @@
<template>
<view>
<uni-drawer ref="showRight" mode="right" :width="240" @change="changeD($event,'showRight')">
<view class="close">
<view class="zhan" style="width: 100%;"></view>
<u-icon name="close" @click="closeDrawer('showRight')" color="#2979ff" size="24"></u-icon>
</view>
<view class="proTitle">
<text>请选择医案分类</text>
</view>
<scroll-view class="warp" scroll-y="true" style="max-height: 80vh;">
<uni-collapse accordion v-if="treeList.length > 0" @change="collapseChange">
<uni-collapse-item v-for="(item, index) in treeList" :key="index" :title="item.title"
:show-animation="true" :showArrow="item.isLast==1?false:true">
<view class="content" >
<!-- <text class="text">{{item.title}}</text> -->
<view class="sub1List">
<!-- <view class="item leve2" @click.stop="clickCourseInfo(item)" >
<text class="textss"> {{item.title}}</text>
</view> -->
<view :class="['item', 'leve2']"
v-for="(item1, index1) in item.children" :key="index1"
@click.stop="clickCourseInfo(item1)">
<text class="textss" style="padding-left: 80rpx;"> {{item1.title}}</text>
<view class="sub2List" v-if="item1.children">
<view :class="['item', 'leve3']"
v-for="(item2, index2) in item1.children" :key="index2"
@click.stop="clickCourseInfo(item2)">
<text class="textss">{{item2.title}}</text>
<view class="sub3List" v-if="item2.isLast == 0 && item2.children && item2.children.length > 0">
<!-- <view :class="['item', 'leve4']" -->
<!-- <template> -->
<text class="textss" v-for="(item3, index3) in item2.children"
:key="index3"
@click.stop="clickCourseInfo(item3)">{{item3.title}}</text>
<!-- </view> -->
<!-- </template> -->
</view>
</view>
</view>
</view>
</view>
</view>
</uni-collapse-item>
</uni-collapse>
</scroll-view>
</uni-drawer>
</view>
</template>
<script>
export default {
name:"tagTree",
// props:['treeList'],
data() {
return {
treeList:[]
};
},methods:{
showDrawer(e) {
this.$refs[e].open()
// this.videoContext.pause()
// this.showTemp = true
console.log('打开抽屉')
},
getData() {
this.$http
.post('common/medicalRecords/getMedicalRecordsLabelList')
.then(res => {
if (res.code == 0 && res.Medicals.length > 0) {
this.treeList = res.Medicals
} else {
this.treeList = []
}
this.showDrawer('showRight')
}).catch(e => {
console.log(e, '报错')
uni.showToast({
title:"获取课程分类失败",
icon:"none"
})
});
},
handleCollapseChange(e){
console.log(e,'1111111111111')
},
clickCourseInfo(val){
this.$emit('clickCourseInfo',val)
if(val.isLast==1){
this.closeDrawer('showRight')
}
},
closeDrawer(e) {
this.$refs[e].close()
},
changeD(e, type) {
// console.log((type === 'showRight' ? '左窗口' : '右窗口') + (e ? '打开' : '关闭'));
this[type] = e
if (!e) {
console.log('关闭弹窗')
}
},
collapseChange(event) {
// 打印所有展开的索引
var val=this.treeList[event]
this.$emit('clickCourseInfo',val)
if(val.isLast==1){
this.closeDrawer('showRight')
}
// 如果你想获取展开的项的数据:
// event.detail返回的是一个包含展开项信息的数组
// 你可以通过索引或具体数据进行处理
},
}
}
</script>
<style lang="scss" scoped>
// ::v-deep uni-drawer{ height: 50vh !important;
// .uni-drawer__content{
// overflow-y: scroll !important;
// }
// }
.sub1List {
background-color: #f7f7f7;
// padding-left: 20rpx;
}
.content {
.item {
background-color: #fff;
line-height: 80rpx;
font-size: 28rpx;
color: #1b2a32;
// border-bottom: 1px solid #dae8f0;
text {
padding-left: 20rpx;
}
.item:last-child {
border-bottom: 0;
}
}
.item.active {
// background-color: #aed1ec;
color: #fff;
background-image: linear-gradient(90deg, #258feb 0%, #00e1ec 100%) !important;
}
.textss {
display: inline-block;
width: 100%;
border-bottom: 1px solid #ebeef5;
}
.leve2 {
.textss {
padding-left: 20rpx;
}
}
.leve2 {
.textss {
padding-left: 40rpx;
}
}
.leve3 {
.sub3List{
border-bottom: 1px solid #ebeef5; padding-left: 60rpx;
.textss{background-color: #ebeef5; border-radius: 20rpx; padding: 10rpx 14rpx !important;}
}
.textss {
padding-left: 60rpx; display: inline; margin-right: 20rpx; border:none !important;
}
}
.leve4 {
.textss {
padding-left: 80rpx;
}
}
}
.proTitle {
text-align: center;
padding: 20rpx 0;
// margin-top: 60rpx;
// margin-bottom: 20rpx;
color: #888;
font-size: 28rpx;
}
.close {
display: flex;
justify-content: right;
padding-top: 60rpx;
padding-right: 20px;
}
</style>