|
@@ -1,5 +1,5 @@
|
|
<template>
|
|
<template>
|
|
- <view id='app'>
|
|
|
|
|
|
+ <view id='app' :style="`bottom:${msgList.KeyBoardHeight}px`">
|
|
<view class="head" :style="{backgroundColor:styleData.color}">
|
|
<view class="head" :style="{backgroundColor:styleData.color}">
|
|
<text :style="{color:styleData.fontColor}">睿宝AI</text>
|
|
<text :style="{color:styleData.fontColor}">睿宝AI</text>
|
|
<view class="switch">
|
|
<view class="switch">
|
|
@@ -31,18 +31,19 @@
|
|
<image class="avtar" src="../../static/Ai-avatar.png" mode="aspectFit"></image>
|
|
<image class="avtar" src="../../static/Ai-avatar.png" mode="aspectFit"></image>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
|
|
+ </view>
|
|
</scroll-view>
|
|
</scroll-view>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
- <view class="chat-bottom">
|
|
|
|
|
|
+ <view class="chat-bottom" >
|
|
<view class="uni-label">
|
|
<view class="uni-label">
|
|
<label v-for="(item,index) in labelList" :key="index" @click="shortcuts(msgList,item)" :style="{backgroundColor:styleData.labelColor,color:styleData.fontColor,borderColor:styleData.borderColor}">{{item}}</label>
|
|
<label v-for="(item,index) in labelList" :key="index" @click="shortcuts(msgList,item)" :style="{backgroundColor:styleData.labelColor,color:styleData.fontColor,borderColor:styleData.borderColor}">{{item}}</label>
|
|
</view>
|
|
</view>
|
|
<view class="send-msg">
|
|
<view class="send-msg">
|
|
<view class="uni-textarea">
|
|
<view class="uni-textarea">
|
|
<textarea id="input-textarea" type="text" v-model="msgList.chatMsg" placeholder="快来聊天吧"
|
|
<textarea id="input-textarea" type="text" v-model="msgList.chatMsg" placeholder="快来聊天吧"
|
|
- confirm-type="send" @confirm="handleSend(msgList)" maxlength="300" />
|
|
|
|
|
|
+ confirm-type="send" @confirm="handleSend(msgList)" maxlength="300"
|
|
|
|
+ @keyboardheightchange="getKeyBoardHeight" :adjust-position="false"/>
|
|
</view>
|
|
</view>
|
|
<view class="uni-button">
|
|
<view class="uni-button">
|
|
<button class="send-btn" @click="handleSend(msgList)" type="primary" :disabled="msgList.isClick" :style="{backgroundColor:styleData.btnColor}">发送</button>
|
|
<button class="send-btn" @click="handleSend(msgList)" type="primary" :disabled="msgList.isClick" :style="{backgroundColor:styleData.btnColor}">发送</button>
|
|
@@ -91,15 +92,17 @@
|
|
len: 0,
|
|
len: 0,
|
|
// 加载符号是否显示
|
|
// 加载符号是否显示
|
|
isloading: [],
|
|
isloading: [],
|
|
- isClick:false
|
|
|
|
|
|
+ isClick:false,
|
|
|
|
+ KeyBoardHeight:0
|
|
})
|
|
})
|
|
|
|
|
|
const styleData = reactive({
|
|
const styleData = reactive({
|
|
value:false,
|
|
value:false,
|
|
color:'#f5f5f5',
|
|
color:'#f5f5f5',
|
|
fontColor:"black",
|
|
fontColor:"black",
|
|
- btnColor:"blue",
|
|
|
|
|
|
+ btnColor:"rgb(30,144,255)",
|
|
contentColor:"#fff",
|
|
contentColor:"#fff",
|
|
|
|
+ labelColor: "#fff",
|
|
borderColor:"rgb(30,144,255)"
|
|
borderColor:"rgb(30,144,255)"
|
|
|
|
|
|
})
|
|
})
|
|
@@ -117,6 +120,12 @@
|
|
watch([msgList.otherChatList,msgList.chatList], (newVal) => {
|
|
watch([msgList.otherChatList,msgList.chatList], (newVal) => {
|
|
scrollToBottom(msgList)
|
|
scrollToBottom(msgList)
|
|
})
|
|
})
|
|
|
|
+
|
|
|
|
+ // 键盘弹起事件
|
|
|
|
+ const getKeyBoardHeight = ((event)=>{
|
|
|
|
+ // 获取键盘高度
|
|
|
|
+ msgList.KeyBoardHeight = event.detail.height
|
|
|
|
+ })
|
|
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|