10
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
<image v-if="isFailedMessage && !isPreview" src="@/static/images/chating_message_failed.png" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="message_content_wrap message_content_wrap_shadow" @longtap="longtap($event)">
|
||||
<view class="message_content_wrap message_content_wrap_shadow" :id="`message_content_wrap_${source.clientMsgID}`" @longtap.stop.prevent="longtapEvent($event)">
|
||||
<text-message-render v-if="showTextRender" :message="source" />
|
||||
<media-message-render v-else-if="showMediaRender" :message="source" />
|
||||
<error-message-render v-else />
|
||||
@@ -26,11 +26,12 @@
|
||||
<!-- 长按菜单 -->
|
||||
<chunLei-popups v-model="toolTipFlag" :popData="toolTipData" @tapPopup="tapPopup"
|
||||
:x="toolTipX" :y="toolTipY" :placement="popPostion"
|
||||
:triangle="false"
|
||||
direction="row" theme="dark" :dynamic="true">
|
||||
</chunLei-popups>
|
||||
</view>
|
||||
|
||||
<view v-else class="notice_message_container" :id="`auchor${source.clientMsgID}`">
|
||||
<view v-else class="notice_message_container" style="margin: 0 auto;" :id="`auchor${source.clientMsgID}`">
|
||||
<text>{{ getNoticeContent }}</text>
|
||||
</view>
|
||||
</template>
|
||||
@@ -74,7 +75,6 @@
|
||||
toolTipFlag: false,
|
||||
popPostion:"default",
|
||||
toolTipData: [],
|
||||
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -137,9 +137,17 @@
|
||||
}, 2000);
|
||||
}
|
||||
},
|
||||
longtap(e){
|
||||
console.log(e.target,e.currentTarget);
|
||||
this.showToolTip(e);
|
||||
longtapEvent(e){
|
||||
console.log('longtapEvent');
|
||||
// console.log("#"+e.currentTarget.id,e);
|
||||
// let view = uni.createSelectorQuery().in(this).select("#"+e.currentTarget.id.replace('message_content_wrap_','auchor'));
|
||||
// console.log(e.touches[0].clientX,e.touches[0].clientY);
|
||||
// view.boundingClientRect((data) => {
|
||||
// console.log(data.left,data.top);
|
||||
// //console.log("得到布局位置信息" + JSON.stringify(data));
|
||||
// }).exec();
|
||||
this.$emit('userEvent',{type:"longtapMsgContent"},this.source);
|
||||
//this.showToolTip(e);
|
||||
},
|
||||
//操作项
|
||||
showToolTip: function(e) {
|
||||
@@ -158,11 +166,23 @@
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
icon: '/static/images/chat/longTipIcon/tag.png',
|
||||
title: '编辑',
|
||||
id: 6,
|
||||
icon: '/static/images/chat/longTipIcon/select.png',
|
||||
title: '多选',
|
||||
disabled: false
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
icon: '/static/images/chat/longTipIcon/delete.png',
|
||||
title: '删除',
|
||||
disabled: false
|
||||
},
|
||||
// {
|
||||
// id: 5,
|
||||
// icon: '/static/images/chat/longTipIcon/tag.png',
|
||||
// title: '编辑',
|
||||
// disabled: false
|
||||
// }
|
||||
];
|
||||
that.toolTipX =e.touches[0].clientX;
|
||||
that.toolTipY = e.touches[0].clientY-20;
|
||||
@@ -184,18 +204,19 @@
|
||||
tapPopup(e) {
|
||||
let that = this;
|
||||
let currentHandleMsg=that.source;
|
||||
console.log(currentHandleMsg);
|
||||
if (e.title == "撤回") {
|
||||
let editMessage=JSON.parse(JSON.stringify(currentHandleMsg));
|
||||
that.$emit("revertMsg",editMessage)
|
||||
that.toolTipFlag = false;
|
||||
that.$emit('userEvent',{type:'revokeMessage'},that.source);
|
||||
}
|
||||
if (e.title == "复制") {
|
||||
let content = currentHandleMsg.content;
|
||||
let content = currentHandleMsg.textElem?.content;
|
||||
if (content) {
|
||||
let copyContent =content.text;
|
||||
let formatStr = this.replaceReseverEmoji(copyContent);
|
||||
that.globalUtil.uniCopy({
|
||||
content: formatStr,
|
||||
let formatStr = copyContent;
|
||||
//let formatStr = this.replaceReseverEmoji(copyContent);
|
||||
uni.setClipboardData({
|
||||
data:formatStr,
|
||||
success: (res) => {
|
||||
uni.showToast({
|
||||
title: res,
|
||||
@@ -215,15 +236,8 @@
|
||||
return;
|
||||
}
|
||||
if (e.title == "转发") {
|
||||
that.$emit('userEvent',{type:'forward'},that.source);
|
||||
that.toolTipFlag = false;
|
||||
/* that.$u.route({
|
||||
url: '/pages/chat/chatGroup/msgForward',
|
||||
params: {
|
||||
msgList:encodeURIComponent(JSON.stringify([currentHandleMsg])),
|
||||
sendType: 1, //1 单条转发 2多条转发
|
||||
fromChatGroupId: currentHandleMsg.groupId
|
||||
}
|
||||
}) */
|
||||
return
|
||||
}
|
||||
if(e.title=="调换"){
|
||||
@@ -231,24 +245,16 @@
|
||||
return;
|
||||
}
|
||||
if (e.title == "多选") {
|
||||
that.$emit('userEvent',{type:'select'},that.source);
|
||||
that.toolTipFlag = false;
|
||||
/* that.$u.route({
|
||||
url: '/pages/chat/chatting/chatting-checkbox',
|
||||
params: {
|
||||
groupId:currentHandleMsg.groupId,
|
||||
pageNum:1,
|
||||
selectMsgId: currentHandleMsg.id,
|
||||
}
|
||||
}) */
|
||||
return
|
||||
}
|
||||
if(e.title=="编辑"){
|
||||
let editMessage=JSON.parse(JSON.stringify(currentHandleMsg));
|
||||
editMessage.formatTimeStr=currentHandleMsg.createTime;
|
||||
that.$emit("showUpdateMsg",editMessage)
|
||||
if (e.title == "删除") {
|
||||
that.toolTipFlag = false;
|
||||
return;
|
||||
that.$emit('userEvent',{type:'deleteMsg'},that.source);
|
||||
return
|
||||
}
|
||||
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -289,7 +295,7 @@
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
margin-left: 20rpx;
|
||||
// text-align: start;
|
||||
// text-align: flex-start;
|
||||
max-width: 80%;
|
||||
position: relative;
|
||||
|
||||
@@ -307,7 +313,7 @@
|
||||
}
|
||||
.message_content_wrap {
|
||||
@include vCenterBox();
|
||||
text-align: start;
|
||||
text-align: flex-start;
|
||||
// font-size: 14px;
|
||||
color: $uni-text-color;
|
||||
width: fit-content;
|
||||
@@ -316,7 +322,7 @@
|
||||
|
||||
.bg_container {
|
||||
padding: 16rpx 24rpx;
|
||||
border-radius: 0rpx 12rpx 12rpx 12rpx;
|
||||
border-radius: 12rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user