转换表情
parent
bad9f9109c
commit
5d16a7a80e
|
@ -3,8 +3,8 @@ var BASE = {
|
||||||
* @description api请求基础路径
|
* @description api请求基础路径
|
||||||
*/
|
*/
|
||||||
API_DEV: {
|
API_DEV: {
|
||||||
common: "https://common-api.pickmall.cn",
|
common: "http://192.168.0.113:8890",
|
||||||
buyer: "https://buyer-api.pickmall.cn",
|
buyer: "http://192.168.0.113:8898",
|
||||||
seller: "https://store-api.pickmall.cn",
|
seller: "https://store-api.pickmall.cn",
|
||||||
manager: "https://admin-api.pickmall.cn"
|
manager: "https://admin-api.pickmall.cn"
|
||||||
},
|
},
|
||||||
|
|
|
@ -65,8 +65,8 @@
|
||||||
right: item.float == 'right',
|
right: item.float == 'right',
|
||||||
}">
|
}">
|
||||||
<div class="arrow"></div>
|
<div class="arrow"></div>
|
||||||
|
<pre v-if="!emojistwo.includes(item.text)" v-html="item.text" />
|
||||||
<pre v-html="item.text" />
|
<pre v-if="emojistwo.includes(item.text)" v-html="textReplaceEmoji(item.text)" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="item.messageType == 'GOODS' && item.text != null" class="goodsStyle " :class="{
|
<div v-if="item.messageType == 'GOODS' && item.text != null" class="goodsStyle " :class="{
|
||||||
|
@ -176,7 +176,7 @@
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { textReplaceLink } from "@/utils/functions";
|
import { textReplaceLink } from "@/utils/functions";
|
||||||
import { textReplaceEmoji } from "@/utils/emojis";
|
import { textReplaceEmoji, emojistwo } from "@/utils/emojis";
|
||||||
import OtherLink from "@/components/chat/panel/OtherLink.vue";
|
import OtherLink from "@/components/chat/panel/OtherLink.vue";
|
||||||
import { mapState, mapGetters } from "vuex";
|
import { mapState, mapGetters } from "vuex";
|
||||||
import TalkSearchRecord from "@/components/chat/TalkSearchRecord";
|
import TalkSearchRecord from "@/components/chat/TalkSearchRecord";
|
||||||
|
@ -233,6 +233,7 @@ export default {
|
||||||
return {
|
return {
|
||||||
// 记录加载相关参数
|
// 记录加载相关参数
|
||||||
textReplaceEmoji,
|
textReplaceEmoji,
|
||||||
|
emojistwo,
|
||||||
textReplaceLink,
|
textReplaceLink,
|
||||||
loadRecord: {
|
loadRecord: {
|
||||||
status: 0,
|
status: 0,
|
||||||
|
@ -387,7 +388,6 @@ export default {
|
||||||
|
|
||||||
// 回车键发送消息回调事件
|
// 回车键发送消息回调事件
|
||||||
submitSendMessage (content) {
|
submitSendMessage (content) {
|
||||||
console.log("发送", content);
|
|
||||||
const record = {
|
const record = {
|
||||||
operation_type: "MESSAGE",
|
operation_type: "MESSAGE",
|
||||||
to: this.params.receiver_id,
|
to: this.params.receiver_id,
|
||||||
|
@ -396,6 +396,9 @@ export default {
|
||||||
context: content,
|
context: content,
|
||||||
talk_id: this.params.talkId,
|
talk_id: this.params.talkId,
|
||||||
};
|
};
|
||||||
|
// if (record.messageType == 'MESSAGE"') {
|
||||||
|
// record.text = this.textReplaceEmoji(record.content)
|
||||||
|
// }
|
||||||
SocketInstance.emit("event_talk", record);
|
SocketInstance.emit("event_talk", record);
|
||||||
|
|
||||||
this.$store.commit("UPDATE_TALK_ITEM", {
|
this.$store.commit("UPDATE_TALK_ITEM", {
|
||||||
|
@ -415,8 +418,6 @@ export default {
|
||||||
text: content,
|
text: content,
|
||||||
float: "right",
|
float: "right",
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log("insterChat", insterChat);
|
|
||||||
// console.log("插入对话记录",'')
|
// console.log("插入对话记录",'')
|
||||||
// 插入对话记录
|
// 插入对话记录
|
||||||
this.$store.commit("PUSH_DIALOGUE", insterChat);
|
this.$store.commit("PUSH_DIALOGUE", insterChat);
|
||||||
|
@ -500,9 +501,9 @@ export default {
|
||||||
if (item.messageType == 'GOODS') {
|
if (item.messageType == 'GOODS') {
|
||||||
item.text = JSON.parse(item.text)
|
item.text = JSON.parse(item.text)
|
||||||
}
|
}
|
||||||
if (item.messageType == '"MESSAGE"') {
|
// if (item.messageType == 'MESSAGE"') {
|
||||||
item.text = textReplaceEmoji(item.text)
|
// item.text = this.textReplaceEmoji(item.text)
|
||||||
}
|
// }
|
||||||
if (item.messageType == 'ORDER') {
|
if (item.messageType == 'ORDER') {
|
||||||
item.text = JSON.parse(item.text)
|
item.text = JSON.parse(item.text)
|
||||||
}
|
}
|
||||||
|
|
|
@ -308,7 +308,6 @@ export default {
|
||||||
|
|
||||||
// 选中表情包回调事件
|
// 选中表情包回调事件
|
||||||
selecteEmoticon (data) {
|
selecteEmoticon (data) {
|
||||||
console.log(data);
|
|
||||||
if (data.type == 1) {
|
if (data.type == 1) {
|
||||||
let value = this.editorText;
|
let value = this.editorText;
|
||||||
let el = this.$refs.textarea;
|
let el = this.$refs.textarea;
|
||||||
|
@ -330,8 +329,6 @@ export default {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const { talk_type, receiver_id } = this.$store.state.dialogue;
|
const { talk_type, receiver_id } = this.$store.state.dialogue;
|
||||||
console.log(talk_type);
|
|
||||||
console.log(receiver_id);
|
|
||||||
ServeSendEmoticon({
|
ServeSendEmoticon({
|
||||||
talk_type,
|
talk_type,
|
||||||
receiver_id,
|
receiver_id,
|
||||||
|
|
|
@ -121,14 +121,12 @@ const symbol = [
|
||||||
];
|
];
|
||||||
|
|
||||||
const emojisKeys = Object.keys(emojis);
|
const emojisKeys = Object.keys(emojis);
|
||||||
|
|
||||||
export const emojiList = {
|
export const emojiList = {
|
||||||
symbol,
|
symbol,
|
||||||
emojis
|
emojis
|
||||||
}
|
}
|
||||||
|
|
||||||
const regEmoji = emojisKeys.map((value) => '|\\' + value).join('').replace('|', '')
|
const regEmoji = emojisKeys.map((value) => '|\\' + value).join('').replace('|', '')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 替换表情文字
|
* 替换表情文字
|
||||||
*
|
*
|
||||||
|
@ -142,3 +140,4 @@ export function textReplaceEmoji (content) {
|
||||||
return emojis[$1];
|
return emojis[$1];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
export const emojistwo = Object.keys(emojis)
|
Loading…
Reference in New Issue