This commit is contained in:
唐明明
2022-02-18 10:50:30 +08:00
9 changed files with 97 additions and 22 deletions

View File

@@ -11,8 +11,8 @@
<sent-voice v-if="chatType === 0" :conversationType="conversationType" :targetId="targetId"
@success="onSuccess" />
<sent-text v-if="chatType === 1" :conversationType="conversationType" :targetId="targetId"
@success="onSuccess" />
<view class="msg-type msg-popups" @click="showPopups = !showPopups">
@success="onSuccess" @focus="onHidePopus" />
<view class="msg-type msg-popups" @click="() => { showPopups = !showPopups, onHidePopus }">
<image class="icon" src="@/static/icon/popups-icon.png"></image>
</view>
</view>
@@ -56,7 +56,13 @@
},
onSuccess() {
this.$emit('onSuccess')
}
},
// 处理弹出层
onHidePopus(){
if(this.showPopups){
this.showPopups = false
}
}
}
}
</script>

View File

@@ -110,14 +110,14 @@
this.callShow = true
break;
case 'location':
uni.showToast({
icon: 'none',
title: '功能正在开发中'
})
// uni.showToast({
// icon: 'none',
// title: '功能正在开发中'
// })
// uni.chooseLocation({
// success: res => {
// console.log(res);
// this.success()
// // this.success()
// }
// })
break;

View File

@@ -1,8 +1,8 @@
<template>
<view class="sent--text">
<input class="input" type="text" @focus="focus" @blur="blur" v-model="inputTxt" confirm-type="send"
<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" />
<!-- <button class="button" size="mini" :disabled="disabled" @click="sent">发送</button> -->
<!-- <button class="button" size="mini" :disabled="disabled" @click="demo">{{focusState ? '失焦': '聚焦'}}</button> -->
</view>
</template>
@@ -44,6 +44,11 @@
RongIMLib.saveTextMessageDraft(this.conversationType, this.targetId, this.inputTxt, (res) => {
console.log('销毁组件之前,保存草稿信息,但是没有执行', res);
})
},
data() {
return {
focusState: false,
}
},
methods: {
// 发送文本消息
@@ -55,11 +60,17 @@
this.inputTxt = ''
})
}
},
demo(){
console.log(this.focusState)
this.focusState = !this.focusState
},
focus() {
this.$emit('focus')
focus() {
this.$emit('focus')
},
blur() {
blur() {
uni.hideKeyboard()
this.$emit('blur')
}
}