tijiao
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
class="hb-comment"
|
||||
:style="isDisable || isShowList || isPopup ? 'height:auto' : 'height: 70vh'"
|
||||
id="commentData"
|
||||
|
||||
>
|
||||
<!-- 阅读数-start -->
|
||||
|
||||
@@ -73,7 +74,7 @@
|
||||
<view
|
||||
class="comment-main-content"
|
||||
style="color: #232325; line-height: 38rpx"
|
||||
@click="reply(item.user.nickname, item.user.nickname, item.id)"
|
||||
@click.stop="reply(item.user.nickname, item.user.nickname, item.id)"
|
||||
>
|
||||
{{ item.content }}
|
||||
<!-- {{
|
||||
@@ -90,9 +91,7 @@
|
||||
</view>
|
||||
<view class="comment-main-foot">
|
||||
<view
|
||||
@click="
|
||||
reply(item.user.nickname, item.user.nickname, item.id)
|
||||
"
|
||||
@click.stop="reply(item.user.nickname, item.user.nickname, item.id)"
|
||||
class="foot-time"
|
||||
style="color: #b7b8ba; letter-spacing: 1rpx; font-size: 24rpx"
|
||||
>{{ item.createTime }}</view
|
||||
@@ -101,7 +100,7 @@
|
||||
class="foot-btn"
|
||||
style="color: #777775"
|
||||
v-if="!isDisable"
|
||||
@click="
|
||||
@click.stop="
|
||||
reply(item.user.nickname, item.user.nickname, item.id)
|
||||
"
|
||||
>回复</view
|
||||
@@ -145,7 +144,7 @@
|
||||
<view
|
||||
class="comment-main-content"
|
||||
style="color: #232325 !important; line-height: 38rpx"
|
||||
@click="
|
||||
@click.stop="
|
||||
reply(each.user.nickname, each.user.nickname, item.id)
|
||||
"
|
||||
>
|
||||
@@ -153,9 +152,9 @@
|
||||
</view>
|
||||
<view class="comment-main-foot">
|
||||
<view
|
||||
@click="
|
||||
reply(each.user.nickname, each.user.nickname, item.id)
|
||||
"
|
||||
@click.stop="
|
||||
reply(each.user.nickname, each.user.nickname, item.id)
|
||||
"
|
||||
class="foot-time"
|
||||
style="
|
||||
color: #b7b8ba;
|
||||
@@ -168,7 +167,7 @@
|
||||
class="foot-btn"
|
||||
style="color: #777775"
|
||||
v-if="each.user && !isDisable"
|
||||
@click="
|
||||
@click.stop="
|
||||
reply(each.user.nickname, each.user.nickname, item.id)
|
||||
"
|
||||
>
|
||||
@@ -249,7 +248,7 @@
|
||||
</view>
|
||||
<view
|
||||
class="input-container"
|
||||
:style="{ bottom: (show?205:0) + 'px' }"
|
||||
:style="{ bottom: (show?200:0) + 'px' }"
|
||||
v-if="showInput"
|
||||
>
|
||||
<view style="overflow: hidden; margin-bottom: 4rpx; font-size: 32rpx"
|
||||
@@ -262,7 +261,7 @@
|
||||
>取消</text
|
||||
>
|
||||
|
||||
<text @click.stop="sendComment" style="float: right; color: #1985fd;margin-right:20rpx;margin-top:4rpx;"
|
||||
<text @click.stop="sendComment" style="float: right; color: #1985fd;margin-right:20rpx;margin-top:4rpx;z-index: 99999;"
|
||||
>发送</text
|
||||
>
|
||||
<image
|
||||
@@ -284,7 +283,7 @@
|
||||
|
||||
|
||||
</view>
|
||||
<view>
|
||||
<view :style="!show?'padding-bottom: 20rpx':'padding-bottom: 10rpx'">
|
||||
<textarea
|
||||
auto-height
|
||||
|
||||
@@ -294,8 +293,8 @@
|
||||
maxlength="-1"
|
||||
:placeholder="placeholder ? placeholder : '发表评论...'"
|
||||
@focus.stop="onInputFocus"
|
||||
|
||||
:auto-focus="showInput"
|
||||
@blur.stop="onInputBlur"
|
||||
:auto-focus="focus"
|
||||
/>
|
||||
</view>
|
||||
|
||||
@@ -542,8 +541,12 @@ export default {
|
||||
|
||||
emojichet() {
|
||||
// this.reply("", "", 0);
|
||||
|
||||
this.show = true; // 打开 emoji 列表
|
||||
setTimeout(()=>{
|
||||
this.focus=false
|
||||
this.showInput=true
|
||||
this.show = true;
|
||||
},50)
|
||||
// 打开 emoji 列表
|
||||
// if(this.show){
|
||||
// this.focus = false;
|
||||
// }else{
|
||||
@@ -568,20 +571,28 @@ export default {
|
||||
},
|
||||
|
||||
// 输入框失去焦点
|
||||
onInputBlur() {
|
||||
onInputBlur(event) {
|
||||
console.log(11111111111);
|
||||
|
||||
if (!this.commentContent.trim()) {
|
||||
this.showInput = false;
|
||||
}
|
||||
|
||||
// 阻止焦点事件冒泡,防止冲突
|
||||
event.stopPropagation();
|
||||
console.log('失去焦点');
|
||||
|
||||
|
||||
// if (!this.commentContent.trim()) {
|
||||
setTimeout(()=>{
|
||||
this.showInput = false;
|
||||
},50)
|
||||
|
||||
// }
|
||||
// 如果输入框为空,点击空白处关闭输入框
|
||||
},
|
||||
|
||||
// 发送评论
|
||||
sendComment() {
|
||||
if (this.commentContent.trim()) {
|
||||
sendComment(event) {
|
||||
setTimeout(()=>{
|
||||
event.stopPropagation();
|
||||
console.log('按钮点击');
|
||||
if (this.commentContent.trim()) {
|
||||
// 这里添加发送评论的逻辑
|
||||
console.log("发送评论:", this.commentContent);
|
||||
this.$emit("add", this.commentContent, this.pId);
|
||||
@@ -592,6 +603,8 @@ export default {
|
||||
} else {
|
||||
this.$commonJS.showToast("请输入评论");
|
||||
}
|
||||
},0)
|
||||
|
||||
},
|
||||
// 初始化评论
|
||||
init(cmData) {
|
||||
@@ -607,7 +620,9 @@ export default {
|
||||
stopPrevent() {},
|
||||
// 回复评论
|
||||
reply(pUser, reUser, pId) {
|
||||
this.showInput = false;
|
||||
this.show=false
|
||||
this.focus=false
|
||||
if (this.isDisable) {
|
||||
return false;
|
||||
}
|
||||
@@ -632,7 +647,12 @@ export default {
|
||||
// } else {
|
||||
// this.commentReq.content = "";
|
||||
// }
|
||||
this.showInput = true;
|
||||
setTimeout(()=>{
|
||||
this.focus=true
|
||||
this.showInput = true;
|
||||
|
||||
},20)
|
||||
|
||||
// this.showTag = true;
|
||||
// this.commentInput();
|
||||
},
|
||||
@@ -937,6 +957,7 @@ export default {
|
||||
// text-align: center;
|
||||
color: #999999;
|
||||
position: fixed;
|
||||
padding-bottom: 20rpx;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
|
||||
Reference in New Issue
Block a user