This commit is contained in:
2025-08-14 16:49:58 +08:00
parent b2009403d8
commit 26c1ac5ced
15 changed files with 1144 additions and 351 deletions

View File

@@ -25,7 +25,7 @@
@click.stop="clickUser()"
>{{ name }}</text
>
<view style="display: flex; align-items: center;margin-top: 14rpx;"
<view style="display: flex; align-items: center;margin-top:8rpx;"
><text class="user__content-note uni-ellipsis">{{
createTime
@@ -56,7 +56,7 @@
height: auto;
color: #4b4b4b;
margin-bottom: 40rpx;
font-size: 28rpx;
font-size: 28rpx;text-indent: 0px !important;
"
/></u-read-more>
<view class="allImage">
@@ -263,9 +263,31 @@ export default {
},
// 自适应判断
judgeImg() {
if (this.imgList.length == 1) {
this.imgWidth = ((this.windowWidth - 60) * 2) / 3;
this.imgHeight = (this.windowHeight * 3) / 5;
if (this.imgList.length === 1) {
const firstImg = this.imgList[0];
// 获取图片的宽高信息
uni.getImageInfo({
src: firstImg, // 获取图片路径
success: (res) => {
const imgWidth = res.width;
const imgHeight = res.height;
// 如果是横向图片(宽大于高)
if (imgWidth > imgHeight) {
// 横向图片尺寸设置
this.imgWidth = ((this.windowWidth - 90) * 2) / 2;
this.imgHeight = (this.windowHeight * 3) / 5;
} else {
// 纵向图片尺寸设置
this.imgWidth = (this.windowWidth - 80) * 0.7; // 纵向图片稍微缩小宽度
this.imgHeight = (this.windowHeight * 3) / 5;
}
},
fail: (err) => {
console.error("图片加载失败", err);
},
});
} else if (this.imgList.length == 4) {
this.imgWidth = (this.windowWidth - 60) / 3.3;
this.imgHeight = this.imgWidth;
@@ -461,7 +483,7 @@ export default {
overflow: hidden;
}
.user__content-note {
margin-top: 3px;
margin-top: 2rpx;
color: #aaacab;
font-size: 26rpx;
letter-spacing: 1rpx;
@@ -485,23 +507,37 @@ export default {
text-align: justify;
color: #292929;
font-weight: 600;
font-size: 32rpx;
margin-bottom: 10rpx;
font-size: 38rpx;
line-height: 42rpx;
margin-bottom: 20rpx;
}
.user__content-title {
color: #5a6988;
font-weight: 600;
font-size: 30rpx;
line-height: 38rpx;
line-height: 34rpx;
// margin-top: 8rpx;
}
::v-deep rich-text {
text-align: justify;
white-space: pre-wrap;
word-wrap: break-word;
}
::v-deep rich-text p {
::v-deep rich-text p,h1,h2 {
text-indent: 0 !important;
}
/deep/ rich-text br {
height: 0 !important;
display: none;
}
::v-deep rich-text h1 {
font-size: 34rpx;
line-height: 40rpx;
}
::v-deep rich-text h2 {
font-size: 30rpx;
line-height: 30rpx;
}
.likeList {
background: #f7f7f7;
border-radius: 4rpx;
@@ -513,8 +549,8 @@ export default {
margin-top: 0;
}
.hidden2 {
line-height: 24px;
max-height: 120px;
line-height: 20px;
max-height: 100px;
-webkit-line-clamp: 5;
height: auto;
}