Sfoglia il codice sorgente

弹出输入框时自动将内容顶上去,隐藏时自动到底部

htc 12 ore fa
parent
commit
432c5ea2e3
2 ha cambiato i file con 8 aggiunte e 2 eliminazioni
  1. 4 1
      pages/dialog.vue
  2. 4 1
      pages/reportAsk.vue

+ 4 - 1
pages/dialog.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
+	<view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px', 'padding-bottom': 'calc(240rpx + ' + fixBottom + 'px)'}">
 		<u-navbar title="创衡正念企业教练AI智能体" bgColor="#E9F4F6" :titleStyle="{'font-size':'32rpx','font-weight':'bold','color':'#002846'}">
 			<view class="u-nav-slot" slot="left" style="display: flex;background-color: transparent;">
 				<image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/06/16/ef50e3e8-d0f9-41dd-a4ec-546b157a1de9.png" style="width: 45rpx;height: 45rpx;" @tap="toBack"></image>
@@ -106,6 +106,9 @@
 		onReady() {
 		    uni.onKeyboardHeightChange(res => {
 		      this.fixBottom = res.height||0;
+			  if(this.fixBottom>0){
+				  this.scrollToBottom()
+			  }
 		    });
 		},
 		onUnload() {

+ 4 - 1
pages/reportAsk.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
+	<view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px', 'padding-bottom': 'calc(240rpx + ' + fixBottom + 'px)'}">
 		<cus-header title='对报告提问' bgColor="#E9F4F6"></cus-header>
 		<view class="dialogs container" ref="messageContainer">
 			<view class="d_pdf">
@@ -97,6 +97,9 @@
 		onReady() {
 		    uni.onKeyboardHeightChange(res => {
 		      this.fixBottom = res.height||0;
+			  if(this.fixBottom>0){
+				  this.scrollToBottom()
+			  }
 		    });
 		},
 		onUnload() {