diff --git a/src/components/framework/Emotion/index.vue b/src/components/framework/Emotion/index.vue index ad888c7f80f7fc7719072ff5b2241b6798686af4..69d5661077dcc493bc151beac9b8507d21d0c442 100644 --- a/src/components/framework/Emotion/index.vue +++ b/src/components/framework/Emotion/index.vue @@ -38,7 +38,7 @@ export default { }, methods: { clickHandler (i) { - let emotion = `#${i};` + let emotion = `/${i}` this.$emit('emotion', emotion) } }, diff --git a/src/components/weChat/autoReply.vue b/src/components/weChat/autoReply.vue index 5dad996004f92627217405dafa200c2d67a3c6f0..eac8e084149161201e5d3b57f3a750537965a1f9 100644 --- a/src/components/weChat/autoReply.vue +++ b/src/components/weChat/autoReply.vue @@ -15,7 +15,7 @@ <div v-for="(item, index) in JSON.parse(props.row.desc)"> <span v-if="item.content && item.type==='text'"> 回å¤{{index+1}}: - <span v-html="item.content.replace(/\#[\u4E00-\u9FA5]{1,3}\;/gi, emotion)"></span> + <span v-html="item.content.replace(/\/[\u4E00-\u9FA5]{1,3}/gi, emotion)"></span> </span> <span v-if="item.content && item.type==='image'">回å¤{{index+1}}:<img class="img" :src="item.content"/></span> <span v-if="item.variable">回å¤{{index+1}}:è€å¸ˆäºŒç»´ç </span> @@ -85,7 +85,7 @@ methods: { // 将匹é…结果替æ¢è¡¨æƒ…图片 emotion (res) { - let word = res.replace(/\#|\;/gi,'') + let word = res.replace(/\//gi,'') const list = ['微笑', '撇嘴', '色', 'å‘呆', 'å¾—æ„', 'æµæ³ª', '害羞', 'é—嘴', 'ç¡', '大å“', 'å°´å°¬', '呿€’', '调皮', '呲牙', '惊讶', '难过', 'é…·', '冷汗', '抓狂', 'å', 'å·ç¬‘', 'å¯çˆ±', '白眼', '傲慢', '饥饿', 'å›°', '惊æ', 'æµæ±—', '憨笑', '大兵', '奋斗', '咒骂', 'ç–‘é—®', '嘘', '晕', '折磨', 'è¡°', '骷髅', '敲打', 'å†è§', '擦汗', 'æŠ é¼»', '鼓掌', '糗大了', 'å笑', '左哼哼', 'å³å“¼å“¼', 'å“ˆæ¬ ', '鄙视', '委屈', 'å¿«å“了', '阴险', '亲亲', 'å“', '坿€œ', 'èœåˆ€', '西瓜', '啤酒', '篮çƒ', '乒乓', 'å’–å•¡', 'é¥', '猪头', '玫瑰', '凋谢', '示爱', '爱心', '心碎', '蛋糕', '闪电', '炸弹', '刀', 'è¶³çƒ', '瓢虫', '便便', '月亮', '太阳', '礼物', '拥抱', '强', 'å¼±', 'æ¡æ‰‹', '胜利', '抱拳', '勾引', '拳头', '差劲', 'çˆ±ä½ ', 'NO', 'OK', '爱情', '飞å»', '跳跳', '呿Ж', '怄ç«', '转圈', '磕头', '回头', '跳绳', '挥手', '激动', '街舞', '献å»', '左太æž', 'å³å¤ªæž'] let index = list.indexOf(word) return `<img src="https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/${index}.gif" align="middle">` diff --git a/src/components/weChat/focusReply.vue b/src/components/weChat/focusReply.vue index f5cd12a19d25bbe1d7049594aa6cd32950e8d27c..feea7a930ddf6e69065b08bd1df86cc9922f156e 100644 --- a/src/components/weChat/focusReply.vue +++ b/src/components/weChat/focusReply.vue @@ -27,7 +27,7 @@ <!--<div v-if="scope.row.type === 'text'">--> <!--{{scope.row.content}}--> <!--</div>--> - <div v-if="scope.row.type === 'text'" v-html="scope.row.content.replace(/\#[\u4E00-\u9FA5]{1,3}\;/gi, emotion)"></div> + <div v-if="scope.row.type === 'text'" v-html="scope.row.content.replace(/\/[\u4E00-\u9FA5]{1,3}/gi, emotion)"></div> <a v-else-if="scope.row.type === 'image' && scope.row.content" :href="scope.row.content" target="_blank"> <img class="shotcut" :src="scope.row.content"> </a> @@ -168,8 +168,7 @@ }, methods:{ emotion (res) { - console.log('emotion', res) - let word = res.replace(/\#|\;/gi,'') + let word = res.replace(/\//gi,'') const list = ['微笑', '撇嘴', '色', 'å‘呆', 'å¾—æ„', 'æµæ³ª', '害羞', 'é—嘴', 'ç¡', '大å“', 'å°´å°¬', '呿€’', '调皮', '呲牙', '惊讶', '难过', 'é…·', '冷汗', '抓狂', 'å', 'å·ç¬‘', 'å¯çˆ±', '白眼', '傲慢', '饥饿', 'å›°', '惊æ', 'æµæ±—', '憨笑', '大兵', '奋斗', '咒骂', 'ç–‘é—®', '嘘', '晕', '折磨', 'è¡°', '骷髅', '敲打', 'å†è§', '擦汗', 'æŠ é¼»', '鼓掌', '糗大了', 'å笑', '左哼哼', 'å³å“¼å“¼', 'å“ˆæ¬ ', '鄙视', '委屈', 'å¿«å“了', '阴险', '亲亲', 'å“', '坿€œ', 'èœåˆ€', '西瓜', '啤酒', '篮çƒ', '乒乓', 'å’–å•¡', 'é¥', '猪头', '玫瑰', '凋谢', '示爱', '爱心', '心碎', '蛋糕', '闪电', '炸弹', '刀', 'è¶³çƒ', '瓢虫', '便便', '月亮', '太阳', '礼物', '拥抱', '强', 'å¼±', 'æ¡æ‰‹', '胜利', '抱拳', '勾引', '拳头', '差劲', 'çˆ±ä½ ', 'NO', 'OK', '爱情', '飞å»', '跳跳', '呿Ж', '怄ç«', '转圈', '磕头', '回头', '跳绳', '挥手', '激动', '街舞', '献å»', '左太æž', 'å³å¤ªæž'] let index = list.indexOf(word) return `<img src="https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/${index}.gif" align="middle">`