This commit is contained in:
liuyuan
2025-08-15 10:05:09 +08:00
parent 26c1ac5ced
commit ba2fb9d84a
50 changed files with 30561 additions and 9618 deletions

View File

@@ -80,7 +80,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="icon uni-row uni-center" ref="commentIcon" @click="showComment"> <view class="icon uni-row uni-center" ref="commentIcon" >
<text class="dot mr-5"></text> <text class="dot mr-5"></text>
<text class="dot"></text> <text class="dot"></text>
</view> </view>

View File

@@ -294,8 +294,7 @@
:user="currentUser" :user="currentUser"
ref="hbComment" ref="hbComment"
@add="sendComment" @add="sendComment"
@del="del"
@focusOn="focusOn"
:deleteTip="'确认删除?'" :deleteTip="'确认删除?'"
:cmData="commentData" :cmData="commentData"
v-if="commentData" v-if="commentData"
@@ -408,8 +407,7 @@
:user="currentUser" :user="currentUser"
ref="hbComment" ref="hbComment"
@add="sendComment" @add="sendComment"
@del="del"
@focusOn="focusOn"
:deleteTip="'确认删除?'" :deleteTip="'确认删除?'"
:cmData="commentData" :cmData="commentData"
v-if="commentData" v-if="commentData"
@@ -1120,12 +1118,13 @@ export default {
.then((res) => { .then((res) => {
console.log("res at line 713:", res); console.log("res at line 713:", res);
if (res.code == 0) { if (res.code == 0) {
this.getMedicalDetail();
if(pid==0){ if(pid==0){
setTimeout(() => { setTimeout(() => {
this.scrollToView("commentData"); this.scrollToView("commentData");
}, 500); }, 100);
} }
this.getMedicalDetail();
// this.scrollToComment(); // this.scrollToComment();

View File

@@ -34,8 +34,7 @@
:articleUserId="articleInfo.userId" :articleUserId="articleInfo.userId"
ref="hbComment" ref="hbComment"
@add="sendComment" @add="sendComment"
@del="del"
@focusOn="focusOn"
:deleteTip="'确认删除?'" :deleteTip="'确认删除?'"
:cmData="commentData" :cmData="commentData"
v-if="commentData" v-if="commentData"
@@ -176,12 +175,14 @@ export default {
.then((res) => { .then((res) => {
console.log("res at line 713:", res); console.log("res at line 713:", res);
if (res.code == 0) { if (res.code == 0) {
this.getMedicalDetail(); if(pid==0){
if (pid == 0) {
setTimeout(() => { setTimeout(() => {
this.scrollToView("commentData"); this.scrollToView("commentData");
}, 500); }, 100);
} }
this.getMedicalDetail();
} else { } else {
this.$commonJS.showToast("评论失败"); this.$commonJS.showToast("评论失败");
} }

View File

@@ -232,6 +232,24 @@
<uni-popup ref="share" type="share" safeArea backgroundColor="#fff"> <uni-popup ref="share" type="share" safeArea backgroundColor="#fff">
<uni-popup-share @select="haveSelected"></uni-popup-share> <uni-popup-share @select="haveSelected"></uni-popup-share>
</uni-popup> </uni-popup>
<uni-popup ref="customModal2" type="dialog" backgroundColor="#fff" round="8" >
<view class="my-modal" style="width: 80vw;border-radius: 20px;padding: 20px;">
<view class="my-modal__hd" style="font-size: 36rpx;font-weight: 700;margin-bottom: 10rpx;">消息提醒</view>
<view style="margin-bottom: 20rpx;font-size: 26rpx;color: #5188e5;">您的文章有人点赞评论啦,请注意查看。</view>
<view class="my-modal__bd">
<view class="multi-line-text">
<view style=" display: block;" v-for="(item, index) in sysNotices_list" :key="index">
<view v-if="item&&item.title" class="hidden1" @click="readArticle(item)" style="text-wrap: wrap;white-space: pre-wrap;width: 100%;
word-wrap: break-word;">{{index+1}}.{{ item.title }}</view>
</view>
</view>
</view>
<view class="my-modal__ft" style="margin-top: 10rpx;">
<button @click="confirm2" style="font-size: 28rpx;color: #bbb;">知道了</button>
</view>
</view>
</uni-popup>
</view> </view>
</template> </template>
@@ -245,6 +263,7 @@ import commonLikeList from "../articleList/likeList.vue";
export default { export default {
data() { data() {
return { return {
sysNotices_list:[],
shareId: null, shareId: null,
activeTab: 0, activeTab: 0,
tabsList: [], tabsList: [],
@@ -303,11 +322,62 @@ export default {
}, 800); }, 800);
}, },
onLoad() { onLoad() {
this.getSysNotices()
uni.hideTabBar(); uni.hideTabBar();
this.getTabData(); this.getTabData();
}, },
onShow() {}, onShow() {},
methods: { methods: {
confirm2(){
this.$refs.customModal2.close();
this.sysNotices_list.forEach(e=>{
if(e&&e.id){
this.readSysNotice(e.id);
}
})
// this.readSysNotice();
},
readArticle(item){
this.readSysNotice(item.id)
uni.navigateTo({
url: `/pages/articleList/article?navTitle=文章详情&title=文章详情&id=${item.id}&type=detail&statusId=${item.showFlag}`,
});
this.$refs.customModal2.close();
},
//已读记录
async readSysNotice(id) {
await $http
.request({
url: "common/taihuTalentArticle/setReadFlag",
method: "POST",
data: { articleId: id},
header: {
"Content-Type": "application/json",
},
})
.then(async (res) => {
});
},
async getSysNotices() {
await $http
.request({
url: "common/taihuTalentArticle/getCommentRemind",
method: "POST",
data: { },
header: {
"Content-Type": "application/json",
},
})
.then(async (res) => {
if(res.set&&res.set.length>0){
this.sysNotices_list = res.set;
// this.idString = res.set.map(item => item.id).join(', ');
this.$refs.customModal2.open();
}
});
},
refreshData(reset) { refreshData(reset) {
if (reset) { if (reset) {
this.currentCateIndex = 0; this.currentCateIndex = 0;
@@ -873,4 +943,10 @@ export default {
max-height: 48px; max-height: 48px;
height: auto; height: auto;
} }
.hidden1 {
line-height: 24px;
max-height: 24px;
height: auto;
-webkit-line-clamp: 1;
}
</style> </style>

View File

@@ -196,10 +196,7 @@
<!-- 无评论-start --> <!-- 无评论-start -->
<view <view
class="comment-none" class="comment-none"
@click="
showInput = false;
commentContent = '';
"
v-if="!isDisable" v-if="!isDisable"
style="background-color: #fafafa" style="background-color: #fafafa"
> >
@@ -252,64 +249,52 @@
</view> </view>
<view <view
class="input-container" class="input-container"
:style="{ bottom: keyboardHeight + 'px' }" :style="{ bottom: (show?205:0) + 'px' }"
v-if="showInput" v-if="showInput"
> >
<view style="overflow: hidden; margin-bottom: 4rpx; font-size: 28rpx" <view style="overflow: hidden; margin-bottom: 4rpx; font-size: 32rpx"
><text ><text
@click.stop=" @click.stop="
showInput = false; showInput = false;
commentContent = ''; commentContent = '';
" "
style="float: left" style="float: left;margin-top:4rpx"
>取消</text >取消</text
> >
<text @click.stop="sendComment" style="float: right; color: #1985fd" <text @click.stop="sendComment" style="float: right; color: #1985fd;margin-right:20rpx;margin-top:4rpx;"
>发送</text >发送</text
> >
<image v-if="!show" <image
src="./emoji.png" src="./emoji.png"
@click.stop="emojichet()" @click.stop="emojichet()"
mode="" mode=""
style=" style="
height: 52rpx; height: 50rpx;
width: 52rpx; width: 50rpx;
object-fit: fill; object-fit: fill;
float: right; float: right;
margin-right: 2%; margin-right: 30rpx;
margin-top: -4rpx; margin-top: 0rpx;
"
></image
>
<image v-else
src="./jianpan.png"
@click.stop="emojichet()"
mode=""
style="
height: 52rpx;
width: 52rpx;
object-fit: fill;
float: right;
margin-right: 2%;
margin-top: -4rpx;
" "
></image ></image
> >
</view> </view>
<view> <view>
<textarea <textarea
auto-height auto-height
style="max-height: 200rpx; overflow-y: auto; padding: 14rpx" style="max-height: 200rpx; overflow-y: auto; padding: 14rpx"
v-model="commentContent" v-model="commentContent"
class="comment-input" class="comment-input"
maxlength="-1" maxlength="-1"
:placeholder="placeholder ? placeholder : '发表评论...'" :placeholder="placeholder ? placeholder : '发表评论...'"
@focus.stop="onInputFocus" @focus.stop="onInputFocus"
@blur.stop="onInputBlur"
:auto-focus="showInput" :auto-focus="showInput"
/> />
</view> </view>
@@ -317,7 +302,7 @@
<view <view
class="emoji_box" class="emoji_box"
v-if="show" v-if="show"
:style="{ height: keyboardHeight + 'px' }"
> >
<scroll-view class="scrool" scroll-y="true"> <scroll-view class="scrool" scroll-y="true">
<view class="emojis"> <view class="emojis">
@@ -447,7 +432,7 @@ export default {
"😉", "😉",
"😊", "😊",
"😇", "😇",
"🥰",
"😍", "😍",
"🤩", "🤩",
"😘", "😘",
@@ -469,7 +454,7 @@ export default {
"🤓", "🤓",
"🤠", "🤠",
"😎", "😎",
"🥳",
"😵", "😵",
"🤧", "🤧",
"🤕", "🤕",
@@ -487,14 +472,14 @@ export default {
"🙄", "🙄",
"😬", "😬",
"🤥", "🤥",
"😶‍🌫️", "😶",
"😮‍🌫️", "😮",
"😴", "😴",
"🤮", "🤮",
"❤️", "❤️",
"💯", "💯",
"💔", "💔",
"💩",
"🤡", "🤡",
"🤖", "🤖",
"👻", "👻",
@@ -504,7 +489,7 @@ export default {
"💣", "💣",
"💋", "💋",
"😡", "😡",
"🤬",
"😠", "😠",
], ],
pId: 0, pId: 0,
@@ -533,12 +518,7 @@ export default {
this.placeholder = "发表评论..."; this.placeholder = "发表评论...";
this.commentContent = ""; this.commentContent = "";
this.keyboardListener = uni.onKeyboardHeightChange((res) => {
this.keyboardHeight = res.height;
});
uni.onKeyboardHeightChange((res) => {
this.KeyboardHeight = res.height;
});
}, },
onUnload() { onUnload() {
// 移除监听 // 移除监听
@@ -548,8 +528,14 @@ export default {
}, },
methods: { methods: {
tap(item) { tap(item) {
console.log("item at line 515:", item); this.$nextTick(() => {
this.commentContent += item; // 在页面渲染完成后获取textarea并设置焦点
this.showInput = true;
});
this.commentContent += item; // 更新文本框内容
this.focus = true; // 更新焦点状态
// this.$emit("emoji", item); // 触发 emoji 事件,将选择的 emoji 传给父组件 // this.$emit("emoji", item); // 触发 emoji 事件,将选择的 emoji 传给父组件
}, },
@@ -557,7 +543,12 @@ export default {
emojichet() { emojichet() {
// this.reply("", "", 0); // this.reply("", "", 0);
this.show = !this.show; // 打开 emoji 列表 this.show = true; // 打开 emoji 列表
// if(this.show){
// this.focus = false;
// }else{
// this.focus = true;
// }
}, },
scrollToView(callback) { scrollToView(callback) {
@@ -572,17 +563,18 @@ export default {
.exec(); .exec();
}, },
onInputFocus() { onInputFocus() {
console.log(11111111111);
// 可以在这里添加额外的逻辑,如滚动到输入框位置 // 可以在这里添加额外的逻辑,如滚动到输入框位置
}, },
// 输入框失去焦点 // 输入框失去焦点
onInputBlur() { onInputBlur() {
console.log(11111111111); console.log(11111111111);
setTimeout(() => {
if (!this.commentContent.trim() && !this.show) { if (!this.commentContent.trim()) {
this.showInput = false; this.showInput = false;
} }
}, 200);
// 如果输入框为空,点击空白处关闭输入框 // 如果输入框为空,点击空白处关闭输入框
}, },
@@ -615,9 +607,15 @@ export default {
stopPrevent() {}, stopPrevent() {},
// 回复评论 // 回复评论
reply(pUser, reUser, pId) { reply(pUser, reUser, pId) {
this.show=false
if (this.isDisable) { if (this.isDisable) {
return false; return false;
} }
this.keyboardListener = uni.onKeyboardHeightChange((res) => {
console.log(res); // 打印返回值,查看其中的内容
this.keyboardHeight = res.height;
});
this.pUser = pUser; this.pUser = pUser;
this.commentReq.pId = pId; this.commentReq.pId = pId;
this.pId = pId; this.pId = pId;
@@ -647,7 +645,7 @@ export default {
confirmText: "确认删除", confirmText: "确认删除",
success: function (res) { success: function (res) {
if (res.confirm) { if (res.confirm) {
that.$emit("del", commentId); // that.$emit("del", commentId);
} }
}, },
}); });
@@ -1061,7 +1059,7 @@ export default {
} }
.emoji_box { .emoji_box {
height: 440rpx; height: 400rpx;
background: #f6f6f6; background: #f6f6f6;
position: fixed; position: fixed;
bottom: 0; bottom: 0;
@@ -1077,10 +1075,10 @@ export default {
.emojis { .emojis {
width: 95%; width: 95%;
margin: 0 auto; margin: 0 auto;
font-size: 40rpx; font-size: 46rpx;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 10rpx 25rpx; gap: 20rpx 30rpx;
flex-shrink: 3; flex-shrink: 3;
// padding-bottom: 50rpx; // padding-bottom: 50rpx;
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 966 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB