新增表情包组件
This commit is contained in:
@@ -1,7 +1,17 @@
|
||||
<template>
|
||||
<view class="sent--text">
|
||||
<input class="input" type="text" :auto-blur="true" @focus="focus" @blur="blur" :focus="focusState"
|
||||
v-model="inputTxt" confirm-type="send" @confirm="sent" cursor-spacing="10" />
|
||||
<input
|
||||
class="input"
|
||||
type="text"
|
||||
:auto-blur="true"
|
||||
:focus="focusState"
|
||||
v-model="inputTxt"
|
||||
confirm-type="send"
|
||||
cursor-spacing="10"
|
||||
@focus="focus"
|
||||
@blur="blur"
|
||||
@confirm="sent"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -27,7 +37,7 @@
|
||||
computed: {
|
||||
disabled() {
|
||||
return this.inputTxt.length === 0
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
RongIMLib.getTextMessageDraft(this.conversationType, this.targetId, ({
|
||||
@@ -45,9 +55,15 @@
|
||||
focusState: false,
|
||||
inputTxt: ''
|
||||
}
|
||||
},
|
||||
},
|
||||
created(){
|
||||
uni.$on('emojiValue', res => {
|
||||
this.inputTxt = res.value
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
sent() {
|
||||
sent() {
|
||||
if (!this.disabled) {
|
||||
im.sentText(this.conversationType, this.targetId, this.inputTxt, this.sender, () => {
|
||||
RongIMLib.clearTextMessageDraft(this.conversationType, this.targetId)
|
||||
@@ -56,13 +72,16 @@
|
||||
})
|
||||
}
|
||||
},
|
||||
focus() {
|
||||
focus() {
|
||||
this.$emit('focus')
|
||||
},
|
||||
blur() {
|
||||
blur(e) {
|
||||
uni.hideKeyboard()
|
||||
this.$emit('blur')
|
||||
this.$emit('blur', e.detail)
|
||||
}
|
||||
},
|
||||
destroyed() {
|
||||
uni.$off('emojiValue')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -75,7 +94,7 @@
|
||||
.input {
|
||||
background: #F3F6FB;
|
||||
height: 70rpx;
|
||||
width: 460rpx;
|
||||
width: 400rpx;
|
||||
border-radius: 10rpx;
|
||||
margin-right: 15rpx;
|
||||
padding: 0 20rpx;
|
||||
|
||||
Reference in New Issue
Block a user