This commit is contained in:
zoujiandong 2024-04-30 17:29:43 +08:00
parent c5020df721
commit 5130ea5c7a
2 changed files with 24 additions and 6 deletions

View File

@ -110,6 +110,7 @@ Component({
* 组件的初始数据
*/
data: {
textFocus:false,
conversation: {},
message: '',
showRound:false,
@ -334,7 +335,20 @@ this.setData({
})
wx.setStorageSync('words', "");
}
//let THIS=this;
// wx.getSystemInfo({
// success: function(res) {
// let platform = res.platform;
// if (platform === 'ios') {
// setTimeout(()=>{
// THIS.setData({
// textFocus: true,
// });
// })
// }
// }
// });
// console.log("pageLifetimes show")
let _this = this
wx.getNetworkType({
@ -1349,9 +1363,13 @@ this.setData({
},
// 监听是否获取焦点有焦点则向父级传值动态改变input组件的高度。
inputBindFocus(event) {
this.setData({
focus: true,
});
let {height}= event.detail;
console.log(height);
// if(height==0){
// this.setData({
// textFocus: true,
// });
// }
// this.getMessageList(this.data.conversation);
this.triggerEvent('pullKeysBoards', {
event,

View File

@ -11,8 +11,8 @@
src="{{isAudio ? '../../../../static/assets/keyboard.svg' : '../../../../static/assets/audio.svg'}}" />
<view wx:if="{{!isAudio || isEmoji}}" class="TUI-message-input-main {{ focus && 'TUI-message-input-main-focus'}}" >
<!-- <textarea class="TUI-message-input-area" adjust-position="{{true}}" cursor-spacing="-300" placeholder="请输入文字" value="{{message}}" bindinput="onInputValueChange" maxlength="-1" type="text" auto-height="{{true}}" placeholder-class="textarea-placeholder" confirm-type="send" show-confirm-bar="{{false}}" disable-default-padding="{{true}}" bindfocus="inputBindFocus" bindblur="inputBindBlur" bindconfirm="sendTextMessage" /> -->
<textarea focus="{{false}}" id="mytextarea" cursor-spacing="-300" class="TUI-message-input-area" adjust-position="{{true}}"
value="{{message}}" bindinput="onInputValueChange" maxlength="-1" type="text" auto-height="{{true}}"
<textarea focus="{{textFocus}}" id="mytextarea" cursor-spacing="-300" class="TUI-message-input-area" adjust-position="{{true}}"
value="{{message}}" bindinput="onInputValueChange" maxlength="-1" type="text" auto-height="{{true}}"
placeholder="请输入文字" placeholder-class="input-placeholder" confirm-type="return" show-confirm-bar="{{false}}"
disable-default-padding="{{true}}"
bindfocus="inputBindFocus"