chore: 重新构建git仓库

This commit is contained in:
2026-01-22 10:30:23 +08:00
parent 962560ea31
commit 7cb4f30b85
756 changed files with 114900 additions and 0 deletions

View File

@@ -0,0 +1,245 @@
<template>
<view class="penBoxListImages com_Img_box">
<!-- tupian我设置的是数字暂无后端数据做循环啊可替换为数组的长度 -->
<block v-for="(item, index) in imageList" wx:key="index">
<image :class="`img_list
${imageList.length == 1 ? 'com_Img_box_images1':''}
${imageList.length == 2 ? 'com_Img_box_images2':''}
${imageList.length == 3 ? 'com_Img_box_images3':''}
${imageList.length == 4 ? 'com_Img_box_images4':''}
${imageList.length == 5 ? 'com_Img_box_images5':''}
${imageList.length == 6 ? 'com_Img_box_images6':''}
${imageList.length == 7 ? 'com_Img_box_images7':''}
${imageList.length == 8 ? 'com_Img_box_images8':''}
${imageList.length == 9 ? 'com_Img_box_images9':''}`"
:src="item" mode="aspectFill" />
</block>
</view>
</template>
<script>
export default {
props: {
// 图片地址列表
imageList: {
type: Array,
required: true,
default: () => []
},
// 网格间距rpx
gap: {
type: Number,
default: 10
},
// 容器宽度占父元素比例
containerRatio: {
type: Number,
default: 1 // 100%宽度
}
},
methods: {
// 根据索引和总数计算每个图片的样式
getItemStyle(index, total) {
// 计算基础尺寸和间隙
const containerWidth = `calc(100% * ${this.containerRatio})`;
let width, height, gridTemplateColumns;
// 根据图片数量设置不同排列规则
switch(total) {
case 1:
// 1张图占满容器
width = '100%';
height = '400rpx';
break;
case 2:
// 2张图并排
width = `calc(50% - ${this.gap/2}rpx)`;
height = '250rpx';
break;
case 3:
// 3张图1行2张1行1张
if (index === 0) {
width = '100%';
height = '250rpx';
} else {
width = `calc(50% - ${this.gap/2}rpx)`;
height = '150rpx';
}
break;
case 4:
// 4张图2x2网格
width = `calc(50% - ${this.gap/2}rpx)`;
height = '200rpx';
break;
default:
// 5张及以上3列网格
width = `calc(33.333% - ${this.gap*2/3}rpx)`;
height = '180rpx';
}
return {
width,
height,
// 处理右边距(最后一列不加右边距)
marginRight: this.shouldAddMarginRight(index, total) ? `${this.gap}rpx` : '0',
// 处理下边距(最后一行不加下边距)
marginBottom: this.shouldAddMarginBottom(index, total) ? `${this.gap}rpx` : '0'
};
},
// 判断是否需要添加右边距
shouldAddMarginRight(index, total) {
if (total <= 2) return index === 0;
if (total === 3) return index === 1;
if (total === 4) return index % 2 === 0;
return (index + 1) % 3 !== 0; // 3列布局最后一列不加右边距
},
// 判断是否需要添加下边距
shouldAddMarginBottom(index, total) {
if (total <= 3) return index < total - 2;
if (total === 4) return index < 2;
// 3列布局最后一行不加下边距
const rows = Math.ceil(total / 3);
const currentRow = Math.floor(index / 3) + 1;
return currentRow < rows;
},
// 预览图片
previewImage(index) {
uni.previewImage({
current: index,
urls: this.imageList,
loop: true
});
}
}
}
</script>
<style scoped>
.com_Img_box {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
position: relative;
}
.com_Img_box_images1:nth-child(1) {
width: 100%;
height: 100%;
}
.com_Img_box_images2 {
width: 49%;
height: 100%;
}
.com_Img_box_images2:nth-child(n) {
width: 49%;
height: 100%;
}
.com_Img_box_images3 {
width: 49%;
height: 100%;
}
.com_Img_box_images3:nth-child(2){
width: 49%;
height: 49%;
}
.com_Img_box_images3:nth-child(3) {
width: 49%;
height: 49%;
position: absolute;
bottom: 0;
right: 0;
}
.com_Img_box_images4 {
width: 49%;
height: 49%;
}
.com_Img_box_images5 {
width: 69%;
height: 69%;
}
.com_Img_box_images5:nth-child(2) {
width: 28%;
height: 69%;
}
.com_Img_box_images5:nth-child(n+3):nth-child(-n+5) {
width: 32%;
height: 29%;
}
.com_Img_box_images6 {
width: 69%;
height: 69%;
}
.com_Img_box_images6:nth-child(2) {
width: 29%;
height: 34%;
}
.com_Img_box_images6:nth-child(3) {
width: 29%;
height: 34%;
position: absolute;
bottom: 29%;
right: 0;
}
.com_Img_box_images6:nth-child(n+4):nth-child(-n+5) {
width: 34%;
height: 29%;
}
.com_Img_box_images6:nth-child(6) {
width: 29%;
height: 29%;
}
.com_Img_box_images7 {
width: 32%;
height: 69%;
}
.com_Img_box_images7:nth-child(3) {
width: 32%;
height: 34%;
}
.com_Img_box_images7:nth-child(4) {
width: 32%;
height: 34%;
position: absolute;
bottom: 29%;
right: 0;
}
.com_Img_box_images7:nth-child(n+5):nth-child(-n+7) {
width: 32%;
height: 29%;
}
.com_Img_box_images8 {
width: 32%;
height: 69%;
}
.com_Img_box_images8:nth-child(n+2):nth-child(-n+3) {
width: 32%;
height: 34%;
}
.com_Img_box_images8:nth-child(4) {
width: 32%;
height: 34%;
position: absolute;
right:33%;
bottom: 29%;
}
.com_Img_box_images8:nth-child(5) {
width: 32%;
height: 34%;
position: absolute;
right:0;
bottom: 29%;
}
.com_Img_box_images8:nth-child(n+6):nth-child(-n+8) {
width: 32%;
height: 29%;
}
.com_Img_box_images9 {
width: 32%;
height: 32%;
}
</style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,73 @@
<template>
<view class="richtext" style="height: 100%;">
<piaoyiEditor :toolbarTop="`${48 + statusBarHeight}px`" :height="height" :placeholder="placeholder" :values="values" @changes="saveContens" :readOnly="readOnly" :photoUrl="photoUrl" :api="api" :name="name"/>
</view>
</template>
<script>
import piaoyiEditor from '@/uni_modules/piaoyi-editor/components/piaoyi-editor/piaoyi-editor.vue';
export default {
props: {
content: {
type: String,
default: ''
},
placeholder: {
type: String,
default: ''
},
readOnly: {
type: Boolean,
default: false
},
height: {
type: String,
default: ''
},
},
data() {
return {
photoUrl: 'https://api.nuttyreading.com', //服务器图片域名或者ip
api: '/oss/fileoss', //上传图片接口地址
txt: '',
name: 'file',
values: ''
};
},
components: {
piaoyiEditor
},
methods: {
saveContens(e) {
this.txt = e.html
this.$emit('saveContens', this.txt)
}
},
onShareAppMessage(res) {
if (res.from === 'button') { // 来自页面内分享按钮
console.log(res.target)
}
return {
title: '多功能富文本编辑器!',
path: '/pages/editor/editor'
}
},
onShareTimeline(res) {
if (res.from === 'button') { // 来自页面内分享按钮
console.log(res.target)
}
return {
title: '多功能富文本编辑器!'
}
}
}
</script>
<style lang="scss">
</style>

821
pages/articleList/index.vue Normal file
View File

@@ -0,0 +1,821 @@
<template>
<view class="content" style="background-color: #d8e6ff57">
<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" style="background-color: #f8f7fc">
<common-sticky
itemStyle="width:50%; height: 38px;font-size:24rpx;"
:list="tabsList"
label="title"
:currentCateIndex="currentCateIndex"
@handleselectCate="ordersTabCLi"
></common-sticky>
</view>
</view>
<scroll-view
scroll-y="true"
:scroll-top="scrollTop"
@scrolltolower="loadMore"
style="
height: calc(100vh - 180rpx);
margin-top: 65rpx;
padding-bottom: 120rpx;
"
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">
<view class="item_top">
<PrecisionImageGrid
:imageList="item.fileList1"
style="
width: 170rpx;
height: 170rpx;
/* position: absolute;
top: 0;
left: 0; */
"
/>
<view class="right">
<view class="item_name hidden2">{{ item.title }}</view>
<view class="item_time"
><text
style="margin-right: 30rpx; color: #e38d54"
v-if="item.come == 1"
>医案同步</text
><text style="letter-spacing: 1rpx">{{
item.createTime ? item.createTime : ""
}}</text></view
>
<view class="item_time item_bottom">
<view class="left">
<view
><text>{{ item.readCount ? item.readCount : 0 }}</text
>阅读</view
><text class="drop">·</text>
<view
><text>{{ item.likeCount ? item.likeCount : 0 }}</text
>点赞</view
><text class="drop">·</text>
<view
><text>{{
item.commentCount ? item.commentCount : 0
}}</text
>评论</view
></view
>
<view v-if="item.showFlag != 0"
class="operate"
@click.stop="handleMore(item)"
style="
line-height: 10rpx;
font-size: 38rpx;
margin-top: -20rpx;
"
>
...
</view>
<view v-else
class="operate"
@click.stop="selectArticleId = item.id;showDel=true"
style="
line-height: 10rpx;
font-size: 38rpx;
/* margin-top: -20rpx; */
"
>
<uni-icons
type="trash-filled"
size="22"
color="#aa3629"
></uni-icons
>
</view>
<!-- <view style="color: #5188e5"
><uni-icons
type="redo-filled"
size="18"
color="#5188e5"
></uni-icons
>分享</view
> -->
</view>
</view>
</view>
<!-- <view class="list_item_bt">
<text class="list_item_study" v-if="taihumedId == 0"
>编辑文章</text
>
<text class="list_item_study" v-else>文章详情</text>
</view> -->
<!-- <text class="item_con">{{ item.taihuTalent.map(talent => talent.name).join(' ') }}</text> -->
</view>
</view>
</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>
<u-action-sheet
:actions="operateList"
:title="title"
@select="selectClick"
:show="showOperate"
@close="showOperate = false"
safeAreaInsetBottom
cancelText="取消"
round="8"
></u-action-sheet>
<u-modal
:show="showDel"
@confirm="confirmDel"
@cancel="showDel = false"
ref="uModalDel"
:asyncClose="true"
:showCancelButton="true"
confirmText="删除"
confirmColor="#aa3629"
title="提示"
>
<view class="slot-content"> 您确定要删除该文章吗 </view>
</u-modal>
</view>
</template>
<script>
import $http from "@/config/requestConfig.js";
import PrecisionImageGrid from "./PrecisionImageGrid.vue";
import { debounce, throttle } from "@/common/debounce.js";
export default {
components: { PrecisionImageGrid },
data() {
return {
selectArticleId: null,
showDel: false, // 控制弹窗显示隐藏
showOperate: false, // 控制弹窗显示隐藏
operateList: [],
tabsList: [],
currentCateIndex: 0,
list: [],
null_text: "",
current: 1,
limit: 10,
courseName: "",
taihumedId: null,
statusTitle: "",
statusColor: "",
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() {
// this.getListData(this.taihumedId);
},
methods: {
confirmDel: throttle(function () {
this.delArticle();
}, 2000),
refreshData(reset) {
this.current = 1;
this.list = [];
this.noMore = false;
if (reset) {
this.currentCateIndex = 0;
this.courseName = "";
this.taihumedId = this.tabsList[this.currentCateIndex].id;
this.statusTitle = this.tabsList[this.currentCateIndex].statusTitle;
this.statusColor = this.tabsList[this.currentCateIndex].color;
//重置
this.list = [];
this.noMore = false;
this.show = false;
this.count = 0;
this.current = 1;
this.getListData(this.taihumedId);
} else {
this.getListData(this.taihumedId);
}
},
selectClick(e) {
console.log(e.name);
if (e.name == "删除文章") {
this.showDel=true;
} else {
uni.navigateTo({
url: `/pages/articleList/article?navTitle=文章详情&title=文章详情&id=${this.selectArticleId}&type=detail&statusId=1&open=${e.name}`,
});
}
},
handleMore(item) {
// uni.showActionSheet({
// itemList: ['选项1', '选项2', '选项3'],
// success: (res) => {
// console.log('点击了:', res.tapIndex);
// },
// fail: (err) => {
// console.log('调用失败', err);
// }
// })
var list = [];
if (item.showFlag != 0) {
list = [
// {
// name: "查看评论",
// fontSize: "16",
// },
{
name: "分享文章",
fontSize: "16",
}
];
}
// if (item.come == 1) {
// this.operateList = list;
// } else {
this.operateList = [
...list,
{
name: "删除文章",
color: "#aa3629",
fontSize: "16",
},
];
// }
this.selectArticleId = item.id;
this.showOperate = true;
// this.$refs.commentLikePopup.showCommentPopup();
},
getGridColumns(length) {
if (length === 1) return "1fr"; // 1 张图 → 1 列
if (length === 2) return "repeat(2, 1fr)"; // 2 张图 → 2 列
if (length === 3) return "repeat(3, 1fr)"; // 3 张图 → 3 列
if (length === 4) return "repeat(2, 1fr)"; // 4 张图 → 2 列(类似朋友圈)
return "repeat(3, 1fr)"; // 其他数量 → 3 列
},
// 预览图片
previewImage(idx) {
uni.previewImage({
current: idx,
urls: this.imgList,
});
},
createFolder() {
uni.navigateTo({
url: `/pages/articleList/articleAdd?navTitle=文章&title=文章&type=add`,
});
},
//判断显示‘上/中/下’
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: 1, title: "已发布", statusTitle: "" },
{ id: 0, title: "发布失败", statusTitle: "发布失败", color: "#f59442" },
];
this.taihumedId = this.tabsList[0].id;
this.statusTitle = "";
this.statusColor = "";
this.getListData(this.taihumedId);
// }
// });
},
//获取列表数据
delArticle() {
var that = this;
this.showDel=false;
uni.showLoading({
title: "加载中",
});
this.$http
.request({
url: "common/taihuTalentArticle/delArticle",
method: "POST",
data: {
id: this.selectArticleId,
},
header: {
"Content-Type": "application/json",
},
})
.then((res) => {
uni.hideLoading();
if (res.code == 0) {
uni.showToast({
title: "删除成功",
icon: "success",
duration: 2000,
});
this.$nextTick(() => {
this.list = this.list.filter((e) => {
return e.id != this.selectArticleId;
});
this.count = this.list.length;
});
}else {
this.showDel=false
uni.showToast({
title: "删除失败",
icon: "success",
duration: 2000,
});
}
});
},
getListData(taihumedId, type) {
console.log("taihumedId at line 344:", taihumedId);
if (type) {
this.current = 1;
this.list = [];
this.noMore = false;
}
if (this.noMore) {
return false;
}
if (this.current == 1) {
this.list = [];
}
uni.showLoading({
title: "加载中",
});
this.$http
.request({
url: "common/taihuTalentArticle/myArticleList",
method: "POST",
data: {
current: this.current,
limit: this.limit,
showFlag: taihumedId,
},
header: {
"Content-Type": "application/json",
},
})
.then((res) => {
uni.hideLoading();
this.count = res.page.total; //总数
let length = res.page.records.length;
if (res.page.records && length > 0) {
this.show = true;
//如果返回的数据少于每页数量,表示没有更多数据
if (
this.count == length ||
length < this.limit ||
this.count / this.current == this.limit
) {
this.noMore = true;
}
if (this.current == 1) {
this.list = [
...res.page.records.map((e) => {
return {
...e,
fileList1: e.img ? e.img.split(",") : [],
};
}),
];
} else {
this.list = [
...this.list,
...res.page.records.map((e) => {
return {
...e,
fileList1: e.img ? e.img.split(",") : [],
};
}),
];
}
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.statusTitle = data.statusTitle;
this.statusColor = data.color;
//重置
this.list = [];
this.noMore = false;
this.show = false;
this.count = 0;
this.current = 1;
this.getListData(this.taihumedId);
},
//详情
goToDetail(item) {
if (this.isRefreshing) return;
var navTitle = "";
var type = "";
switch (this.taihumedId) {
case 0:
navTitle = "文章详情";
type = "detail";
break;
case 1:
navTitle = "文章详情";
type = "detail";
break;
}
uni.navigateTo({
url: `/pages/articleList/article?navTitle=${navTitle}&title=${navTitle}&id=${item.id}&type=${type}&statusId=${this.taihumedId}`,
});
},
},
};
</script>
<style lang="scss" scoped>
@import "@/static/mixin.scss";
.content {
height: 100%;
overflow: auto;
background-color: #fff !important;
}
.doctors_list {
margin: 0 30rpx 30rpx;
}
.doctors_item {
// border: 1rpx solid $themeColor;
// border-radius: 15rpx;
// margin-bottom: 20rpx;
padding: 30rpx 0;
box-sizing: border-box;
display: flex;
align-items: center;
position: relative;
border-top: 2rpx solid #eee;
border-bottom: 2rpx solid #eee;
// background-color: #fff;
// box-shadow: 0 1px 8px #e3e1e1;
}
.item_image {
display: block;
width: 120rpx;
height: 120rpx;
flex-shrink: 0;
background: #f3f3f3;
}
.item_right {
width: calc(100%);
// margin-left: 30rpx;
// padding-bottom: 20rpx;
}
.item_time {
color: #8e8d93;
margin-top: 14rpx;
line-height: 30rpx;
}
.item_top {
display: flex;
align-items: center;
justify-content: space-between;
// line-height: 30rpx;
// margin-top: 8rpx;
}
.right {
width: calc(100% - 186rpx);
}
.item_name {
font-size: 32rpx;
line-height: 26rpx;
white-space: pre-wrap;
word-wrap: break-word; /* 避免长单词造成溢出 */
color: #1b1b1d;
font-weight: bold;
margin-bottom: 12rpx;
}
.item_content {
h1 {
font-size: 28rpx;
line-height: 30px;
}
}
.item_title {
font-size: 32rpx;
color: #333;
}
.item_time {
font-size: 26rpx;
color: #aaacab;
}
.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: 16rpx;
}
.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;
}
}
/deep/.u-upload__deletable {
display: none !important;
}
/deep/.u-upload__button {
display: none !important;
}
/* 状态样式 */
.card_label {
display: inline-block;
padding: 0px 16rpx;
background-color: #4caf50; /* 绿色背景 */
color: white;
// font-weight: bold;
font-size: 12px;
border-radius: 4px; /* 圆角 */
position: relative; /* 用于斜角效果 */
text-align: center;
transform: skew(-20deg); /* 倾斜效果 */
margin-right: 20rpx; /* 如果有多个标签时,之间保持间距 */
line-height: 38rpx;
}
/* 斜角效果 */
// .card_label::after {
// content: '';
// position: absolute;
// top: 0;
// right: -10px;
// width: 20px;
// height: 20px;
// background-color: inherit;
// transform: rotate(45deg); /* 旋转45度形成斜角 */
// z-index: -1;
// }
.item_bottom {
display: flex;
align-items: center;
justify-content: space-between;
}
.item_bottom {
.left {
display: flex;
align-items: center;
}
.drop {
margin: 0 10rpx;
}
text {
margin-right: 10rpx;
}
}
.demo-section {
background-color: #fff;
padding: 20rpx;
border-radius: 10rpx;
margin-bottom: 20rpx;
}
.demo-title {
font-size: 28rpx;
margin-bottom: 15rpx;
display: block;
color: #333;
}
.hidden2 {
line-height: 24px;
max-height: 48px;
height: auto;
}
.operate {
display: flex;
align-items: center;
justify-content: space-around;
}
.like,
.comment,
.more {
margin: 0 5px;
}
</style>

View File

@@ -0,0 +1,498 @@
<template>
<view>
<u-popup
:show="orderModalShow"
mode="bottom"
:round="8"
:background="'#fff'"
@close="closeOrderModalShow"
style="background: #fff" backgroundColor="#fff"
>
<view class="orderModalShow popup_box">
<view style="text-align: center"
>全部 {{ articleInfo.likeCount }} 人点赞</view
>
<u-icon
name="close"
color="#333"
size="18"
@click="closeOrderModalShow"
style="
display: inline-block;
position: absolute;
right: 20rpx;
top: 20rpx;
"
></u-icon>
<view style="padding-top: 40rpx; overflow: auto; padding-bottom: 0rpx">
<view class="hb-comment" style="max-height: 70vh">
<view class="comment-list" v-if="likeList.length != 0">
<view class="comment-box" v-for="(item, index) in likeList">
<view class="comment-box-item">
<view>
<image
v-if="item.user.avatar"
:src="item.user.avatar"
mode="aspectFill"
class="avatar"
></image>
<image
v-else
src="/static/icon/noIcon.png"
mode="aspectFill"
class="avatar"
></image>
</view>
<view class="comment-main">
<!-- 父评论体-start -->
<view class="comment-main-top">
<view class="nick-name-box">
<view class="nick-name"
>{{ item.user.nickname ? item.user.nickname : "普通用户" }}
</view
>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- <hb-comment
:user="currentUser"
ref="hbComment"
@add="sendComment"
@del="del"
@focusOn="focusOn"
:deleteTip="'确认删除?'"
:cmData="commentData"
v-if="commentData"
></hb-comment> -->
</view>
</u-popup>
</view>
</template>
<script>
import $http from "@/config/requestConfig.js";
import { mapState, mapMutations } from "vuex";
export default {
components: {
},
props:[],
data() {
return {
articleId: null,
currentUser: {},
orderModalShow: false,
likeList: [],
articleInfo: {},
};
},
computed: {
...mapState(["userInfo"]),
},
async onLoad(options) {
},
watch: {
orderModalShow: {
handler(newVal, oldVal) {
this.$emit("show",this.orderModalShow);
},
immediate: true,
},
},
onShow() {
},
methods: {
// 自适应判断
async onHandleClickOpenComment(id) {
this.articleId=id;
console.log("111 at line 384:", 111);
console.log(
"this.currentUser at line 365:",
this.articleInfo.taihuTalent
);
await this.getMedicalDetail(()=>{
this.orderModalShow = true;
});
},
closeOrderModalShow() {
this.orderModalShow = false;
this.$emit("close",this.articleId);
},
saveContens(content) {
console.log("content at line 322:", content);
this.formData.message = content;
},
handleSubmit(type, isNewSave) {
console.log("this.editableMap at line 243:", this.formData);
if (!this.formData.title) {
this.$commonJS.showToast("请输入文章标题");
return;
}
if (!this.formData.message) {
this.$commonJS.showToast("请输入文章正文内容");
return;
}
if (this.fileList1.length == 0) {
this.$commonJS.showToast("请至少上传一张图片");
return;
}
var data = {
img:
this.fileList1.length > 0
? this.fileList1.map((e) => e.url).toString()
: "",
title: this.formData.title ? this.formData.title : "",
content: this.formData.message ? this.formData.message : "",
};
this.$http
.request({
url: "common/taihuTalentArticle/addArticle",
method: "POST",
data: {
...data,
},
header: {
"Content-Type": "application/json",
},
})
.then((res) => {
if (res.code == 0) {
uni.redirectTo({
url: "/pages/articleList/index",
});
} else {
this.$commonJS.showToast(res.msg);
}
})
.catch((err) => {});
},
//点击每个记录
//创建新对话
sendComment(comment, pid) {
this.$http
.request({
url: "common/taihuTalentArticle/addArticleComment",
method: "POST",
data: {
pid: pid ? pid : 0, //第一条评论为0
articleId: this.articleId, //文章id
content: comment, //内容
},
header: {
"Content-Type": "application/json",
},
})
.then((res) => {
console.log("res at line 713:", res);
if (res.code == 0) {
this.getMedicalDetail();
} else {
this.$commonJS.showToast("评论失败");
}
});
},
//交谈请求,获取回答
getTree(data) {
let result = [];
let map = {};
data.forEach((item) => {
map[item.id] = item;
});
data.forEach((item) => {
let parent = map[item.parentId];
if (parent) {
(parent.children || (parent.children = [])).push(item);
} else {
result.push(item);
}
});
return result;
},
getMedicalDetail(fn) {
//清空消息记录
this.$http
.request({
url: "common/taihuTalentArticle/getArticleLikeAndComment",
method: "POST",
data: {
articleId: this.articleId,
},
header: {
"Content-Type": "application/json",
},
})
.then((res) => {
console.log("res at line 682:", res);
if (res.code == 0) {
this.loading = false;
this.articleInfo = res.article;
this.medicalForm = { ...this.articleInfo };
console.log("this.medicalForm at line 193:", this.articleInfo);
this.$nextTick(() => {
// if (this.userInfo.id == this.articleInfo.userId) {
// this.currentUser = this.articleInfo.taihuTalent;
// } else {
this.currentUser = {...this.userInfo,icon:this.userInfo.avatar};
console.log('this.currentUser at line 823:', this.currentUser)
// }
});
this.likeList = res.article.likeList;
if(fn){
fn();
}
// 滚动到最底部锚点
// that.$nextTick(() => {
// that.scrollToBottom();
// });
// 停止轮询
}
})
.catch((error) => {
console.log("请求出错:", error);
});
//调用后端 SSE 接口,发送问题并接收实时回答
// this.startSSE(params);
},
},
onHide() {},
onUnload() {},
};
</script>
<style lang="scss" scoped>
@import "@/static/mixin.scss";
.hb-comment {
// padding: 10rpx;
}
.top-read {
font-size: 28rpx;
padding-left: 10rpx;
color: #999999;
}
.seg_line_box {
display: flex;
height: 5rpx;
justify-content: space-between;
margin: 5rpx 0;
}
.seg_line {
width: 45%;
border-bottom: 1rpx solid #e1e1e1;
}
.seg_dot {
width: 8%;
border-bottom: 5rpx dotted #dbdbdb;
}
.comment-num {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx 0;
}
.comment-box {
padding: 12rpx 0;
}
.comment-box-item {
width: 100%;
display: flex;
}
.comment-main {
width: calc(100% - 70rpx);
padding-left: 20rpx;
}
.comment-main-top {
width: 100%;
padding-top: 12rpx;
display: flex;
justify-content: space-between;
}
.sub-comment-main-top {
width: 510rpx;
padding-top: 6rpx;
display: flex;
justify-content: space-between;
}
.avatar {
width: 70rpx;
height: 70rpx;
border-radius: 50%;
}
.nick-name-box {
display: flex;
align-items: center;
}
.comLogo {
margin-right: 18rpx;
font-size: 22rpx;
border-radius: 10rpx;
padding: 5rpx 15rpx;
color: #ffffff;
}
.com1 {
background-color: #d218b1;
}
.com2 {
background-color: #f19c0b;
}
.com3 {
background-color: #c8da85;
}
.com4 {
background-color: #bfd0da;
}
.nick-name {
color: #2d8cf0;
color: #494943;
line-height: 50rpx;
// font-size: 40rpx;
}
.isLike {
font-size: 28rpx;
padding-right: 10rpx;
color: #2d8cf0;
}
.notLike {
font-size: 28rpx;
padding-right: 10rpx;
color: #999999;
}
.comment-main-content {
width: 100%;
padding: 8rpx 10rpx 8rpx 0;
text-align: justify;
white-space: pre-wrap;
word-wrap: break-word;
// font-size: 30rpx;
}
.comment-main-foot {
display: flex;
font-size: 22rpx;
line-height: 24rpx;
margin-top: 6rpx;
margin-top: 6rpx;
}
.replayTag {
color: #909399;
margin-bottom: 5px;
border: 1px solid #c8c9cc;
background-color: #f4f4f5;
border-radius: 3px;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 16rpx;
padding: 5px 10px;
}
.replyTagClose {
font-size: 20px;
line-height: 12px;
padding: 0 0 2px 5px;
}
.foot-btn {
padding-left: 20rpx;
color: #007aff;
}
.comment-sub-box {
padding: 20rpx 0;
}
.comment-sub-item {
display: flex;
margin-bottom: 12rpx;
}
.popup_box {
padding: 20rpx;
box-sizing: border-box;
.curriulum_title_box {
.title {
text-align: center;
font-size: 34rpx !important;
}
}
}
</style>

View File

@@ -0,0 +1,872 @@
<template>
<view>
<u-popup
:show="orderModalShow"
mode="bottom"
:round="8"
@close="closeOrderModalShow"
:background="'#fff'"
style="background: #fff"
backgroundColor="#fff"
>
<view class="orderModalShow popup_box">
<view style="text-align: center"
>全部 {{ articleInfo.commentCount }} 条评论</view
>
<u-icon
name="close"
color="#333"
size="18"
@click="closeOrderModalShow"
style="
display: inline-block;
position: absolute;
right: 20rpx;
top: 20rpx;
"
></u-icon>
<scroll-view :scroll-into-view="targetId" scroll-y style="height: 70vh;padding-top: 40rpx; padding-bottom: 100rpx">
<hb-comment
style=""
:user="currentUser"
:isPopup="true"
:articleUserId="articleInfo.userId"
ref="hbComment"
@add="sendComment"
:deleteTip="'确认删除?'"
:cmData="commentData"
v-if="commentData"
></hb-comment
></scroll-view>
</view>
</u-popup>
</view>
</template>
<script>
import $http from "@/config/requestConfig.js";
import { mapState, mapMutations } from "vuex";
import { debounce, throttle } from "@/common/debounce.js";
export default {
components: {},
props: [],
data() {
return {
targetId: null,
articleId: null,
currentUser: {},
orderModalShow: false,
commentData: [],
articleInfo: {},
};
},
computed: {
...mapState(["userInfo"]),
},
async onLoad(options) {},
onShow() {},
watch: {
orderModalShow: {
handler(newVal, oldVal) {
this.$emit("show", this.orderModalShow);
},
immediate: true,
},
},
methods: {
// 自适应判断
scrollToView(id) {
// commentData
this.targetId = id; // 设置目标元素 id
setTimeout(() => {
this.targetId = null;
}, 1000);
},
async onHandleClickOpenComment(id) {
this.articleId = id;
console.log("111 at line 384:", 111);
console.log(
"this.currentUser at line 365:",
this.articleInfo.taihuTalent
);
await this.getMedicalDetail(() => {
this.orderModalShow = true;
});
},
closeOrderModalShow() {
this.orderModalShow = false;
this.$emit("close", this.articleId);
},
saveContens(content) {
console.log("content at line 322:", content);
this.formData.message = content;
},
handleSubmit(type, isNewSave) {
console.log("this.editableMap at line 243:", this.formData);
if (!this.formData.title) {
this.$commonJS.showToast("请输入文章标题");
return;
}
if (!this.formData.message) {
this.$commonJS.showToast("请输入文章正文内容");
return;
}
if (this.fileList1.length == 0) {
this.$commonJS.showToast("请至少上传一张图片");
return;
}
var data = {
img:
this.fileList1.length > 0
? this.fileList1.map((e) => e.url).toString()
: "",
title: this.formData.title ? this.formData.title : "",
content: this.formData.message ? this.formData.message : "",
};
this.$http
.request({
url: "common/taihuTalentArticle/addArticle",
method: "POST",
data: {
...data,
},
header: {
"Content-Type": "application/json",
},
})
.then((res) => {
if (res.code == 0) {
uni.redirectTo({
url: "/pages/articleList/index",
});
} else {
this.$commonJS.showToast(res.msg);
}
})
.catch((err) => {});
},
//点击每个记录
//创建新对话
sendComment: throttle(function (comment, pid) {
this.$http
.request({
url: "common/taihuTalentArticle/addArticleComment",
method: "POST",
data: {
pid: pid ? pid : 0, //第一条评论为0
articleId: this.articleId, //文章id
content: comment, //内容
},
header: {
"Content-Type": "application/json",
},
})
.then((res) => {
console.log("res at line 713:", res);
if (res.code == 0) {
if(pid==0){
setTimeout(() => {
this.scrollToView("commentData");
}, 100);
}
this.getMedicalDetail();
} else {
this.$commonJS.showToast("评论失败");
}
});
}),
//交谈请求,获取回答
getTree(data) {
let result = [];
let map = {};
data.forEach((item) => {
map[item.id] = item;
});
data.forEach((item) => {
let parent = map[item.parentId];
if (parent) {
(parent.children || (parent.children = [])).push(item);
} else {
result.push(item);
}
});
return result;
},
getMedicalDetail(fn) {
//清空消息记录
this.$http
.request({
url: "common/taihuTalentArticle/getArticleLikeAndComment",
method: "POST",
data: {
articleId: this.articleId,
},
header: {
"Content-Type": "application/json",
},
})
.then((res) => {
console.log("res at line 682:", res);
if (res.code == 0) {
this.loading = false;
this.articleInfo = res.article;
this.medicalForm = { ...this.articleInfo };
console.log("this.medicalForm at line 193:", this.articleInfo);
this.$nextTick(() => {
// if (this.userInfo.id == this.articleInfo.userId) {
// this.currentUser = this.articleInfo.taihuTalent;
// } else {
this.currentUser = {
...this.userInfo,
icon: this.userInfo.avatar,
};
console.log("this.currentUser at line 823:", this.currentUser);
// }
});
this.commentData = res.comments;
this.commentData = {
commentSize: res.commentCount,
comment: this.getTree(this.commentData),
};
if (fn) {
fn();
}
// 滚动到最底部锚点
// that.$nextTick(() => {
// that.scrollToBottom();
// });
// 停止轮询
}
})
.catch((error) => {
console.log("请求出错:", error);
});
//调用后端 SSE 接口,发送问题并接收实时回答
// this.startSSE(params);
},
},
onHide() {},
onUnload() {},
};
</script>
<style lang="scss" scoped>
@import "@/static/mixin.scss";
.content {
height: 100%;
background: linear-gradient(to bottom, #d8e6ff 0%, #d8e6ff57 90%, #fff 98%);
}
.home_top {
width: 100%;
background: #fff;
position: fixed;
top: 0;
left: 0;
padding: 90rpx 50rpx 30rpx;
text-align: center;
box-sizing: border-box;
z-index: 999;
.home_top_icon {
position: absolute;
left: 40rpx;
top: 85rpx;
display: flex;
align-items: center;
.home_top_left,
.home_top_right {
width: 60rpx;
height: 60rpx;
padding: 10rpx;
box-sizing: border-box;
}
.home_top_right {
margin-left: 30rpx;
}
}
text {
font-size: 43rpx;
line-height: 44rpx;
font-weight: bold;
color: $themeColor;
}
.home_top_folder {
padding: 12rpx;
position: absolute;
right: 40rpx;
top: 75rpx;
image {
width: 50rpx;
height: 50rpx;
}
}
}
.home_wrap {
// padding-bottom: 300rpx;
overflow-y: auto;
.home_logo {
padding-top: 40rpx;
image {
display: block;
width: 130rpx;
height: 130rpx;
margin: 0 auto;
}
.logo_main {
text-align: center;
display: block;
padding-top: 30rpx;
font-size: 35rpx;
color: $themeColor;
line-height: 46rpx;
}
.logo_con {
display: block;
width: 510rpx;
margin: 30rpx auto;
font-size: 28rpx;
color: #303030;
line-height: 40rpx;
text-indent: 2em;
}
}
}
.home_form {
height: 100%;
// margin-top: 60rpx;
position: relative;
.form_item {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 30rpx;
text {
line-height: 68rpx;
font-size: 38rpx;
color: #fff;
background: $themeBgColor;
text-align: center;
border-radius: 20rpx;
padding: 0 25rpx;
border: 1rpx solid $themeBgColor;
box-sizing: border-box;
}
textarea,
input {
display: inline-block;
width: calc(100%);
height: 70rpx;
line-height: 44rpx;
padding: 0 20rpx;
// padding: 17rpx 30rpx;
font-size: 38rpx;
color: #303030;
box-sizing: border-box;
resize: none;
overflow-y: scroll;
}
}
}
.custom-placeholder {
font-size: 38rpx;
font-weight: 500 !important;
color: #8b8c90 !important;
}
.submit_form {
width: 100%;
height: 90px;
background: #fff;
position: fixed;
left: 0;
bottom: 120rpx;
padding: 0 50rpx;
z-index: 999;
}
.submit_btn {
position: absolute;
right: 0rpx;
bottom: 10rpx;
image {
width: 55rpx;
height: 55rpx;
}
}
.active {
text {
color: $themeBgColor;
}
.assistants_img_1 {
display: none !important;
}
.assistants_img_2 {
display: block !important;
}
}
.message_wrap {
position: relative;
width: 100%;
// background: #fff;
z-index: 99;
padding: 0 30rpx;
height: 85vh;
}
.message_title {
text-align: center;
font-size: 30rpx;
color: #333;
line-height: 50rpx;
display: block;
font-weight: bold;
padding: 10rpx 0;
}
.message-container-block {
padding-top: 20rpx;
padding-bottom: 80px;
font-size: 30rpx;
}
.message-container {
display: inline;
line-height: 48rpx;
}
/* 自定义的loading效果 */
.loading-spinner {
margin-top: 10rpx;
border: 2px solid #f3f3f3;
/* 灰色背景 */
border-top: 2px solid #3498db;
/* 蓝色顶部 */
border-radius: 50%;
width: 16px;
height: 16px;
animation: spin 1s linear infinite;
/* 旋转动画 */
}
/* 旋转动画 */
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.bold-text {
display: block;
font-weight: bold;
font-size: 28rpx;
/* 增大字号 */
}
h3 {
font-size: 36rpx;
font-weight: bold;
}
h3 {
font-size: 32rpx;
}
.red-text {
color: red;
font-size: 28rpx;
/* 增大字号 */
}
.message-right {
display: block;
text-align: right;
margin: 30rpx 0;
text {
display: inline-block;
padding: 20rpx;
line-height: 38rpx;
background-color: rgba(81, 136, 229, 0.2);
border-radius: 15rpx;
color: #333;
font-size: 28rpx;
text-align: left;
}
}
.drawer-content {
height: 100vh;
display: flex;
flex-direction: column;
}
.list_content {
padding: 70rpx 20rpx 30rpx;
overflow-y: auto;
}
.list_item {
padding: 18rpx 10rpx;
}
.text_item {
display: block;
width: 100%;
font-size: 30rpx;
line-height: 40rpx;
padding: 0 10rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.null_text {
display: block;
text-align: center;
font-size: 30rpx;
color: #999;
padding-top: 150rpx;
}
.active_item {
background: #d8e6ff;
border-radius: 15rpx;
text {
color: #5188e5;
}
}
.folder_popup {
z-index: 9999;
.popup-content {
padding: 30rpx;
width: 550rpx;
background: #fff;
border-radius: 10rpx;
.popup-top {
padding: 15rpx;
display: flex;
align-items: center;
background: #5188e5;
border-radius: 10rpx;
color: #fff;
font-size: 28rpx;
line-height: 45rpx;
.uni-icons {
margin-right: 2rpx;
}
}
.popup-list {
.item-list {
padding: 15rpx;
background: #d8e6ff;
border-radius: 10rpx;
font-size: 28rpx;
line-height: 45rpx;
color: #5188e5;
margin-top: 15rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
position: relative;
text {
position: absolute;
right: 20rpx;
top: 12rpx;
font-size: 22rpx;
line-height: 45rpx;
color: #ff7800;
}
}
.popup-scroll {
max-height: 330rpx;
}
}
}
}
.aiFlag {
position: absolute;
bottom: 55px;
left: 20px;
width: calc(100% - 40px);
font-size: 11px;
line-height: 16px;
color: #f69e12;
z-index: 999;
background: rgba(254, 243, 225, 0.8);
border: 1px solid #f2d7aa;
padding: 5px;
border-radius: 6px;
}
.in {
border: 1rpx solid #eeeeee;
border-radius: 8rpx;
width: calc(100% - 200rpx);
}
.shangpin_editor {
width: 100%;
}
/deep/.h1_box {
height: 24px;
margin-top: 40rpx;
h1 {
margin: 0 !important;
font-size: 20px;
line-height: 24px;
}
}
#editor {
height: 300px;
border: 1px solid #ccc;
}
.ql-container {
height: auto;
min-height: auto;
}
.editor-wrapper {
// background-color: #f0f0f080;
padding: 20rpx;
box-sizing: border-box;
border-radius: 20rpx;
border: 0.5px solid #777778;
}
.footer_box {
background: #fff;
padding-top: 10rpx;
height: 80rpx;
position: fixed;
bottom: 0;
left: 0;
width: 100%;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
z-index: 502;
box-sizing: content-box;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
box-shadow: 0 1px 15px rgba(0, 0, 0, 0.1);
}
.footer_bg {
background-color: #fff;
box-shadow: 0 0px 10px 1px #0000001a;
}
.footer_item {
position: relative;
flex: 1;
margin: 0 auto;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.footer_item .footer_item_icon {
display: flex;
align-items: center;
margin-bottom: 4rpx;
// justify-content: space-around;
}
.footer_item_count {
margin-left: 10rpx;
}
/deep/.u-upload__button {
background-color: #fff;
.uicon-camera-fill {
color: #5188e5 !important;
}
}
.analysis_box {
height: 100%;
// padding-top: 20rpx;
width: 100%;
box-sizing: border-box !important;
uni-textarea {
border: none !important;
}
.analysis_title {
margin-top: 30rpx;
margin-bottom: 20rpx;
// color: #1781ff;
font-size: 32rpx;
font-weight: 700;
}
.analysis_title_detail {
margin-top: 20rpx;
margin-bottom: 30rpx;
// color: #1781ff;
font-size: 42rpx;
font-weight: 700;
}
}
/deep/.home_wrap_analysis {
.home_form {
padding-bottom: 0px;
}
.form_item {
margin-bottom: 0 !important;
textarea {
// padding-top: 20rpx;
// height: 80vh !important;
}
.uni-textarea-wrapper {
// height: 100% !important;
}
}
.submit_btn {
padding: 0 40rpx;
position: absolute;
right: 24rpx;
bottom: 24rpx;
background-color: #1985fd;
margin: auto auto;
margin-top: 10rpx;
border-radius: 20rpx;
line-height: 62rpx;
height: 62rpx;
text-align: center;
color: #fff;
// font-weight: bold;
}
}
.content_detail {
background: #fff;
padding: 0 20rpx;
}
.message_wrap_detail {
padding: 0;
}
.analysis_img_box {
margin-bottom: 4rpx;
}
.analysis_img {
display: flex;
align-items: center;
margin-bottom: 10rpx;
image {
width: 120rpx;
height: 120rpx;
border-radius: 120rpx;
margin-right: 20rpx;
}
}
.taihuTalentBox {
width: calc(100% - 140rpx);
color: #1b1b1b;
.taihuTalent_name {
font-size: 36rpx;
font-weight: 600;
}
.zhicheng {
background: #e4f0ff;
color: #1985fd;
padding: 4rpx 20rpx;
border-radius: 10rpx;
font-size: 24rpx;
line-height: 28rpx;
}
}
.orderModalShow {
width: 100%;
// max-height: 48vh;
// padding-bottom: 120rpx;
}
.popup_box {
padding: 20rpx;
box-sizing: border-box;
.curriulum_title_box {
.title {
text-align: center;
font-size: 34rpx !important;
}
}
}
.allImage {
margin-top: 40rpx;
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
}
.imgList {
// margin: 0 30rpx;
}
.images:not(:nth-child(3n)) {
/* margin-right: 10rpx; */
}
.text {
margin: 1% 3% 2%;
}
.images {
margin-right: 10rpx;
display: inline-block;
}
.images3:nth-child(3n) {
margin-right: 0rpx;
}
</style>

214
pages/articleList/tag.vue Normal file
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>