diff --git a/buyer/src/pages/GoodsDetail.vue b/buyer/src/pages/GoodsDetail.vue index 736102a2..929db852 100644 --- a/buyer/src/pages/GoodsDetail.vue +++ b/buyer/src/pages/GoodsDetail.vue @@ -81,19 +81,8 @@ export default { this.$Message.error("请登录后再联系客服"); return; } - // window.open( - // this.IMLink + - // "?token=" + - // accessToken + - // "&id=" + - // this.goodsMsg.data.storeId + - // "&goodsId=" + - // this.goodsMsg.data.goodsId + - // "&skuId=" + - // this.goodsMsg.data.id - // ); window.open( - 'http://192.168.0.139:8000/' + + this.IMLink + "?token=" + accessToken + "&id=" + @@ -103,6 +92,17 @@ export default { "&skuId=" + this.goodsMsg.data.id ); + // window.open( + // 'http://192.168.0.139:8000/' + + // "?token=" + + // accessToken + + // "&id=" + + // this.goodsMsg.data.storeId + + // "&goodsId=" + + // this.goodsMsg.data.goodsId + + // "&skuId=" + + // this.goodsMsg.data.id + // ); }, // 获取im信息 async getIMDetailMethods () { diff --git a/im/src/components/chat/panel/TalkPanel.vue b/im/src/components/chat/panel/TalkPanel.vue index e5f5a787..a85d6c0c 100644 --- a/im/src/components/chat/panel/TalkPanel.vue +++ b/im/src/components/chat/panel/TalkPanel.vue @@ -500,6 +500,9 @@ export default { if (item.messageType == 'GOODS') { item.text = JSON.parse(item.text) } + if (item.messageType == 'MESSAGE') { + item.text = textReplaceEmoji(item.text) + } if (item.messageType == 'ORDER') { item.text = JSON.parse(item.text) } diff --git a/im/src/components/chat/panel/template/footPrint.vue b/im/src/components/chat/panel/template/footPrint.vue index fcfdf36e..a725727e 100644 --- a/im/src/components/chat/panel/template/footPrint.vue +++ b/im/src/components/chat/panel/template/footPrint.vue @@ -51,11 +51,11 @@
@@ -168,7 +168,7 @@ export default { }, mounted () { // state.user.toUser - console.log(this.$store.state.user.toUser, ' this.$store.state.user.toUser this.$store.state.user.toUser this.$store.state.user.toUser'); + console.log(this.orderList, ' this.$store.state.user.toUser this.$store.state.user.toUser this.$store.state.user.toUser'); this.btnHide = localStorage.getItem('btnHide') } } diff --git a/im/src/utils/emojis.js b/im/src/utils/emojis.js index 030fda59..5a71fe7e 100644 --- a/im/src/utils/emojis.js +++ b/im/src/utils/emojis.js @@ -2,129 +2,129 @@ * 动态表情 */ const emojis = { - "[微笑]": "", - "[撇嘴]": "", - "[色]": "", - "[发呆]": "", - "[得意]": "", - "[流泪]": "", - "[害羞]": "", - "[闭嘴]": "", - "[睡]": "", - "[大哭]": "", - "[尴尬]": "", - "[发怒]": "", - "[调皮]": "", - "[呲牙]": "", - "[惊讶]": "", - "[难过]": "", - "[酷]": "", - "[冷汗]": "", - "[抓狂]": "", - "[吐]": "", - "[偷笑]": "", - "[可爱]": "", - "[白眼]": "", - "[傲慢]": "", - "[饥饿]": "", - "[困]": "", - "[惊恐]": "", - "[流汗]": "", - "[憨笑]": "", - "[大兵]": "", - "[奋斗]": "", - "[咒骂]": "", - "[疑问]": "", - "[嘘]": "", - "[晕]": "", - "[折磨]": "", - "[衰]": "", - "[骷髅]": "", - "[敲打]": "", - "[再见]": "", - "[擦汗]": "", - "[抠鼻]": "", - "[鼓掌]": "", - "[糗大了]": "", - "[坏笑]": "", - "[左哼哼]": "", - "[右哼哼]": "", - "[哈欠]": "", - "[鄙视]": "", - "[委屈]": "", - "[快哭了]": "", - "[阴险]": "", - "[亲亲]": "", - "[吓]": "", - "[可怜]": "", - "[菜刀]": "", - "[西瓜]": "", - "[啤酒]": "", - "[篮球]": "", - "[乒乓]": "", - "[咖啡]": "", - "[饭]": "", - "[猪头]": "", - "[玫瑰]": "", - "[凋谢]": "", - "[示爱]": "", - "[爱心]": "", - "[心碎]": "", - "[蛋糕]": "", - "[闪电]": "", - "[炸弹]": "", - "[刀]": "", - "[足球]": "", - "[瓢虫]": "", - "[便便]": "", - "[月亮]": "", - "[太阳]": "", - "[礼物]": "", - "[拥抱]": "", - "[强]": "", - "[弱]": "", - "[握手]": "", - "[胜利]": "", - "[抱拳]": "", - "[勾引]": "", - "[拳头]": "", - "[差劲]": "", - "[爱你]": "", - "[NO]": "", - "[OK]": "", - "[爱情]": "", - "[飞吻]": "", - "[跳跳]": "", - "[发抖]": "", - "[怄火]": "", - "[转圈]": "", - "[磕头]": "", - "[回头]": "", - "[跳绳]": "", - "[挥手]": "", - "[激动]": "", - "[街舞]": "", - "[献吻]": "", - "[左太极]": "", - "[右太极]": "", + "[微笑]": "", + "[撇嘴]": "", + "[色]": "", + "[发呆]": "", + "[得意]": "", + "[流泪]": "", + "[害羞]": "", + "[闭嘴]": "", + "[睡]": "", + "[大哭]": "", + "[尴尬]": "", + "[发怒]": "", + "[调皮]": "", + "[呲牙]": "", + "[惊讶]": "", + "[难过]": "", + "[酷]": "", + "[冷汗]": "", + "[抓狂]": "", + "[吐]": "", + "[偷笑]": "", + "[可爱]": "", + "[白眼]": "", + "[傲慢]": "", + "[饥饿]": "", + "[困]": "", + "[惊恐]": "", + "[流汗]": "", + "[憨笑]": "", + "[大兵]": "", + "[奋斗]": "", + "[咒骂]": "", + "[疑问]": "", + "[嘘]": "", + "[晕]": "", + "[折磨]": "", + "[衰]": "", + "[骷髅]": "", + "[敲打]": "", + "[再见]": "", + "[擦汗]": "", + "[抠鼻]": "", + "[鼓掌]": "", + "[糗大了]": "", + "[坏笑]": "", + "[左哼哼]": "", + "[右哼哼]": "", + "[哈欠]": "", + "[鄙视]": "", + "[委屈]": "", + "[快哭了]": "", + "[阴险]": "", + "[亲亲]": "", + "[吓]": "", + "[可怜]": "", + "[菜刀]": "", + "[西瓜]": "", + "[啤酒]": "", + "[篮球]": "", + "[乒乓]": "", + "[咖啡]": "", + "[饭]": "", + "[猪头]": "", + "[玫瑰]": "", + "[凋谢]": "", + "[示爱]": "", + "[爱心]": "", + "[心碎]": "", + "[蛋糕]": "", + "[闪电]": "", + "[炸弹]": "", + "[刀]": "", + "[足球]": "", + "[瓢虫]": "", + "[便便]": "", + "[月亮]": "", + "[太阳]": "", + "[礼物]": "", + "[拥抱]": "", + "[强]": "", + "[弱]": "", + "[握手]": "", + "[胜利]": "", + "[抱拳]": "", + "[勾引]": "", + "[拳头]": "", + "[差劲]": "", + "[爱你]": "", + "[NO]": "", + "[OK]": "", + "[爱情]": "", + "[飞吻]": "", + "[跳跳]": "", + "[发抖]": "", + "[怄火]": "", + "[转圈]": "", + "[磕头]": "", + "[回头]": "", + "[跳绳]": "", + "[挥手]": "", + "[激动]": "", + "[街舞]": "", + "[献吻]": "", + "[左太极]": "", + "[右太极]": "", }; /** * 符号表情 */ const symbol = [ - "😠", "😩", "😲", "😞", "😵", "😰", "😒", "😍", "😤", "😜", "😝", "😋", "😘", "😚", "😷", - "😳", "😃", "😅", "😆", "😁", "😂", "😊", "☺", "😄", "😢", - "😭", "😨", "😣", "😡", "😌", "😖", "😔", "😱", "😪", "😏", "😓", "😥", "😫", "😉", - "✊", "✋", "✌", "👊", "👍", "☝", "👆", "👇", "👈", "👉", - "👋", "👏", "👌", "👎" + "😠", "😩", "😲", "😞", "😵", "😰", "😒", "😍", "😤", "😜", "😝", "😋", "😘", "😚", "😷", + "😳", "😃", "😅", "😆", "😁", "😂", "😊", "☺", "😄", "😢", + "😭", "😨", "😣", "😡", "😌", "😖", "😔", "😱", "😪", "😏", "😓", "😥", "😫", "😉", + "✊", "✋", "✌", "👊", "👍", "☝", "👆", "👇", "👈", "👉", + "👋", "👏", "👌", "👎" ]; const emojisKeys = Object.keys(emojis); export const emojiList = { - symbol, - emojis + symbol, + emojis } const regEmoji = emojisKeys.map((value) => '|\\' + value).join('').replace('|', '') @@ -134,11 +134,11 @@ const regEmoji = emojisKeys.map((value) => '|\\' + value).join('').replace('|', * * @param {String} content 需要替换的字符串 */ -export function textReplaceEmoji(content) { - if(!content){ - return "" - } - return content.replace(new RegExp(`(${regEmoji})`, 'gi'), ($0, $1) => { - return emojis[$1]; - }); +export function textReplaceEmoji (content) { + if (!content) { + return "" + } + return content.replace(new RegExp(`(${regEmoji})`, 'gi'), ($0, $1) => { + return emojis[$1]; + }); } \ No newline at end of file diff --git a/im/src/views/layout/MainLayout.vue b/im/src/views/layout/MainLayout.vue index 0406c1a8..1cb9b102 100644 --- a/im/src/views/layout/MainLayout.vue +++ b/im/src/views/layout/MainLayout.vue @@ -72,17 +72,17 @@ export default { }), }, watch: { - unreadNum(n, o) { + unreadNum (n, o) { if (n > 0 && n > o && this.notifyCueTone) { this.play(); } }, }, - created() { + created () { this.setApplyNum(); }, methods: { - play() { + play () { document .querySelector("#audio") .play() @@ -90,10 +90,10 @@ export default { console.error("消息提示音播放异常"); }); }, - logout() { + logout () { this.$store.dispatch("ACT_USER_LOGOUT"); }, - setApplyNum() { + setApplyNum () { // TODO 暂且return return; ServeFindFriendApplyNum().then((res) => { @@ -108,7 +108,7 @@ export default {