no message

This commit is contained in:
wangdongbo 2026-01-29 18:03:24 +08:00
parent 8233411831
commit 01529b1b99
5 changed files with 23 additions and 29 deletions

View File

@ -22,12 +22,9 @@ export default {
async initIMOnLaunch() {
try {
const account = accountStore();
// openId
const storedAccount = uni.getStorageSync("account");
const storedOpenId = uni.getStorageSync("openid");
debugger;
if (storedOpenId) {
console.log("检测到已登录的 openId开始初始化 IM:", storedOpenId);
account.openid = storedOpenId;

View File

@ -286,7 +286,6 @@ defineExpose({
.popup-footer {
padding: 20rpx 32rpx;
padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
border-top: 1rpx solid #f0f0f0;
}

View File

@ -348,23 +348,30 @@ $primary-color: #0877F1;
.text-input,
.voice-input-btn {
flex: 1;
padding: 0 46rpx;
padding: 16rpx 46rpx;
background-color: #f3f5fa;
border-radius: 20rpx;
margin: 0 16rpx;
font-size: 28rpx;
height: 80rpx;
min-height: 80rpx;
max-height: 200rpx;
border: none;
outline: none;
box-sizing: border-box;
display: flex;
align-items: center;
line-height: 96rpx;
line-height: 1.5;
color: #333;
}
.voice-input-btn {
height: 80rpx;
display: flex;
align-items: center;
padding: 0 46rpx;
}
.voice-input-btn {
text-align: center;
line-height: 80rpx;
}
.more-panel {

View File

@ -6,8 +6,9 @@
<uni-icons v-else type="mic" size="28" color="#666" />
</view>
<view class="input-area">
<input v-if="!showVoiceInput" class="text-input" v-model="inputText" placeholder="我来说两句..."
@confirm="sendTextMessage" @focus="handleInputFocus" />
<textarea v-if="!showVoiceInput" class="text-input" v-model="inputText" placeholder="我来说两句..."
@confirm="sendTextMessage" @focus="handleInputFocus" @input="handleInput"
:auto-height="true" :show-confirm-bar="false" :adjust-position="true" />
<input v-else class="voice-input-btn" :class="{ recording: isRecording }" @touchstart="startRecord"
@touchmove="onRecordTouchMove" @touchend="stopRecord" @touchcancel="cancelRecord" :placeholder="isRecording ? '松开发送' : '按住说话'" disabled>
</input>
@ -334,6 +335,13 @@ function handleInputFocus() {
});
}
function handleInput(e) {
// textarea
nextTick().then(() => {
emit("scrollToBottom");
});
}
onMounted(() => {
//
initRecorderManager();

View File

@ -444,24 +444,7 @@ onShow(async () => {
// IM
const imReady = await initIM();
if (!imReady) {
console.error("IM初始化失败");
uni.showToast({
title: "连接失败,请重试",
icon: "none",
});
return;
}
// TIM
if (!globalTimChatManager || !globalTimChatManager.tim) {
console.error("IM初始化后 TIM 实例仍不存在");
uni.showToast({
title: "初始化异常,请重启应用",
icon: "none",
});
return;
}
if (!imReady) initIMAfterLogin();
//
await loadConversationList();
//