blue
1 year ago
committed by
Gitee
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with
22 additions and
12 deletions
-
im-uniapp/common/emotion.js
-
im-uniapp/manifest.json
-
im-uniapp/pages/chat/chat-box.vue
-
BIN
im-uniapp/static/logo/logo.png
|
|
|
@ -20,16 +20,23 @@ let transform = (content, extClass) => { |
|
|
|
if (idx == -1) { |
|
|
|
return emoText; |
|
|
|
} |
|
|
|
let path = textToPath(emoText); |
|
|
|
let path = textToPath(emoText, true); |
|
|
|
let img = `<img src="${path}" class="${extClass}"/>`; |
|
|
|
return img; |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
let textToPath = (emoText) => { |
|
|
|
let textToPath = (emoText, isRichText) => { |
|
|
|
let word = emoText.replace(/\#|\;/gi, ''); |
|
|
|
let idx = emoTextList.indexOf(word); |
|
|
|
return `/static/emoji/${idx}.gif`; |
|
|
|
let path = `/static/emoji/${idx}.gif`; |
|
|
|
// #ifdef MP-WEIXIN
|
|
|
|
// 小程序的表情要去掉最前面"/"(但有的时候又不能去掉,十分奇怪)
|
|
|
|
if (isRichText) { |
|
|
|
path = path.slice(1); |
|
|
|
} |
|
|
|
// #endif
|
|
|
|
return path; |
|
|
|
} |
|
|
|
|
|
|
|
export default { |
|
|
|
|
|
|
|
@ -106,9 +106,11 @@ |
|
|
|
"appid" : "wxda94f40bfad0262c", |
|
|
|
"libVersion" : "latest", |
|
|
|
"setting" : { |
|
|
|
"urlCheck" : false |
|
|
|
"urlCheck" : false, |
|
|
|
"minified" : true |
|
|
|
}, |
|
|
|
"usingComponents" : true |
|
|
|
"usingComponents" : true, |
|
|
|
"lazyCodeLoading" : "requiredComponents" |
|
|
|
}, |
|
|
|
"mp-alipay" : { |
|
|
|
"usingComponents" : true |
|
|
|
|
|
|
|
@ -32,7 +32,8 @@ |
|
|
|
<chat-record v-if="showRecord" class="chat-record" @send="onSendRecord"></chat-record> |
|
|
|
<view v-else class="send-text"> |
|
|
|
<editor id="editor" class="send-text-area" :placeholder="isReceipt ? '[回执消息]' : ''" |
|
|
|
:read-only="isReadOnly" @focus="onEditorFocus" @blur="onEditorBlur" @ready="onEditorReady" @input="onTextInput"> |
|
|
|
:read-only="isReadOnly" @focus="onEditorFocus" @blur="onEditorBlur" @ready="onEditorReady" |
|
|
|
@input="onTextInput"> |
|
|
|
</editor> |
|
|
|
</view> |
|
|
|
<view v-if="chat && chat.type == 'GROUP'" class="iconfont icon-at" @click="openAtBox()"></view> |
|
|
|
@ -93,7 +94,7 @@ |
|
|
|
<scroll-view v-if="chatTabBox === 'emo'" class="chat-emotion" scroll-y="true" |
|
|
|
:style="{height: keyboardHeight+'px'}"> |
|
|
|
<view class="emotion-item-list"> |
|
|
|
<image class="emotion-item emoji-large" :title="emoText" :src="$emo.textToPath(emoText)" |
|
|
|
<image class="emotion-item emoji-large" :title="emoText" :src="$emo.textToPath(emoText,false)" |
|
|
|
v-for="(emoText, i) in $emo.emoTextList" :key="i" @click="selectEmoji(emoText)" mode="aspectFit" |
|
|
|
lazy-load="true"></image> |
|
|
|
</view> |
|
|
|
@ -369,7 +370,7 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
selectEmoji(emoText) { |
|
|
|
let path = this.$emo.textToPath(emoText) |
|
|
|
let path = this.$emo.textToPath(emoText, true) |
|
|
|
// 先把键盘禁用了,否则会重新弹出键盘 |
|
|
|
this.isReadOnly = true; |
|
|
|
this.isEmpty = false; |
|
|
|
|
Width:
|
Height:
|
Size: 238 KiB
|