This commit is contained in:
2025-08-13 14:53:35 +08:00
parent 1f5f069988
commit b2009403d8
13 changed files with 761 additions and 282 deletions

View File

@@ -53,8 +53,7 @@
></image> -->
<view class="item_right">
<view class="item_top"
>
<view class="item_top">
<PrecisionImageGrid
:imageList="item.fileList1"
style="
@@ -66,27 +65,53 @@
"
/>
<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 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 style="color: #5188e5"
<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
class="operate"
@click.stop="handleMore(item)"
style="
line-height: 10rpx;
font-size: 38rpx;
margin-top: -20rpx;
"
>
...
<!-- <button class="like" @click.stop="handleLike">
</button>
<button class="comment" @click.stop="handleComment">
评论
</button> -->
</view>
<!-- <view style="color: #5188e5"
><uni-icons
type="redo-filled"
size="18"
@@ -94,9 +119,8 @@
></uni-icons
>分享</view
> -->
</view>
</view>
</view>
</view>
<!-- <view class="list_item_bt">
@@ -118,6 +142,17 @@
</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>
</view>
</template>
@@ -128,6 +163,28 @@ export default {
components: { PrecisionImageGrid },
data() {
return {
selectArticleId: null,
showOperate: false, // 控制弹窗显示隐藏
operateList: [
{
name: "查看评论",
fontSize: "16",
},
{
name: "分享文章",
fontSize: "16",
},
{
name: "删除",
color: "#aa3629",
fontSize: "16",
},
],
tabsList: [],
currentCateIndex: 0,
list: [],
@@ -166,12 +223,66 @@ export default {
},
onLoad() {
uni.hideTabBar();
this.getTabData();
this.getTabData()
},
onShow() {
// this.getListData(this.taihumedId);
},
methods: {
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.delArticle();
} 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);
// }
// })
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 列
@@ -189,7 +300,7 @@ export default {
},
createFolder() {
uni.navigateTo({
url: `/pages/articleList/article?navTitle=创建文章&title=创建文章&type=add`,
url: `/pages/articleList/article?navTitle=文章&title=文章&type=add`,
});
},
//判断显示‘上/中/下’
@@ -228,8 +339,49 @@ export default {
// }
// });
},
//获取列表数据
delArticle() {
var that = this;
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
})
});
},
getListData(taihumedId, type) {
console.log('taihumedId at line 344:', taihumedId)
if (type) {
this.current = 1;
this.list = [];
@@ -388,17 +540,18 @@ export default {
line-height: 30rpx;
}
.item_top {
display: flex;
align-items: center;
justify-content: space-between;
display: flex;
align-items: center;
justify-content: space-between;
// line-height: 30rpx;
// margin-top: 8rpx;
}
.right{
.right {
width: calc(100% - 186rpx);
}
.item_name {
font-size: 32rpx;line-height: 26rpx;
font-size: 32rpx;
line-height: 26rpx;
white-space: pre-wrap;
word-wrap: break-word; /* 避免长单词造成溢出 */
@@ -595,9 +748,19 @@ export default {
display: block;
color: #333;
}
.hidden2{
line-height: 24px;
max-height: 48px;
height: auto;
}
.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>