diff --git a/package1/ieBrowser/chat.vue b/package1/ieBrowser/chat.vue
index ab9204c..a9615b7 100644
--- a/package1/ieBrowser/chat.vue
+++ b/package1/ieBrowser/chat.vue
@@ -38,7 +38,7 @@
-
正在加载更早消息...
没有更早的消息了
@@ -62,20 +62,21 @@
{{ typingHint }}
-
+
{{ item }}
-
+
{{ item }}
-
+
☺
{{ voiceMode ? '键' : '语' }}
-
+
{{ voiceHoldText }}
@@ -99,6 +100,16 @@
{{ targetProfile.avatarText || companion.avatar }}
{{ targetProfile.anonymousName || companion.name }}
{{ targetProfile.currentMode === 'e' ? 'e 人 · 轻轻热闹' : 'i 人 · 安静陪伴' }}
+
+
+ 性别
+ {{ genderText(targetProfile.gender) }}
+
+
+ 想遇见
+ {{ targetText(targetProfile.targetModePreference, targetProfile.targetGenderPreference) }}
+
+
{{ targetProfile.intro || companion.prompt || '这个人还没有写介绍。' }}
{{ tag }}
@@ -144,6 +155,8 @@
innerAudioContext: null,
playingVoiceUrl: '',
voiceSwitching: false,
+ keyboardHeight: 0,
+ keyboardListener: null,
messages: [],
messagePage: 1,
messagePageSize: 20,
@@ -189,6 +202,23 @@
voiceHoldText() {
if (!this.recording) return '按住说话'
return this.voiceCancelling ? '松开取消' : '松开发送,上滑取消'
+ },
+ keyboardBottomPx() {
+ return this.keyboardHeight > 0 ? (this.keyboardHeight + 8) + 'px' : '30rpx'
+ },
+ inputBarBottom() {
+ return this.keyboardBottomPx
+ },
+ presenceBottom() {
+ return this.keyboardHeight > 0 ? (this.keyboardHeight + 76) + 'px' : '132rpx'
+ },
+ emojiPanelBottom() {
+ return this.keyboardHeight > 0 ? (this.keyboardHeight + 82) + 'px' : '128rpx'
+ },
+ messagesStyle() {
+ return {
+ paddingBottom: this.keyboardHeight > 0 ? (this.keyboardHeight + 140) + 'px' : '24rpx'
+ }
}
},
onLoad(options) {
@@ -216,16 +246,49 @@
this.loadLatestMessages()
this.initSocket()
this.startMessagePolling()
+ this.bindKeyboardListener()
},
onUnload() {
this.clearTimer()
this.stopMessagePolling()
+ this.unbindKeyboardListener()
if (this.innerAudioContext) {
this.innerAudioContext.destroy()
this.innerAudioContext = null
}
},
methods: {
+ bindKeyboardListener() {
+ if (!uni.onKeyboardHeightChange) return
+ this.keyboardListener = (res = {}) => {
+ this.keyboardHeight = res.height || 0
+ this.$nextTick(() => {
+ this.scrollToBottom(false)
+ })
+ }
+ uni.onKeyboardHeightChange(this.keyboardListener)
+ },
+ unbindKeyboardListener() {
+ if (!this.keyboardListener) return
+ if (uni.offKeyboardHeightChange) {
+ uni.offKeyboardHeightChange(this.keyboardListener)
+ }
+ this.keyboardListener = null
+ },
+ handleInputFocus(e) {
+ const height = e && e.detail ? e.detail.height : 0
+ if (height) {
+ this.keyboardHeight = height
+ }
+ this.$nextTick(() => {
+ this.scrollToBottom(false)
+ })
+ },
+ handleInputBlur() {
+ setTimeout(() => {
+ this.keyboardHeight = 0
+ }, 120)
+ },
startTimer() {
// 已匹配的陪伴关系可持续聊天,不再自动倒计时结束。
},
@@ -569,6 +632,24 @@
this.innerAudioContext.play()
}, 80)
},
+ genderText(gender) {
+ if (gender === 'male') return '男生'
+ if (gender === 'female') return '女生'
+ return '未设置'
+ },
+ modePreferenceText(mode) {
+ if (mode === 'i') return 'i 人'
+ if (mode === 'e') return 'e 人'
+ return '都可以'
+ },
+ genderPreferenceText(gender) {
+ if (gender === 'male') return '男生'
+ if (gender === 'female') return '女生'
+ return '不限性别'
+ },
+ targetText(mode, gender) {
+ return this.modePreferenceText(mode) + ' · ' + this.genderPreferenceText(gender)
+ },
async openTargetProfile() {
await this.loadTargetProfile()
if (!this.targetProfile || !this.targetProfile.userId) {
@@ -1262,6 +1343,30 @@
font-size: 23rpx;
}
+ .profile-info-grid {
+ display: flex;
+ gap: 18rpx;
+ margin-top: 26rpx;
+ }
+
+ .profile-info {
+ flex: 1;
+ padding: 18rpx 14rpx;
+ border-radius: 24rpx;
+ color: rgba(22, 27, 46, 0.72);
+ background: rgba(238, 244, 255, 0.72);
+ font-size: 24rpx;
+ font-weight: 800;
+ }
+
+ .profile-info-label {
+ display: block;
+ margin-bottom: 8rpx;
+ color: rgba(22, 27, 46, 0.38);
+ font-size: 20rpx;
+ font-weight: 600;
+ }
+
.profile-intro {
margin-top: 26rpx;
padding: 24rpx;
diff --git a/package1/ieBrowser/messages.vue b/package1/ieBrowser/messages.vue
index d81e708..fc03a93 100644
--- a/package1/ieBrowser/messages.vue
+++ b/package1/ieBrowser/messages.vue
@@ -10,7 +10,7 @@
消息
这里不是聊天列表,只放未完成的陪伴。
-
+
{{ item.avatar }}
@@ -21,11 +21,26 @@
没有未完成的关系,也是一种轻松。
{{ loading ? '正在加载...' : (hasMore ? '上滑加载更多' : '没有更多消息了') }}
+
+
+
+ !
+ 删除这段聊天记录?
+ 删除后无法找回。对方再次发来消息时,这段对话会重新出现在这里。
+
+ 将删除与「{{ deleteTarget.name }}」的聊天入口
+
+
+ 再想想
+ {{ deleting ? '删除中...' : '确认删除' }}
+
+
+